@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
|
@@ -16,52 +16,47 @@ var _ActionIcons = _interopRequireDefault(require("../ActionIcons"));
|
|
|
16
16
|
var _PrimaryAction = _interopRequireDefault(require("../PrimaryAction"));
|
|
17
17
|
var _types = require("../../types");
|
|
18
18
|
var _constants2 = require("./constants");
|
|
19
|
+
var _utils = require("./utils");
|
|
19
20
|
var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
|
|
20
21
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
21
|
-
function _getRequireWildcardCache(
|
|
22
|
-
function _interopRequireWildcard(
|
|
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); }
|
|
22
|
+
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); }
|
|
23
|
+
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
24
|
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
|
-
|
|
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");
|
|
25
|
+
const TableRow = _ref => {
|
|
26
|
+
let {
|
|
27
|
+
CellComponent,
|
|
28
|
+
cellProps,
|
|
29
|
+
checkBoxOnChange,
|
|
30
|
+
checkBoxSelected,
|
|
31
|
+
checkBoxClassName,
|
|
32
|
+
className,
|
|
33
|
+
columnsDefinition,
|
|
34
|
+
columnSizes,
|
|
35
|
+
containerStyle,
|
|
36
|
+
exclusiveSelection,
|
|
37
|
+
selectable,
|
|
38
|
+
disableRowSelection,
|
|
39
|
+
disabledRowSelectionTooltip,
|
|
40
|
+
fixedRowsLeftClassName,
|
|
41
|
+
fixedRowsRightClassName,
|
|
42
|
+
handleRowClick,
|
|
43
|
+
removeFixedRowsDivisors,
|
|
44
|
+
rowClassName,
|
|
45
|
+
rowStyles,
|
|
46
|
+
tableSize,
|
|
47
|
+
isResponsive,
|
|
48
|
+
pageRows
|
|
49
|
+
} = _ref;
|
|
50
|
+
const {
|
|
51
|
+
fixedLeftColumns = [],
|
|
52
|
+
fixedRightColumns = [],
|
|
53
|
+
secondaryColumns = [],
|
|
54
|
+
primaryActions = [],
|
|
55
|
+
secondaryActions = []
|
|
56
|
+
} = columnsDefinition;
|
|
57
|
+
const SelectionComponent = exclusiveSelection ? _Radio.default : _Checkbox.default;
|
|
58
|
+
const hasActionsRow = selectable || (0, _utils.hasVisibleActions)(secondaryActions, cellProps.rowData);
|
|
59
|
+
const selectableCellStyles = isResponsive ? "".concat(_stylesModule.default.secondaryActionsContainer, "\n ").concat(cellProps.classes.responsiveCell, "\n ").concat(hasActionsRow ? cellProps.classes.responsiveRowTopBorder : _stylesModule.default.hidden, "\n ") : "\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
60
|
return /*#__PURE__*/_react.default.createElement(_react.Fragment, null, /*#__PURE__*/_react.default.createElement(_UTTouchableWithoutFeedback.default, {
|
|
66
61
|
onClick: handleRowClick,
|
|
67
62
|
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 +65,16 @@ var TableRow = function TableRow(_ref) {
|
|
|
70
65
|
className: _stylesModule.default.stickyRowBackground
|
|
71
66
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
72
67
|
className: "".concat(_stylesModule.default.rowBackground, " ").concat(rowClassName),
|
|
73
|
-
style:
|
|
74
|
-
width: tableSize
|
|
75
|
-
|
|
68
|
+
style: {
|
|
69
|
+
width: tableSize,
|
|
70
|
+
...rowStyles.rowBackground
|
|
71
|
+
}
|
|
76
72
|
})), /*#__PURE__*/_react.default.createElement("div", {
|
|
77
73
|
className: selectableCellStyles,
|
|
78
|
-
style:
|
|
74
|
+
style: {
|
|
75
|
+
...rowStyles.fixedRowsLeft,
|
|
79
76
|
width: isResponsive ? 'auto' : columnSizes.leftColumnsSize
|
|
80
|
-
}
|
|
77
|
+
}
|
|
81
78
|
}, selectable && /*#__PURE__*/_react.default.createElement("div", {
|
|
82
79
|
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
80
|
style: rowStyles.selectCell
|
|
@@ -95,57 +92,48 @@ var TableRow = function TableRow(_ref) {
|
|
|
95
92
|
checked: checkBoxSelected,
|
|
96
93
|
onChange: checkBoxOnChange,
|
|
97
94
|
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", {
|
|
95
|
+
})))), fixedLeftColumns.map(column => /*#__PURE__*/_react.default.createElement(CellComponent, _extends({
|
|
96
|
+
key: "cell_".concat(column.key),
|
|
97
|
+
column: column,
|
|
98
|
+
columnSizes: columnSizes
|
|
99
|
+
}, cellProps))), !(0, _array.isEmpty)(secondaryActions) && /*#__PURE__*/_react.default.createElement("div", {
|
|
105
100
|
className: _stylesModule.default.secondaryActions
|
|
106
|
-
}, secondaryActions.map(
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
}))), !(0, _array.isEmpty)(secondaryColumns) && /*#__PURE__*/_react.default.createElement("div", {
|
|
114
|
-
className: "\n ".concat(_stylesModule.default.secondaryColumns, " \n ").concat(isResponsive && checkBoxSelected && cellProps.classes.selectedResponsiveCell, "\n ").concat(isResponsive && selectable && _stylesModule.default.hideTopBorder, "\n "),
|
|
101
|
+
}, secondaryActions.map(action => /*#__PURE__*/_react.default.createElement(_ActionIcons.default, {
|
|
102
|
+
column: action,
|
|
103
|
+
key: "action_".concat(action.key),
|
|
104
|
+
rowData: cellProps.rowData,
|
|
105
|
+
classes: cellProps.classes
|
|
106
|
+
})))), !(0, _array.isEmpty)(secondaryColumns) && /*#__PURE__*/_react.default.createElement("div", {
|
|
107
|
+
className: "\n ".concat(_stylesModule.default.secondaryColumns, " \n ").concat(isResponsive && checkBoxSelected && cellProps.classes.selectedResponsiveCell, "\n ").concat(isResponsive && selectable && _stylesModule.default.hideTopBorder, "\n ").concat(isResponsive && hasActionsRow && _stylesModule.default.fixBorderRadius, "\n "),
|
|
115
108
|
style: {
|
|
116
109
|
width: isResponsive ? 'auto' : columnSizes.secondaryColumnsSize
|
|
117
110
|
}
|
|
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", {
|
|
111
|
+
}, secondaryColumns.map((column, index) => /*#__PURE__*/_react.default.createElement(CellComponent, _extends({
|
|
112
|
+
key: "cell_".concat(column.key),
|
|
113
|
+
column: column,
|
|
114
|
+
columnSizes: columnSizes
|
|
115
|
+
}, cellProps, {
|
|
116
|
+
rowStyles: rowStyles,
|
|
117
|
+
showBottomBorder: index === secondaryColumns.length - 1 && (0, _array.isEmpty)(primaryActions)
|
|
118
|
+
}))), primaryActions.map((column, index) => /*#__PURE__*/_react.default.createElement(_PrimaryAction.default, _extends({
|
|
119
|
+
key: "cell_".concat(column.key),
|
|
120
|
+
column: column
|
|
121
|
+
}, cellProps, {
|
|
122
|
+
rowStyles: rowStyles,
|
|
123
|
+
showBottomRadius: index === primaryActions.length - 1,
|
|
124
|
+
showBottomBorder: index === primaryActions.length - 1
|
|
125
|
+
})))), !isResponsive && /*#__PURE__*/_react.default.createElement("div", {
|
|
137
126
|
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:
|
|
127
|
+
style: {
|
|
128
|
+
...rowStyles.fixedRowsRight,
|
|
139
129
|
width: columnSizes.rightColumnsSize
|
|
140
|
-
}
|
|
141
|
-
}, fixedRightColumns.map(
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
}, cellProps));
|
|
148
|
-
}))));
|
|
130
|
+
}
|
|
131
|
+
}, fixedRightColumns.map(column => /*#__PURE__*/_react.default.createElement(CellComponent, _extends({
|
|
132
|
+
key: "cell_".concat(column.key),
|
|
133
|
+
column: column,
|
|
134
|
+
columnSizes: columnSizes,
|
|
135
|
+
align: _constants.COLUMN_POSITION.RIGHT
|
|
136
|
+
}, cellProps))))));
|
|
149
137
|
};
|
|
150
138
|
TableRow.propTypes = {
|
|
151
139
|
CellComponent: _propTypes.elementType,
|
|
@@ -175,5 +163,4 @@ TableRow.propTypes = {
|
|
|
175
163
|
isResponsive: _propTypes.bool,
|
|
176
164
|
pageRows: (0, _propTypes.arrayOf)(_propTypes.object)
|
|
177
165
|
};
|
|
178
|
-
var _default = /*#__PURE__*/(0, _react.memo)(TableRow);
|
|
179
|
-
exports.default = _default;
|
|
166
|
+
var _default = exports.default = /*#__PURE__*/(0, _react.memo)(TableRow);
|
|
@@ -133,7 +133,7 @@ $selection-element-size: 42px;
|
|
|
133
133
|
}
|
|
134
134
|
|
|
135
135
|
.hidden {
|
|
136
|
-
display: none;
|
|
136
|
+
display: none !important;
|
|
137
137
|
}
|
|
138
138
|
|
|
139
139
|
.hideTopBorder {
|
|
@@ -146,3 +146,10 @@ $selection-element-size: 42px;
|
|
|
146
146
|
.disableSelectionTooltip {
|
|
147
147
|
text-align: center;
|
|
148
148
|
}
|
|
149
|
+
|
|
150
|
+
.fixBorderRadius {
|
|
151
|
+
& :first-child {
|
|
152
|
+
border-top-left-radius: 0 !important;
|
|
153
|
+
border-top-right-radius: 0 !important;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.hasVisibleActions = void 0;
|
|
7
|
+
var _array = require("@widergy/web-utils/lib/array");
|
|
8
|
+
const hasVisibleActions = (secondaryActions, rowData) => !(0, _array.isEmpty)(secondaryActions) && secondaryActions.some(secondaryAction => {
|
|
9
|
+
var _secondaryAction$acti;
|
|
10
|
+
return secondaryAction === null || secondaryAction === void 0 || (_secondaryAction$acti = secondaryAction.actions) === null || _secondaryAction$acti === void 0 ? void 0 : _secondaryAction$acti.some(action => {
|
|
11
|
+
var _action$isVisible;
|
|
12
|
+
return (_action$isVisible = action.isVisible) === null || _action$isVisible === void 0 ? void 0 : _action$isVisible.call(action, rowData);
|
|
13
|
+
});
|
|
14
|
+
});
|
|
15
|
+
exports.hasVisibleActions = hasVisibleActions;
|
|
@@ -4,12 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.TOTAL_ROW_LABEL = exports.TOTAL_ROWS_LABEL = exports.ROW_SPACING_NAMES = exports.ROW_SPACING = exports.ROW_SIDE_PADDING = exports.ROW_PADDING_NAMES = exports.ROW_PADDING = exports.ROW_KEY = exports.ROWS_PER_PAGE = exports.ROWS_BORDER_SIZE = exports.PAGINATION_LIMIT_DOUBLE_ARROWS = exports.NO_RESULTS_LABEL = exports.MAX_PAGINATION_ITEMS = exports.DEFAULT_TABLET_BREAKPOINT = exports.COLUMN_SIZES = exports.COLUMN_POSITION = exports.CELL_TYPES = exports.CELL_SIDE_PADDING = exports.CELL_ACTION_TYPES = void 0;
|
|
7
|
-
|
|
8
|
-
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); }
|
|
9
|
-
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; }
|
|
10
|
-
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
11
|
-
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); }
|
|
12
|
-
var COLUMN_SIZES = {
|
|
7
|
+
const COLUMN_SIZES = exports.COLUMN_SIZES = {
|
|
13
8
|
xsmall: 70,
|
|
14
9
|
small: 90,
|
|
15
10
|
medium: 120,
|
|
@@ -17,55 +12,43 @@ var COLUMN_SIZES = {
|
|
|
17
12
|
xlarge: 260,
|
|
18
13
|
xxlarge: 350
|
|
19
14
|
};
|
|
20
|
-
exports.
|
|
21
|
-
|
|
22
|
-
exports.
|
|
23
|
-
var CELL_SIDE_PADDING = 16;
|
|
24
|
-
exports.CELL_SIDE_PADDING = CELL_SIDE_PADDING;
|
|
25
|
-
var ROW_SPACING_NAMES = {
|
|
15
|
+
const ROW_SIDE_PADDING = exports.ROW_SIDE_PADDING = 16;
|
|
16
|
+
const CELL_SIDE_PADDING = exports.CELL_SIDE_PADDING = 16;
|
|
17
|
+
const ROW_SPACING_NAMES = exports.ROW_SPACING_NAMES = {
|
|
26
18
|
NONE: 'none',
|
|
27
19
|
SMALL: 'small',
|
|
28
20
|
MEDIUM: 'medium'
|
|
29
21
|
};
|
|
30
|
-
exports.
|
|
31
|
-
var ROW_PADDING_NAMES = {
|
|
22
|
+
const ROW_PADDING_NAMES = exports.ROW_PADDING_NAMES = {
|
|
32
23
|
SMALL: 'small',
|
|
33
24
|
MEDIUM: 'medium'
|
|
34
25
|
};
|
|
35
|
-
exports.
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
26
|
+
const ROW_SPACING = exports.ROW_SPACING = {
|
|
27
|
+
[ROW_SPACING_NAMES.NONE]: 0,
|
|
28
|
+
[ROW_SPACING_NAMES.SMALL]: 5,
|
|
29
|
+
[ROW_SPACING_NAMES.MEDIUM]: 10
|
|
30
|
+
};
|
|
31
|
+
const ROW_PADDING = exports.ROW_PADDING = {
|
|
32
|
+
[ROW_PADDING_NAMES.SMALL]: 16,
|
|
33
|
+
[ROW_PADDING_NAMES.MEDIUM]: 24
|
|
34
|
+
};
|
|
35
|
+
const COLUMN_POSITION = exports.COLUMN_POSITION = {
|
|
41
36
|
LEFT: 'left',
|
|
42
37
|
RIGHT: 'right'
|
|
43
38
|
};
|
|
44
|
-
exports.
|
|
45
|
-
|
|
46
|
-
exports.
|
|
47
|
-
|
|
48
|
-
exports.
|
|
49
|
-
|
|
50
|
-
exports.
|
|
51
|
-
|
|
52
|
-
exports.
|
|
53
|
-
var NO_RESULTS_LABEL = 'Aún no hay resultados';
|
|
54
|
-
exports.NO_RESULTS_LABEL = NO_RESULTS_LABEL;
|
|
55
|
-
var ROW_KEY = 'id';
|
|
56
|
-
exports.ROW_KEY = ROW_KEY;
|
|
57
|
-
var MAX_PAGINATION_ITEMS = 5;
|
|
58
|
-
exports.MAX_PAGINATION_ITEMS = MAX_PAGINATION_ITEMS;
|
|
59
|
-
var PAGINATION_LIMIT_DOUBLE_ARROWS = 10;
|
|
60
|
-
exports.PAGINATION_LIMIT_DOUBLE_ARROWS = PAGINATION_LIMIT_DOUBLE_ARROWS;
|
|
61
|
-
var CELL_TYPES = {
|
|
39
|
+
const ROWS_PER_PAGE = exports.ROWS_PER_PAGE = [10, 25, 50];
|
|
40
|
+
const ROWS_BORDER_SIZE = exports.ROWS_BORDER_SIZE = 1;
|
|
41
|
+
const TOTAL_ROWS_LABEL = exports.TOTAL_ROWS_LABEL = 'resultados';
|
|
42
|
+
const TOTAL_ROW_LABEL = exports.TOTAL_ROW_LABEL = 'resultado';
|
|
43
|
+
const NO_RESULTS_LABEL = exports.NO_RESULTS_LABEL = 'Aún no hay resultados';
|
|
44
|
+
const ROW_KEY = exports.ROW_KEY = 'id';
|
|
45
|
+
const MAX_PAGINATION_ITEMS = exports.MAX_PAGINATION_ITEMS = 5;
|
|
46
|
+
const PAGINATION_LIMIT_DOUBLE_ARROWS = exports.PAGINATION_LIMIT_DOUBLE_ARROWS = 10;
|
|
47
|
+
const CELL_TYPES = exports.CELL_TYPES = {
|
|
62
48
|
STATUS: 'status',
|
|
63
49
|
ACTION_ICONS: 'action-icons',
|
|
64
50
|
ACTION_BUTTON: 'action-button',
|
|
65
51
|
TEXT: 'text'
|
|
66
52
|
};
|
|
67
|
-
exports.
|
|
68
|
-
|
|
69
|
-
exports.CELL_ACTION_TYPES = CELL_ACTION_TYPES;
|
|
70
|
-
var DEFAULT_TABLET_BREAKPOINT = 1024;
|
|
71
|
-
exports.DEFAULT_TABLET_BREAKPOINT = DEFAULT_TABLET_BREAKPOINT;
|
|
53
|
+
const CELL_ACTION_TYPES = exports.CELL_ACTION_TYPES = [CELL_TYPES.ACTION_ICONS, CELL_TYPES.ACTION_BUTTON];
|
|
54
|
+
const DEFAULT_TABLET_BREAKPOINT = exports.DEFAULT_TABLET_BREAKPOINT = 1024;
|
|
@@ -5,42 +5,27 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.useResizeObserver = void 0;
|
|
7
7
|
var _react = require("react");
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
14
|
-
var useResizeObserver = function useResizeObserver() {
|
|
15
|
-
var _useState = (0, _react.useState)({}),
|
|
16
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
17
|
-
observerEntry = _useState2[0],
|
|
18
|
-
setObserverEntry = _useState2[1];
|
|
19
|
-
var _useState3 = (0, _react.useState)(null),
|
|
20
|
-
_useState4 = _slicedToArray(_useState3, 2),
|
|
21
|
-
node = _useState4[0],
|
|
22
|
-
setNode = _useState4[1];
|
|
23
|
-
var observer = (0, _react.useRef)(null);
|
|
24
|
-
var disconnect = (0, _react.useCallback)(function () {
|
|
8
|
+
const useResizeObserver = () => {
|
|
9
|
+
const [observerEntry, setObserverEntry] = (0, _react.useState)({});
|
|
10
|
+
const [node, setNode] = (0, _react.useState)(null);
|
|
11
|
+
const observer = (0, _react.useRef)(null);
|
|
12
|
+
const disconnect = (0, _react.useCallback)(() => {
|
|
25
13
|
var _observer$current;
|
|
26
14
|
return (_observer$current = observer.current) === null || _observer$current === void 0 ? void 0 : _observer$current.disconnect();
|
|
27
15
|
}, []);
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
window.requestAnimationFrame(function () {
|
|
16
|
+
const callback = _ref => {
|
|
17
|
+
let [entry] = _ref;
|
|
18
|
+
window.requestAnimationFrame(() => {
|
|
32
19
|
setObserverEntry(entry);
|
|
33
20
|
});
|
|
34
21
|
};
|
|
35
|
-
|
|
22
|
+
const observe = (0, _react.useCallback)(() => {
|
|
36
23
|
observer.current = new ResizeObserver(callback);
|
|
37
24
|
if (node) observer.current.observe(node);
|
|
38
25
|
}, [node]);
|
|
39
|
-
(0, _react.useLayoutEffect)(
|
|
26
|
+
(0, _react.useLayoutEffect)(() => {
|
|
40
27
|
observe();
|
|
41
|
-
return
|
|
42
|
-
return disconnect();
|
|
43
|
-
};
|
|
28
|
+
return () => disconnect();
|
|
44
29
|
}, [disconnect, observe]);
|
|
45
30
|
return [setNode, observerEntry];
|
|
46
31
|
};
|