@widergy/energy-ui 2.12.2 → 2.12.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/EnergyThemeProvider/index.js +13 -36
- package/dist/components/Loading/constants.js +1 -2
- package/dist/components/Loading/index.js +13 -12
- package/dist/components/Loading/theme.js +4 -2
- package/dist/components/UTAlert/AlertHandler.js +75 -101
- package/dist/components/UTAlert/index.js +65 -87
- package/dist/components/UTAlert/theme.js +32 -32
- package/dist/components/UTAttachment/components/Preview/index.js +8 -9
- package/dist/components/UTAttachment/constants.js +7 -13
- package/dist/components/UTAttachment/index.js +159 -250
- package/dist/components/UTAttachment/layout.js +26 -27
- package/dist/components/UTAttachment/theme.js +4 -2
- package/dist/components/UTAttachment/utils.js +34 -117
- package/dist/components/UTAutocomplete/components/ListBox/index.js +13 -21
- package/dist/components/UTAutocomplete/components/ListBox/utils.js +9 -11
- package/dist/components/UTAutocomplete/constants.js +12 -23
- package/dist/components/UTAutocomplete/index.js +54 -94
- package/dist/components/UTAutocomplete/theme.js +6 -4
- package/dist/components/UTAvatar/constants.js +2 -3
- package/dist/components/UTAvatar/index.js +18 -17
- package/dist/components/UTBarChart/components/Bars/components/Bar/components/Rect/index.js +22 -22
- package/dist/components/UTBarChart/components/Bars/components/Bar/constants.js +1 -1
- package/dist/components/UTBarChart/components/Bars/components/Bar/index.js +21 -22
- package/dist/components/UTBarChart/components/Bars/constants.js +3 -6
- package/dist/components/UTBarChart/components/Bars/index.js +70 -80
- package/dist/components/UTBarChart/components/Legend/constants.js +12 -18
- package/dist/components/UTBarChart/components/Legend/index.js +75 -93
- package/dist/components/UTBarChart/components/Legend/utils.js +1 -5
- package/dist/components/UTBarChart/components/Levels/index.js +16 -14
- package/dist/components/UTBarChart/components/Levels/utils.js +25 -27
- package/dist/components/UTBarChart/components/LinearPlot/constants.js +3 -5
- package/dist/components/UTBarChart/components/LinearPlot/index.js +25 -20
- package/dist/components/UTBarChart/components/LinearPlot/utils.js +37 -39
- package/dist/components/UTBarChart/components/Pagination/constants.js +1 -2
- package/dist/components/UTBarChart/components/Pagination/index.js +20 -24
- package/dist/components/UTBarChart/components/XAxis/components/AxisElement/index.js +21 -32
- package/dist/components/UTBarChart/components/XAxis/components/Decoration/constants.js +2 -4
- package/dist/components/UTBarChart/components/XAxis/components/Decoration/index.js +20 -19
- package/dist/components/UTBarChart/components/XAxis/constants.js +1 -2
- package/dist/components/UTBarChart/components/XAxis/index.js +54 -65
- package/dist/components/UTBarChart/components/YAxis/AxisElement/index.js +12 -11
- package/dist/components/UTBarChart/components/YAxis/constants.js +1 -2
- package/dist/components/UTBarChart/components/YAxis/index.js +30 -37
- package/dist/components/UTBarChart/components/YAxis/utils.js +4 -6
- package/dist/components/UTBarChart/constants.js +4 -8
- package/dist/components/UTBarChart/hooks/use-dynamic-margins.js +23 -40
- package/dist/components/UTBarChart/index.js +152 -166
- package/dist/components/UTBarChart/theme.js +4 -2
- package/dist/components/UTBarChart/types.js +10 -19
- package/dist/components/UTBarChart/utils.js +107 -111
- package/dist/components/UTBreadcrumbs/constants.js +23 -31
- package/dist/components/UTBreadcrumbs/index.js +76 -101
- package/dist/components/UTBreadcrumbs/theme.js +4 -2
- package/dist/components/UTButton/constants.js +11 -17
- package/dist/components/UTButton/index.js +28 -31
- package/dist/components/UTButton/theme.js +23 -23
- package/dist/components/UTCBUInput/index.js +36 -40
- package/dist/components/UTCBUInput/theme.js +4 -2
- package/dist/components/UTCaptcha/index.js +19 -45
- package/dist/components/UTCard/components/UTCardFooter/index.js +15 -16
- package/dist/components/UTCard/index.js +85 -120
- package/dist/components/UTCard/theme.js +11 -12
- package/dist/components/UTCard/types.js +2 -3
- package/dist/components/UTCarousel/components/Button/index.js +13 -13
- package/dist/components/UTCarousel/components/Legend/index.js +13 -15
- package/dist/components/UTCarousel/components/Slider/component/Slide/index.js +16 -16
- package/dist/components/UTCarousel/components/Slider/constants.js +5 -10
- package/dist/components/UTCarousel/components/Slider/index.js +204 -273
- package/dist/components/UTCarousel/components/Slider/layout.js +67 -94
- package/dist/components/UTCarousel/index.js +14 -15
- package/dist/components/UTCarousel/theme.js +4 -2
- package/dist/components/UTCheckList/constants.js +1 -2
- package/dist/components/UTCheckList/index.js +72 -93
- package/dist/components/UTCheckList/theme.js +31 -31
- package/dist/components/UTCheckbox/constants.js +3 -6
- package/dist/components/UTCheckbox/index.js +32 -44
- package/dist/components/UTCheckbox/theme.js +35 -35
- package/dist/components/UTConsumptionBar/components/ConsumptionBarIndicator/index.js +9 -9
- package/dist/components/UTConsumptionBar/constants.js +3 -6
- package/dist/components/UTConsumptionBar/index.js +53 -80
- package/dist/components/UTCuit/index.js +109 -133
- package/dist/components/UTCuit/theme.js +51 -53
- package/dist/components/UTDatePicker/components/Day/constants.js +1 -2
- package/dist/components/UTDatePicker/components/Day/index.js +12 -12
- package/dist/components/UTDatePicker/constants.js +20 -31
- package/dist/components/UTDatePicker/index.js +60 -102
- package/dist/components/UTDatePicker/theme.js +5 -3
- package/dist/components/UTDatePicker/types.js +2 -3
- package/dist/components/UTDatePicker/utils.js +2 -6
- package/dist/components/UTDialog/constants.js +2 -4
- package/dist/components/UTDialog/index.js +38 -37
- package/dist/components/UTDialog/theme.js +4 -2
- package/dist/components/UTDialog/types.js +2 -3
- package/dist/components/UTDotMenu/index.js +39 -61
- package/dist/components/UTEmojiPicker/constants.js +6 -11
- package/dist/components/UTEmojiPicker/index.js +45 -65
- package/dist/components/UTEmojiPicker/theme.js +4 -2
- package/dist/components/UTEmojiPicker/utils.js +21 -51
- package/dist/components/UTExternalLink/constants.js +3 -5
- package/dist/components/UTExternalLink/index.js +18 -15
- package/dist/components/UTExternalLink/theme.js +8 -6
- package/dist/components/UTFileInput/constants.js +2 -4
- package/dist/components/UTFileInput/index.js +7 -31
- package/dist/components/UTFileInput/layout.js +68 -97
- package/dist/components/UTIconButton/index.js +49 -72
- package/dist/components/UTIconButton/theme.js +4 -2
- package/dist/components/UTImageRadio/components/ImageRadioCard/index.js +53 -58
- package/dist/components/UTImageRadio/constants.js +3 -6
- package/dist/components/UTImageRadio/index.js +39 -47
- package/dist/components/UTImageRadio/theme.js +11 -12
- package/dist/components/UTImageRadio/types.js +2 -3
- package/dist/components/UTImageRadio/utils.js +2 -6
- package/dist/components/UTLabel/constants.js +14 -20
- package/dist/components/UTLabel/index.js +18 -20
- package/dist/components/UTLabel/theme.js +15 -15
- package/dist/components/UTList/index.js +15 -18
- package/dist/components/UTLoading/index.js +15 -15
- package/dist/components/UTMap/components/GoogleMaps/constants.js +8 -11
- package/dist/components/UTMap/components/GoogleMaps/index.js +63 -91
- package/dist/components/UTMap/components/GoogleMaps/styles.js +2 -3
- package/dist/components/UTMap/constants.js +6 -12
- package/dist/components/UTMap/index.js +163 -198
- package/dist/components/UTMap/types.js +4 -6
- package/dist/components/UTMap/utils.js +29 -46
- package/dist/components/UTMap/withGoogleMapScript.js +18 -22
- package/dist/components/UTMenu/index.js +52 -69
- package/dist/components/UTMenu/theme.js +5 -3
- package/dist/components/UTMenu/utils.js +5 -11
- package/dist/components/UTModal/constants.js +9 -13
- package/dist/components/UTModal/index.js +26 -30
- package/dist/components/UTModal/theme.js +4 -2
- package/dist/components/UTPagination/components/PageSizeSelector/index.js +11 -10
- package/dist/components/UTPagination/components/PageSizeSelector/utils.js +7 -13
- package/dist/components/UTPagination/components/Pagination/components/NavigationButton/index.js +12 -12
- package/dist/components/UTPagination/components/Pagination/index.js +28 -39
- package/dist/components/UTPagination/components/Pagination/utils.js +8 -14
- package/dist/components/UTPagination/constants.js +3 -6
- package/dist/components/UTPagination/index.js +16 -17
- package/dist/components/UTPagination/theme.js +4 -2
- package/dist/components/UTPanel/index.js +38 -44
- package/dist/components/UTPasswordField/components/PasswordValidations/components/Error/index.js +13 -10
- package/dist/components/UTPasswordField/components/PasswordValidations/components/Validation/index.js +22 -19
- package/dist/components/UTPasswordField/components/PasswordValidations/index.js +63 -50
- package/dist/components/UTPasswordField/components/PasswordWarning/index.js +25 -26
- package/dist/components/UTPasswordField/index.js +26 -23
- package/dist/components/UTPasswordField/theme.js +4 -2
- package/dist/components/UTPhoneInput/constants.js +3 -6
- package/dist/components/UTPhoneInput/index.js +180 -205
- package/dist/components/UTPhoneInput/theme.js +77 -77
- package/dist/components/UTPieChart/components/ArrowLabel/constants.js +4 -8
- package/dist/components/UTPieChart/components/ArrowLabel/index.js +24 -23
- package/dist/components/UTPieChart/components/Legend/contants.js +3 -6
- package/dist/components/UTPieChart/components/Legend/index.js +27 -24
- package/dist/components/UTPieChart/constants.js +13 -26
- package/dist/components/UTPieChart/hooks/use-animated-value/index.js +15 -33
- package/dist/components/UTPieChart/index.js +73 -76
- package/dist/components/UTPieChart/theme.js +4 -2
- package/dist/components/UTPieChart/utils.js +4 -2
- package/dist/components/UTProgressBar/constants.js +2 -4
- package/dist/components/UTProgressBar/index.js +15 -17
- package/dist/components/UTProgressBar/theme.js +4 -2
- package/dist/components/UTProgressBar/types.js +2 -3
- package/dist/components/UTRadioGroup/index.js +56 -83
- package/dist/components/UTRadioGroup/theme.js +52 -52
- package/dist/components/UTRating/components/Circle/index.js +41 -56
- package/dist/components/UTRating/components/Faces/constants.js +2 -4
- package/dist/components/UTRating/components/Faces/index.js +34 -36
- package/dist/components/UTRating/components/Star/index.js +36 -40
- package/dist/components/UTRating/constants.js +4 -8
- package/dist/components/UTRating/index.js +31 -46
- package/dist/components/UTRating/theme.js +4 -2
- package/dist/components/UTRipple/Ripple.js +22 -39
- package/dist/components/UTRipple/index.js +18 -37
- package/dist/components/UTSelect/components/Option/index.js +13 -13
- package/dist/components/UTSelect/constants.js +4 -8
- package/dist/components/UTSelect/index.js +63 -85
- package/dist/components/UTSelect/stylesJS.js +2 -3
- package/dist/components/UTSelect/theme.js +6 -4
- package/dist/components/UTSelect/utils.js +3 -13
- package/dist/components/UTSidebar/components/ListOption/index.js +34 -49
- package/dist/components/UTSidebar/components/LogosContainer/components/DynamicIcon/index.js +8 -8
- package/dist/components/UTSidebar/components/LogosContainer/index.js +14 -14
- package/dist/components/UTSidebar/components/Option/constants.js +2 -3
- package/dist/components/UTSidebar/components/Option/index.js +28 -32
- package/dist/components/UTSidebar/components/Toggler/index.js +11 -11
- package/dist/components/UTSidebar/index.js +42 -53
- package/dist/components/UTSidebar/theme.js +4 -2
- package/dist/components/UTSidebar/types.js +5 -10
- package/dist/components/UTSkeleton/index.js +10 -36
- package/dist/components/UTStatus/constants.js +5 -9
- package/dist/components/UTStatus/index.js +16 -15
- package/dist/components/UTStatus/theme.js +66 -49
- package/dist/components/UTSwitch/constants.js +3 -6
- package/dist/components/UTSwitch/index.js +42 -57
- package/dist/components/UTSwitch/theme.js +4 -2
- package/dist/components/UTTable/components/ActionIcons/constants.js +1 -2
- package/dist/components/UTTable/components/ActionIcons/index.js +47 -85
- package/dist/components/UTTable/components/Cell/components/ActionButton/index.js +10 -12
- package/dist/components/UTTable/components/Cell/index.js +18 -23
- package/dist/components/UTTable/components/HeaderCell/constants.js +2 -3
- package/dist/components/UTTable/components/HeaderCell/index.js +23 -30
- package/dist/components/UTTable/components/HeaderCell/utils.js +3 -3
- package/dist/components/UTTable/components/PrimaryAction/index.js +12 -11
- package/dist/components/UTTable/components/ResponsiveCell/index.js +19 -20
- package/dist/components/UTTable/components/Status/index.js +18 -19
- package/dist/components/UTTable/components/TableFooter/components/PageSizeSelector/index.js +10 -9
- package/dist/components/UTTable/components/TableFooter/components/PageSizeSelector/utils.js +7 -13
- package/dist/components/UTTable/components/TableFooter/components/Pagination/components/NavigationButton/index.js +12 -12
- package/dist/components/UTTable/components/TableFooter/components/Pagination/index.js +21 -32
- package/dist/components/UTTable/components/TableFooter/components/Pagination/utils.js +8 -14
- package/dist/components/UTTable/components/TableFooter/constants.js +1 -2
- package/dist/components/UTTable/components/TableFooter/index.js +15 -15
- package/dist/components/UTTable/components/TableHeader/index.js +11 -11
- package/dist/components/UTTable/components/TableRow/constants.js +3 -6
- package/dist/components/UTTable/components/TableRow/index.js +82 -95
- package/dist/components/UTTable/components/TableRow/styles.module.scss +8 -1
- package/dist/components/UTTable/components/TableRow/utils.js +15 -0
- package/dist/components/UTTable/constants.js +26 -43
- package/dist/components/UTTable/hook.js +11 -26
- package/dist/components/UTTable/index.js +129 -220
- package/dist/components/UTTable/theme.js +17 -17
- package/dist/components/UTTable/types.js +4 -8
- package/dist/components/UTTable/utils.js +70 -74
- package/dist/components/UTTabs/components/TooltipTab/index.js +20 -30
- package/dist/components/UTTabs/constants.js +4 -8
- package/dist/components/UTTabs/index.js +57 -86
- package/dist/components/UTTabs/theme.js +4 -2
- package/dist/components/UTTabs/utils.js +1 -1
- package/dist/components/UTTextArea/constants.js +3 -6
- package/dist/components/UTTextArea/index.js +23 -23
- package/dist/components/UTTextArea/theme.js +4 -2
- package/dist/components/UTTextInput/constants.js +2 -3
- package/dist/components/UTTextInput/index.js +137 -165
- package/dist/components/UTTextInput/theme.js +6 -4
- package/dist/components/UTThirdPartyCookieChecker/index.js +17 -21
- package/dist/components/UTToggle/components/ToggleOption/index.js +16 -17
- package/dist/components/UTToggle/index.js +25 -26
- package/dist/components/UTToggle/theme.js +4 -2
- package/dist/components/UTTooltip/index.js +23 -30
- package/dist/components/UTTooltip/theme.js +4 -2
- package/dist/components/UTTopbar/components/Notifications/index.js +11 -14
- package/dist/components/UTTopbar/components/UserMenu/index.js +15 -15
- package/dist/components/UTTopbar/index.js +28 -31
- package/dist/components/UTTopbar/theme.js +4 -2
- package/dist/components/UTTopbar/types.js +5 -9
- package/dist/components/UTTouchableWithoutFeedback/index.js +14 -27
- package/dist/components/UTVirtualizedList/components/VirtualizedData/components/ListRow/constants.js +2 -4
- package/dist/components/UTVirtualizedList/components/VirtualizedData/components/ListRow/index.js +34 -31
- package/dist/components/UTVirtualizedList/components/VirtualizedData/components/ListRow/utils.js +4 -4
- package/dist/components/UTVirtualizedList/components/VirtualizedData/constants.js +6 -12
- package/dist/components/UTVirtualizedList/components/VirtualizedData/hooks/use-ledger.js +8 -18
- package/dist/components/UTVirtualizedList/components/VirtualizedData/hooks/use-virtualized-data.js +23 -47
- package/dist/components/UTVirtualizedList/components/VirtualizedData/index.js +31 -34
- package/dist/components/UTVirtualizedList/components/VirtualizedData/utils.js +81 -93
- package/dist/components/UTVirtualizedList/constants.js +4 -8
- package/dist/components/UTVirtualizedList/index.js +26 -38
- package/dist/components/UTWorkflowContainer/components/ActionButton/index.js +17 -21
- package/dist/components/UTWorkflowContainer/constants.js +3 -6
- package/dist/components/UTWorkflowContainer/hooks/use-previous.js +3 -3
- package/dist/components/UTWorkflowContainer/index.js +32 -51
- package/dist/components/UTWorkflowContainer/theme.js +60 -53
- package/dist/components/UTWorkflowContainer/types.js +2 -3
- package/dist/components/WithLoading/index.js +10 -15
- package/dist/components/WithTheme/index.js +10 -17
- package/dist/components/WithTheme/layout.js +22 -28
- package/dist/components/WithTouch/index.js +12 -19
- package/dist/constants/UTTable.js +2 -3
- package/dist/index.js +58 -58
- package/dist/theme.js +6 -5
- package/dist/types/commonTypes.js +3 -5
- package/dist/types/consumptionTypes.js +3 -5
- package/dist/types/formTypes.js +4 -7
- package/dist/types/tableTypes.js +2 -3
- package/dist/utils/classesUtils.js +5 -13
- package/dist/utils/componentUtils.js +10 -13
- package/dist/utils/helperFunctions.js +4 -4
- package/dist/utils/shadowUtils.js +13 -11
- package/dist/utils/useScreenSize.js +2 -3
- package/package.json +1 -1
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
@@ -8,11 +7,6 @@ exports.validateProps = exports.retrieveStyle = exports.getLabelTheme = exports.
|
|
|
8
7
|
var _react = _interopRequireDefault(require("react"));
|
|
9
8
|
var _constants = require("./constants");
|
|
10
9
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
|
-
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; }
|
|
12
|
-
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; }
|
|
13
|
-
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; }
|
|
14
|
-
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
15
|
-
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); }
|
|
16
10
|
var ErrorIcon = function ErrorIcon(props) {
|
|
17
11
|
return /*#__PURE__*/_react.default.createElement("svg", props, /*#__PURE__*/_react.default.createElement("path", {
|
|
18
12
|
fillRule: "evenodd",
|
|
@@ -88,47 +82,62 @@ WarningIcon.defaultProps = {
|
|
|
88
82
|
fill: "none",
|
|
89
83
|
xmlns: "http://www.w3.org/2000/svg"
|
|
90
84
|
};
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
85
|
+
const getBackgroundColor = _ref => {
|
|
86
|
+
let {
|
|
87
|
+
theme,
|
|
88
|
+
type,
|
|
89
|
+
variant
|
|
90
|
+
} = _ref;
|
|
95
91
|
return variant !== _constants.VARIANTS.unassigned ? theme.Palette[variant][type === _constants.TYPES.negative ? '04' : '01'] : type === _constants.TYPES.negative ? theme.Palette.gray['04'] : theme.Palette.light['04'];
|
|
96
92
|
};
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
type
|
|
101
|
-
variant
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
};
|
|
93
|
+
const getIconFill = _ref2 => {
|
|
94
|
+
let {
|
|
95
|
+
theme,
|
|
96
|
+
type,
|
|
97
|
+
variant
|
|
98
|
+
} = _ref2;
|
|
99
|
+
return {
|
|
100
|
+
[_constants.TYPES.default]: theme.Palette.dark['05'],
|
|
101
|
+
[_constants.TYPES.light]: theme.Palette[variant !== _constants.VARIANTS.unassigned ? variant : 'gray']['05'],
|
|
102
|
+
[_constants.TYPES.negative]: theme.Palette.light['01']
|
|
103
|
+
}[type];
|
|
104
|
+
};
|
|
105
|
+
const defaultIconMapper = variant => ({
|
|
106
|
+
[_constants.VARIANTS.error]: ErrorIcon,
|
|
107
|
+
[_constants.VARIANTS.information]: InfoIcon,
|
|
108
|
+
[_constants.VARIANTS.success]: SuccessIcon,
|
|
109
|
+
[_constants.VARIANTS.unassigned]: UnassignedIcon,
|
|
110
|
+
[_constants.VARIANTS.warning]: WarningIcon
|
|
111
|
+
})[variant];
|
|
108
112
|
exports.defaultIconMapper = defaultIconMapper;
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
113
|
+
const validateProps = _ref3 => {
|
|
114
|
+
let {
|
|
115
|
+
type,
|
|
116
|
+
variant
|
|
117
|
+
} = _ref3;
|
|
112
118
|
return {
|
|
113
119
|
type: _constants.TYPES[type] || _constants.TYPES[_constants.DEFAULT_PROPS.type],
|
|
114
120
|
variant: _constants.VARIANTS[variant] || _constants.VARIANTS[_constants.DEFAULT_PROPS.variant]
|
|
115
121
|
};
|
|
116
122
|
};
|
|
117
123
|
exports.validateProps = validateProps;
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
124
|
+
const retrieveStyle = _ref4 => {
|
|
125
|
+
let {
|
|
126
|
+
theme,
|
|
127
|
+
type,
|
|
128
|
+
uppercase,
|
|
129
|
+
variant
|
|
130
|
+
} = _ref4;
|
|
123
131
|
return {
|
|
124
132
|
root: {
|
|
125
133
|
alignItems: 'center',
|
|
126
|
-
backgroundColor: getBackgroundColor(
|
|
127
|
-
theme
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
134
|
+
backgroundColor: getBackgroundColor({
|
|
135
|
+
theme,
|
|
136
|
+
...validateProps({
|
|
137
|
+
type,
|
|
138
|
+
variant
|
|
139
|
+
})
|
|
140
|
+
}),
|
|
132
141
|
borderRadius: '4px',
|
|
133
142
|
display: 'flex',
|
|
134
143
|
gridGap: '8px',
|
|
@@ -139,29 +148,37 @@ var retrieveStyle = function retrieveStyle(_ref4) {
|
|
|
139
148
|
display: 'none'
|
|
140
149
|
}
|
|
141
150
|
},
|
|
142
|
-
label:
|
|
143
|
-
|
|
144
|
-
|
|
151
|
+
label: {
|
|
152
|
+
...(uppercase ? {
|
|
153
|
+
textTransform: 'uppercase'
|
|
154
|
+
} : {})
|
|
155
|
+
},
|
|
145
156
|
icon: {
|
|
146
157
|
flexShrink: '0',
|
|
147
158
|
height: '20px',
|
|
148
159
|
width: '20px',
|
|
149
160
|
'& path': {
|
|
150
|
-
fill: getIconFill(
|
|
151
|
-
theme
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
161
|
+
fill: getIconFill({
|
|
162
|
+
theme,
|
|
163
|
+
...validateProps({
|
|
164
|
+
type,
|
|
165
|
+
variant
|
|
166
|
+
})
|
|
167
|
+
})
|
|
156
168
|
}
|
|
157
169
|
}
|
|
158
170
|
};
|
|
159
171
|
};
|
|
160
172
|
exports.retrieveStyle = retrieveStyle;
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
variant
|
|
165
|
-
|
|
173
|
+
const getLabelTheme = _ref5 => {
|
|
174
|
+
let {
|
|
175
|
+
type,
|
|
176
|
+
variant
|
|
177
|
+
} = _ref5;
|
|
178
|
+
return {
|
|
179
|
+
[_constants.TYPES.default]: 'dark',
|
|
180
|
+
[_constants.TYPES.light]: variant !== _constants.VARIANTS.unassigned ? variant : 'gray',
|
|
181
|
+
[_constants.TYPES.negative]: 'light'
|
|
182
|
+
}[type];
|
|
166
183
|
};
|
|
167
184
|
exports.getLabelTheme = getLabelTheme;
|
|
@@ -4,12 +4,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.TRUE = exports.STATES = exports.DEFAULT_SWITCH_ID = void 0;
|
|
7
|
-
|
|
7
|
+
const STATES = exports.STATES = {
|
|
8
8
|
ON: 'SI',
|
|
9
9
|
OFF: 'NO'
|
|
10
10
|
};
|
|
11
|
-
exports.
|
|
12
|
-
|
|
13
|
-
exports.DEFAULT_SWITCH_ID = DEFAULT_SWITCH_ID;
|
|
14
|
-
var TRUE = 'true';
|
|
15
|
-
exports.TRUE = TRUE;
|
|
11
|
+
const DEFAULT_SWITCH_ID = exports.DEFAULT_SWITCH_ID = 'switch';
|
|
12
|
+
const TRUE = exports.TRUE = 'true';
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
@@ -16,62 +15,49 @@ var _WithTheme = _interopRequireDefault(require("../WithTheme"));
|
|
|
16
15
|
var _theme = require("./theme");
|
|
17
16
|
var _constants = require("./constants.js");
|
|
18
17
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
|
-
function _getRequireWildcardCache(
|
|
20
|
-
function _interopRequireWildcard(
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
var useFieldOptions = fieldOptions && !(0, _array.isEmpty)(fieldOptions);
|
|
59
|
-
var _ref2 = useFieldOptions ? _toConsumableArray(fieldOptions).sort(function (_, _ref4) {
|
|
60
|
-
var optionValue = _ref4.value,
|
|
61
|
-
name = _ref4.name;
|
|
62
|
-
return [optionValue, name === _constants.TRUE].includes(value) ? 1 : -1;
|
|
63
|
-
}) : [],
|
|
64
|
-
_ref3 = _slicedToArray(_ref2, 2),
|
|
65
|
-
currentOption = _ref3[0],
|
|
66
|
-
switchedOption = _ref3[1];
|
|
67
|
-
var onChange = useFieldOptions ? function () {
|
|
68
|
-
return onChange_(switchedOption.value);
|
|
69
|
-
} : onChange_;
|
|
70
|
-
(0, _react.useEffect)(function () {
|
|
18
|
+
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); }
|
|
19
|
+
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; }
|
|
20
|
+
const UTSwitch = _ref => {
|
|
21
|
+
let {
|
|
22
|
+
classes: themeClasses = {},
|
|
23
|
+
classNames,
|
|
24
|
+
disabled,
|
|
25
|
+
field = {},
|
|
26
|
+
input = {},
|
|
27
|
+
meta = {},
|
|
28
|
+
showErrors
|
|
29
|
+
} = _ref;
|
|
30
|
+
const {
|
|
31
|
+
value,
|
|
32
|
+
onChange: onChange_
|
|
33
|
+
} = input;
|
|
34
|
+
const {
|
|
35
|
+
key,
|
|
36
|
+
field_options: fieldOptions,
|
|
37
|
+
configuration = {}
|
|
38
|
+
} = field;
|
|
39
|
+
const {
|
|
40
|
+
textOff: textOff_,
|
|
41
|
+
textOn: textOn_,
|
|
42
|
+
insideText = true,
|
|
43
|
+
withText
|
|
44
|
+
} = configuration;
|
|
45
|
+
const switchId = key || _constants.DEFAULT_SWITCH_ID;
|
|
46
|
+
const classes = (0, _react.useMemo)(() => (0, _classesUtils.mergeClasses)(themeClasses, classNames), [classNames]);
|
|
47
|
+
const useFieldOptions = fieldOptions && !(0, _array.isEmpty)(fieldOptions);
|
|
48
|
+
const [currentOption, switchedOption] = useFieldOptions ? [...fieldOptions].sort((_, _ref2) => {
|
|
49
|
+
let {
|
|
50
|
+
value: optionValue,
|
|
51
|
+
name
|
|
52
|
+
} = _ref2;
|
|
53
|
+
return [optionValue, name === _constants.TRUE].includes(value) ? 1 : -1;
|
|
54
|
+
}) : [];
|
|
55
|
+
const onChange = useFieldOptions ? () => onChange_(switchedOption.value) : onChange_;
|
|
56
|
+
(0, _react.useEffect)(() => {
|
|
71
57
|
if (useFieldOptions && value === false) onChange_(currentOption.value);
|
|
72
58
|
}, [value]);
|
|
73
|
-
|
|
74
|
-
|
|
59
|
+
const textOn = textOn_ || _constants.STATES.ON;
|
|
60
|
+
const textOff = textOff_ || _constants.STATES.OFF;
|
|
75
61
|
return /*#__PURE__*/_react.default.createElement(_react.Fragment, null, /*#__PURE__*/_react.default.createElement("div", {
|
|
76
62
|
className: classes.outerContainer
|
|
77
63
|
}, withText && !insideText && textOff, /*#__PURE__*/_react.default.createElement("label", {
|
|
@@ -113,5 +99,4 @@ UTSwitch.propTypes = {
|
|
|
113
99
|
meta: _formTypes.metaPropTypes,
|
|
114
100
|
showErrors: _propTypes.bool
|
|
115
101
|
};
|
|
116
|
-
var _default = (0, _WithTheme.default)(_theme.retrieveStyle)(UTSwitch);
|
|
117
|
-
exports.default = _default;
|
|
102
|
+
var _default = exports.default = (0, _WithTheme.default)(_theme.retrieveStyle)(UTSwitch);
|
|
@@ -7,8 +7,10 @@ exports.retrieveStyle = void 0;
|
|
|
7
7
|
var _seamlessImmutable = require("seamless-immutable");
|
|
8
8
|
var _colorsModule = _interopRequireDefault(require("../../scss/variables/colors.module.scss"));
|
|
9
9
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
const retrieveStyle = _ref => {
|
|
11
|
+
let {
|
|
12
|
+
theme
|
|
13
|
+
} = _ref;
|
|
12
14
|
return {
|
|
13
15
|
outerContainer: {
|
|
14
16
|
alignItems: (0, _seamlessImmutable.getIn)(theme, ['UTSwitch', 'outerContainer', 'alignItems'], 'center'),
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
@@ -15,91 +14,57 @@ var _types = require("../../types");
|
|
|
15
14
|
var _constants = require("./constants");
|
|
16
15
|
var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
|
|
17
16
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
18
|
-
function _getRequireWildcardCache(
|
|
19
|
-
function _interopRequireWildcard(
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
} : _ref2$isVisible,
|
|
51
|
-
_ref2$tooltipProps = _ref2.tooltipProps,
|
|
52
|
-
tooltipProps = _ref2$tooltipProps === void 0 ? {} : _ref2$tooltipProps,
|
|
53
|
-
_ref2$isDisabled = _ref2.isDisabled,
|
|
54
|
-
isDisabled = _ref2$isDisabled === void 0 ? function () {
|
|
55
|
-
return false;
|
|
56
|
-
} : _ref2$isDisabled,
|
|
57
|
-
_ref2$isLoading = _ref2.isLoading,
|
|
58
|
-
isLoading = _ref2$isLoading === void 0 ? function () {
|
|
59
|
-
return false;
|
|
60
|
-
} : _ref2$isLoading,
|
|
61
|
-
_ref2$menuItems = _ref2.menuItems,
|
|
62
|
-
menuItems = _ref2$menuItems === void 0 ? [] : _ref2$menuItems,
|
|
63
|
-
withMenuDivider = _ref2.withMenuDivider;
|
|
64
|
-
var _useState = (0, _react.useState)(),
|
|
65
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
66
|
-
menuAnchor = _useState2[0],
|
|
67
|
-
setMenuAnchor = _useState2[1];
|
|
68
|
-
var _useState3 = (0, _react.useState)(),
|
|
69
|
-
_useState4 = _slicedToArray(_useState3, 2),
|
|
70
|
-
menuRowContextData = _useState4[0],
|
|
71
|
-
setMenuRowConextData = _useState4[1];
|
|
72
|
-
var openMenu = function openMenu(event) {
|
|
73
|
-
return setMenuAnchor(event.currentTarget);
|
|
74
|
-
};
|
|
75
|
-
var closeMenu = function closeMenu() {
|
|
76
|
-
return setMenuAnchor();
|
|
77
|
-
};
|
|
78
|
-
var handleActionClick = function handleActionClick(event, eventRowData) {
|
|
17
|
+
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); }
|
|
18
|
+
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; }
|
|
19
|
+
const ActionIcons = _ref => {
|
|
20
|
+
let {
|
|
21
|
+
classes,
|
|
22
|
+
column,
|
|
23
|
+
rowData
|
|
24
|
+
} = _ref;
|
|
25
|
+
return /*#__PURE__*/_react.default.createElement(_react.Fragment, null, column.actions.map(_ref2 => {
|
|
26
|
+
let {
|
|
27
|
+
key,
|
|
28
|
+
Icon,
|
|
29
|
+
tooltip,
|
|
30
|
+
disabledTooltip,
|
|
31
|
+
onClick,
|
|
32
|
+
buttonClassName,
|
|
33
|
+
iconClassName,
|
|
34
|
+
disabledIconClassName,
|
|
35
|
+
loadingClassName,
|
|
36
|
+
loadingSize = _constants.DEAULT_LOADING_SIZE,
|
|
37
|
+
isVisible = () => true,
|
|
38
|
+
tooltipProps = {},
|
|
39
|
+
isDisabled = () => false,
|
|
40
|
+
isLoading = () => false,
|
|
41
|
+
menuItems = [],
|
|
42
|
+
withMenuDivider
|
|
43
|
+
} = _ref2;
|
|
44
|
+
const [menuAnchor, setMenuAnchor] = (0, _react.useState)();
|
|
45
|
+
const [menuRowContextData, setMenuRowConextData] = (0, _react.useState)();
|
|
46
|
+
const openMenu = event => setMenuAnchor(event.currentTarget);
|
|
47
|
+
const closeMenu = () => setMenuAnchor();
|
|
48
|
+
const handleActionClick = (event, eventRowData) => {
|
|
79
49
|
if ((0, _array.isEmpty)(menuItems)) onClick(eventRowData);else {
|
|
80
|
-
setMenuRowConextData(
|
|
50
|
+
setMenuRowConextData({
|
|
51
|
+
...eventRowData,
|
|
81
52
|
clickCallback: closeMenu
|
|
82
|
-
})
|
|
53
|
+
});
|
|
83
54
|
openMenu(event);
|
|
84
55
|
}
|
|
85
56
|
};
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
57
|
+
const visibleMenuItems = menuItems.filter(menuItem => !menuItem.isVisible || menuItem.isVisible(rowData)).map(menuItem => ({
|
|
58
|
+
...menuItem,
|
|
59
|
+
disabled: menuItem.isDisabled && menuItem.isDisabled(rowData)
|
|
60
|
+
}));
|
|
61
|
+
const getDisabledTooltip = () => typeof disabledTooltip === 'function' ? disabledTooltip(rowData) : disabledTooltip;
|
|
62
|
+
const tooltipContent = isDisabled(rowData) && disabledTooltip ? getDisabledTooltip() : tooltip;
|
|
63
|
+
const tippyProps = {
|
|
64
|
+
appendTo: () => document.body,
|
|
65
|
+
interactive: false,
|
|
66
|
+
...tooltipProps
|
|
95
67
|
};
|
|
96
|
-
var tooltipContent = isDisabled(rowData) && disabledTooltip ? getDisabledTooltip() : tooltip;
|
|
97
|
-
var tippyProps = _objectSpread({
|
|
98
|
-
appendTo: function appendTo() {
|
|
99
|
-
return document.body;
|
|
100
|
-
},
|
|
101
|
-
interactive: false
|
|
102
|
-
}, tooltipProps);
|
|
103
68
|
return isVisible(rowData) && /*#__PURE__*/_react.default.createElement(_UTTooltip.default, {
|
|
104
69
|
key: key,
|
|
105
70
|
content: tooltipContent,
|
|
@@ -107,9 +72,7 @@ var ActionIcons = function ActionIcons(_ref) {
|
|
|
107
72
|
tippyProps: tippyProps
|
|
108
73
|
}, /*#__PURE__*/_react.default.createElement("span", null, /*#__PURE__*/_react.default.createElement("div", {
|
|
109
74
|
className: "".concat(_stylesModule.default.iconButton, " ").concat(classes.actionIconButton, " \n ").concat((isDisabled(rowData) || isLoading(rowData)) && _stylesModule.default.disabled, " ").concat(buttonClassName),
|
|
110
|
-
onClick:
|
|
111
|
-
return handleActionClick(event, rowData);
|
|
112
|
-
},
|
|
75
|
+
onClick: event => handleActionClick(event, rowData),
|
|
113
76
|
role: "button"
|
|
114
77
|
}, isLoading(rowData) ? /*#__PURE__*/_react.default.createElement(_CircularProgress.default, {
|
|
115
78
|
className: "".concat(classes.actionLoading, " ").concat(loadingClassName),
|
|
@@ -132,5 +95,4 @@ ActionIcons.propTypes = {
|
|
|
132
95
|
column: _types.columnType,
|
|
133
96
|
rowData: _propTypes.object
|
|
134
97
|
};
|
|
135
|
-
var _default = /*#__PURE__*/(0, _react.memo)(ActionIcons);
|
|
136
|
-
exports.default = _default;
|
|
98
|
+
var _default = exports.default = /*#__PURE__*/(0, _react.memo)(ActionIcons);
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
@@ -11,19 +10,19 @@ var _object = require("@widergy/web-utils/lib/object");
|
|
|
11
10
|
var _UTButton = _interopRequireDefault(require("../../../../../UTButton"));
|
|
12
11
|
var _types = require("../../../../types");
|
|
13
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
14
|
-
function _getRequireWildcardCache(
|
|
15
|
-
function _interopRequireWildcard(
|
|
16
|
-
|
|
13
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
14
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
15
|
+
const ActionButton = _ref => {
|
|
17
16
|
var _column$actions;
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
17
|
+
let {
|
|
18
|
+
column,
|
|
19
|
+
rowData
|
|
20
|
+
} = _ref;
|
|
21
|
+
const actionConfig = (_column$actions = column.actions) === null || _column$actions === void 0 ? void 0 : _column$actions[0];
|
|
21
22
|
return !(0, _object.objectIsEmpty)(actionConfig) && /*#__PURE__*/_react.default.createElement(_UTButton.default, {
|
|
22
23
|
classNames: actionConfig.buttonClassNames,
|
|
23
24
|
key: actionConfig.key,
|
|
24
|
-
onClick:
|
|
25
|
-
return actionConfig.onClick(rowData);
|
|
26
|
-
},
|
|
25
|
+
onClick: () => actionConfig.onClick(rowData),
|
|
27
26
|
variant: "text"
|
|
28
27
|
}, actionConfig.text);
|
|
29
28
|
};
|
|
@@ -31,5 +30,4 @@ ActionButton.propTypes = {
|
|
|
31
30
|
column: _types.columnType,
|
|
32
31
|
rowData: _propTypes.object
|
|
33
32
|
};
|
|
34
|
-
var _default = /*#__PURE__*/(0, _react.memo)(ActionButton);
|
|
35
|
-
exports.default = _default;
|
|
33
|
+
var _default = exports.default = /*#__PURE__*/(0, _react.memo)(ActionButton);
|
|
@@ -13,29 +13,25 @@ var _Status = _interopRequireDefault(require("../Status"));
|
|
|
13
13
|
var _ActionButton = _interopRequireDefault(require("./components/ActionButton"));
|
|
14
14
|
var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
|
|
15
15
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
16
|
-
function _getRequireWildcardCache(
|
|
17
|
-
function _interopRequireWildcard(
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
columnSizes = _ref.columnSizes,
|
|
30
|
-
defaultNullValue = _ref.defaultNullValue,
|
|
31
|
-
rowData = _ref.rowData,
|
|
32
|
-
style = _ref.style;
|
|
33
|
-
var cellAlignStyles = [_constants.CELL_TYPES.ACTION_ICONS, _constants.CELL_TYPES.ACTION_BUTTON].includes(column.type) ? _stylesModule.default.centerAlign : _stylesModule.default["".concat(align, "Align")];
|
|
16
|
+
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); }
|
|
17
|
+
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; }
|
|
18
|
+
const Cell = _ref => {
|
|
19
|
+
let {
|
|
20
|
+
align = _constants.COLUMN_POSITION.LEFT,
|
|
21
|
+
classes,
|
|
22
|
+
column,
|
|
23
|
+
columnSizes,
|
|
24
|
+
defaultNullValue,
|
|
25
|
+
rowData,
|
|
26
|
+
style
|
|
27
|
+
} = _ref;
|
|
28
|
+
const cellAlignStyles = [_constants.CELL_TYPES.ACTION_ICONS, _constants.CELL_TYPES.ACTION_BUTTON].includes(column.type) ? _stylesModule.default.centerAlign : _stylesModule.default["".concat(align, "Align")];
|
|
34
29
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
35
30
|
className: " ".concat(_stylesModule.default.rowElement, " ").concat(cellAlignStyles, " ").concat(classes.rowCell),
|
|
36
|
-
style:
|
|
37
|
-
width: columnSizes[column.key]
|
|
38
|
-
|
|
31
|
+
style: {
|
|
32
|
+
width: columnSizes[column.key],
|
|
33
|
+
...style
|
|
34
|
+
}
|
|
39
35
|
}, column.cellRenderer ? column.cellRenderer(rowData[column.key], rowData) : column.type === _constants.CELL_TYPES.ACTION_BUTTON ? /*#__PURE__*/_react.default.createElement(_ActionButton.default, {
|
|
40
36
|
column: column,
|
|
41
37
|
rowData: rowData
|
|
@@ -59,5 +55,4 @@ Cell.propTypes = {
|
|
|
59
55
|
rowData: _propTypes.object,
|
|
60
56
|
style: _propTypes.object
|
|
61
57
|
};
|
|
62
|
-
var _default = /*#__PURE__*/(0, _react.memo)(Cell);
|
|
63
|
-
exports.default = _default;
|
|
58
|
+
var _default = exports.default = /*#__PURE__*/(0, _react.memo)(Cell);
|
|
@@ -4,8 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.ORDER_DIRECTION = void 0;
|
|
7
|
-
|
|
7
|
+
const ORDER_DIRECTION = exports.ORDER_DIRECTION = {
|
|
8
8
|
ASC: 'asc',
|
|
9
9
|
DESC: 'desc'
|
|
10
|
-
};
|
|
11
|
-
exports.ORDER_DIRECTION = ORDER_DIRECTION;
|
|
10
|
+
};
|