@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
|
@@ -8,19 +8,13 @@ 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
|
-
|
|
18
|
-
var secondaryColumns = [];
|
|
19
|
-
var primaryActions = [];
|
|
20
|
-
var secondaryActions = [];
|
|
21
|
-
var fixedLeftColumns = [];
|
|
22
|
-
var fixedRightColumns = [];
|
|
23
|
-
columnns.forEach(function (column) {
|
|
11
|
+
const getColumnDefinition = (columnns, isResponsive) => {
|
|
12
|
+
const secondaryColumns = [];
|
|
13
|
+
const primaryActions = [];
|
|
14
|
+
const secondaryActions = [];
|
|
15
|
+
const fixedLeftColumns = [];
|
|
16
|
+
const fixedRightColumns = [];
|
|
17
|
+
columnns.forEach(column => {
|
|
24
18
|
if (isResponsive) {
|
|
25
19
|
if (column.type === _constants.CELL_TYPES.ACTION_BUTTON) {
|
|
26
20
|
primaryActions.push(column);
|
|
@@ -38,54 +32,54 @@ var getColumnDefinition = function getColumnDefinition(columnns, isResponsive) {
|
|
|
38
32
|
}
|
|
39
33
|
});
|
|
40
34
|
return {
|
|
41
|
-
secondaryColumns
|
|
42
|
-
primaryActions
|
|
43
|
-
secondaryActions
|
|
44
|
-
fixedLeftColumns
|
|
45
|
-
fixedRightColumns
|
|
35
|
+
secondaryColumns,
|
|
36
|
+
primaryActions,
|
|
37
|
+
secondaryActions,
|
|
38
|
+
fixedLeftColumns,
|
|
39
|
+
fixedRightColumns
|
|
46
40
|
};
|
|
47
41
|
};
|
|
48
42
|
exports.getColumnDefinition = getColumnDefinition;
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
43
|
+
const customSort = (a, b, order) => {
|
|
44
|
+
const firstValue = a[order.key] || '';
|
|
45
|
+
const secondValue = b[order.key] || '';
|
|
52
46
|
if (firstValue < secondValue) return order.direction === 'asc' ? -1 : 1;
|
|
53
47
|
if (firstValue > secondValue) return order.direction === 'asc' ? 1 : -1;
|
|
54
48
|
return 0;
|
|
55
49
|
};
|
|
56
50
|
exports.customSort = customSort;
|
|
57
|
-
|
|
51
|
+
const orderRows = (rows, order, defaultRows, columns) => {
|
|
58
52
|
if ((0, _object.objectIsEmpty)(order)) return defaultRows;
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
53
|
+
const ordererRows = [...rows];
|
|
54
|
+
const sortFunction = columns.find(_ref => {
|
|
55
|
+
let {
|
|
56
|
+
key
|
|
57
|
+
} = _ref;
|
|
62
58
|
return key === order.key;
|
|
63
59
|
}).customSort || customSort;
|
|
64
|
-
ordererRows.sort(
|
|
65
|
-
return sortFunction(a, b, order);
|
|
66
|
-
});
|
|
60
|
+
ordererRows.sort((a, b) => sortFunction(a, b, order));
|
|
67
61
|
return ordererRows;
|
|
68
62
|
};
|
|
69
63
|
exports.orderRows = orderRows;
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
64
|
+
const getCurrentRows = (rows, currentPage, rowsPerPage) => {
|
|
65
|
+
const initialIndex = currentPage * rowsPerPage;
|
|
66
|
+
const lastIndex = (currentPage + 1) * rowsPerPage;
|
|
73
67
|
return rows.slice(initialIndex, lastIndex);
|
|
74
68
|
};
|
|
75
69
|
exports.getCurrentRows = getCurrentRows;
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
70
|
+
const createRowStyles = (rowPadding, rowSpacing, headerPadding, isResponsive) => {
|
|
71
|
+
const margin = _constants.ROW_SPACING[rowSpacing] || _constants.ROW_SPACING.none;
|
|
72
|
+
const paddingValue = _constants.ROW_PADDING[rowPadding] || _constants.ROW_PADDING.small;
|
|
73
|
+
const headerPaddingValue = _constants.ROW_PADDING[headerPadding] || _constants.ROW_PADDING.medium;
|
|
74
|
+
const borderRadius = margin === _constants.ROW_SPACING.none && 0;
|
|
81
75
|
return {
|
|
82
76
|
fixedRowsLeft: {
|
|
83
|
-
borderRadius
|
|
77
|
+
borderRadius,
|
|
84
78
|
borderWidth: "".concat(_constants.ROWS_BORDER_SIZE, "px"),
|
|
85
79
|
paddingLeft: _constants.CELL_SIDE_PADDING
|
|
86
80
|
},
|
|
87
81
|
fixedRowsRight: {
|
|
88
|
-
borderRadius
|
|
82
|
+
borderRadius,
|
|
89
83
|
borderWidth: "".concat(_constants.ROWS_BORDER_SIZE, "px"),
|
|
90
84
|
paddingRight: _constants.CELL_SIDE_PADDING
|
|
91
85
|
},
|
|
@@ -115,7 +109,7 @@ var createRowStyles = function createRowStyles(rowPadding, rowSpacing, headerPad
|
|
|
115
109
|
paddingTop: headerPaddingValue
|
|
116
110
|
},
|
|
117
111
|
rowBackground: {
|
|
118
|
-
borderRadius
|
|
112
|
+
borderRadius,
|
|
119
113
|
borderBottomWidth: "".concat(_constants.ROWS_BORDER_SIZE, "px"),
|
|
120
114
|
borderTopWidth: "".concat(_constants.ROWS_BORDER_SIZE, "px"),
|
|
121
115
|
borderLeftWidth: 0,
|
|
@@ -140,59 +134,61 @@ var createRowStyles = function createRowStyles(rowPadding, rowSpacing, headerPad
|
|
|
140
134
|
};
|
|
141
135
|
};
|
|
142
136
|
exports.createRowStyles = createRowStyles;
|
|
143
|
-
|
|
144
|
-
return (disableRowSelection ? rows.filter(function (_row) {
|
|
145
|
-
return !disableRowSelection(_row);
|
|
146
|
-
}) : rows).map(function (_row) {
|
|
147
|
-
return _row[rowKey];
|
|
148
|
-
});
|
|
149
|
-
};
|
|
137
|
+
const getSelectableRowIds = (rows, rowKey, disableRowSelection) => (disableRowSelection ? rows.filter(_row => !disableRowSelection(_row)) : rows).map(_row => _row[rowKey]);
|
|
150
138
|
exports.getSelectableRowIds = getSelectableRowIds;
|
|
151
|
-
|
|
139
|
+
const getInitialValidRowsPerPage = (externalOption, originalOptions, data) => {
|
|
152
140
|
if (externalOption === undefined) return originalOptions[0];
|
|
153
|
-
|
|
154
|
-
|
|
141
|
+
const options = (0, _utils.getPageSizeOptions)(originalOptions, data.length).map(_ref2 => {
|
|
142
|
+
let {
|
|
143
|
+
value
|
|
144
|
+
} = _ref2;
|
|
155
145
|
return value;
|
|
156
146
|
});
|
|
157
147
|
return options.includes(externalOption) ? externalOption : options[0];
|
|
158
148
|
};
|
|
159
149
|
exports.getInitialValidRowsPerPage = getInitialValidRowsPerPage;
|
|
160
|
-
|
|
161
|
-
return integrationType === _UTTable.INTEGRATION_TYPES.EXTERNAL ? externalPage : externalPage === undefined || Math.floor(data.length / rowsPerPage) < externalPage ? 0 : externalPage;
|
|
162
|
-
};
|
|
150
|
+
const getInitialValidPage = (externalPage, rowsPerPage, data, integrationType) => integrationType === _UTTable.INTEGRATION_TYPES.EXTERNAL ? externalPage : externalPage === undefined || Math.floor(data.length / rowsPerPage) < externalPage ? 0 : externalPage;
|
|
163
151
|
exports.getInitialValidPage = getInitialValidPage;
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
152
|
+
const getColumnsSizes = _ref3 => {
|
|
153
|
+
let {
|
|
154
|
+
columns,
|
|
155
|
+
fitColumnsWidth,
|
|
156
|
+
selectable
|
|
157
|
+
} = _ref3;
|
|
158
|
+
const columnSizes = {};
|
|
169
159
|
if (fitColumnsWidth) {
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
columns.forEach(
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
160
|
+
let columnsFullSize = 0;
|
|
161
|
+
let leftColumnsSize = selectable ? 54 : 0;
|
|
162
|
+
let secondaryColumnsSize = 0;
|
|
163
|
+
let rightColumnsSize = 0;
|
|
164
|
+
columns.forEach(_ref4 => {
|
|
165
|
+
let {
|
|
166
|
+
position,
|
|
167
|
+
size
|
|
168
|
+
} = _ref4;
|
|
169
|
+
const columnSize = _constants.COLUMN_SIZES[size] || _constants.COLUMN_SIZES.medium;
|
|
178
170
|
columnsFullSize += columnSize;
|
|
179
171
|
if (position === _constants.COLUMN_POSITION.LEFT) leftColumnsSize += columnSize;else if (position === _constants.COLUMN_POSITION.RIGHT) rightColumnsSize += columnSize;else secondaryColumnsSize += columnSize;
|
|
180
172
|
});
|
|
181
|
-
columns.forEach(
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
173
|
+
columns.forEach(_ref5 => {
|
|
174
|
+
let {
|
|
175
|
+
key,
|
|
176
|
+
position,
|
|
177
|
+
size
|
|
178
|
+
} = _ref5;
|
|
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);
|
|
187
181
|
columnSizes[key] = "".concat(finalSize, "%");
|
|
188
182
|
});
|
|
189
183
|
columnSizes.leftColumnsSize = "".concat(leftColumnsSize * 100 / columnsFullSize, "%");
|
|
190
184
|
columnSizes.secondaryColumnsSize = "".concat(secondaryColumnsSize * 100 / columnsFullSize, "%");
|
|
191
185
|
columnSizes.rightColumnsSize = "".concat(rightColumnsSize * 100 / columnsFullSize, "%");
|
|
192
186
|
} else {
|
|
193
|
-
columns.forEach(
|
|
194
|
-
|
|
195
|
-
|
|
187
|
+
columns.forEach(_ref6 => {
|
|
188
|
+
let {
|
|
189
|
+
key,
|
|
190
|
+
size
|
|
191
|
+
} = _ref6;
|
|
196
192
|
columnSizes[key] = _constants.COLUMN_SIZES[size] || _constants.COLUMN_SIZES.medium;
|
|
197
193
|
});
|
|
198
194
|
columnSizes.leftColumnsSize = 'auto';
|
|
@@ -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,35 +9,27 @@ var _propTypes = require("prop-types");
|
|
|
10
9
|
var _UTTooltip = _interopRequireDefault(require("../../../UTTooltip"));
|
|
11
10
|
var _commonTypes = require("../../../../types/commonTypes");
|
|
12
11
|
var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
|
|
13
|
-
var _excluded = ["children", "buttonRef", "className", "isDisabled", "onClick", "tooltip", "tooltipProps"];
|
|
14
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
|
-
function _getRequireWildcardCache(
|
|
16
|
-
function _interopRequireWildcard(
|
|
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; }
|
|
17
15
|
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); }
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
var tippyProps = _objectSpread({
|
|
36
|
-
appendTo: function appendTo() {
|
|
37
|
-
return document.body;
|
|
38
|
-
},
|
|
39
|
-
interactive: false
|
|
40
|
-
}, tooltipProps);
|
|
41
|
-
var handleClick = function handleClick(event) {
|
|
16
|
+
const TooltipTab = _ref => {
|
|
17
|
+
let {
|
|
18
|
+
children,
|
|
19
|
+
buttonRef,
|
|
20
|
+
className,
|
|
21
|
+
isDisabled,
|
|
22
|
+
onClick,
|
|
23
|
+
tooltip,
|
|
24
|
+
tooltipProps = {},
|
|
25
|
+
...props
|
|
26
|
+
} = _ref;
|
|
27
|
+
const tippyProps = {
|
|
28
|
+
appendTo: () => document.body,
|
|
29
|
+
interactive: false,
|
|
30
|
+
...tooltipProps
|
|
31
|
+
};
|
|
32
|
+
const handleClick = event => {
|
|
42
33
|
if (!isDisabled) onClick(event);
|
|
43
34
|
};
|
|
44
35
|
return /*#__PURE__*/_react.default.createElement(_UTTooltip.default, {
|
|
@@ -58,5 +49,4 @@ TooltipTab.propTypes = {
|
|
|
58
49
|
tooltip: _propTypes.string,
|
|
59
50
|
tooltipProps: _propTypes.object
|
|
60
51
|
};
|
|
61
|
-
var _default = /*#__PURE__*/(0, _react.memo)(TooltipTab);
|
|
62
|
-
exports.default = _default;
|
|
52
|
+
var _default = exports.default = /*#__PURE__*/(0, _react.memo)(TooltipTab);
|
|
@@ -4,17 +4,13 @@ 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
|
+
const DEFAULT_TABS_PROPS = exports.DEFAULT_TABS_PROPS = {
|
|
8
8
|
variant: 'fullWidth',
|
|
9
9
|
orientation: 'horizontal'
|
|
10
10
|
};
|
|
11
|
-
exports.
|
|
12
|
-
var variants = {
|
|
11
|
+
const variants = exports.variants = {
|
|
13
12
|
BASE: 'base',
|
|
14
13
|
SECONDARY: 'secondary'
|
|
15
14
|
};
|
|
16
|
-
exports.
|
|
17
|
-
|
|
18
|
-
exports.DEFAULT_VARIANT = DEFAULT_VARIANT;
|
|
19
|
-
var DEFAULT_TAB_COMPONENT = 'button';
|
|
20
|
-
exports.DEFAULT_TAB_COMPONENT = DEFAULT_TAB_COMPONENT;
|
|
15
|
+
const DEFAULT_VARIANT = exports.DEFAULT_VARIANT = variants.BASE;
|
|
16
|
+
const DEFAULT_TAB_COMPONENT = exports.DEFAULT_TAB_COMPONENT = 'button';
|
|
@@ -17,95 +17,67 @@ 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(
|
|
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); }
|
|
20
|
+
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); }
|
|
21
|
+
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; }
|
|
23
22
|
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); }
|
|
34
23
|
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; }
|
|
35
|
-
function _toPropertyKey(
|
|
36
|
-
function _toPrimitive(
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
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;
|
|
24
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : String(i); }
|
|
25
|
+
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
26
|
+
class UTTabs extends _react.PureComponent {
|
|
27
|
+
constructor() {
|
|
28
|
+
super(...arguments);
|
|
29
|
+
_defineProperty(this, "handleChange", (_, value) => this.props.onChange(value));
|
|
51
30
|
}
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
31
|
+
render() {
|
|
32
|
+
const {
|
|
33
|
+
badges,
|
|
34
|
+
classes: themeClasses,
|
|
35
|
+
classNames,
|
|
36
|
+
options,
|
|
37
|
+
tabProps,
|
|
38
|
+
tabsProps,
|
|
39
|
+
tabTooltipProps,
|
|
40
|
+
variant
|
|
41
|
+
} = this.props;
|
|
42
|
+
const classes = (0, _classesUtils.mergeClasses)(themeClasses, classNames);
|
|
43
|
+
const styles = (0, _utils.retrieveClassNamesFromVariants)(variant, classes);
|
|
44
|
+
return /*#__PURE__*/_react.default.createElement(_Tabs.default, _extends({
|
|
45
|
+
value: this.props.value,
|
|
46
|
+
onChange: this.handleChange,
|
|
47
|
+
classes: {
|
|
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({
|
|
69
63
|
classes: {
|
|
70
|
-
root: "".concat(styles.
|
|
71
|
-
|
|
64
|
+
root: "".concat(styles.tabRoot, " ").concat(classes.tabRoot),
|
|
65
|
+
selected: "".concat(styles.selected, " ").concat(classes.selected),
|
|
66
|
+
textColorPrimary: "".concat(styles.textColorPrimary, " ").concat(classes.textColorPrimary),
|
|
67
|
+
wrapper: "".concat(styles.label, " ").concat(classes.label)
|
|
72
68
|
},
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
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);
|
|
69
|
+
key: opt.value,
|
|
70
|
+
value: opt.value,
|
|
71
|
+
label: opt.label,
|
|
72
|
+
disabled: opt.disabled,
|
|
73
|
+
icon: opt.icon,
|
|
74
|
+
component: tabComponent
|
|
75
|
+
}, tabProps));
|
|
76
|
+
}), !(0, _array.isEmpty)(badges) && badges.map(badge => /*#__PURE__*/_react.default.createElement("div", {
|
|
77
|
+
className: "".concat(badge.styles, " ").concat(!badge.show && _stylesModule.default.hiddenBadge)
|
|
78
|
+
})));
|
|
79
|
+
}
|
|
80
|
+
}
|
|
109
81
|
UTTabs.defaultProps = {
|
|
110
82
|
badges: [],
|
|
111
83
|
classes: {},
|
|
@@ -144,5 +116,4 @@ UTTabs.propTypes = {
|
|
|
144
116
|
tabTooltipProps: _propTypes.object,
|
|
145
117
|
value: (0, _propTypes.oneOfType)([_propTypes.string, _propTypes.number])
|
|
146
118
|
};
|
|
147
|
-
var _default = (0, _WithTheme.default)(_theme.retrieveStyle)(UTTabs);
|
|
148
|
-
exports.default = _default;
|
|
119
|
+
var _default = exports.default = (0, _WithTheme.default)(_theme.retrieveStyle)(UTTabs);
|
|
@@ -7,8 +7,10 @@ exports.retrieveStyle = void 0;
|
|
|
7
7
|
var _seamlessImmutable = require("seamless-immutable");
|
|
8
8
|
var _colorsModule = _interopRequireDefault(require("../../scss/variables/colors.module.scss"));
|
|
9
9
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
const retrieveStyle = _ref => {
|
|
11
|
+
let {
|
|
12
|
+
theme
|
|
13
|
+
} = _ref;
|
|
12
14
|
return {
|
|
13
15
|
baseTabsRoot: {
|
|
14
16
|
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
|
+
const retrieveClassNamesFromVariants = (variant, classes) => {
|
|
9
9
|
switch (variant) {
|
|
10
10
|
case _constants.variants.SECONDARY:
|
|
11
11
|
return {
|
|
@@ -4,10 +4,7 @@ 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
|
-
};
|
|
13
|
-
exports.tippyProps = tippyProps;
|
|
10
|
+
};
|
|
@@ -16,27 +16,28 @@ 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
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
icon
|
|
37
|
-
textarea
|
|
38
|
-
label
|
|
39
|
-
textAreaContainer
|
|
19
|
+
const UTTextArea = _ref => {
|
|
20
|
+
let {
|
|
21
|
+
classes,
|
|
22
|
+
classNames = {},
|
|
23
|
+
disabled,
|
|
24
|
+
HelpIcon,
|
|
25
|
+
inputProps = {},
|
|
26
|
+
onBlur,
|
|
27
|
+
onChange,
|
|
28
|
+
onFocus,
|
|
29
|
+
placeholder,
|
|
30
|
+
title = '',
|
|
31
|
+
tooltip,
|
|
32
|
+
value
|
|
33
|
+
} = _ref;
|
|
34
|
+
const {
|
|
35
|
+
container,
|
|
36
|
+
icon,
|
|
37
|
+
textarea,
|
|
38
|
+
label,
|
|
39
|
+
textAreaContainer
|
|
40
|
+
} = classNames;
|
|
40
41
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
41
42
|
className: container
|
|
42
43
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
@@ -81,5 +82,4 @@ UTTextArea.propTypes = {
|
|
|
81
82
|
tooltip: _propTypes.string,
|
|
82
83
|
value: _propTypes.string
|
|
83
84
|
};
|
|
84
|
-
var _default = (0, _WithTheme.default)(_theme.retrieveStyle)(UTTextArea);
|
|
85
|
-
exports.default = _default;
|
|
85
|
+
var _default = exports.default = (0, _WithTheme.default)(_theme.retrieveStyle)(UTTextArea);
|
|
@@ -6,9 +6,11 @@ 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
|
+
const 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
|
-
|
|
11
|
+
let {
|
|
12
|
+
theme
|
|
13
|
+
} = _ref;
|
|
12
14
|
return {
|
|
13
15
|
textarea: {
|
|
14
16
|
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,9 +4,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.INPUT_TYPES = void 0;
|
|
7
|
-
|
|
7
|
+
const INPUT_TYPES = exports.INPUT_TYPES = {
|
|
8
8
|
PASSWORD: 'password',
|
|
9
9
|
TEXT: 'text',
|
|
10
10
|
NUMBER: 'number'
|
|
11
|
-
};
|
|
12
|
-
exports.INPUT_TYPES = INPUT_TYPES;
|
|
11
|
+
};
|