@widergy/energy-ui 2.10.1 → 2.12.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/dist/components/EnergyThemeProvider/index.js +12 -34
- package/dist/components/Loading/constants.js +1 -1
- package/dist/components/Loading/index.js +12 -10
- package/dist/components/Loading/theme.js +6 -3
- package/dist/components/UTAlert/AlertHandler.js +74 -99
- package/dist/components/UTAlert/index.js +64 -85
- package/dist/components/UTAlert/theme.js +34 -32
- package/dist/components/UTAttachment/components/Preview/index.js +7 -7
- package/dist/components/UTAttachment/constants.js +6 -6
- package/dist/components/UTAttachment/index.js +158 -248
- package/dist/components/UTAttachment/layout.js +25 -25
- package/dist/components/UTAttachment/theme.js +6 -3
- package/dist/components/UTAttachment/utils.js +44 -117
- package/dist/components/UTAutocomplete/components/ListBox/index.js +12 -19
- package/dist/components/UTAutocomplete/components/ListBox/utils.js +11 -12
- package/dist/components/UTAutocomplete/constants.js +11 -11
- package/dist/components/UTAutocomplete/index.js +53 -92
- package/dist/components/UTAutocomplete/theme.js +9 -5
- package/dist/components/UTAvatar/constants.js +1 -1
- package/dist/components/UTAvatar/index.js +17 -15
- package/dist/components/UTBarChart/components/Bars/components/Bar/components/Rect/index.js +21 -20
- package/dist/components/UTBarChart/components/Bars/components/Bar/constants.js +2 -1
- package/dist/components/UTBarChart/components/Bars/components/Bar/index.js +20 -20
- package/dist/components/UTBarChart/components/Bars/constants.js +3 -3
- package/dist/components/UTBarChart/components/Bars/index.js +69 -78
- package/dist/components/UTBarChart/components/Legend/constants.js +14 -17
- package/dist/components/UTBarChart/components/Legend/index.js +74 -91
- package/dist/components/UTBarChart/components/Legend/utils.js +2 -5
- package/dist/components/UTBarChart/components/Levels/index.js +15 -12
- package/dist/components/UTBarChart/components/Levels/utils.js +26 -27
- package/dist/components/UTBarChart/components/LinearPlot/constants.js +2 -2
- package/dist/components/UTBarChart/components/LinearPlot/index.js +24 -18
- package/dist/components/UTBarChart/components/LinearPlot/utils.js +39 -39
- package/dist/components/UTBarChart/components/Pagination/constants.js +1 -1
- package/dist/components/UTBarChart/components/Pagination/index.js +19 -22
- package/dist/components/UTBarChart/components/XAxis/components/AxisElement/index.js +20 -30
- package/dist/components/UTBarChart/components/XAxis/components/Decoration/constants.js +2 -2
- package/dist/components/UTBarChart/components/XAxis/components/Decoration/index.js +19 -17
- package/dist/components/UTBarChart/components/XAxis/constants.js +1 -1
- package/dist/components/UTBarChart/components/XAxis/index.js +53 -63
- package/dist/components/UTBarChart/components/YAxis/AxisElement/index.js +11 -9
- package/dist/components/UTBarChart/components/YAxis/constants.js +1 -1
- package/dist/components/UTBarChart/components/YAxis/index.js +29 -35
- package/dist/components/UTBarChart/components/YAxis/utils.js +6 -6
- package/dist/components/UTBarChart/constants.js +4 -4
- package/dist/components/UTBarChart/hooks/use-dynamic-margins.js +22 -38
- package/dist/components/UTBarChart/index.js +151 -164
- package/dist/components/UTBarChart/theme.js +6 -3
- package/dist/components/UTBarChart/types.js +9 -9
- package/dist/components/UTBarChart/utils.js +118 -111
- package/dist/components/UTBreadcrumbs/constants.js +22 -24
- package/dist/components/UTBreadcrumbs/index.js +75 -99
- package/dist/components/UTBreadcrumbs/theme.js +6 -3
- package/dist/components/UTButton/constants.js +11 -11
- package/dist/components/UTButton/index.js +27 -29
- package/dist/components/UTButton/theme.js +26 -24
- package/dist/components/UTCBUInput/index.js +35 -38
- package/dist/components/UTCBUInput/theme.js +6 -3
- package/dist/components/UTCaptcha/index.js +18 -43
- package/dist/components/UTCard/components/UTCardFooter/index.js +14 -14
- package/dist/components/UTCard/index.js +84 -118
- package/dist/components/UTCard/theme.js +13 -13
- package/dist/components/UTCard/types.js +1 -1
- package/dist/components/UTCarousel/components/Button/index.js +12 -11
- package/dist/components/UTCarousel/components/Legend/index.js +12 -13
- package/dist/components/UTCarousel/components/Slider/component/Slide/index.js +15 -14
- package/dist/components/UTCarousel/components/Slider/constants.js +5 -5
- package/dist/components/UTCarousel/components/Slider/index.js +203 -271
- package/dist/components/UTCarousel/components/Slider/layout.js +66 -92
- package/dist/components/UTCarousel/index.js +13 -13
- package/dist/components/UTCarousel/theme.js +6 -3
- package/dist/components/UTCheckList/constants.js +1 -1
- package/dist/components/UTCheckList/index.js +71 -91
- package/dist/components/UTCheckList/theme.js +34 -32
- package/dist/components/UTCheckbox/constants.js +2 -4
- package/dist/components/UTCheckbox/index.js +31 -42
- package/dist/components/UTCheckbox/theme.js +37 -35
- package/dist/components/UTConsumptionBar/components/ConsumptionBarIndicator/index.js +8 -7
- package/dist/components/UTConsumptionBar/constants.js +3 -3
- package/dist/components/UTConsumptionBar/index.js +52 -78
- package/dist/components/UTCuit/index.js +108 -131
- package/dist/components/UTCuit/theme.js +52 -53
- package/dist/components/UTDatePicker/components/Day/constants.js +1 -1
- package/dist/components/UTDatePicker/components/Day/index.js +11 -10
- package/dist/components/UTDatePicker/constants.js +21 -22
- package/dist/components/UTDatePicker/index.js +59 -100
- package/dist/components/UTDatePicker/theme.js +8 -4
- package/dist/components/UTDatePicker/types.js +1 -1
- package/dist/components/UTDatePicker/utils.js +4 -6
- package/dist/components/UTDialog/constants.js +2 -2
- package/dist/components/UTDialog/index.js +37 -35
- package/dist/components/UTDialog/theme.js +6 -3
- package/dist/components/UTDialog/types.js +1 -1
- package/dist/components/UTDotMenu/index.js +38 -59
- package/dist/components/UTEmojiPicker/constants.js +5 -5
- package/dist/components/UTEmojiPicker/index.js +44 -63
- package/dist/components/UTEmojiPicker/theme.js +6 -3
- package/dist/components/UTEmojiPicker/utils.js +24 -52
- package/dist/components/UTExternalLink/constants.js +2 -2
- package/dist/components/UTExternalLink/index.js +17 -13
- package/dist/components/UTExternalLink/theme.js +11 -7
- package/dist/components/UTFileInput/constants.js +2 -2
- package/dist/components/UTFileInput/index.js +6 -29
- package/dist/components/UTFileInput/layout.js +67 -95
- package/dist/components/UTIconButton/index.js +48 -70
- package/dist/components/UTIconButton/theme.js +6 -3
- package/dist/components/UTImageRadio/components/ImageRadioCard/index.js +52 -56
- package/dist/components/UTImageRadio/constants.js +3 -3
- package/dist/components/UTImageRadio/index.js +38 -45
- package/dist/components/UTImageRadio/theme.js +13 -13
- package/dist/components/UTImageRadio/types.js +1 -1
- package/dist/components/UTImageRadio/utils.js +4 -6
- package/dist/components/UTLabel/constants.js +13 -11
- package/dist/components/UTLabel/index.js +17 -18
- package/dist/components/UTLabel/theme.js +19 -16
- package/dist/components/UTList/index.js +14 -16
- package/dist/components/UTLoading/index.js +14 -13
- package/dist/components/UTMap/components/GoogleMaps/constants.js +9 -10
- package/dist/components/UTMap/components/GoogleMaps/index.js +62 -89
- package/dist/components/UTMap/constants.js +6 -6
- package/dist/components/UTMap/index.js +162 -196
- package/dist/components/UTMap/types.js +4 -3
- package/dist/components/UTMap/utils.js +35 -46
- package/dist/components/UTMap/withGoogleMapScript.js +18 -14
- package/dist/components/UTMenu/index.js +51 -67
- package/dist/components/UTMenu/theme.js +8 -4
- package/dist/components/UTMenu/utils.js +10 -12
- package/dist/components/UTModal/constants.js +9 -9
- package/dist/components/UTModal/index.js +25 -28
- package/dist/components/UTModal/theme.js +6 -3
- package/dist/components/UTPagination/components/PageSizeSelector/index.js +10 -8
- package/dist/components/UTPagination/components/PageSizeSelector/utils.js +9 -14
- package/dist/components/UTPagination/components/Pagination/components/NavigationButton/index.js +11 -10
- package/dist/components/UTPagination/components/Pagination/index.js +27 -37
- package/dist/components/UTPagination/components/Pagination/utils.js +10 -15
- package/dist/components/UTPagination/constants.js +3 -3
- package/dist/components/UTPagination/index.js +15 -15
- package/dist/components/UTPagination/theme.js +6 -3
- package/dist/components/UTPanel/index.js +37 -42
- package/dist/components/UTPasswordField/components/PasswordValidations/components/Error/index.js +12 -8
- package/dist/components/UTPasswordField/components/PasswordValidations/components/Validation/index.js +21 -17
- package/dist/components/UTPasswordField/components/PasswordValidations/index.js +62 -48
- package/dist/components/UTPasswordField/components/PasswordWarning/index.js +24 -24
- package/dist/components/UTPasswordField/index.js +25 -21
- package/dist/components/UTPasswordField/theme.js +6 -3
- package/dist/components/UTPhoneInput/constants.js +3 -3
- package/dist/components/UTPhoneInput/index.js +179 -203
- package/dist/components/UTPhoneInput/theme.js +79 -77
- package/dist/components/UTPieChart/components/ArrowLabel/constants.js +4 -4
- package/dist/components/UTPieChart/components/ArrowLabel/index.js +23 -21
- package/dist/components/UTPieChart/components/Legend/contants.js +3 -3
- package/dist/components/UTPieChart/components/Legend/index.js +26 -22
- package/dist/components/UTPieChart/constants.js +13 -13
- package/dist/components/UTPieChart/hooks/use-animated-value/index.js +14 -31
- package/dist/components/UTPieChart/index.js +72 -74
- package/dist/components/UTPieChart/theme.js +6 -3
- package/dist/components/UTPieChart/utils.js +6 -3
- package/dist/components/UTProgressBar/constants.js +2 -2
- package/dist/components/UTProgressBar/index.js +14 -15
- package/dist/components/UTProgressBar/theme.js +6 -3
- package/dist/components/UTProgressBar/types.js +1 -1
- package/dist/components/UTRadioGroup/index.js +55 -81
- package/dist/components/UTRadioGroup/theme.js +54 -52
- package/dist/components/UTRating/components/Circle/index.js +40 -54
- package/dist/components/UTRating/components/Faces/assets/mood-confuzed.svg +3 -0
- package/dist/components/UTRating/components/Faces/assets/mood-empty.svg +3 -0
- package/dist/components/UTRating/components/Faces/assets/mood-happy.svg +3 -0
- package/dist/components/UTRating/components/Faces/assets/mood-sad.svg +3 -0
- package/dist/components/UTRating/components/Faces/assets/mood-smile.svg +3 -0
- package/dist/components/UTRating/components/Faces/constants.js +85 -0
- package/dist/components/UTRating/components/Faces/index.js +76 -0
- package/dist/components/UTRating/components/Faces/styles.module.scss +78 -0
- package/dist/components/UTRating/components/Star/index.js +35 -38
- package/dist/components/UTRating/constants.js +5 -4
- package/dist/components/UTRating/index.js +35 -46
- package/dist/components/UTRating/styles.module.scss +1 -0
- package/dist/components/UTRating/theme.js +52 -3
- package/dist/components/UTRipple/Ripple.js +21 -37
- package/dist/components/UTRipple/index.js +17 -35
- package/dist/components/UTSelect/components/Option/index.js +12 -11
- package/dist/components/UTSelect/constants.js +4 -4
- package/dist/components/UTSelect/index.js +62 -83
- package/dist/components/UTSelect/theme.js +9 -5
- package/dist/components/UTSelect/utils.js +5 -14
- package/dist/components/UTSidebar/components/ListOption/index.js +33 -47
- package/dist/components/UTSidebar/components/LogosContainer/components/DynamicIcon/index.js +7 -6
- package/dist/components/UTSidebar/components/LogosContainer/index.js +13 -12
- package/dist/components/UTSidebar/components/Option/constants.js +1 -1
- package/dist/components/UTSidebar/components/Option/index.js +27 -30
- package/dist/components/UTSidebar/components/Toggler/index.js +10 -9
- package/dist/components/UTSidebar/index.js +41 -51
- package/dist/components/UTSidebar/theme.js +6 -3
- package/dist/components/UTSidebar/types.js +5 -5
- package/dist/components/UTSkeleton/index.js +9 -34
- package/dist/components/UTStatus/constants.js +4 -4
- package/dist/components/UTStatus/index.js +15 -13
- package/dist/components/UTStatus/theme.js +70 -49
- package/dist/components/UTSwitch/constants.js +3 -3
- package/dist/components/UTSwitch/index.js +41 -55
- package/dist/components/UTSwitch/theme.js +6 -3
- package/dist/components/UTTable/components/ActionIcons/constants.js +1 -1
- package/dist/components/UTTable/components/ActionIcons/index.js +46 -83
- package/dist/components/UTTable/components/Cell/components/ActionButton/index.js +9 -10
- package/dist/components/UTTable/components/Cell/index.js +17 -21
- package/dist/components/UTTable/components/HeaderCell/constants.js +1 -1
- package/dist/components/UTTable/components/HeaderCell/index.js +22 -28
- package/dist/components/UTTable/components/HeaderCell/utils.js +5 -4
- package/dist/components/UTTable/components/PrimaryAction/index.js +11 -9
- package/dist/components/UTTable/components/ResponsiveCell/index.js +18 -18
- package/dist/components/UTTable/components/Status/index.js +17 -17
- package/dist/components/UTTable/components/TableFooter/components/PageSizeSelector/index.js +9 -7
- package/dist/components/UTTable/components/TableFooter/components/PageSizeSelector/utils.js +9 -14
- package/dist/components/UTTable/components/TableFooter/components/Pagination/components/NavigationButton/index.js +11 -10
- package/dist/components/UTTable/components/TableFooter/components/Pagination/index.js +20 -30
- package/dist/components/UTTable/components/TableFooter/components/Pagination/utils.js +10 -15
- package/dist/components/UTTable/components/TableFooter/constants.js +1 -1
- package/dist/components/UTTable/components/TableFooter/index.js +14 -13
- package/dist/components/UTTable/components/TableHeader/index.js +10 -9
- package/dist/components/UTTable/components/TableRow/constants.js +2 -4
- package/dist/components/UTTable/components/TableRow/index.js +78 -92
- package/dist/components/UTTable/constants.js +26 -24
- package/dist/components/UTTable/hook.js +13 -27
- package/dist/components/UTTable/index.js +125 -213
- package/dist/components/UTTable/theme.js +19 -18
- package/dist/components/UTTable/types.js +4 -4
- package/dist/components/UTTable/utils.js +80 -75
- package/dist/components/UTTabs/components/TooltipTab/index.js +19 -28
- package/dist/components/UTTabs/constants.js +4 -4
- package/dist/components/UTTabs/index.js +56 -84
- package/dist/components/UTTabs/theme.js +6 -3
- package/dist/components/UTTabs/utils.js +3 -2
- package/dist/components/UTTextArea/constants.js +2 -4
- package/dist/components/UTTextArea/index.js +22 -21
- package/dist/components/UTTextArea/theme.js +6 -3
- package/dist/components/UTTextInput/constants.js +1 -1
- package/dist/components/UTTextInput/index.js +136 -163
- package/dist/components/UTTextInput/theme.js +9 -5
- package/dist/components/UTThirdPartyCookieChecker/index.js +16 -19
- package/dist/components/UTToggle/components/ToggleOption/index.js +15 -15
- package/dist/components/UTToggle/index.js +24 -24
- package/dist/components/UTToggle/theme.js +6 -3
- package/dist/components/UTTooltip/index.js +22 -28
- package/dist/components/UTTooltip/theme.js +6 -3
- package/dist/components/UTTopbar/components/Notifications/index.js +10 -12
- package/dist/components/UTTopbar/components/UserMenu/index.js +14 -13
- package/dist/components/UTTopbar/index.js +27 -29
- package/dist/components/UTTopbar/theme.js +6 -3
- package/dist/components/UTTopbar/types.js +4 -4
- package/dist/components/UTTouchableWithoutFeedback/index.js +13 -25
- package/dist/components/UTVirtualizedList/components/VirtualizedData/components/ListRow/constants.js +2 -2
- package/dist/components/UTVirtualizedList/components/VirtualizedData/components/ListRow/index.js +33 -29
- package/dist/components/UTVirtualizedList/components/VirtualizedData/components/ListRow/utils.js +6 -5
- package/dist/components/UTVirtualizedList/components/VirtualizedData/constants.js +6 -6
- package/dist/components/UTVirtualizedList/components/VirtualizedData/hooks/use-ledger.js +7 -16
- package/dist/components/UTVirtualizedList/components/VirtualizedData/hooks/use-virtualized-data.js +22 -45
- package/dist/components/UTVirtualizedList/components/VirtualizedData/index.js +30 -32
- package/dist/components/UTVirtualizedList/components/VirtualizedData/utils.js +89 -94
- package/dist/components/UTVirtualizedList/constants.js +4 -4
- package/dist/components/UTVirtualizedList/index.js +25 -36
- package/dist/components/UTWorkflowContainer/components/ActionButton/index.js +14 -17
- package/dist/components/UTWorkflowContainer/constants.js +3 -3
- package/dist/components/UTWorkflowContainer/hooks/use-previous.js +5 -4
- package/dist/components/UTWorkflowContainer/index.js +31 -49
- package/dist/components/UTWorkflowContainer/theme.js +62 -54
- package/dist/components/UTWorkflowContainer/types.js +1 -1
- package/dist/components/WithLoading/index.js +9 -13
- package/dist/components/WithTheme/index.js +9 -15
- package/dist/components/WithTheme/layout.js +21 -26
- package/dist/components/WithTouch/index.js +11 -17
- package/dist/constants/UTTable.js +1 -1
- package/dist/index.js +58 -58
- package/dist/theme.js +8 -4
- package/dist/types/commonTypes.js +2 -2
- package/dist/types/consumptionTypes.js +2 -2
- package/dist/types/formTypes.js +3 -3
- package/dist/types/tableTypes.js +1 -1
- package/dist/utils/classesUtils.js +7 -13
- package/dist/utils/componentUtils.js +8 -10
- package/dist/utils/helperFunctions.js +6 -5
- package/dist/utils/shadowUtils.js +15 -12
- package/dist/utils/useScreenSize.js +1 -1
- package/package.json +2 -2
- package/CHANGELOG.md +0 -2234
|
@@ -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
|
});
|
|
@@ -10,22 +9,23 @@ var _propTypes = require("prop-types");
|
|
|
10
9
|
var _string = require("@widergy/web-utils/lib/string");
|
|
11
10
|
var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
|
|
12
11
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
|
-
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function
|
|
14
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" !=
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
className
|
|
25
|
-
definitionLabel
|
|
26
|
-
Icon
|
|
27
|
-
iconClassName
|
|
28
|
-
labelClassName
|
|
12
|
+
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); }
|
|
13
|
+
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; }
|
|
14
|
+
const Status = _ref => {
|
|
15
|
+
let {
|
|
16
|
+
definition,
|
|
17
|
+
label,
|
|
18
|
+
value
|
|
19
|
+
} = _ref;
|
|
20
|
+
const isBool = typeof value === 'boolean';
|
|
21
|
+
const currentDefinition = (isBool || value) && definition.find(el => isBool ? el.value === value : el.value && (0, _string.stringCompare)(el.value, value));
|
|
22
|
+
const {
|
|
23
|
+
className,
|
|
24
|
+
label: definitionLabel,
|
|
25
|
+
Icon,
|
|
26
|
+
iconClassName,
|
|
27
|
+
labelClassName
|
|
28
|
+
} = currentDefinition || {};
|
|
29
29
|
return currentDefinition && /*#__PURE__*/_react.default.createElement("div", {
|
|
30
30
|
className: "".concat(_stylesModule.default.statusContainer, " ").concat(className)
|
|
31
31
|
}, Icon && /*#__PURE__*/_react.default.createElement(Icon, {
|
|
@@ -12,13 +12,15 @@ var _types = require("../../../../types");
|
|
|
12
12
|
var _utils = require("./utils");
|
|
13
13
|
var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
|
|
14
14
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
15
|
+
const PageSizeSelector = _ref => {
|
|
16
|
+
let {
|
|
17
|
+
classes,
|
|
18
|
+
options,
|
|
19
|
+
rowsPerPage,
|
|
20
|
+
onChangeRowPerPage,
|
|
21
|
+
label,
|
|
22
|
+
totalRows
|
|
23
|
+
} = _ref;
|
|
22
24
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
23
25
|
className: _stylesModule.default.pageSizeSelector
|
|
24
26
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
@@ -5,21 +5,16 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.getPageSizeOptions = void 0;
|
|
7
7
|
var _array = require("@widergy/web-utils/lib/array");
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
var getPageSizeOptions = exports.getPageSizeOptions = function getPageSizeOptions(originalOptions, totalRows) {
|
|
12
|
-
var filteredOptions = originalOptions.filter(function (_, index) {
|
|
13
|
-
return getPrevOption(originalOptions, index) < totalRows;
|
|
14
|
-
});
|
|
8
|
+
const getPrevOption = (options, index) => index === 0 ? 0 : options[index - 1];
|
|
9
|
+
const getPageSizeOptions = (originalOptions, totalRows) => {
|
|
10
|
+
const filteredOptions = originalOptions.filter((_, index) => getPrevOption(originalOptions, index) < totalRows);
|
|
15
11
|
if ((0, _array.isEmpty)(filteredOptions)) return [{
|
|
16
12
|
value: originalOptions[0],
|
|
17
13
|
label: totalRows
|
|
18
14
|
}];
|
|
19
|
-
return filteredOptions.map(
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
};
|
|
15
|
+
return filteredOptions.map(value => ({
|
|
16
|
+
value,
|
|
17
|
+
label: Math.min(value, totalRows)
|
|
18
|
+
}));
|
|
19
|
+
};
|
|
20
|
+
exports.getPageSizeOptions = getPageSizeOptions;
|
|
@@ -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,15 +10,17 @@ var _UTTouchableWithoutFeedback = _interopRequireDefault(require("../../../../..
|
|
|
11
10
|
var _types = require("../../../../../../types");
|
|
12
11
|
var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
|
|
13
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
14
|
-
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function
|
|
15
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" !=
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
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 NavigationButton = _ref => {
|
|
16
|
+
let {
|
|
17
|
+
classes,
|
|
18
|
+
Icon,
|
|
19
|
+
label,
|
|
20
|
+
onClick,
|
|
21
|
+
className,
|
|
22
|
+
disabled
|
|
23
|
+
} = _ref;
|
|
23
24
|
return /*#__PURE__*/_react.default.createElement(_UTTouchableWithoutFeedback.default, {
|
|
24
25
|
className: "\n ".concat(className, "\n ").concat(_stylesModule.default.navigationButton, "\n ").concat(classes.navigationButton, "\n ").concat(disabled && "".concat(_stylesModule.default.buttonDisabled, " ").concat(classes.navigationButtonDisabled), "\n "),
|
|
25
26
|
onClick: onClick
|
|
@@ -65,15 +65,17 @@ NavigateHeaderNextIcon.defaultProps = {
|
|
|
65
65
|
viewBox: "0 0 14 14",
|
|
66
66
|
xmlns: "http://www.w3.org/2000/svg"
|
|
67
67
|
};
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
68
|
+
const Pagination = _ref => {
|
|
69
|
+
let {
|
|
70
|
+
classes,
|
|
71
|
+
currentPage,
|
|
72
|
+
handlePageChange,
|
|
73
|
+
rowsPerPage,
|
|
74
|
+
totalRows,
|
|
75
|
+
isResponsive
|
|
76
|
+
} = _ref;
|
|
77
|
+
const totalPages = rowsPerPage >= totalRows ? 1 : Math.ceil(totalRows / rowsPerPage);
|
|
78
|
+
const pageList = (0, _utils.getPageNumbers)(totalPages, currentPage, isResponsive);
|
|
77
79
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
78
80
|
className: _stylesModule.default.pagination
|
|
79
81
|
}, totalPages > _constants.PAGINATION_LIMIT_DOUBLE_ARROWS && !isResponsive && /*#__PURE__*/_react.default.createElement(_NavigationButton.default, {
|
|
@@ -82,42 +84,30 @@ var Pagination = function Pagination(_ref) {
|
|
|
82
84
|
Icon: NavigateHeaderBeforeIcon,
|
|
83
85
|
label: "1",
|
|
84
86
|
disabled: currentPage === 0,
|
|
85
|
-
onClick:
|
|
86
|
-
return handlePageChange(0);
|
|
87
|
-
}
|
|
87
|
+
onClick: () => handlePageChange(0)
|
|
88
88
|
}), /*#__PURE__*/_react.default.createElement(_NavigationButton.default, {
|
|
89
89
|
classes: classes,
|
|
90
90
|
className: _stylesModule.default.firstArrow,
|
|
91
91
|
Icon: NavigateBeforeIcon,
|
|
92
92
|
disabled: currentPage === 0,
|
|
93
|
-
onClick:
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
className: "\n ".concat(_stylesModule.default.pageButton, "\n ").concat(classes.pageButton, "\n ").concat(currentPage === page && "".concat(_stylesModule.default.buttonDisabled, " ").concat(classes.pageButtonSelected), "\n "),
|
|
100
|
-
onClick: function onClick() {
|
|
101
|
-
return handlePageChange(page);
|
|
102
|
-
}
|
|
103
|
-
}, page + 1);
|
|
104
|
-
}), /*#__PURE__*/_react.default.createElement(_NavigationButton.default, {
|
|
93
|
+
onClick: () => handlePageChange(currentPage - 1)
|
|
94
|
+
}), pageList.map(page => /*#__PURE__*/_react.default.createElement(_UTTouchableWithoutFeedback.default, {
|
|
95
|
+
key: "page_".concat(page),
|
|
96
|
+
className: "\n ".concat(_stylesModule.default.pageButton, "\n ").concat(classes.pageButton, "\n ").concat(currentPage === page && "".concat(_stylesModule.default.buttonDisabled, " ").concat(classes.pageButtonSelected), "\n "),
|
|
97
|
+
onClick: () => handlePageChange(page)
|
|
98
|
+
}, page + 1)), /*#__PURE__*/_react.default.createElement(_NavigationButton.default, {
|
|
105
99
|
classes: classes,
|
|
106
100
|
className: _stylesModule.default.lastArrow,
|
|
107
101
|
Icon: NavigateNextIcon,
|
|
108
102
|
disabled: currentPage === totalPages - 1,
|
|
109
|
-
onClick:
|
|
110
|
-
return handlePageChange(currentPage + 1);
|
|
111
|
-
}
|
|
103
|
+
onClick: () => handlePageChange(currentPage + 1)
|
|
112
104
|
}), totalPages > _constants.PAGINATION_LIMIT_DOUBLE_ARROWS && !isResponsive && /*#__PURE__*/_react.default.createElement(_NavigationButton.default, {
|
|
113
105
|
classes: classes,
|
|
114
106
|
className: _stylesModule.default.navigationLabel,
|
|
115
107
|
Icon: NavigateHeaderNextIcon,
|
|
116
108
|
label: totalPages,
|
|
117
109
|
disabled: currentPage === totalPages - 1,
|
|
118
|
-
onClick:
|
|
119
|
-
return handlePageChange(totalPages - 1);
|
|
120
|
-
}
|
|
110
|
+
onClick: () => handlePageChange(totalPages - 1)
|
|
121
111
|
}));
|
|
122
112
|
};
|
|
123
113
|
Pagination.propTypes = {
|
|
@@ -5,19 +5,14 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.getPageNumbers = void 0;
|
|
7
7
|
var _constants = require("../../../../constants");
|
|
8
|
-
|
|
9
|
-
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."); }
|
|
10
|
-
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); }
|
|
11
|
-
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
12
|
-
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
13
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
14
|
-
var getPageNumbers = exports.getPageNumbers = function getPageNumbers(totalPages, currentPage, isResponsive) {
|
|
8
|
+
const getPageNumbers = (totalPages, currentPage, isResponsive) => {
|
|
15
9
|
if (isResponsive) return [currentPage];
|
|
16
|
-
if (totalPages <= _constants.MAX_PAGINATION_ITEMS) return
|
|
17
|
-
|
|
18
|
-
if (currentPage < Math.ceil(paginationFactor)) return
|
|
19
|
-
if (totalPages - currentPage < paginationFactor) return
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
return
|
|
23
|
-
};
|
|
10
|
+
if (totalPages <= _constants.MAX_PAGINATION_ITEMS) return [...Array(totalPages).keys()];
|
|
11
|
+
const paginationFactor = _constants.MAX_PAGINATION_ITEMS / 2;
|
|
12
|
+
if (currentPage < Math.ceil(paginationFactor)) return [...Array(_constants.MAX_PAGINATION_ITEMS).keys()];
|
|
13
|
+
if (totalPages - currentPage < paginationFactor) return [...Array(totalPages).keys()].slice(totalPages - _constants.MAX_PAGINATION_ITEMS, totalPages);
|
|
14
|
+
const floorFactor = Math.floor(paginationFactor);
|
|
15
|
+
const ceilFactor = Math.ceil(paginationFactor);
|
|
16
|
+
return [...Array(currentPage + ceilFactor).keys()].slice(currentPage - floorFactor);
|
|
17
|
+
};
|
|
18
|
+
exports.getPageNumbers = getPageNumbers;
|
|
@@ -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
|
});
|
|
@@ -13,18 +12,20 @@ var _Pagination = _interopRequireDefault(require("./components/Pagination"));
|
|
|
13
12
|
var _constants = require("./constants");
|
|
14
13
|
var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
|
|
15
14
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
16
|
-
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function
|
|
17
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" !=
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
15
|
+
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); }
|
|
16
|
+
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; }
|
|
17
|
+
const TableFooter = _ref => {
|
|
18
|
+
let {
|
|
19
|
+
classes,
|
|
20
|
+
page,
|
|
21
|
+
handlePageChange,
|
|
22
|
+
onChangeRowPerPage,
|
|
23
|
+
rowsPerPage,
|
|
24
|
+
rowsPerPageOptions,
|
|
25
|
+
totalRows,
|
|
26
|
+
totalRowsLabel,
|
|
27
|
+
isResponsive
|
|
28
|
+
} = _ref;
|
|
28
29
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
29
30
|
className: _stylesModule.default.tableFooter
|
|
30
31
|
}, /*#__PURE__*/_react.default.createElement(_PageSizeSelector.default, {
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
@@ -12,8 +11,8 @@ var _UTLabel = _interopRequireDefault(require("../../../UTLabel"));
|
|
|
12
11
|
var _types = require("../../types");
|
|
13
12
|
var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
|
|
14
13
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
|
-
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function
|
|
16
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" !=
|
|
14
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
15
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
17
16
|
var RefreshIcon = function RefreshIcon(props) {
|
|
18
17
|
return /*#__PURE__*/_react.default.createElement("svg", props, /*#__PURE__*/_react.default.createElement("path", {
|
|
19
18
|
fill: "#FF6026",
|
|
@@ -27,12 +26,14 @@ RefreshIcon.defaultProps = {
|
|
|
27
26
|
viewBox: "0 0 18 18",
|
|
28
27
|
xmlns: "http://www.w3.org/2000/svg"
|
|
29
28
|
};
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
29
|
+
const TableHeader = _ref => {
|
|
30
|
+
let {
|
|
31
|
+
classes,
|
|
32
|
+
onReload,
|
|
33
|
+
title,
|
|
34
|
+
GeneralActions,
|
|
35
|
+
disabled
|
|
36
|
+
} = _ref;
|
|
36
37
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
37
38
|
className: "".concat(_stylesModule.default.header, " ").concat(classes.headerContainer)
|
|
38
39
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
@@ -4,10 +4,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.tippyProps = void 0;
|
|
7
|
-
|
|
8
|
-
appendTo:
|
|
9
|
-
return document.body;
|
|
10
|
-
},
|
|
7
|
+
const tippyProps = exports.tippyProps = {
|
|
8
|
+
appendTo: () => document.body,
|
|
11
9
|
interactive: false,
|
|
12
10
|
maxWidth: 'none'
|
|
13
11
|
};
|
|
@@ -18,50 +18,43 @@ var _types = require("../../types");
|
|
|
18
18
|
var _constants2 = require("./constants");
|
|
19
19
|
var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
|
|
20
20
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
21
|
-
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function
|
|
22
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" !=
|
|
23
|
-
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); }
|
|
21
|
+
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); }
|
|
22
|
+
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; }
|
|
24
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); }
|
|
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
|
-
|
|
59
|
-
_columnsDefinition$pr = columnsDefinition.primaryActions,
|
|
60
|
-
primaryActions = _columnsDefinition$pr === void 0 ? [] : _columnsDefinition$pr,
|
|
61
|
-
_columnsDefinition$se2 = columnsDefinition.secondaryActions,
|
|
62
|
-
secondaryActions = _columnsDefinition$se2 === void 0 ? [] : _columnsDefinition$se2;
|
|
63
|
-
var SelectionComponent = exclusiveSelection ? _Radio.default : _Checkbox.default;
|
|
64
|
-
var selectableCellStyles = isResponsive ? "".concat(_stylesModule.default.secondaryActionsContainer, "\n ").concat(cellProps.classes.responsiveCell, "\n ").concat(selectable || !(0, _array.isEmpty)(secondaryActions) ? cellProps.classes.responsiveRowTopBorder : _stylesModule.default.hidden) : "\n\t".concat(_stylesModule.default.fixedRowLeft, "\n\t").concat(fixedRowsLeftClassName, "\n\t").concat((removeFixedRowsDivisors || (0, _array.isEmpty)(fixedLeftColumns)) && _stylesModule.default.disableBorderRight, "\n\t").concat(!selectable && (0, _array.isEmpty)(fixedLeftColumns) && _stylesModule.default.cleanFixedColumns, "\n");
|
|
24
|
+
const TableRow = _ref => {
|
|
25
|
+
let {
|
|
26
|
+
CellComponent,
|
|
27
|
+
cellProps,
|
|
28
|
+
checkBoxOnChange,
|
|
29
|
+
checkBoxSelected,
|
|
30
|
+
checkBoxClassName,
|
|
31
|
+
className,
|
|
32
|
+
columnsDefinition,
|
|
33
|
+
columnSizes,
|
|
34
|
+
containerStyle,
|
|
35
|
+
exclusiveSelection,
|
|
36
|
+
selectable,
|
|
37
|
+
disableRowSelection,
|
|
38
|
+
disabledRowSelectionTooltip,
|
|
39
|
+
fixedRowsLeftClassName,
|
|
40
|
+
fixedRowsRightClassName,
|
|
41
|
+
handleRowClick,
|
|
42
|
+
removeFixedRowsDivisors,
|
|
43
|
+
rowClassName,
|
|
44
|
+
rowStyles,
|
|
45
|
+
tableSize,
|
|
46
|
+
isResponsive,
|
|
47
|
+
pageRows
|
|
48
|
+
} = _ref;
|
|
49
|
+
const {
|
|
50
|
+
fixedLeftColumns = [],
|
|
51
|
+
fixedRightColumns = [],
|
|
52
|
+
secondaryColumns = [],
|
|
53
|
+
primaryActions = [],
|
|
54
|
+
secondaryActions = []
|
|
55
|
+
} = columnsDefinition;
|
|
56
|
+
const SelectionComponent = exclusiveSelection ? _Radio.default : _Checkbox.default;
|
|
57
|
+
const selectableCellStyles = isResponsive ? "".concat(_stylesModule.default.secondaryActionsContainer, "\n ").concat(cellProps.classes.responsiveCell, "\n ").concat(selectable || !(0, _array.isEmpty)(secondaryActions) ? cellProps.classes.responsiveRowTopBorder : _stylesModule.default.hidden) : "\n\t".concat(_stylesModule.default.fixedRowLeft, "\n\t").concat(fixedRowsLeftClassName, "\n\t").concat((removeFixedRowsDivisors || (0, _array.isEmpty)(fixedLeftColumns)) && _stylesModule.default.disableBorderRight, "\n\t").concat(!selectable && (0, _array.isEmpty)(fixedLeftColumns) && _stylesModule.default.cleanFixedColumns, "\n");
|
|
65
58
|
return /*#__PURE__*/_react.default.createElement(_react.Fragment, null, /*#__PURE__*/_react.default.createElement(_UTTouchableWithoutFeedback.default, {
|
|
66
59
|
onClick: handleRowClick,
|
|
67
60
|
className: "\n ".concat(_stylesModule.default.row, "\n ").concat((!handleRowClick || isResponsive) && _stylesModule.default.noClick, "\n ").concat(isResponsive && cellProps.classes.responsiveRow, "\n ").concat(className, "\n "),
|
|
@@ -70,14 +63,16 @@ var TableRow = function TableRow(_ref) {
|
|
|
70
63
|
className: _stylesModule.default.stickyRowBackground
|
|
71
64
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
72
65
|
className: "".concat(_stylesModule.default.rowBackground, " ").concat(rowClassName),
|
|
73
|
-
style:
|
|
74
|
-
width: tableSize
|
|
75
|
-
|
|
66
|
+
style: {
|
|
67
|
+
width: tableSize,
|
|
68
|
+
...rowStyles.rowBackground
|
|
69
|
+
}
|
|
76
70
|
})), /*#__PURE__*/_react.default.createElement("div", {
|
|
77
71
|
className: selectableCellStyles,
|
|
78
|
-
style:
|
|
72
|
+
style: {
|
|
73
|
+
...rowStyles.fixedRowsLeft,
|
|
79
74
|
width: isResponsive ? 'auto' : columnSizes.leftColumnsSize
|
|
80
|
-
}
|
|
75
|
+
}
|
|
81
76
|
}, selectable && /*#__PURE__*/_react.default.createElement("div", {
|
|
82
77
|
className: "\n ".concat(_stylesModule.default.checkBoxCell, "\n ").concat(checkBoxSelected ? cellProps.classes.headerDecoratorSelected : cellProps.classes.headerDecoratorUnselected, "\n ").concat(checkBoxClassName, "\n ").concat(isResponsive && checkBoxSelected && cellProps.classes.selectedResponsiveCell, "\n "),
|
|
83
78
|
style: rowStyles.selectCell
|
|
@@ -95,57 +90,48 @@ var TableRow = function TableRow(_ref) {
|
|
|
95
90
|
checked: checkBoxSelected,
|
|
96
91
|
onChange: checkBoxOnChange,
|
|
97
92
|
disabled: disableRowSelection && disableRowSelection(cellProps.rowData, pageRows)
|
|
98
|
-
})))), fixedLeftColumns.map(
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
}, cellProps));
|
|
104
|
-
}), !(0, _array.isEmpty)(secondaryActions) && /*#__PURE__*/_react.default.createElement("div", {
|
|
93
|
+
})))), fixedLeftColumns.map(column => /*#__PURE__*/_react.default.createElement(CellComponent, _extends({
|
|
94
|
+
key: "cell_".concat(column.key),
|
|
95
|
+
column: column,
|
|
96
|
+
columnSizes: columnSizes
|
|
97
|
+
}, cellProps))), !(0, _array.isEmpty)(secondaryActions) && /*#__PURE__*/_react.default.createElement("div", {
|
|
105
98
|
className: _stylesModule.default.secondaryActions
|
|
106
|
-
}, secondaryActions.map(
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
});
|
|
113
|
-
}))), !(0, _array.isEmpty)(secondaryColumns) && /*#__PURE__*/_react.default.createElement("div", {
|
|
99
|
+
}, secondaryActions.map(action => /*#__PURE__*/_react.default.createElement(_ActionIcons.default, {
|
|
100
|
+
column: action,
|
|
101
|
+
key: "action_".concat(action.key),
|
|
102
|
+
rowData: cellProps.rowData,
|
|
103
|
+
classes: cellProps.classes
|
|
104
|
+
})))), !(0, _array.isEmpty)(secondaryColumns) && /*#__PURE__*/_react.default.createElement("div", {
|
|
114
105
|
className: "\n ".concat(_stylesModule.default.secondaryColumns, " \n ").concat(isResponsive && checkBoxSelected && cellProps.classes.selectedResponsiveCell, "\n ").concat(isResponsive && selectable && _stylesModule.default.hideTopBorder, "\n "),
|
|
115
106
|
style: {
|
|
116
107
|
width: isResponsive ? 'auto' : columnSizes.secondaryColumnsSize
|
|
117
108
|
}
|
|
118
|
-
}, secondaryColumns.map(
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
showBottomRadius: index === primaryActions.length - 1,
|
|
134
|
-
showBottomBorder: index === primaryActions.length - 1
|
|
135
|
-
}));
|
|
136
|
-
})), !isResponsive && /*#__PURE__*/_react.default.createElement("div", {
|
|
109
|
+
}, secondaryColumns.map((column, index) => /*#__PURE__*/_react.default.createElement(CellComponent, _extends({
|
|
110
|
+
key: "cell_".concat(column.key),
|
|
111
|
+
column: column,
|
|
112
|
+
columnSizes: columnSizes
|
|
113
|
+
}, cellProps, {
|
|
114
|
+
rowStyles: rowStyles,
|
|
115
|
+
showBottomBorder: index === secondaryColumns.length - 1 && (0, _array.isEmpty)(primaryActions)
|
|
116
|
+
}))), primaryActions.map((column, index) => /*#__PURE__*/_react.default.createElement(_PrimaryAction.default, _extends({
|
|
117
|
+
key: "cell_".concat(column.key),
|
|
118
|
+
column: column
|
|
119
|
+
}, cellProps, {
|
|
120
|
+
rowStyles: rowStyles,
|
|
121
|
+
showBottomRadius: index === primaryActions.length - 1,
|
|
122
|
+
showBottomBorder: index === primaryActions.length - 1
|
|
123
|
+
})))), !isResponsive && /*#__PURE__*/_react.default.createElement("div", {
|
|
137
124
|
className: "\n ".concat(_stylesModule.default.fixedRowRight, "\n ").concat(fixedRowsRightClassName, "\n ").concat((removeFixedRowsDivisors || (0, _array.isEmpty)(fixedRightColumns)) && _stylesModule.default.disableBorderLeft, "\n ").concat((0, _array.isEmpty)(fixedRightColumns) && _stylesModule.default.cleanFixedColumns, "\n "),
|
|
138
|
-
style:
|
|
125
|
+
style: {
|
|
126
|
+
...rowStyles.fixedRowsRight,
|
|
139
127
|
width: columnSizes.rightColumnsSize
|
|
140
|
-
}
|
|
141
|
-
}, fixedRightColumns.map(
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
}, cellProps));
|
|
148
|
-
}))));
|
|
128
|
+
}
|
|
129
|
+
}, fixedRightColumns.map(column => /*#__PURE__*/_react.default.createElement(CellComponent, _extends({
|
|
130
|
+
key: "cell_".concat(column.key),
|
|
131
|
+
column: column,
|
|
132
|
+
columnSizes: columnSizes,
|
|
133
|
+
align: _constants.COLUMN_POSITION.RIGHT
|
|
134
|
+
}, cellProps))))));
|
|
149
135
|
};
|
|
150
136
|
TableRow.propTypes = {
|
|
151
137
|
CellComponent: _propTypes.elementType,
|