@widergy/energy-ui 2.12.1 → 2.12.2
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 +36 -13
- package/dist/components/Loading/constants.js +2 -1
- package/dist/components/Loading/index.js +12 -13
- package/dist/components/Loading/theme.js +2 -4
- package/dist/components/UTAlert/AlertHandler.js +101 -75
- package/dist/components/UTAlert/index.js +87 -65
- package/dist/components/UTAlert/theme.js +32 -32
- package/dist/components/UTAttachment/components/Preview/index.js +9 -8
- package/dist/components/UTAttachment/constants.js +13 -7
- package/dist/components/UTAttachment/index.js +250 -159
- package/dist/components/UTAttachment/layout.js +27 -26
- package/dist/components/UTAttachment/theme.js +2 -4
- package/dist/components/UTAttachment/utils.js +117 -34
- package/dist/components/UTAutocomplete/components/ListBox/index.js +21 -13
- package/dist/components/UTAutocomplete/components/ListBox/utils.js +11 -9
- package/dist/components/UTAutocomplete/constants.js +23 -12
- package/dist/components/UTAutocomplete/index.js +94 -54
- package/dist/components/UTAutocomplete/theme.js +4 -6
- package/dist/components/UTAvatar/constants.js +3 -2
- package/dist/components/UTAvatar/index.js +17 -18
- 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 +22 -21
- package/dist/components/UTBarChart/components/Bars/constants.js +6 -3
- package/dist/components/UTBarChart/components/Bars/index.js +80 -70
- package/dist/components/UTBarChart/components/Legend/constants.js +18 -12
- package/dist/components/UTBarChart/components/Legend/index.js +93 -75
- package/dist/components/UTBarChart/components/Legend/utils.js +5 -1
- package/dist/components/UTBarChart/components/Levels/index.js +14 -16
- package/dist/components/UTBarChart/components/Levels/utils.js +27 -25
- package/dist/components/UTBarChart/components/LinearPlot/constants.js +5 -3
- package/dist/components/UTBarChart/components/LinearPlot/index.js +20 -25
- package/dist/components/UTBarChart/components/LinearPlot/utils.js +39 -37
- package/dist/components/UTBarChart/components/Pagination/constants.js +2 -1
- package/dist/components/UTBarChart/components/Pagination/index.js +24 -20
- package/dist/components/UTBarChart/components/XAxis/components/AxisElement/index.js +32 -21
- package/dist/components/UTBarChart/components/XAxis/components/Decoration/constants.js +4 -2
- package/dist/components/UTBarChart/components/XAxis/components/Decoration/index.js +19 -20
- package/dist/components/UTBarChart/components/XAxis/constants.js +2 -1
- package/dist/components/UTBarChart/components/XAxis/index.js +65 -54
- package/dist/components/UTBarChart/components/YAxis/AxisElement/index.js +11 -12
- package/dist/components/UTBarChart/components/YAxis/constants.js +2 -1
- package/dist/components/UTBarChart/components/YAxis/index.js +37 -30
- package/dist/components/UTBarChart/components/YAxis/utils.js +6 -4
- package/dist/components/UTBarChart/constants.js +8 -4
- package/dist/components/UTBarChart/hooks/use-dynamic-margins.js +40 -23
- package/dist/components/UTBarChart/index.js +166 -152
- package/dist/components/UTBarChart/theme.js +2 -4
- package/dist/components/UTBarChart/types.js +19 -10
- package/dist/components/UTBarChart/utils.js +111 -107
- package/dist/components/UTBreadcrumbs/constants.js +31 -23
- package/dist/components/UTBreadcrumbs/index.js +101 -76
- package/dist/components/UTBreadcrumbs/theme.js +2 -4
- package/dist/components/UTButton/constants.js +17 -11
- package/dist/components/UTButton/index.js +31 -28
- package/dist/components/UTButton/theme.js +23 -23
- package/dist/components/UTCBUInput/index.js +40 -36
- package/dist/components/UTCBUInput/theme.js +2 -4
- package/dist/components/UTCaptcha/index.js +45 -19
- package/dist/components/UTCard/components/UTCardFooter/index.js +16 -15
- package/dist/components/UTCard/index.js +120 -85
- package/dist/components/UTCard/theme.js +12 -11
- package/dist/components/UTCard/types.js +3 -2
- package/dist/components/UTCarousel/components/Button/index.js +13 -13
- package/dist/components/UTCarousel/components/Legend/index.js +15 -13
- package/dist/components/UTCarousel/components/Slider/component/Slide/index.js +16 -16
- package/dist/components/UTCarousel/components/Slider/constants.js +10 -5
- package/dist/components/UTCarousel/components/Slider/index.js +273 -204
- package/dist/components/UTCarousel/components/Slider/layout.js +94 -67
- package/dist/components/UTCarousel/index.js +15 -14
- package/dist/components/UTCarousel/theme.js +2 -4
- package/dist/components/UTCheckList/constants.js +2 -1
- package/dist/components/UTCheckList/index.js +93 -72
- package/dist/components/UTCheckList/theme.js +31 -31
- package/dist/components/UTCheckbox/constants.js +6 -3
- package/dist/components/UTCheckbox/index.js +44 -32
- package/dist/components/UTCheckbox/theme.js +35 -35
- package/dist/components/UTConsumptionBar/components/ConsumptionBarIndicator/index.js +9 -9
- package/dist/components/UTConsumptionBar/constants.js +6 -3
- package/dist/components/UTConsumptionBar/index.js +80 -53
- package/dist/components/UTCuit/index.js +133 -109
- package/dist/components/UTCuit/theme.js +53 -51
- package/dist/components/UTDatePicker/components/Day/constants.js +2 -1
- package/dist/components/UTDatePicker/components/Day/index.js +12 -12
- package/dist/components/UTDatePicker/constants.js +31 -20
- package/dist/components/UTDatePicker/index.js +102 -60
- package/dist/components/UTDatePicker/theme.js +3 -5
- package/dist/components/UTDatePicker/types.js +3 -2
- package/dist/components/UTDatePicker/utils.js +6 -2
- package/dist/components/UTDialog/constants.js +4 -2
- package/dist/components/UTDialog/index.js +37 -38
- package/dist/components/UTDialog/theme.js +2 -4
- package/dist/components/UTDialog/types.js +3 -2
- package/dist/components/UTDotMenu/index.js +61 -39
- package/dist/components/UTEmojiPicker/constants.js +11 -6
- package/dist/components/UTEmojiPicker/index.js +65 -45
- package/dist/components/UTEmojiPicker/theme.js +2 -4
- package/dist/components/UTEmojiPicker/utils.js +51 -21
- package/dist/components/UTExternalLink/constants.js +5 -3
- package/dist/components/UTExternalLink/index.js +15 -18
- package/dist/components/UTExternalLink/theme.js +6 -8
- package/dist/components/UTFileInput/constants.js +4 -2
- package/dist/components/UTFileInput/index.js +31 -7
- package/dist/components/UTFileInput/layout.js +97 -68
- package/dist/components/UTIconButton/index.js +72 -49
- package/dist/components/UTIconButton/theme.js +2 -4
- package/dist/components/UTImageRadio/components/ImageRadioCard/index.js +58 -53
- package/dist/components/UTImageRadio/constants.js +6 -3
- package/dist/components/UTImageRadio/index.js +47 -39
- package/dist/components/UTImageRadio/theme.js +12 -11
- package/dist/components/UTImageRadio/types.js +3 -2
- package/dist/components/UTImageRadio/utils.js +6 -2
- package/dist/components/UTLabel/constants.js +20 -14
- package/dist/components/UTLabel/index.js +20 -18
- package/dist/components/UTLabel/theme.js +15 -15
- package/dist/components/UTList/index.js +18 -15
- package/dist/components/UTLoading/index.js +15 -15
- package/dist/components/UTMap/components/GoogleMaps/constants.js +11 -8
- package/dist/components/UTMap/components/GoogleMaps/index.js +91 -63
- package/dist/components/UTMap/components/GoogleMaps/styles.js +3 -2
- package/dist/components/UTMap/constants.js +12 -6
- package/dist/components/UTMap/index.js +198 -163
- package/dist/components/UTMap/types.js +6 -4
- package/dist/components/UTMap/utils.js +46 -29
- package/dist/components/UTMap/withGoogleMapScript.js +22 -18
- package/dist/components/UTMenu/index.js +69 -52
- package/dist/components/UTMenu/theme.js +3 -5
- package/dist/components/UTMenu/utils.js +11 -5
- package/dist/components/UTModal/constants.js +13 -9
- package/dist/components/UTModal/index.js +30 -26
- package/dist/components/UTModal/theme.js +2 -4
- package/dist/components/UTPagination/components/PageSizeSelector/index.js +10 -11
- package/dist/components/UTPagination/components/PageSizeSelector/utils.js +13 -7
- package/dist/components/UTPagination/components/Pagination/components/NavigationButton/index.js +12 -12
- package/dist/components/UTPagination/components/Pagination/index.js +39 -28
- package/dist/components/UTPagination/components/Pagination/utils.js +14 -8
- package/dist/components/UTPagination/constants.js +6 -3
- package/dist/components/UTPagination/index.js +17 -16
- package/dist/components/UTPagination/theme.js +2 -4
- package/dist/components/UTPanel/index.js +44 -38
- package/dist/components/UTPasswordField/components/PasswordValidations/components/Error/index.js +10 -13
- package/dist/components/UTPasswordField/components/PasswordValidations/components/Validation/index.js +19 -22
- package/dist/components/UTPasswordField/components/PasswordValidations/index.js +50 -63
- package/dist/components/UTPasswordField/components/PasswordWarning/index.js +26 -25
- package/dist/components/UTPasswordField/index.js +23 -26
- package/dist/components/UTPasswordField/theme.js +2 -4
- package/dist/components/UTPhoneInput/constants.js +6 -3
- package/dist/components/UTPhoneInput/index.js +205 -180
- package/dist/components/UTPhoneInput/theme.js +77 -77
- package/dist/components/UTPieChart/components/ArrowLabel/constants.js +8 -4
- package/dist/components/UTPieChart/components/ArrowLabel/index.js +23 -24
- package/dist/components/UTPieChart/components/Legend/contants.js +6 -3
- package/dist/components/UTPieChart/components/Legend/index.js +24 -27
- package/dist/components/UTPieChart/constants.js +26 -13
- package/dist/components/UTPieChart/hooks/use-animated-value/index.js +33 -15
- package/dist/components/UTPieChart/index.js +76 -73
- package/dist/components/UTPieChart/theme.js +2 -4
- package/dist/components/UTPieChart/utils.js +2 -4
- package/dist/components/UTProgressBar/constants.js +4 -2
- package/dist/components/UTProgressBar/index.js +17 -15
- package/dist/components/UTProgressBar/theme.js +2 -4
- package/dist/components/UTProgressBar/types.js +3 -2
- package/dist/components/UTRadioGroup/index.js +83 -56
- package/dist/components/UTRadioGroup/theme.js +52 -52
- package/dist/components/UTRating/components/Circle/index.js +56 -41
- package/dist/components/UTRating/components/Faces/constants.js +4 -2
- package/dist/components/UTRating/components/Faces/index.js +36 -34
- package/dist/components/UTRating/components/Star/index.js +40 -36
- package/dist/components/UTRating/constants.js +8 -4
- package/dist/components/UTRating/index.js +46 -31
- package/dist/components/UTRating/theme.js +2 -4
- package/dist/components/UTRipple/Ripple.js +39 -22
- package/dist/components/UTRipple/index.js +37 -18
- package/dist/components/UTSelect/components/Option/index.js +13 -13
- package/dist/components/UTSelect/constants.js +8 -4
- package/dist/components/UTSelect/index.js +85 -63
- package/dist/components/UTSelect/stylesJS.js +3 -2
- package/dist/components/UTSelect/theme.js +4 -6
- package/dist/components/UTSelect/utils.js +13 -3
- package/dist/components/UTSidebar/components/ListOption/index.js +49 -34
- 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 +3 -2
- package/dist/components/UTSidebar/components/Option/index.js +32 -28
- package/dist/components/UTSidebar/components/Toggler/index.js +11 -11
- package/dist/components/UTSidebar/index.js +53 -42
- package/dist/components/UTSidebar/theme.js +2 -4
- package/dist/components/UTSidebar/types.js +10 -5
- package/dist/components/UTSkeleton/index.js +36 -10
- package/dist/components/UTStatus/constants.js +9 -5
- package/dist/components/UTStatus/index.js +15 -16
- package/dist/components/UTStatus/theme.js +49 -66
- package/dist/components/UTSwitch/constants.js +6 -3
- package/dist/components/UTSwitch/index.js +57 -42
- package/dist/components/UTSwitch/theme.js +2 -4
- package/dist/components/UTTable/components/ActionIcons/constants.js +2 -1
- package/dist/components/UTTable/components/ActionIcons/index.js +85 -47
- package/dist/components/UTTable/components/Cell/components/ActionButton/index.js +12 -10
- package/dist/components/UTTable/components/Cell/index.js +23 -18
- package/dist/components/UTTable/components/HeaderCell/constants.js +3 -2
- package/dist/components/UTTable/components/HeaderCell/index.js +30 -23
- package/dist/components/UTTable/components/HeaderCell/utils.js +3 -3
- package/dist/components/UTTable/components/PrimaryAction/index.js +11 -12
- package/dist/components/UTTable/components/ResponsiveCell/index.js +20 -19
- package/dist/components/UTTable/components/Status/index.js +19 -18
- package/dist/components/UTTable/components/TableFooter/components/PageSizeSelector/index.js +9 -10
- package/dist/components/UTTable/components/TableFooter/components/PageSizeSelector/utils.js +13 -7
- package/dist/components/UTTable/components/TableFooter/components/Pagination/components/NavigationButton/index.js +12 -12
- package/dist/components/UTTable/components/TableFooter/components/Pagination/index.js +32 -21
- package/dist/components/UTTable/components/TableFooter/components/Pagination/utils.js +14 -8
- package/dist/components/UTTable/components/TableFooter/constants.js +2 -1
- 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 +6 -3
- package/dist/components/UTTable/components/TableRow/index.js +94 -79
- package/dist/components/UTTable/constants.js +43 -26
- package/dist/components/UTTable/hook.js +26 -11
- package/dist/components/UTTable/index.js +223 -132
- package/dist/components/UTTable/theme.js +17 -17
- package/dist/components/UTTable/types.js +8 -4
- package/dist/components/UTTable/utils.js +74 -70
- package/dist/components/UTTabs/components/TooltipTab/index.js +30 -20
- package/dist/components/UTTabs/constants.js +8 -4
- package/dist/components/UTTabs/index.js +86 -57
- package/dist/components/UTTabs/theme.js +2 -4
- package/dist/components/UTTabs/utils.js +1 -1
- package/dist/components/UTTextArea/constants.js +6 -3
- package/dist/components/UTTextArea/index.js +23 -23
- package/dist/components/UTTextArea/theme.js +2 -4
- package/dist/components/UTTextInput/constants.js +3 -2
- package/dist/components/UTTextInput/index.js +165 -137
- package/dist/components/UTTextInput/theme.js +4 -6
- package/dist/components/UTThirdPartyCookieChecker/index.js +21 -17
- package/dist/components/UTToggle/components/ToggleOption/index.js +17 -16
- package/dist/components/UTToggle/index.js +26 -25
- package/dist/components/UTToggle/theme.js +2 -4
- package/dist/components/UTTooltip/index.js +30 -23
- package/dist/components/UTTooltip/theme.js +2 -4
- package/dist/components/UTTopbar/components/Notifications/index.js +14 -11
- package/dist/components/UTTopbar/components/UserMenu/index.js +15 -15
- package/dist/components/UTTopbar/index.js +31 -28
- package/dist/components/UTTopbar/theme.js +2 -4
- package/dist/components/UTTopbar/types.js +9 -5
- package/dist/components/UTTouchableWithoutFeedback/index.js +27 -14
- package/dist/components/UTVirtualizedList/components/VirtualizedData/components/ListRow/constants.js +4 -2
- package/dist/components/UTVirtualizedList/components/VirtualizedData/components/ListRow/index.js +31 -34
- package/dist/components/UTVirtualizedList/components/VirtualizedData/components/ListRow/utils.js +4 -4
- package/dist/components/UTVirtualizedList/components/VirtualizedData/constants.js +12 -6
- package/dist/components/UTVirtualizedList/components/VirtualizedData/hooks/use-ledger.js +18 -8
- package/dist/components/UTVirtualizedList/components/VirtualizedData/hooks/use-virtualized-data.js +47 -23
- package/dist/components/UTVirtualizedList/components/VirtualizedData/index.js +34 -31
- package/dist/components/UTVirtualizedList/components/VirtualizedData/utils.js +93 -81
- package/dist/components/UTVirtualizedList/constants.js +8 -4
- package/dist/components/UTVirtualizedList/index.js +38 -26
- package/dist/components/UTWorkflowContainer/components/ActionButton/index.js +21 -17
- package/dist/components/UTWorkflowContainer/constants.js +6 -3
- package/dist/components/UTWorkflowContainer/hooks/use-previous.js +3 -3
- package/dist/components/UTWorkflowContainer/index.js +51 -32
- package/dist/components/UTWorkflowContainer/theme.js +53 -60
- package/dist/components/UTWorkflowContainer/types.js +3 -2
- package/dist/components/WithLoading/index.js +15 -10
- package/dist/components/WithTheme/index.js +17 -10
- package/dist/components/WithTheme/layout.js +28 -22
- package/dist/components/WithTouch/index.js +19 -12
- package/dist/constants/UTTable.js +3 -2
- package/dist/index.js +58 -58
- package/dist/theme.js +5 -6
- package/dist/types/commonTypes.js +5 -3
- package/dist/types/consumptionTypes.js +5 -3
- package/dist/types/formTypes.js +7 -4
- package/dist/types/tableTypes.js +3 -2
- package/dist/utils/classesUtils.js +13 -5
- package/dist/utils/componentUtils.js +13 -10
- package/dist/utils/helperFunctions.js +4 -4
- package/dist/utils/shadowUtils.js +11 -13
- package/dist/utils/useScreenSize.js +3 -2
- package/package.json +1 -1
|
@@ -8,13 +8,19 @@ var _object = require("@widergy/web-utils/lib/object");
|
|
|
8
8
|
var _UTTable = require("../../constants/UTTable");
|
|
9
9
|
var _utils = require("./components/TableFooter/components/PageSizeSelector/utils");
|
|
10
10
|
var _constants = require("./constants");
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
11
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
12
|
+
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."); }
|
|
13
|
+
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); }
|
|
14
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
15
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
16
|
+
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; }
|
|
17
|
+
var getColumnDefinition = function getColumnDefinition(columnns, isResponsive) {
|
|
18
|
+
var secondaryColumns = [];
|
|
19
|
+
var primaryActions = [];
|
|
20
|
+
var secondaryActions = [];
|
|
21
|
+
var fixedLeftColumns = [];
|
|
22
|
+
var fixedRightColumns = [];
|
|
23
|
+
columnns.forEach(function (column) {
|
|
18
24
|
if (isResponsive) {
|
|
19
25
|
if (column.type === _constants.CELL_TYPES.ACTION_BUTTON) {
|
|
20
26
|
primaryActions.push(column);
|
|
@@ -32,54 +38,54 @@ const getColumnDefinition = (columnns, isResponsive) => {
|
|
|
32
38
|
}
|
|
33
39
|
});
|
|
34
40
|
return {
|
|
35
|
-
secondaryColumns,
|
|
36
|
-
primaryActions,
|
|
37
|
-
secondaryActions,
|
|
38
|
-
fixedLeftColumns,
|
|
39
|
-
fixedRightColumns
|
|
41
|
+
secondaryColumns: secondaryColumns,
|
|
42
|
+
primaryActions: primaryActions,
|
|
43
|
+
secondaryActions: secondaryActions,
|
|
44
|
+
fixedLeftColumns: fixedLeftColumns,
|
|
45
|
+
fixedRightColumns: fixedRightColumns
|
|
40
46
|
};
|
|
41
47
|
};
|
|
42
48
|
exports.getColumnDefinition = getColumnDefinition;
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
49
|
+
var customSort = function customSort(a, b, order) {
|
|
50
|
+
var firstValue = a[order.key] || '';
|
|
51
|
+
var secondValue = b[order.key] || '';
|
|
46
52
|
if (firstValue < secondValue) return order.direction === 'asc' ? -1 : 1;
|
|
47
53
|
if (firstValue > secondValue) return order.direction === 'asc' ? 1 : -1;
|
|
48
54
|
return 0;
|
|
49
55
|
};
|
|
50
56
|
exports.customSort = customSort;
|
|
51
|
-
|
|
57
|
+
var orderRows = function orderRows(rows, order, defaultRows, columns) {
|
|
52
58
|
if ((0, _object.objectIsEmpty)(order)) return defaultRows;
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
key
|
|
57
|
-
} = _ref;
|
|
59
|
+
var ordererRows = _toConsumableArray(rows);
|
|
60
|
+
var sortFunction = columns.find(function (_ref) {
|
|
61
|
+
var key = _ref.key;
|
|
58
62
|
return key === order.key;
|
|
59
63
|
}).customSort || customSort;
|
|
60
|
-
ordererRows.sort((a, b)
|
|
64
|
+
ordererRows.sort(function (a, b) {
|
|
65
|
+
return sortFunction(a, b, order);
|
|
66
|
+
});
|
|
61
67
|
return ordererRows;
|
|
62
68
|
};
|
|
63
69
|
exports.orderRows = orderRows;
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
70
|
+
var getCurrentRows = function getCurrentRows(rows, currentPage, rowsPerPage) {
|
|
71
|
+
var initialIndex = currentPage * rowsPerPage;
|
|
72
|
+
var lastIndex = (currentPage + 1) * rowsPerPage;
|
|
67
73
|
return rows.slice(initialIndex, lastIndex);
|
|
68
74
|
};
|
|
69
75
|
exports.getCurrentRows = getCurrentRows;
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
76
|
+
var createRowStyles = function createRowStyles(rowPadding, rowSpacing, headerPadding, isResponsive) {
|
|
77
|
+
var margin = _constants.ROW_SPACING[rowSpacing] || _constants.ROW_SPACING.none;
|
|
78
|
+
var paddingValue = _constants.ROW_PADDING[rowPadding] || _constants.ROW_PADDING.small;
|
|
79
|
+
var headerPaddingValue = _constants.ROW_PADDING[headerPadding] || _constants.ROW_PADDING.medium;
|
|
80
|
+
var borderRadius = margin === _constants.ROW_SPACING.none && 0;
|
|
75
81
|
return {
|
|
76
82
|
fixedRowsLeft: {
|
|
77
|
-
borderRadius,
|
|
83
|
+
borderRadius: borderRadius,
|
|
78
84
|
borderWidth: "".concat(_constants.ROWS_BORDER_SIZE, "px"),
|
|
79
85
|
paddingLeft: _constants.CELL_SIDE_PADDING
|
|
80
86
|
},
|
|
81
87
|
fixedRowsRight: {
|
|
82
|
-
borderRadius,
|
|
88
|
+
borderRadius: borderRadius,
|
|
83
89
|
borderWidth: "".concat(_constants.ROWS_BORDER_SIZE, "px"),
|
|
84
90
|
paddingRight: _constants.CELL_SIDE_PADDING
|
|
85
91
|
},
|
|
@@ -109,7 +115,7 @@ const createRowStyles = (rowPadding, rowSpacing, headerPadding, isResponsive) =>
|
|
|
109
115
|
paddingTop: headerPaddingValue
|
|
110
116
|
},
|
|
111
117
|
rowBackground: {
|
|
112
|
-
borderRadius,
|
|
118
|
+
borderRadius: borderRadius,
|
|
113
119
|
borderBottomWidth: "".concat(_constants.ROWS_BORDER_SIZE, "px"),
|
|
114
120
|
borderTopWidth: "".concat(_constants.ROWS_BORDER_SIZE, "px"),
|
|
115
121
|
borderLeftWidth: 0,
|
|
@@ -134,61 +140,59 @@ const createRowStyles = (rowPadding, rowSpacing, headerPadding, isResponsive) =>
|
|
|
134
140
|
};
|
|
135
141
|
};
|
|
136
142
|
exports.createRowStyles = createRowStyles;
|
|
137
|
-
|
|
143
|
+
var getSelectableRowIds = function getSelectableRowIds(rows, rowKey, disableRowSelection) {
|
|
144
|
+
return (disableRowSelection ? rows.filter(function (_row) {
|
|
145
|
+
return !disableRowSelection(_row);
|
|
146
|
+
}) : rows).map(function (_row) {
|
|
147
|
+
return _row[rowKey];
|
|
148
|
+
});
|
|
149
|
+
};
|
|
138
150
|
exports.getSelectableRowIds = getSelectableRowIds;
|
|
139
|
-
|
|
151
|
+
var getInitialValidRowsPerPage = function getInitialValidRowsPerPage(externalOption, originalOptions, data) {
|
|
140
152
|
if (externalOption === undefined) return originalOptions[0];
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
value
|
|
144
|
-
} = _ref2;
|
|
153
|
+
var options = (0, _utils.getPageSizeOptions)(originalOptions, data.length).map(function (_ref2) {
|
|
154
|
+
var value = _ref2.value;
|
|
145
155
|
return value;
|
|
146
156
|
});
|
|
147
157
|
return options.includes(externalOption) ? externalOption : options[0];
|
|
148
158
|
};
|
|
149
159
|
exports.getInitialValidRowsPerPage = getInitialValidRowsPerPage;
|
|
150
|
-
|
|
160
|
+
var getInitialValidPage = function getInitialValidPage(externalPage, rowsPerPage, data, integrationType) {
|
|
161
|
+
return integrationType === _UTTable.INTEGRATION_TYPES.EXTERNAL ? externalPage : externalPage === undefined || Math.floor(data.length / rowsPerPage) < externalPage ? 0 : externalPage;
|
|
162
|
+
};
|
|
151
163
|
exports.getInitialValidPage = getInitialValidPage;
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
} = _ref3;
|
|
158
|
-
const columnSizes = {};
|
|
164
|
+
var getColumnsSizes = function getColumnsSizes(_ref3) {
|
|
165
|
+
var columns = _ref3.columns,
|
|
166
|
+
fitColumnsWidth = _ref3.fitColumnsWidth,
|
|
167
|
+
selectable = _ref3.selectable;
|
|
168
|
+
var columnSizes = {};
|
|
159
169
|
if (fitColumnsWidth) {
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
columns.forEach(_ref4
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
} = _ref4;
|
|
169
|
-
const columnSize = _constants.COLUMN_SIZES[size] || _constants.COLUMN_SIZES.medium;
|
|
170
|
+
var columnsFullSize = 0;
|
|
171
|
+
var leftColumnsSize = selectable ? 54 : 0;
|
|
172
|
+
var secondaryColumnsSize = 0;
|
|
173
|
+
var rightColumnsSize = 0;
|
|
174
|
+
columns.forEach(function (_ref4) {
|
|
175
|
+
var position = _ref4.position,
|
|
176
|
+
size = _ref4.size;
|
|
177
|
+
var columnSize = _constants.COLUMN_SIZES[size] || _constants.COLUMN_SIZES.medium;
|
|
170
178
|
columnsFullSize += columnSize;
|
|
171
179
|
if (position === _constants.COLUMN_POSITION.LEFT) leftColumnsSize += columnSize;else if (position === _constants.COLUMN_POSITION.RIGHT) rightColumnsSize += columnSize;else secondaryColumnsSize += columnSize;
|
|
172
180
|
});
|
|
173
|
-
columns.forEach(_ref5
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
const columnSize = _constants.COLUMN_SIZES[size] || _constants.COLUMN_SIZES.medium;
|
|
180
|
-
const finalSize = columnSize * 100 / (position === _constants.COLUMN_POSITION.LEFT ? leftColumnsSize : position === _constants.COLUMN_POSITION.RIGHT ? rightColumnsSize : secondaryColumnsSize);
|
|
181
|
+
columns.forEach(function (_ref5) {
|
|
182
|
+
var key = _ref5.key,
|
|
183
|
+
position = _ref5.position,
|
|
184
|
+
size = _ref5.size;
|
|
185
|
+
var columnSize = _constants.COLUMN_SIZES[size] || _constants.COLUMN_SIZES.medium;
|
|
186
|
+
var finalSize = columnSize * 100 / (position === _constants.COLUMN_POSITION.LEFT ? leftColumnsSize : position === _constants.COLUMN_POSITION.RIGHT ? rightColumnsSize : secondaryColumnsSize);
|
|
181
187
|
columnSizes[key] = "".concat(finalSize, "%");
|
|
182
188
|
});
|
|
183
189
|
columnSizes.leftColumnsSize = "".concat(leftColumnsSize * 100 / columnsFullSize, "%");
|
|
184
190
|
columnSizes.secondaryColumnsSize = "".concat(secondaryColumnsSize * 100 / columnsFullSize, "%");
|
|
185
191
|
columnSizes.rightColumnsSize = "".concat(rightColumnsSize * 100 / columnsFullSize, "%");
|
|
186
192
|
} else {
|
|
187
|
-
columns.forEach(_ref6
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
size
|
|
191
|
-
} = _ref6;
|
|
193
|
+
columns.forEach(function (_ref6) {
|
|
194
|
+
var key = _ref6.key,
|
|
195
|
+
size = _ref6.size;
|
|
192
196
|
columnSizes[key] = _constants.COLUMN_SIZES[size] || _constants.COLUMN_SIZES.medium;
|
|
193
197
|
});
|
|
194
198
|
columnSizes.leftColumnsSize = 'auto';
|
|
@@ -1,5 +1,6 @@
|
|
|
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); }
|
|
3
4
|
Object.defineProperty(exports, "__esModule", {
|
|
4
5
|
value: true
|
|
5
6
|
});
|
|
@@ -9,27 +10,35 @@ var _propTypes = require("prop-types");
|
|
|
9
10
|
var _UTTooltip = _interopRequireDefault(require("../../../UTTooltip"));
|
|
10
11
|
var _commonTypes = require("../../../../types/commonTypes");
|
|
11
12
|
var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
|
|
13
|
+
var _excluded = ["children", "buttonRef", "className", "isDisabled", "onClick", "tooltip", "tooltipProps"];
|
|
12
14
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
|
-
function _getRequireWildcardCache(
|
|
14
|
-
function _interopRequireWildcard(
|
|
15
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
16
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
15
17
|
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); }
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
18
|
+
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; }
|
|
19
|
+
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; }
|
|
20
|
+
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; }
|
|
21
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
22
|
+
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); }
|
|
23
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
24
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
25
|
+
var TooltipTab = function TooltipTab(_ref) {
|
|
26
|
+
var children = _ref.children,
|
|
27
|
+
buttonRef = _ref.buttonRef,
|
|
28
|
+
className = _ref.className,
|
|
29
|
+
isDisabled = _ref.isDisabled,
|
|
30
|
+
onClick = _ref.onClick,
|
|
31
|
+
tooltip = _ref.tooltip,
|
|
32
|
+
_ref$tooltipProps = _ref.tooltipProps,
|
|
33
|
+
tooltipProps = _ref$tooltipProps === void 0 ? {} : _ref$tooltipProps,
|
|
34
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
35
|
+
var tippyProps = _objectSpread({
|
|
36
|
+
appendTo: function appendTo() {
|
|
37
|
+
return document.body;
|
|
38
|
+
},
|
|
39
|
+
interactive: false
|
|
40
|
+
}, tooltipProps);
|
|
41
|
+
var handleClick = function handleClick(event) {
|
|
33
42
|
if (!isDisabled) onClick(event);
|
|
34
43
|
};
|
|
35
44
|
return /*#__PURE__*/_react.default.createElement(_UTTooltip.default, {
|
|
@@ -49,4 +58,5 @@ TooltipTab.propTypes = {
|
|
|
49
58
|
tooltip: _propTypes.string,
|
|
50
59
|
tooltipProps: _propTypes.object
|
|
51
60
|
};
|
|
52
|
-
var _default =
|
|
61
|
+
var _default = /*#__PURE__*/(0, _react.memo)(TooltipTab);
|
|
62
|
+
exports.default = _default;
|
|
@@ -4,13 +4,17 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.variants = exports.DEFAULT_VARIANT = exports.DEFAULT_TAB_COMPONENT = exports.DEFAULT_TABS_PROPS = void 0;
|
|
7
|
-
|
|
7
|
+
var DEFAULT_TABS_PROPS = {
|
|
8
8
|
variant: 'fullWidth',
|
|
9
9
|
orientation: 'horizontal'
|
|
10
10
|
};
|
|
11
|
-
|
|
11
|
+
exports.DEFAULT_TABS_PROPS = DEFAULT_TABS_PROPS;
|
|
12
|
+
var variants = {
|
|
12
13
|
BASE: 'base',
|
|
13
14
|
SECONDARY: 'secondary'
|
|
14
15
|
};
|
|
15
|
-
|
|
16
|
-
|
|
16
|
+
exports.variants = variants;
|
|
17
|
+
var DEFAULT_VARIANT = variants.BASE;
|
|
18
|
+
exports.DEFAULT_VARIANT = DEFAULT_VARIANT;
|
|
19
|
+
var DEFAULT_TAB_COMPONENT = 'button';
|
|
20
|
+
exports.DEFAULT_TAB_COMPONENT = DEFAULT_TAB_COMPONENT;
|
|
@@ -17,67 +17,95 @@ var _utils = require("./utils");
|
|
|
17
17
|
var _theme = require("./theme");
|
|
18
18
|
var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
|
|
19
19
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
20
|
-
function _getRequireWildcardCache(
|
|
21
|
-
function _interopRequireWildcard(
|
|
20
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
21
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
22
|
+
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
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); }
|
|
24
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
25
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
26
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
27
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
28
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
29
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
30
|
+
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
31
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
32
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
33
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
23
34
|
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; }
|
|
24
|
-
function _toPropertyKey(
|
|
25
|
-
function _toPrimitive(
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
35
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
36
|
+
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); }
|
|
37
|
+
var UTTabs = /*#__PURE__*/function (_PureComponent) {
|
|
38
|
+
_inherits(UTTabs, _PureComponent);
|
|
39
|
+
var _super = _createSuper(UTTabs);
|
|
40
|
+
function UTTabs() {
|
|
41
|
+
var _this;
|
|
42
|
+
_classCallCheck(this, UTTabs);
|
|
43
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
44
|
+
args[_key] = arguments[_key];
|
|
45
|
+
}
|
|
46
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
47
|
+
_defineProperty(_assertThisInitialized(_this), "handleChange", function (_, value) {
|
|
48
|
+
return _this.props.onChange(value);
|
|
49
|
+
});
|
|
50
|
+
return _this;
|
|
30
51
|
}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
root: "".concat(styles.tabsRoot, " ").concat(classes.tabsRoot),
|
|
49
|
-
flexContainer: classes.flexContainer
|
|
50
|
-
},
|
|
51
|
-
TabIndicatorProps: {
|
|
52
|
-
className: "".concat(styles.indicator, " ").concat(classes.indicator),
|
|
53
|
-
children: /*#__PURE__*/_react.default.createElement("div", null)
|
|
54
|
-
}
|
|
55
|
-
}, tabsProps), options.map(opt => {
|
|
56
|
-
const tabComponent = opt.tooltip ? /*#__PURE__*/(0, _react.forwardRef)((props, ref) => /*#__PURE__*/_react.default.createElement(_TooltipTab.default, _extends({}, props, {
|
|
57
|
-
buttonRef: ref,
|
|
58
|
-
isDisabled: opt.disabled,
|
|
59
|
-
tooltip: opt.tooltip,
|
|
60
|
-
tooltipProps: tabTooltipProps
|
|
61
|
-
}))) : _constants.DEFAULT_TAB_COMPONENT;
|
|
62
|
-
return /*#__PURE__*/_react.default.createElement(_Tab.default, _extends({
|
|
52
|
+
_createClass(UTTabs, [{
|
|
53
|
+
key: "render",
|
|
54
|
+
value: function render() {
|
|
55
|
+
var _this$props = this.props,
|
|
56
|
+
badges = _this$props.badges,
|
|
57
|
+
themeClasses = _this$props.classes,
|
|
58
|
+
classNames = _this$props.classNames,
|
|
59
|
+
options = _this$props.options,
|
|
60
|
+
tabProps = _this$props.tabProps,
|
|
61
|
+
tabsProps = _this$props.tabsProps,
|
|
62
|
+
tabTooltipProps = _this$props.tabTooltipProps,
|
|
63
|
+
variant = _this$props.variant;
|
|
64
|
+
var classes = (0, _classesUtils.mergeClasses)(themeClasses, classNames);
|
|
65
|
+
var styles = (0, _utils.retrieveClassNamesFromVariants)(variant, classes);
|
|
66
|
+
return /*#__PURE__*/_react.default.createElement(_Tabs.default, _extends({
|
|
67
|
+
value: this.props.value,
|
|
68
|
+
onChange: this.handleChange,
|
|
63
69
|
classes: {
|
|
64
|
-
root: "".concat(styles.
|
|
65
|
-
|
|
66
|
-
textColorPrimary: "".concat(styles.textColorPrimary, " ").concat(classes.textColorPrimary),
|
|
67
|
-
wrapper: "".concat(styles.label, " ").concat(classes.label)
|
|
70
|
+
root: "".concat(styles.tabsRoot, " ").concat(classes.tabsRoot),
|
|
71
|
+
flexContainer: classes.flexContainer
|
|
68
72
|
},
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
}
|
|
73
|
+
TabIndicatorProps: {
|
|
74
|
+
className: "".concat(styles.indicator, " ").concat(classes.indicator),
|
|
75
|
+
children: /*#__PURE__*/_react.default.createElement("div", null)
|
|
76
|
+
}
|
|
77
|
+
}, tabsProps), options.map(function (opt) {
|
|
78
|
+
var tabComponent = opt.tooltip ? /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
|
|
79
|
+
return /*#__PURE__*/_react.default.createElement(_TooltipTab.default, _extends({}, props, {
|
|
80
|
+
buttonRef: ref,
|
|
81
|
+
isDisabled: opt.disabled,
|
|
82
|
+
tooltip: opt.tooltip,
|
|
83
|
+
tooltipProps: tabTooltipProps
|
|
84
|
+
}));
|
|
85
|
+
}) : _constants.DEFAULT_TAB_COMPONENT;
|
|
86
|
+
return /*#__PURE__*/_react.default.createElement(_Tab.default, _extends({
|
|
87
|
+
classes: {
|
|
88
|
+
root: "".concat(styles.tabRoot, " ").concat(classes.tabRoot),
|
|
89
|
+
selected: "".concat(styles.selected, " ").concat(classes.selected),
|
|
90
|
+
textColorPrimary: "".concat(styles.textColorPrimary, " ").concat(classes.textColorPrimary),
|
|
91
|
+
wrapper: "".concat(styles.label, " ").concat(classes.label)
|
|
92
|
+
},
|
|
93
|
+
key: opt.value,
|
|
94
|
+
value: opt.value,
|
|
95
|
+
label: opt.label,
|
|
96
|
+
disabled: opt.disabled,
|
|
97
|
+
icon: opt.icon,
|
|
98
|
+
component: tabComponent
|
|
99
|
+
}, tabProps));
|
|
100
|
+
}), !(0, _array.isEmpty)(badges) && badges.map(function (badge) {
|
|
101
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
102
|
+
className: "".concat(badge.styles, " ").concat(!badge.show && _stylesModule.default.hiddenBadge)
|
|
103
|
+
});
|
|
104
|
+
}));
|
|
105
|
+
}
|
|
106
|
+
}]);
|
|
107
|
+
return UTTabs;
|
|
108
|
+
}(_react.PureComponent);
|
|
81
109
|
UTTabs.defaultProps = {
|
|
82
110
|
badges: [],
|
|
83
111
|
classes: {},
|
|
@@ -116,4 +144,5 @@ UTTabs.propTypes = {
|
|
|
116
144
|
tabTooltipProps: _propTypes.object,
|
|
117
145
|
value: (0, _propTypes.oneOfType)([_propTypes.string, _propTypes.number])
|
|
118
146
|
};
|
|
119
|
-
var _default =
|
|
147
|
+
var _default = (0, _WithTheme.default)(_theme.retrieveStyle)(UTTabs);
|
|
148
|
+
exports.default = _default;
|
|
@@ -7,10 +7,8 @@ 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
|
-
|
|
12
|
-
theme
|
|
13
|
-
} = _ref;
|
|
10
|
+
var retrieveStyle = function retrieveStyle(_ref) {
|
|
11
|
+
var theme = _ref.theme;
|
|
14
12
|
return {
|
|
15
13
|
baseTabsRoot: {
|
|
16
14
|
border: (0, _seamlessImmutable.getIn)(theme, ['UTTabs', 'baseTabsRoot', 'border'], 0),
|
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.retrieveClassNamesFromVariants = void 0;
|
|
7
7
|
var _constants = require("./constants");
|
|
8
|
-
|
|
8
|
+
var retrieveClassNamesFromVariants = function retrieveClassNamesFromVariants(variant, classes) {
|
|
9
9
|
switch (variant) {
|
|
10
10
|
case _constants.variants.SECONDARY:
|
|
11
11
|
return {
|
|
@@ -4,7 +4,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.tippyProps = void 0;
|
|
7
|
-
|
|
8
|
-
appendTo: ()
|
|
7
|
+
var tippyProps = {
|
|
8
|
+
appendTo: function appendTo() {
|
|
9
|
+
return document.body;
|
|
10
|
+
},
|
|
9
11
|
interactive: false
|
|
10
|
-
};
|
|
12
|
+
};
|
|
13
|
+
exports.tippyProps = tippyProps;
|
|
@@ -16,28 +16,27 @@ var _theme = require("./theme");
|
|
|
16
16
|
var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
|
|
17
17
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
18
18
|
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); }
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
classNames = {},
|
|
23
|
-
disabled,
|
|
24
|
-
HelpIcon,
|
|
25
|
-
inputProps =
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
icon,
|
|
37
|
-
textarea,
|
|
38
|
-
label,
|
|
39
|
-
textAreaContainer
|
|
40
|
-
} = classNames;
|
|
19
|
+
var UTTextArea = function UTTextArea(_ref) {
|
|
20
|
+
var classes = _ref.classes,
|
|
21
|
+
_ref$classNames = _ref.classNames,
|
|
22
|
+
classNames = _ref$classNames === void 0 ? {} : _ref$classNames,
|
|
23
|
+
disabled = _ref.disabled,
|
|
24
|
+
HelpIcon = _ref.HelpIcon,
|
|
25
|
+
_ref$inputProps = _ref.inputProps,
|
|
26
|
+
inputProps = _ref$inputProps === void 0 ? {} : _ref$inputProps,
|
|
27
|
+
onBlur = _ref.onBlur,
|
|
28
|
+
onChange = _ref.onChange,
|
|
29
|
+
onFocus = _ref.onFocus,
|
|
30
|
+
placeholder = _ref.placeholder,
|
|
31
|
+
_ref$title = _ref.title,
|
|
32
|
+
title = _ref$title === void 0 ? '' : _ref$title,
|
|
33
|
+
tooltip = _ref.tooltip,
|
|
34
|
+
value = _ref.value;
|
|
35
|
+
var container = classNames.container,
|
|
36
|
+
icon = classNames.icon,
|
|
37
|
+
textarea = classNames.textarea,
|
|
38
|
+
label = classNames.label,
|
|
39
|
+
textAreaContainer = classNames.textAreaContainer;
|
|
41
40
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
42
41
|
className: container
|
|
43
42
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
@@ -82,4 +81,5 @@ UTTextArea.propTypes = {
|
|
|
82
81
|
tooltip: _propTypes.string,
|
|
83
82
|
value: _propTypes.string
|
|
84
83
|
};
|
|
85
|
-
var _default =
|
|
84
|
+
var _default = (0, _WithTheme.default)(_theme.retrieveStyle)(UTTextArea);
|
|
85
|
+
exports.default = _default;
|
|
@@ -6,11 +6,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.retrieveStyle = void 0;
|
|
7
7
|
var _colorsModule = _interopRequireDefault(require("../../scss/variables/colors.module.scss"));
|
|
8
8
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
9
|
-
|
|
9
|
+
var retrieveStyle = function retrieveStyle(_ref) {
|
|
10
10
|
var _theme$UTTextArea, _theme$UTTextArea2, _theme$UTTextArea3, _theme$UTTextArea4, _theme$Fonts, _theme$UTTextArea5, _theme$UTTextArea6, _theme$UTTextArea7, _theme$UTTextArea8, _theme$UTTextArea9, _theme$UTTextArea10, _theme$UTTextArea11, _theme$UTTextArea12, _theme$UTTextArea13, _theme$UTTextArea14, _theme$UTTextArea15, _theme$UTTextArea16, _theme$UTTextArea17, _theme$UTTextArea18, _theme$UTTextArea19, _theme$UTTextArea20;
|
|
11
|
-
|
|
12
|
-
theme
|
|
13
|
-
} = _ref;
|
|
11
|
+
var theme = _ref.theme;
|
|
14
12
|
return {
|
|
15
13
|
textarea: {
|
|
16
14
|
background: theme === null || theme === void 0 || (_theme$UTTextArea = theme.UTTextArea) === null || _theme$UTTextArea === void 0 || (_theme$UTTextArea = _theme$UTTextArea.textarea) === null || _theme$UTTextArea === void 0 ? void 0 : _theme$UTTextArea.background,
|
|
@@ -4,8 +4,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.INPUT_TYPES = void 0;
|
|
7
|
-
|
|
7
|
+
var INPUT_TYPES = {
|
|
8
8
|
PASSWORD: 'password',
|
|
9
9
|
TEXT: 'text',
|
|
10
10
|
NUMBER: 'number'
|
|
11
|
-
};
|
|
11
|
+
};
|
|
12
|
+
exports.INPUT_TYPES = INPUT_TYPES;
|