@widergy/energy-ui 1.134.2 → 2.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 +12 -0
- package/dist/components/Loading/index.js +1 -2
- package/dist/components/Loading/styles.module.scss +1 -1
- package/dist/components/Loading/theme.js +2 -1
- package/dist/components/UTAlert/theme.js +3 -2
- package/dist/components/UTAttachment/layout.js +9 -7
- package/dist/components/UTAttachment/styles.module.scss +0 -1
- package/dist/components/UTAttachment/theme.js +2 -1
- package/dist/components/UTAutocomplete/theme.js +8 -6
- package/dist/components/UTAvatar/index.js +21 -8
- package/dist/components/UTBarChart/components/Legend/index.js +24 -20
- package/dist/components/UTBarChart/components/Pagination/index.js +26 -20
- package/dist/components/UTBarChart/components/YAxis/AxisElement/index.js +1 -1
- package/dist/components/UTBarChart/components/YAxis/index.js +1 -1
- package/dist/components/UTBarChart/index.js +7 -4
- package/dist/components/UTBarChart/theme.js +10 -7
- package/dist/components/UTBarChart/types.js +2 -2
- package/dist/components/UTBreadcrumbs/index.js +14 -8
- package/dist/components/UTBreadcrumbs/styles.module.scss +0 -6
- package/dist/components/UTBreadcrumbs/theme.js +2 -13
- package/dist/components/UTButton/README.md +35 -0
- package/dist/components/UTButton/constants.js +42 -0
- package/dist/components/UTButton/index.js +63 -83
- package/dist/components/UTButton/styles.module.scss +36 -0
- package/dist/components/UTButton/theme.js +143 -158
- package/dist/components/UTCBUInput/theme.js +2 -1
- package/dist/components/UTCard/components/UTCardFooter/index.js +5 -6
- package/dist/components/UTCard/index.js +23 -29
- package/dist/components/UTCard/theme.js +2 -1
- package/dist/components/UTCarousel/components/Button/index.js +1 -1
- package/dist/components/UTCarousel/components/Legend/index.js +1 -4
- package/dist/components/UTCarousel/components/Slider/component/Slide/index.js +2 -5
- package/dist/components/UTCarousel/components/Slider/index.js +45 -18
- package/dist/components/UTCarousel/components/Slider/layout.js +13 -12
- package/dist/components/UTCarousel/theme.js +2 -1
- package/dist/components/UTCheckList/index.js +11 -9
- package/dist/components/UTCheckList/theme.js +8 -3
- package/dist/components/UTCheckbox/index.js +34 -28
- package/dist/components/UTCheckbox/theme.js +11 -3
- package/dist/components/UTConsumptionBar/components/ConsumptionBarIndicator/index.js +7 -8
- package/dist/components/UTConsumptionBar/components/ConsumptionBarIndicator/styles.module.scss +1 -2
- package/dist/components/UTConsumptionBar/index.js +22 -13
- package/dist/components/UTConsumptionBar/styles.module.scss +0 -14
- package/dist/components/UTCuit/index.js +2 -2
- package/dist/components/UTCuit/theme.js +1 -1
- package/dist/components/UTDatePicker/index.js +29 -27
- package/dist/components/UTDatePicker/theme.js +22 -7
- package/dist/components/UTDialog/index.js +19 -23
- package/dist/components/UTDialog/theme.js +8 -23
- package/dist/components/UTDialog/types.js +5 -6
- package/dist/components/UTDotMenu/index.js +16 -8
- package/dist/components/UTEmojiPicker/theme.js +2 -1
- package/dist/components/UTFileInput/layout.js +5 -4
- package/dist/components/UTFileInput/styles.module.scss +0 -1
- package/dist/components/UTIconButton/theme.js +2 -1
- package/dist/components/UTImageRadio/components/ImageRadioCard/index.js +2 -2
- package/dist/components/UTImageRadio/index.js +2 -1
- package/dist/components/UTImageRadio/theme.js +15 -12
- package/dist/components/UTLabel/README.md +169 -0
- package/dist/components/UTLabel/constants.js +91 -0
- package/dist/components/UTLabel/index.js +41 -104
- package/dist/components/UTLabel/theme.js +29 -84
- package/dist/components/UTMap/index.js +7 -7
- package/dist/components/UTMap/styles.module.scss +0 -5
- package/dist/components/UTMenu/theme.js +3 -2
- package/dist/components/UTPanel/index.js +11 -10
- package/dist/components/UTPasswordField/components/PasswordValidations/components/Error/index.js +4 -3
- package/dist/components/UTPasswordField/components/PasswordValidations/components/Error/styles.module.scss +2 -2
- package/dist/components/UTPasswordField/components/PasswordValidations/components/Validation/index.js +16 -16
- package/dist/components/UTPasswordField/components/PasswordValidations/components/Validation/styles.module.scss +2 -2
- package/dist/components/UTPasswordField/components/PasswordValidations/index.js +11 -9
- package/dist/components/UTPasswordField/components/PasswordWarning/index.js +3 -3
- package/dist/components/UTPasswordField/components/PasswordWarning/styles.module.scss +1 -1
- package/dist/components/UTPasswordField/theme.js +13 -27
- package/dist/components/UTPhoneInput/index.js +4 -4
- package/dist/components/UTPhoneInput/theme.js +3 -6
- package/dist/components/UTPieChart/theme.js +2 -1
- package/dist/components/UTProgressBar/index.js +27 -20
- package/dist/components/UTProgressBar/theme.js +14 -13
- package/dist/components/UTRadioGroup/index.js +35 -22
- package/dist/components/UTRadioGroup/theme.js +10 -6
- package/dist/components/UTRating/components/Star/index.js +2 -1
- package/dist/components/UTRating/index.js +3 -1
- package/dist/components/UTRating/theme.js +3 -2
- package/dist/components/UTSelect/index.js +13 -3
- package/dist/components/UTSelect/styles.module.scss +5 -0
- package/dist/components/UTSelect/theme.js +7 -2
- package/dist/components/UTSidebar/theme.js +6 -5
- package/dist/components/UTSkeleton/index.js +3 -2
- package/dist/components/UTSwitch/index.js +2 -1
- package/dist/components/UTSwitch/theme.js +2 -1
- package/dist/components/UTTable/components/TableHeader/index.js +11 -7
- package/dist/components/UTTable/theme.js +31 -29
- package/dist/components/UTTabs/index.js +25 -20
- package/dist/components/UTTabs/theme.js +2 -1
- package/dist/components/UTTextArea/index.js +2 -1
- package/dist/components/UTTextArea/theme.js +2 -1
- package/dist/components/UTTextInput/index.js +16 -8
- package/dist/components/UTTextInput/styles.module.scss +3 -2
- package/dist/components/UTTextInput/theme.js +3 -2
- package/dist/components/UTToggle/components/ToggleOption/index.js +1 -0
- package/dist/components/UTToggle/theme.js +2 -1
- package/dist/components/UTTooltip/index.js +6 -4
- package/dist/components/UTTooltip/styles.module.scss +4 -2
- package/dist/components/UTTooltip/theme.js +2 -1
- package/dist/components/UTWorkflowContainer/components/ActionButton/index.js +12 -4
- package/dist/components/UTWorkflowContainer/index.js +19 -15
- package/dist/components/UTWorkflowContainer/styles.module.scss +0 -34
- package/dist/components/UTWorkflowContainer/theme.js +12 -58
- package/dist/components/UTWorkflowContainer/types.js +1 -1
- package/dist/components/WithTheme/layout.js +46 -42
- package/dist/scss/variables/_colors.scss +8 -0
- package/dist/theme.js +4 -1
- package/dist/types/formTypes.js +3 -3
- package/dist/utils/classesUtils.js +7 -3
- package/dist/utils/shadowUtils.js +40 -0
- package/package.json +5 -3
- package/dist/components/UTDialog/components/ActionButton/index.js +0 -35
- package/dist/components/UTLabel/styles.module.scss +0 -3
|
@@ -8,10 +8,10 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
8
8
|
var _propTypes = require("prop-types");
|
|
9
9
|
var _ExpandMore = _interopRequireDefault(require("@material-ui/icons/ExpandMore"));
|
|
10
10
|
var _ExpandLess = _interopRequireDefault(require("@material-ui/icons/ExpandLess"));
|
|
11
|
-
var
|
|
11
|
+
var _UTButton = _interopRequireDefault(require("../UTButton"));
|
|
12
12
|
var _UTTouchableWithoutFeedback = _interopRequireDefault(require("../UTTouchableWithoutFeedback"));
|
|
13
13
|
var _WithTheme = _interopRequireDefault(require("../WithTheme"));
|
|
14
|
-
var
|
|
14
|
+
var _classesUtils = require("../../utils/classesUtils");
|
|
15
15
|
var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
|
|
16
16
|
var _UTCardFooter = _interopRequireDefault(require("./components/UTCardFooter"));
|
|
17
17
|
var _types = require("./types");
|
|
@@ -20,6 +20,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
20
20
|
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); }
|
|
21
21
|
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; }
|
|
22
22
|
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
23
|
+
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
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
24
25
|
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
25
26
|
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); }
|
|
@@ -84,25 +85,21 @@ var UTCard = /*#__PURE__*/function (_PureComponent) {
|
|
|
84
85
|
var _this$props = this.props,
|
|
85
86
|
button = _this$props.button,
|
|
86
87
|
children = _this$props.children,
|
|
87
|
-
|
|
88
|
-
|
|
88
|
+
themeClasses = _this$props.classes,
|
|
89
|
+
classNames = _this$props.classNames,
|
|
89
90
|
CustomFooter = _this$props.CustomFooter,
|
|
90
|
-
|
|
91
|
-
expandableIconButtonClassName = _this$props.expandableIconButtonClassName,
|
|
92
|
-
expandableIconClassName = _this$props.expandableIconClassName,
|
|
91
|
+
expandableIconProps = _this$props.expandableIconProps,
|
|
93
92
|
ExpandedIcon = _this$props.ExpandedIcon,
|
|
94
93
|
expandText = _this$props.expandText,
|
|
95
|
-
expandTextClassName = _this$props.expandTextClassName,
|
|
96
94
|
flat = _this$props.flat,
|
|
97
95
|
footer = _this$props.footer,
|
|
98
|
-
footerClassName = _this$props.footerClassName,
|
|
99
96
|
header = _this$props.header,
|
|
100
|
-
headerClassName = _this$props.headerClassName,
|
|
101
97
|
horizontal = _this$props.horizontal,
|
|
102
98
|
isCollapsible = _this$props.isCollapsible,
|
|
103
99
|
isOpen = _this$props.isOpen,
|
|
104
100
|
NonExpandedIcon = _this$props.NonExpandedIcon,
|
|
105
101
|
style = _this$props.style;
|
|
102
|
+
var classes = (0, _classesUtils.mergeClasses)(themeClasses, classNames);
|
|
106
103
|
var _this$state = this.state,
|
|
107
104
|
expandIsSelected = _this$state.expandIsSelected,
|
|
108
105
|
childrenHeight = _this$state.childrenHeight;
|
|
@@ -111,35 +108,37 @@ var UTCard = /*#__PURE__*/function (_PureComponent) {
|
|
|
111
108
|
var Footer = footer && /*#__PURE__*/_react.default.createElement(_UTCardFooter.default, {
|
|
112
109
|
customButton: button,
|
|
113
110
|
footer: footer,
|
|
114
|
-
footerClassName:
|
|
111
|
+
footerClassName: classes.footer
|
|
115
112
|
});
|
|
116
113
|
return !isCollapsible ? /*#__PURE__*/_react.default.createElement("div", {
|
|
117
|
-
className: "".concat(classes.base, " ").concat(flat && classes.flat, " ").concat(!horizontal && _stylesModule.default.column, " ").concat(
|
|
114
|
+
className: "".concat(classes.base, " ").concat(flat && classes.flat, " ").concat(!horizontal && _stylesModule.default.column, " ").concat(classes.base),
|
|
118
115
|
style: style
|
|
119
116
|
}, header && /*#__PURE__*/_react.default.createElement("div", {
|
|
120
117
|
className: _stylesModule.default.headerContent
|
|
121
118
|
}, header), children, CustomFooter ? /*#__PURE__*/_react.default.createElement(CustomFooter, null) : Footer) : /*#__PURE__*/_react.default.createElement("div", {
|
|
122
|
-
className: "".concat(classes.base, " ").concat(flat && classes.flat, " ").concat(_stylesModule.default.column
|
|
119
|
+
className: "".concat(classes.base, " ").concat(flat && classes.flat, " ").concat(_stylesModule.default.column),
|
|
123
120
|
style: style
|
|
124
121
|
}, /*#__PURE__*/_react.default.createElement(_UTTouchableWithoutFeedback.default, {
|
|
125
122
|
onClick: this.handleOnPress,
|
|
126
|
-
className: "".concat(_stylesModule.default.header, " ").concat(
|
|
123
|
+
className: "".concat(_stylesModule.default.header, " ").concat(classes.header)
|
|
127
124
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
128
125
|
className: _stylesModule.default.headerContent
|
|
129
|
-
}, header), /*#__PURE__*/_react.default.createElement(
|
|
126
|
+
}, header), /*#__PURE__*/_react.default.createElement(_UTButton.default, _extends({
|
|
127
|
+
Icon: ExpandIcon,
|
|
128
|
+
iconPlacement: "right",
|
|
130
129
|
onClick: this.handleOnPress,
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
}))), /*#__PURE__*/_react.default.createElement("div", {
|
|
130
|
+
variant: "text",
|
|
131
|
+
classNames: {
|
|
132
|
+
icon: classes.expandButtonIcon,
|
|
133
|
+
root: classes.expandButton
|
|
134
|
+
}
|
|
135
|
+
}, expandableIconProps), expandText)), /*#__PURE__*/_react.default.createElement("div", {
|
|
137
136
|
ref: function ref(_ref) {
|
|
138
137
|
return _this2.setState({
|
|
139
138
|
childrenRef: _ref
|
|
140
139
|
});
|
|
141
140
|
},
|
|
142
|
-
className: "".concat(_stylesModule.default.children, " ").concat(expanded && _stylesModule.default.active, " ").concat(
|
|
141
|
+
className: "".concat(_stylesModule.default.children, " ").concat(expanded && _stylesModule.default.active, " ").concat(classes.expandableContent),
|
|
143
142
|
style: {
|
|
144
143
|
height: expanded && childrenHeight !== null ? childrenHeight : '0px'
|
|
145
144
|
}
|
|
@@ -151,19 +150,14 @@ var UTCard = /*#__PURE__*/function (_PureComponent) {
|
|
|
151
150
|
UTCard.propTypes = {
|
|
152
151
|
button: _propTypes.element,
|
|
153
152
|
classes: (0, _propTypes.objectOf)(_propTypes.string),
|
|
154
|
-
|
|
153
|
+
classNames: (0, _propTypes.objectOf)(_propTypes.string),
|
|
155
154
|
CustomFooter: (0, _propTypes.oneOfType)([_propTypes.element, _propTypes.func]),
|
|
156
|
-
|
|
157
|
-
expandableIconButtonClassName: _propTypes.string,
|
|
158
|
-
expandableIconClassName: _propTypes.string,
|
|
155
|
+
expandableIconProps: _propTypes.object,
|
|
159
156
|
ExpandedIcon: (0, _propTypes.oneOfType)([_propTypes.func, _propTypes.element]),
|
|
160
157
|
expandText: _propTypes.string,
|
|
161
|
-
expandTextClassName: _propTypes.string,
|
|
162
158
|
flat: _propTypes.bool,
|
|
163
159
|
footer: _types.cardActionsTypes.footer,
|
|
164
|
-
footerClassName: _propTypes.string,
|
|
165
160
|
header: _types.cardActionsTypes.header,
|
|
166
|
-
headerClassName: _propTypes.string,
|
|
167
161
|
horizontal: _propTypes.bool,
|
|
168
162
|
isCollapsible: _propTypes.bool,
|
|
169
163
|
isOpen: _propTypes.bool,
|
|
@@ -11,7 +11,8 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
11
11
|
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; }
|
|
12
12
|
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
13
13
|
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); }
|
|
14
|
-
var retrieveStyle = function retrieveStyle(
|
|
14
|
+
var retrieveStyle = function retrieveStyle(_ref) {
|
|
15
|
+
var theme = _ref.theme;
|
|
15
16
|
var tabletMobile = (0, _seamlessImmutable.getIn)(theme, ['Media', 'tabletMobile']);
|
|
16
17
|
return {
|
|
17
18
|
base: _defineProperty({
|
|
@@ -29,7 +29,7 @@ var Button = function Button(_ref) {
|
|
|
29
29
|
className: "".concat(classes.arrowStyle, " ").concat(className),
|
|
30
30
|
onClick: handleOnPress
|
|
31
31
|
}) : /*#__PURE__*/_react.default.createElement(_IconButton.default, {
|
|
32
|
-
className: "".concat(classes.arrowStyle, "
|
|
32
|
+
className: "".concat(classes.arrowStyle, " ").concat(className),
|
|
33
33
|
onClick: handleOnPress
|
|
34
34
|
}, left ? /*#__PURE__*/_react.default.createElement(_KeyboardArrowLeft.default, null) : /*#__PURE__*/_react.default.createElement(_KeyboardArrowRight.default, null));
|
|
35
35
|
};
|
|
@@ -16,8 +16,7 @@ var LegendContainer = function LegendContainer(_ref) {
|
|
|
16
16
|
currentSlide = _ref.currentSlide,
|
|
17
17
|
onClick = _ref.onClick,
|
|
18
18
|
LegendCustom = _ref.LegendCustom,
|
|
19
|
-
classes = _ref.classes
|
|
20
|
-
keyName = _ref.keyName;
|
|
19
|
+
classes = _ref.classes;
|
|
21
20
|
var handleOnClick = function handleOnClick() {
|
|
22
21
|
return onClick(index + 1);
|
|
23
22
|
};
|
|
@@ -25,7 +24,6 @@ var LegendContainer = function LegendContainer(_ref) {
|
|
|
25
24
|
return LegendCustom ? /*#__PURE__*/_react.default.createElement(LegendCustom, {
|
|
26
25
|
onClick: handleOnClick
|
|
27
26
|
}) : /*#__PURE__*/_react.default.createElement(_UTTouchableWithoutFeedback.default, {
|
|
28
|
-
keyName: keyName,
|
|
29
27
|
className: classes.legendStyleTouchable,
|
|
30
28
|
onClick: handleOnClick
|
|
31
29
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
@@ -37,7 +35,6 @@ LegendContainer.propTypes = {
|
|
|
37
35
|
index: _propTypes.number,
|
|
38
36
|
currentSlide: _propTypes.number,
|
|
39
37
|
LegendCustom: _propTypes.node,
|
|
40
|
-
keyName: _propTypes.string,
|
|
41
38
|
classes: (0, _propTypes.objectOf)(_propTypes.string)
|
|
42
39
|
};
|
|
43
40
|
var _default = /*#__PURE__*/(0, _react.memo)(LegendContainer);
|
|
@@ -13,8 +13,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
13
13
|
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); }
|
|
14
14
|
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; }
|
|
15
15
|
var Slide = function Slide(_ref) {
|
|
16
|
-
var
|
|
17
|
-
imgSrc = _ref.imgSrc,
|
|
16
|
+
var imgSrc = _ref.imgSrc,
|
|
18
17
|
position = _ref.position,
|
|
19
18
|
widthContainer = _ref.widthContainer,
|
|
20
19
|
currentSlide = _ref.currentSlide,
|
|
@@ -24,7 +23,6 @@ var Slide = function Slide(_ref) {
|
|
|
24
23
|
onClick = _ref.onClick;
|
|
25
24
|
var slide = currentSlide === position ? border / 2 : currentSlide === position - 1 ? -border / 4 : currentSlide === position + 1 && border + border / 4;
|
|
26
25
|
return /*#__PURE__*/_react.default.createElement(_UTTouchableWithoutFeedback.default, {
|
|
27
|
-
keyName: keyName,
|
|
28
26
|
className: "".concat(_stylesModule.default.imageContainer),
|
|
29
27
|
style: {
|
|
30
28
|
left: position * (slide ? widthContainer + slide : widthContainer),
|
|
@@ -49,8 +47,7 @@ Slide.propTypes = {
|
|
|
49
47
|
shouldAnimate: _propTypes.bool,
|
|
50
48
|
currentSlide: _propTypes.number,
|
|
51
49
|
animationTime: _propTypes.number,
|
|
52
|
-
onClick: _propTypes.func
|
|
53
|
-
keyName: _propTypes.string
|
|
50
|
+
onClick: _propTypes.func
|
|
54
51
|
};
|
|
55
52
|
var _default = /*#__PURE__*/(0, _react.memo)(Slide);
|
|
56
53
|
exports.default = _default;
|
|
@@ -16,6 +16,8 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
16
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
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
18
|
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
19
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
20
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
19
21
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
20
22
|
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
21
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); }
|
|
@@ -69,8 +71,26 @@ var SliderContainer = /*#__PURE__*/function (_PureComponent) {
|
|
|
69
71
|
timeMove: new Date().getTime()
|
|
70
72
|
});
|
|
71
73
|
}, _this.state.timeAnimation));
|
|
74
|
+
_defineProperty(_assertThisInitialized(_this), "componentWillUnmount", function () {
|
|
75
|
+
var _this$containerRef;
|
|
76
|
+
if ((_this$containerRef = _this.containerRef) !== null && _this$containerRef !== void 0 && _this$containerRef.current) {
|
|
77
|
+
_this.containerRef.current.removeEventListener('touchstart', _this.handleTouchDown);
|
|
78
|
+
_this.containerRef.current.removeEventListener('mousedown', _this.handleMouseDown);
|
|
79
|
+
_this.containerRef.current.removeEventListener('mousemove', _this.handleMouseMove);
|
|
80
|
+
_this.containerRef.current.removeEventListener('touchmove', _this.handleTouchMove);
|
|
81
|
+
}
|
|
82
|
+
window.removeEventListener('mouseup', _this.handleEventUp);
|
|
83
|
+
window.removeEventListener('resize', _this.updateContainerWidth);
|
|
84
|
+
window.removeEventListener('touchend', _this.handleEventUp);
|
|
85
|
+
});
|
|
72
86
|
_defineProperty(_assertThisInitialized(_this), "updateImgArray", function () {
|
|
73
|
-
var
|
|
87
|
+
var firstSlide = _this.props.slides[0];
|
|
88
|
+
var lastSlide = _this.props.slides[_this.props.slides.length - 1];
|
|
89
|
+
var arr = [_objectSpread(_objectSpread({}, lastSlide), {}, {
|
|
90
|
+
id: "lastSlide-".concat(lastSlide.id || lastSlide.imgSrc)
|
|
91
|
+
})].concat(_toConsumableArray(_this.props.slides), [_objectSpread(_objectSpread({}, firstSlide), {}, {
|
|
92
|
+
id: "firstSlide-".concat(firstSlide.id || firstSlide.imgSrc)
|
|
93
|
+
})]);
|
|
74
94
|
_this.setState({
|
|
75
95
|
slideArray: arr
|
|
76
96
|
});
|
|
@@ -214,7 +234,13 @@ var SliderContainer = /*#__PURE__*/function (_PureComponent) {
|
|
|
214
234
|
key: "componentDidMount",
|
|
215
235
|
value: function componentDidMount() {
|
|
216
236
|
var _this2 = this;
|
|
217
|
-
var
|
|
237
|
+
var firstSlide = this.props.slides[0];
|
|
238
|
+
var lastSlide = this.props.slides[this.props.slides.length - 1];
|
|
239
|
+
var arr = [_objectSpread(_objectSpread({}, lastSlide), {}, {
|
|
240
|
+
id: "lastSlide-".concat(lastSlide.id || lastSlide.imgSrc)
|
|
241
|
+
})].concat(_toConsumableArray(this.props.slides), [_objectSpread(_objectSpread({}, firstSlide), {}, {
|
|
242
|
+
id: "firstSlide-".concat(firstSlide.id || firstSlide.imgSrc)
|
|
243
|
+
})]);
|
|
218
244
|
this.setState({
|
|
219
245
|
slideArray: arr
|
|
220
246
|
});
|
|
@@ -292,14 +318,14 @@ var SliderContainer = /*#__PURE__*/function (_PureComponent) {
|
|
|
292
318
|
className: _stylesModule.default.legendContainerOut
|
|
293
319
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
294
320
|
className: _stylesModule.default.legend
|
|
295
|
-
}, slides.map(function (
|
|
321
|
+
}, slides.map(function (slide, slideIndex) {
|
|
296
322
|
return /*#__PURE__*/_react.default.createElement(_Legend.default, {
|
|
297
323
|
LegendCustom: legend.legendCustom,
|
|
298
|
-
index:
|
|
324
|
+
index: slideIndex,
|
|
299
325
|
currentSlide: index === slideArray.length - 1 ? 0 : index === 0 ? 1 : index - 1,
|
|
300
326
|
onClick: _this3.handleLegend,
|
|
301
327
|
classes: classes,
|
|
302
|
-
|
|
328
|
+
key: "legend-out-".concat(slide.id || slide.imgSrc)
|
|
303
329
|
});
|
|
304
330
|
}))), arrow && arrow.position === _constants.OUTSIDE && /*#__PURE__*/_react.default.createElement("div", {
|
|
305
331
|
className: _stylesModule.default.arrowContainer
|
|
@@ -314,28 +340,29 @@ var SliderContainer = /*#__PURE__*/function (_PureComponent) {
|
|
|
314
340
|
return SliderContainer;
|
|
315
341
|
}(_react.PureComponent);
|
|
316
342
|
SliderContainer.propTypes = {
|
|
317
|
-
|
|
318
|
-
imgSrc: _propTypes.string
|
|
319
|
-
})),
|
|
343
|
+
activeEvents: _propTypes.bool,
|
|
320
344
|
arrow: (0, _propTypes.shape)({
|
|
321
|
-
position: _propTypes.string,
|
|
322
345
|
arrowCustomLeft: _propTypes.node,
|
|
323
346
|
arrowCustomRight: _propTypes.node,
|
|
324
347
|
callbackLeft: _propTypes.func,
|
|
325
|
-
callbackRight: _propTypes.func
|
|
348
|
+
callbackRight: _propTypes.func,
|
|
349
|
+
position: _propTypes.string
|
|
326
350
|
}),
|
|
351
|
+
autoPlay: _propTypes.bool,
|
|
352
|
+
autoPlayDelay: _propTypes.number,
|
|
353
|
+
className: _propTypes.string,
|
|
354
|
+
classes: (0, _propTypes.objectOf)(_propTypes.string),
|
|
327
355
|
legend: (0, _propTypes.shape)({
|
|
328
|
-
|
|
329
|
-
|
|
356
|
+
legendCustom: _propTypes.node,
|
|
357
|
+
position: _propTypes.string
|
|
330
358
|
}),
|
|
331
359
|
enableMove: _propTypes.bool,
|
|
332
|
-
withBorder: _propTypes.number,
|
|
333
|
-
autoPlay: _propTypes.bool,
|
|
334
|
-
autoPlayDelay: _propTypes.number,
|
|
335
|
-
activeEvents: _propTypes.bool,
|
|
336
360
|
height: _propTypes.string,
|
|
337
|
-
|
|
338
|
-
|
|
361
|
+
slides: (0, _propTypes.arrayOf)((0, _propTypes.shape)({
|
|
362
|
+
imgSrc: _propTypes.string,
|
|
363
|
+
id: (0, _propTypes.oneOfType)([_propTypes.number, _propTypes.string])
|
|
364
|
+
})),
|
|
365
|
+
withBorder: _propTypes.number
|
|
339
366
|
};
|
|
340
367
|
var _default = SliderContainer;
|
|
341
368
|
exports.default = _default;
|
|
@@ -68,30 +68,30 @@ var Slider = /*#__PURE__*/function (_PureComponent) {
|
|
|
68
68
|
},
|
|
69
69
|
className: "".concat(_stylesModule.default.slideContainer),
|
|
70
70
|
draggable: "false"
|
|
71
|
-
}, slideArray.map(function (
|
|
71
|
+
}, slideArray.map(function (slide, _index) {
|
|
72
72
|
return /*#__PURE__*/_react.default.createElement(_Slide.default, {
|
|
73
|
-
|
|
73
|
+
key: "slide-".concat(slide.id || slide.imgSrc),
|
|
74
74
|
position: _index - 1,
|
|
75
75
|
currentSlide: index - 1,
|
|
76
76
|
widthContainer: containerWidth,
|
|
77
|
-
imgSrc:
|
|
77
|
+
imgSrc: slide.imgSrc,
|
|
78
78
|
border: withBorder,
|
|
79
79
|
shouldAnimate: shouldAnimate,
|
|
80
80
|
animationTime: animationTime,
|
|
81
|
-
onClick:
|
|
81
|
+
onClick: slide.onClick
|
|
82
82
|
});
|
|
83
83
|
})), legend && legend.position === _constants.INSIDE && /*#__PURE__*/_react.default.createElement("div", {
|
|
84
84
|
className: _stylesModule.default.legendContainer
|
|
85
85
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
86
86
|
className: _stylesModule.default.legend
|
|
87
|
-
}, slides.map(function (
|
|
87
|
+
}, slides.map(function (slide, itemIndex) {
|
|
88
88
|
return /*#__PURE__*/_react.default.createElement(_Legend.default, {
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
index: item,
|
|
89
|
+
key: "legend-in-".concat(slide.id || slide.imgSrc),
|
|
90
|
+
classes: classes,
|
|
92
91
|
currentSlide: index === slideArray.length - 1 ? 0 : index === 0 ? 1 : index - 1,
|
|
93
|
-
|
|
94
|
-
|
|
92
|
+
index: itemIndex,
|
|
93
|
+
LegendCustom: legend.legendCustom,
|
|
94
|
+
onClick: handleLegend
|
|
95
95
|
});
|
|
96
96
|
}))), arrow && arrow.position === _constants.INSIDE && /*#__PURE__*/_react.default.createElement(_Button.default, {
|
|
97
97
|
ArrowCustom: arrow.arrowCustomRight,
|
|
@@ -107,10 +107,11 @@ var Slider = /*#__PURE__*/function (_PureComponent) {
|
|
|
107
107
|
Slider.propTypes = {
|
|
108
108
|
slideArray: (0, _propTypes.arrayOf)((0, _propTypes.shape)({
|
|
109
109
|
imgSrc: _propTypes.string,
|
|
110
|
-
id: _propTypes.number
|
|
110
|
+
id: (0, _propTypes.oneOfType)([_propTypes.number, _propTypes.string])
|
|
111
111
|
})),
|
|
112
112
|
slides: (0, _propTypes.arrayOf)((0, _propTypes.shape)({
|
|
113
|
-
imgSrc: _propTypes.string
|
|
113
|
+
imgSrc: _propTypes.string,
|
|
114
|
+
id: (0, _propTypes.oneOfType)([_propTypes.number, _propTypes.string])
|
|
114
115
|
})),
|
|
115
116
|
arrow: (0, _propTypes.shape)({
|
|
116
117
|
position: _propTypes.string,
|
|
@@ -8,7 +8,8 @@ var _seamlessImmutable = require("seamless-immutable");
|
|
|
8
8
|
var _colors = _interopRequireDefault(require("../../scss/variables/_colors.scss"));
|
|
9
9
|
var _sizes = _interopRequireDefault(require("../../scss/variables/_sizes.scss"));
|
|
10
10
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
|
-
var retrieveStyle = function retrieveStyle(
|
|
11
|
+
var retrieveStyle = function retrieveStyle(_ref) {
|
|
12
|
+
var theme = _ref.theme;
|
|
12
13
|
return {
|
|
13
14
|
arrowStyle: {
|
|
14
15
|
fontSize: (0, _seamlessImmutable.getIn)(theme, ['UTCarousel', 'arrowStyle', 'fontSize'], _sizes.default.defaultCarrouselArrowSize),
|
|
@@ -83,21 +83,23 @@ var UTCheckList = function UTCheckList(_ref) {
|
|
|
83
83
|
var item = arguments.length > 1 ? arguments[1] : undefined;
|
|
84
84
|
return key.map(function (keyValue) {
|
|
85
85
|
return /*#__PURE__*/_react.default.createElement(_UTLabel.default, {
|
|
86
|
-
|
|
87
|
-
|
|
86
|
+
variant: "xsmall",
|
|
87
|
+
className: classes.rowItem
|
|
88
88
|
}, item[keyValue]);
|
|
89
89
|
});
|
|
90
90
|
};
|
|
91
91
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
92
92
|
className: "".concat(_stylesModule.default.container, " ").concat(className)
|
|
93
93
|
}, shouldShowUpperTitle && /*#__PURE__*/_react.default.createElement(_UTLabel.default, _extends({
|
|
94
|
-
className:
|
|
95
|
-
}, titleProps
|
|
94
|
+
className: classes.title
|
|
95
|
+
}, titleProps, {
|
|
96
|
+
withMarkdown: true
|
|
97
|
+
}), field.title), /*#__PURE__*/_react.default.createElement("div", {
|
|
96
98
|
className: header ? classes.tableHeader : classes.selectAll
|
|
97
99
|
}, header && header.map(function (item) {
|
|
98
100
|
return /*#__PURE__*/_react.default.createElement(_UTLabel.default, {
|
|
101
|
+
weight: "bold",
|
|
99
102
|
className: classes.headerItem,
|
|
100
|
-
bold: true,
|
|
101
103
|
key: item.text
|
|
102
104
|
}, item.text);
|
|
103
105
|
}), /*#__PURE__*/_react.default.createElement(_UTCheckbox.default, {
|
|
@@ -139,7 +141,7 @@ var UTCheckList = function UTCheckList(_ref) {
|
|
|
139
141
|
useCustomIcons: useCustomIcons,
|
|
140
142
|
CustomCheckedIcon: CustomCheckedIcon,
|
|
141
143
|
CustomUncheckedIcon: CustomUncheckedIcon,
|
|
142
|
-
tooltipContent: item.disabled && disabledItemTooltip
|
|
144
|
+
tooltipContent: item.disabled && disabledItemTooltip ? disabledItemTooltip(item, list) : undefined
|
|
143
145
|
}));
|
|
144
146
|
})), additionalInfo && additionalInfo.footer && /*#__PURE__*/_react.default.createElement(_FormHelperText.default, null, additionalInfo.footer), shouldShowErrors && /*#__PURE__*/_react.default.createElement(_FormHelperText.default, {
|
|
145
147
|
error: true
|
|
@@ -158,8 +160,8 @@ UTCheckList.propTypes = {
|
|
|
158
160
|
className: _propTypes.string,
|
|
159
161
|
classNames: (0, _propTypes.objectOf)(_propTypes.string),
|
|
160
162
|
CustomCheckedIcon: _propTypes.element,
|
|
161
|
-
customRowLabel: _propTypes.element,
|
|
162
|
-
customSelectAllRowLabel: _propTypes.element,
|
|
163
|
+
customRowLabel: (0, _propTypes.oneOfType)([_propTypes.func, _propTypes.element, _propTypes.string]),
|
|
164
|
+
customSelectAllRowLabel: (0, _propTypes.oneOfType)([_propTypes.func, _propTypes.element, _propTypes.string]),
|
|
163
165
|
CustomUncheckedIcon: _propTypes.element,
|
|
164
166
|
disabled: _propTypes.bool,
|
|
165
167
|
disabledItemTooltip: _propTypes.func,
|
|
@@ -175,7 +177,7 @@ UTCheckList.propTypes = {
|
|
|
175
177
|
}),
|
|
176
178
|
labelKey: _propTypes.string.isRequired,
|
|
177
179
|
list: (0, _propTypes.arrayOf)((0, _propTypes.shape)({
|
|
178
|
-
id: _propTypes.number,
|
|
180
|
+
id: (0, _propTypes.oneOfType)([_propTypes.number, _propTypes.string]),
|
|
179
181
|
label: _propTypes.string,
|
|
180
182
|
checked: _propTypes.bool
|
|
181
183
|
})),
|
|
@@ -7,9 +7,10 @@ exports.retrieveStyle = exports.retrieveMuiTheme = void 0;
|
|
|
7
7
|
var _seamlessImmutable = require("seamless-immutable");
|
|
8
8
|
var _styles = require("@material-ui/core/styles");
|
|
9
9
|
var _colors = _interopRequireDefault(require("../../scss/variables/_colors.scss"));
|
|
10
|
+
var _classesUtils = require("../../utils/classesUtils");
|
|
10
11
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
12
|
var retrieveMuiTheme = function retrieveMuiTheme(theme) {
|
|
12
|
-
return (0, _styles.
|
|
13
|
+
return (0, _styles.createTheme)({
|
|
13
14
|
typography: {
|
|
14
15
|
fontFamily: (0, _seamlessImmutable.getIn)(theme, ['Fonts', 'fontFamily'])
|
|
15
16
|
},
|
|
@@ -44,7 +45,9 @@ var retrieveMuiTheme = function retrieveMuiTheme(theme) {
|
|
|
44
45
|
});
|
|
45
46
|
};
|
|
46
47
|
exports.retrieveMuiTheme = retrieveMuiTheme;
|
|
47
|
-
var retrieveStyle = function retrieveStyle(
|
|
48
|
+
var retrieveStyle = function retrieveStyle(_ref) {
|
|
49
|
+
var _theme$UTCheckList, _theme$UTCheckList$cu, _theme$UTCheckList$cu2, _theme$Fonts, _theme$UTCheckList2, _theme$UTCheckList2$c, _theme$UTCheckList2$c2, _theme$Fonts2;
|
|
50
|
+
var theme = _ref.theme;
|
|
48
51
|
return {
|
|
49
52
|
selectAllRowRoot: {
|
|
50
53
|
color: (0, _seamlessImmutable.getIn)(theme, ['UTCheckList', 'selectAllRow', 'root', 'color']),
|
|
@@ -65,7 +68,8 @@ var retrieveStyle = function retrieveStyle(theme) {
|
|
|
65
68
|
padding: (0, _seamlessImmutable.getIn)(theme, ['UTCheckList', 'customRow', 'root', 'padding'])
|
|
66
69
|
},
|
|
67
70
|
headerItem: {
|
|
68
|
-
marginRight: (0, _seamlessImmutable.getIn)(theme, ['UTCheckList', 'customCheckRow', 'headerItem', 'marginRight'], '60px')
|
|
71
|
+
marginRight: (0, _seamlessImmutable.getIn)(theme, ['UTCheckList', 'customCheckRow', 'headerItem', 'marginRight'], '60px'),
|
|
72
|
+
fontSize: (0, _classesUtils.withImportant)((theme === null || theme === void 0 ? void 0 : (_theme$UTCheckList = theme.UTCheckList) === null || _theme$UTCheckList === void 0 ? void 0 : (_theme$UTCheckList$cu = _theme$UTCheckList.customCheckRow) === null || _theme$UTCheckList$cu === void 0 ? void 0 : (_theme$UTCheckList$cu2 = _theme$UTCheckList$cu.headerItem) === null || _theme$UTCheckList$cu2 === void 0 ? void 0 : _theme$UTCheckList$cu2.fontSize) || (theme === null || theme === void 0 ? void 0 : (_theme$Fonts = theme.Fonts) === null || _theme$Fonts === void 0 ? void 0 : _theme$Fonts.medium))
|
|
69
73
|
},
|
|
70
74
|
checkRowContainer: {
|
|
71
75
|
alignItems: (0, _seamlessImmutable.getIn)(theme, ['UTCheckList', 'customCheckRow', 'container', 'alignItems']),
|
|
@@ -80,6 +84,7 @@ var retrieveStyle = function retrieveStyle(theme) {
|
|
|
80
84
|
},
|
|
81
85
|
rowItem: {
|
|
82
86
|
display: (0, _seamlessImmutable.getIn)(theme, ['UTCheckList', 'customCheckRow', 'rowItem', 'display']),
|
|
87
|
+
fontSize: (0, _classesUtils.withImportant)((theme === null || theme === void 0 ? void 0 : (_theme$UTCheckList2 = theme.UTCheckList) === null || _theme$UTCheckList2 === void 0 ? void 0 : (_theme$UTCheckList2$c = _theme$UTCheckList2.customCheckRow) === null || _theme$UTCheckList2$c === void 0 ? void 0 : (_theme$UTCheckList2$c2 = _theme$UTCheckList2$c.rowItem) === null || _theme$UTCheckList2$c2 === void 0 ? void 0 : _theme$UTCheckList2$c2.fontSize) || (theme === null || theme === void 0 ? void 0 : (_theme$Fonts2 = theme.Fonts) === null || _theme$Fonts2 === void 0 ? void 0 : _theme$Fonts2.small)),
|
|
83
88
|
justifyContent: (0, _seamlessImmutable.getIn)(theme, ['UTCheckList', 'customCheckRow', 'rowItem', 'justifyContent']),
|
|
84
89
|
width: (0, _seamlessImmutable.getIn)(theme, ['UTCheckList', 'customCheckRow', 'rowItem', 'width'])
|
|
85
90
|
}
|
|
@@ -22,6 +22,7 @@ var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
|
|
|
22
22
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
23
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
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; }
|
|
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
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
26
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."); }
|
|
27
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); }
|
|
@@ -38,17 +39,14 @@ Checked.defaultProps = {
|
|
|
38
39
|
viewBox: "5 6.58 14 10.42"
|
|
39
40
|
};
|
|
40
41
|
var UTCheckbox = function UTCheckbox(_ref) {
|
|
41
|
-
var
|
|
42
|
-
disabled = _ref.disabled,
|
|
43
|
-
item = _ref.item,
|
|
44
|
-
CustomRowLabel = _ref.customRowLabel,
|
|
45
|
-
_ref$classes = _ref.classes,
|
|
42
|
+
var _ref$classes = _ref.classes,
|
|
46
43
|
themeClasses = _ref$classes === void 0 ? {} : _ref$classes,
|
|
47
44
|
classNames = _ref.classNames,
|
|
48
45
|
_ref$color = _ref.color,
|
|
49
46
|
color = _ref$color === void 0 ? 'primary' : _ref$color,
|
|
50
47
|
_ref$CustomCheckedIco = _ref.CustomCheckedIcon,
|
|
51
48
|
CustomCheckedIcon = _ref$CustomCheckedIco === void 0 ? Checked : _ref$CustomCheckedIco,
|
|
49
|
+
CustomRowLabel = _ref.customRowLabel,
|
|
52
50
|
_ref$CustomUncheckedI = _ref.CustomUncheckedIcon,
|
|
53
51
|
CustomUncheckedIcon = _ref$CustomUncheckedI === void 0 ? function (_ref2) {
|
|
54
52
|
var className = _ref2.className;
|
|
@@ -56,14 +54,19 @@ var UTCheckbox = function UTCheckbox(_ref) {
|
|
|
56
54
|
className: className
|
|
57
55
|
});
|
|
58
56
|
} : _ref$CustomUncheckedI,
|
|
59
|
-
|
|
60
|
-
showError = _ref.showError,
|
|
61
|
-
meta = _ref.meta,
|
|
57
|
+
disabled = _ref.disabled,
|
|
62
58
|
disableRipple = _ref.disableRipple,
|
|
63
|
-
label = _ref.label,
|
|
64
59
|
input = _ref.input,
|
|
60
|
+
item = _ref.item,
|
|
61
|
+
label = _ref.label,
|
|
62
|
+
_ref$labelProps = _ref.labelProps,
|
|
63
|
+
labelProps = _ref$labelProps === void 0 ? {} : _ref$labelProps,
|
|
64
|
+
meta = _ref.meta,
|
|
65
|
+
onChange = _ref.onChange,
|
|
66
|
+
showError = _ref.showError,
|
|
65
67
|
tooltipContent = _ref.tooltipContent,
|
|
66
|
-
|
|
68
|
+
useCustomIcons = _ref.useCustomIcons,
|
|
69
|
+
value = _ref.value;
|
|
67
70
|
var _useMutableState = (0, _energyHooks.useMutableState)(value),
|
|
68
71
|
_useMutableState2 = _slicedToArray(_useMutableState, 2),
|
|
69
72
|
checkedRef = _useMutableState2[0],
|
|
@@ -102,39 +105,42 @@ var UTCheckbox = function UTCheckbox(_ref) {
|
|
|
102
105
|
}))),
|
|
103
106
|
label: CustomRowLabel ? /*#__PURE__*/_react.default.createElement(CustomRowLabel, {
|
|
104
107
|
item: item
|
|
105
|
-
}) : /*#__PURE__*/_react.default.createElement(_UTLabel.default, {
|
|
106
|
-
className: classes.label
|
|
107
|
-
|
|
108
|
+
}) : /*#__PURE__*/_react.default.createElement(_UTLabel.default, _extends({
|
|
109
|
+
className: classes.label,
|
|
110
|
+
variant: "small",
|
|
111
|
+
withMarkdown: true
|
|
112
|
+
}, labelProps), label),
|
|
108
113
|
classes: classes && {
|
|
109
114
|
root: classes.root,
|
|
110
115
|
label: classes.label
|
|
111
116
|
}
|
|
112
117
|
}), showError && (0, _form.shouldShowErrors)(meta) && /*#__PURE__*/_react.default.createElement(_UTLabel.default, {
|
|
113
|
-
|
|
114
|
-
|
|
118
|
+
colorTheme: "error",
|
|
119
|
+
variant: "small"
|
|
115
120
|
}, meta.error));
|
|
116
121
|
};
|
|
117
122
|
UTCheckbox.propTypes = {
|
|
118
|
-
disabled: _propTypes.bool,
|
|
119
|
-
onChange: _propTypes.func,
|
|
120
|
-
label: _propTypes.string,
|
|
121
|
-
value: (0, _propTypes.oneOfType)([_propTypes.bool, _propTypes.string]),
|
|
122
|
-
CustomCheckedIcon: _propTypes.node,
|
|
123
|
-
CustomUncheckedIcon: _propTypes.node,
|
|
124
|
-
item: (0, _propTypes.oneOfType)([_propTypes.string, _propTypes.object]),
|
|
125
|
-
color: _propTypes.string,
|
|
126
|
-
customRowLabel: (0, _propTypes.oneOfType)([_propTypes.func, _propTypes.element, _propTypes.string]),
|
|
127
|
-
useCustomIcons: _propTypes.bool,
|
|
128
123
|
classes: (0, _propTypes.shape)({
|
|
129
124
|
checkboxColorPrimary: _propTypes.string,
|
|
130
125
|
checkboxColorSecondary: _propTypes.string
|
|
131
126
|
}),
|
|
132
127
|
classNames: (0, _propTypes.objectOf)(_propTypes.string),
|
|
128
|
+
color: _propTypes.string,
|
|
129
|
+
CustomCheckedIcon: _propTypes.node,
|
|
130
|
+
customRowLabel: (0, _propTypes.oneOfType)([_propTypes.func, _propTypes.element, _propTypes.string]),
|
|
131
|
+
CustomUncheckedIcon: _propTypes.node,
|
|
132
|
+
disabled: _propTypes.bool,
|
|
133
|
+
disableRipple: _propTypes.bool,
|
|
134
|
+
input: _formTypes.inputPropTypes,
|
|
135
|
+
item: (0, _propTypes.oneOfType)([_propTypes.string, _propTypes.object]),
|
|
136
|
+
label: (0, _propTypes.oneOfType)([_propTypes.number, _propTypes.string]),
|
|
137
|
+
labelProps: _propTypes.object,
|
|
133
138
|
meta: _formTypes.metaPropTypes,
|
|
139
|
+
onChange: _propTypes.func,
|
|
134
140
|
showError: _propTypes.bool,
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
141
|
+
tooltipContent: _propTypes.element,
|
|
142
|
+
useCustomIcons: _propTypes.bool,
|
|
143
|
+
value: (0, _propTypes.oneOfType)([_propTypes.bool, _propTypes.string])
|
|
138
144
|
};
|
|
139
145
|
var _default = (0, _WithTheme.default)(_theme.retrieveStyle, _theme.retrieveMuiTheme)(UTCheckbox);
|
|
140
146
|
exports.default = _default;
|
|
@@ -8,7 +8,8 @@ var _seamlessImmutable = require("seamless-immutable");
|
|
|
8
8
|
var _styles = require("@material-ui/core/styles");
|
|
9
9
|
var _colors = _interopRequireDefault(require("../../scss/variables/_colors.scss"));
|
|
10
10
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
|
-
var retrieveStyle = function retrieveStyle(
|
|
11
|
+
var retrieveStyle = function retrieveStyle(_ref) {
|
|
12
|
+
var theme = _ref.theme;
|
|
12
13
|
return {
|
|
13
14
|
checkedIcon: {
|
|
14
15
|
width: (0, _seamlessImmutable.getIn)(theme, ['UTCheckbox', 'icon', 'checked', 'width']),
|
|
@@ -34,7 +35,7 @@ var retrieveStyle = function retrieveStyle(theme) {
|
|
|
34
35
|
};
|
|
35
36
|
exports.retrieveStyle = retrieveStyle;
|
|
36
37
|
var retrieveMuiTheme = function retrieveMuiTheme(theme) {
|
|
37
|
-
return (0, _styles.
|
|
38
|
+
return (0, _styles.createTheme)({
|
|
38
39
|
typography: {
|
|
39
40
|
fontFamily: (0, _seamlessImmutable.getIn)(theme, ['Fonts', 'fontFamily'])
|
|
40
41
|
},
|
|
@@ -42,7 +43,14 @@ var retrieveMuiTheme = function retrieveMuiTheme(theme) {
|
|
|
42
43
|
MuiFormControlLabel: {
|
|
43
44
|
label: {
|
|
44
45
|
fontSize: (0, _seamlessImmutable.getIn)(theme, ['UTCheckbox', 'label', 'fontSize'], 14),
|
|
45
|
-
color: (0, _seamlessImmutable.getIn)(theme, ['UTCheckbox', 'label', 'color'], _colors.default.primary)
|
|
46
|
+
color: (0, _seamlessImmutable.getIn)(theme, ['UTCheckbox', 'label', 'color'], _colors.default.primary),
|
|
47
|
+
'& span': {
|
|
48
|
+
fontSize: (0, _seamlessImmutable.getIn)(theme, ['UTCheckbox', 'label', 'fontSize'], 14),
|
|
49
|
+
color: (0, _seamlessImmutable.getIn)(theme, ['UTCheckbox', 'label', 'color'], _colors.default.primary),
|
|
50
|
+
'& a': {
|
|
51
|
+
color: (0, _seamlessImmutable.getIn)(theme, ['UTCheckbox', 'linkLabel', 'color'], _colors.default.primary)
|
|
52
|
+
}
|
|
53
|
+
}
|
|
46
54
|
}
|
|
47
55
|
},
|
|
48
56
|
MuiFormHelperText: {
|