@widergy/energy-ui 2.10.1 → 2.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/EnergyThemeProvider/index.js +12 -34
- package/dist/components/Loading/constants.js +1 -1
- package/dist/components/Loading/index.js +12 -10
- package/dist/components/Loading/theme.js +6 -3
- package/dist/components/UTAlert/AlertHandler.js +74 -99
- package/dist/components/UTAlert/index.js +64 -85
- package/dist/components/UTAlert/theme.js +34 -32
- package/dist/components/UTAttachment/components/Preview/index.js +7 -7
- package/dist/components/UTAttachment/constants.js +6 -6
- package/dist/components/UTAttachment/index.js +158 -248
- package/dist/components/UTAttachment/layout.js +25 -25
- package/dist/components/UTAttachment/theme.js +6 -3
- package/dist/components/UTAttachment/utils.js +44 -117
- package/dist/components/UTAutocomplete/components/ListBox/index.js +12 -19
- package/dist/components/UTAutocomplete/components/ListBox/utils.js +11 -12
- package/dist/components/UTAutocomplete/constants.js +11 -11
- package/dist/components/UTAutocomplete/index.js +53 -92
- package/dist/components/UTAutocomplete/theme.js +9 -5
- package/dist/components/UTAvatar/constants.js +1 -1
- package/dist/components/UTAvatar/index.js +17 -15
- package/dist/components/UTBarChart/components/Bars/components/Bar/components/Rect/index.js +21 -20
- package/dist/components/UTBarChart/components/Bars/components/Bar/constants.js +2 -1
- package/dist/components/UTBarChart/components/Bars/components/Bar/index.js +20 -20
- package/dist/components/UTBarChart/components/Bars/constants.js +3 -3
- package/dist/components/UTBarChart/components/Bars/index.js +69 -78
- package/dist/components/UTBarChart/components/Legend/constants.js +14 -17
- package/dist/components/UTBarChart/components/Legend/index.js +74 -91
- package/dist/components/UTBarChart/components/Legend/utils.js +2 -5
- package/dist/components/UTBarChart/components/Levels/index.js +15 -12
- package/dist/components/UTBarChart/components/Levels/utils.js +26 -27
- package/dist/components/UTBarChart/components/LinearPlot/constants.js +2 -2
- package/dist/components/UTBarChart/components/LinearPlot/index.js +24 -18
- package/dist/components/UTBarChart/components/LinearPlot/utils.js +39 -39
- package/dist/components/UTBarChart/components/Pagination/constants.js +1 -1
- package/dist/components/UTBarChart/components/Pagination/index.js +19 -22
- package/dist/components/UTBarChart/components/XAxis/components/AxisElement/index.js +20 -30
- package/dist/components/UTBarChart/components/XAxis/components/Decoration/constants.js +2 -2
- package/dist/components/UTBarChart/components/XAxis/components/Decoration/index.js +19 -17
- package/dist/components/UTBarChart/components/XAxis/constants.js +1 -1
- package/dist/components/UTBarChart/components/XAxis/index.js +53 -63
- package/dist/components/UTBarChart/components/YAxis/AxisElement/index.js +11 -9
- package/dist/components/UTBarChart/components/YAxis/constants.js +1 -1
- package/dist/components/UTBarChart/components/YAxis/index.js +29 -35
- package/dist/components/UTBarChart/components/YAxis/utils.js +6 -6
- package/dist/components/UTBarChart/constants.js +4 -4
- package/dist/components/UTBarChart/hooks/use-dynamic-margins.js +22 -38
- package/dist/components/UTBarChart/index.js +151 -164
- package/dist/components/UTBarChart/theme.js +6 -3
- package/dist/components/UTBarChart/types.js +9 -9
- package/dist/components/UTBarChart/utils.js +118 -111
- package/dist/components/UTBreadcrumbs/constants.js +22 -24
- package/dist/components/UTBreadcrumbs/index.js +75 -99
- package/dist/components/UTBreadcrumbs/theme.js +6 -3
- package/dist/components/UTButton/constants.js +11 -11
- package/dist/components/UTButton/index.js +27 -29
- package/dist/components/UTButton/theme.js +26 -24
- package/dist/components/UTCBUInput/index.js +35 -38
- package/dist/components/UTCBUInput/theme.js +6 -3
- package/dist/components/UTCaptcha/index.js +18 -43
- package/dist/components/UTCard/components/UTCardFooter/index.js +14 -14
- package/dist/components/UTCard/index.js +84 -118
- package/dist/components/UTCard/theme.js +13 -13
- package/dist/components/UTCard/types.js +1 -1
- package/dist/components/UTCarousel/components/Button/index.js +12 -11
- package/dist/components/UTCarousel/components/Legend/index.js +12 -13
- package/dist/components/UTCarousel/components/Slider/component/Slide/index.js +15 -14
- package/dist/components/UTCarousel/components/Slider/constants.js +5 -5
- package/dist/components/UTCarousel/components/Slider/index.js +203 -271
- package/dist/components/UTCarousel/components/Slider/layout.js +66 -92
- package/dist/components/UTCarousel/index.js +13 -13
- package/dist/components/UTCarousel/theme.js +6 -3
- package/dist/components/UTCheckList/constants.js +1 -1
- package/dist/components/UTCheckList/index.js +71 -91
- package/dist/components/UTCheckList/theme.js +34 -32
- package/dist/components/UTCheckbox/constants.js +2 -4
- package/dist/components/UTCheckbox/index.js +31 -42
- package/dist/components/UTCheckbox/theme.js +37 -35
- package/dist/components/UTConsumptionBar/components/ConsumptionBarIndicator/index.js +8 -7
- package/dist/components/UTConsumptionBar/constants.js +3 -3
- package/dist/components/UTConsumptionBar/index.js +52 -78
- package/dist/components/UTCuit/index.js +108 -131
- package/dist/components/UTCuit/theme.js +52 -53
- package/dist/components/UTDatePicker/components/Day/constants.js +1 -1
- package/dist/components/UTDatePicker/components/Day/index.js +11 -10
- package/dist/components/UTDatePicker/constants.js +21 -22
- package/dist/components/UTDatePicker/index.js +59 -100
- package/dist/components/UTDatePicker/theme.js +8 -4
- package/dist/components/UTDatePicker/types.js +1 -1
- package/dist/components/UTDatePicker/utils.js +4 -6
- package/dist/components/UTDialog/constants.js +2 -2
- package/dist/components/UTDialog/index.js +37 -35
- package/dist/components/UTDialog/theme.js +6 -3
- package/dist/components/UTDialog/types.js +1 -1
- package/dist/components/UTDotMenu/index.js +38 -59
- package/dist/components/UTEmojiPicker/constants.js +5 -5
- package/dist/components/UTEmojiPicker/index.js +44 -63
- package/dist/components/UTEmojiPicker/theme.js +6 -3
- package/dist/components/UTEmojiPicker/utils.js +24 -52
- package/dist/components/UTExternalLink/constants.js +2 -2
- package/dist/components/UTExternalLink/index.js +17 -13
- package/dist/components/UTExternalLink/theme.js +11 -7
- package/dist/components/UTFileInput/constants.js +2 -2
- package/dist/components/UTFileInput/index.js +6 -29
- package/dist/components/UTFileInput/layout.js +67 -95
- package/dist/components/UTIconButton/index.js +48 -70
- package/dist/components/UTIconButton/theme.js +6 -3
- package/dist/components/UTImageRadio/components/ImageRadioCard/index.js +52 -56
- package/dist/components/UTImageRadio/constants.js +3 -3
- package/dist/components/UTImageRadio/index.js +38 -45
- package/dist/components/UTImageRadio/theme.js +13 -13
- package/dist/components/UTImageRadio/types.js +1 -1
- package/dist/components/UTImageRadio/utils.js +4 -6
- package/dist/components/UTLabel/constants.js +13 -11
- package/dist/components/UTLabel/index.js +17 -18
- package/dist/components/UTLabel/theme.js +19 -16
- package/dist/components/UTList/index.js +14 -16
- package/dist/components/UTLoading/index.js +14 -13
- package/dist/components/UTMap/components/GoogleMaps/constants.js +9 -10
- package/dist/components/UTMap/components/GoogleMaps/index.js +62 -89
- package/dist/components/UTMap/constants.js +6 -6
- package/dist/components/UTMap/index.js +162 -196
- package/dist/components/UTMap/types.js +4 -3
- package/dist/components/UTMap/utils.js +35 -46
- package/dist/components/UTMap/withGoogleMapScript.js +18 -14
- package/dist/components/UTMenu/index.js +51 -67
- package/dist/components/UTMenu/theme.js +8 -4
- package/dist/components/UTMenu/utils.js +10 -12
- package/dist/components/UTModal/constants.js +9 -9
- package/dist/components/UTModal/index.js +25 -28
- package/dist/components/UTModal/theme.js +6 -3
- package/dist/components/UTPagination/components/PageSizeSelector/index.js +10 -8
- package/dist/components/UTPagination/components/PageSizeSelector/utils.js +9 -14
- package/dist/components/UTPagination/components/Pagination/components/NavigationButton/index.js +11 -10
- package/dist/components/UTPagination/components/Pagination/index.js +27 -37
- package/dist/components/UTPagination/components/Pagination/utils.js +10 -15
- package/dist/components/UTPagination/constants.js +3 -3
- package/dist/components/UTPagination/index.js +15 -15
- package/dist/components/UTPagination/theme.js +6 -3
- package/dist/components/UTPanel/index.js +37 -42
- package/dist/components/UTPasswordField/components/PasswordValidations/components/Error/index.js +12 -8
- package/dist/components/UTPasswordField/components/PasswordValidations/components/Validation/index.js +21 -17
- package/dist/components/UTPasswordField/components/PasswordValidations/index.js +62 -48
- package/dist/components/UTPasswordField/components/PasswordWarning/index.js +24 -24
- package/dist/components/UTPasswordField/index.js +25 -21
- package/dist/components/UTPasswordField/theme.js +6 -3
- package/dist/components/UTPhoneInput/constants.js +3 -3
- package/dist/components/UTPhoneInput/index.js +179 -203
- package/dist/components/UTPhoneInput/theme.js +79 -77
- package/dist/components/UTPieChart/components/ArrowLabel/constants.js +4 -4
- package/dist/components/UTPieChart/components/ArrowLabel/index.js +23 -21
- package/dist/components/UTPieChart/components/Legend/contants.js +3 -3
- package/dist/components/UTPieChart/components/Legend/index.js +26 -22
- package/dist/components/UTPieChart/constants.js +13 -13
- package/dist/components/UTPieChart/hooks/use-animated-value/index.js +14 -31
- package/dist/components/UTPieChart/index.js +72 -74
- package/dist/components/UTPieChart/theme.js +6 -3
- package/dist/components/UTPieChart/utils.js +6 -3
- package/dist/components/UTProgressBar/constants.js +2 -2
- package/dist/components/UTProgressBar/index.js +14 -15
- package/dist/components/UTProgressBar/theme.js +6 -3
- package/dist/components/UTProgressBar/types.js +1 -1
- package/dist/components/UTRadioGroup/index.js +55 -81
- package/dist/components/UTRadioGroup/theme.js +54 -52
- package/dist/components/UTRating/components/Circle/index.js +40 -54
- package/dist/components/UTRating/components/Faces/assets/mood-confuzed.svg +3 -0
- package/dist/components/UTRating/components/Faces/assets/mood-empty.svg +3 -0
- package/dist/components/UTRating/components/Faces/assets/mood-happy.svg +3 -0
- package/dist/components/UTRating/components/Faces/assets/mood-sad.svg +3 -0
- package/dist/components/UTRating/components/Faces/assets/mood-smile.svg +3 -0
- package/dist/components/UTRating/components/Faces/constants.js +85 -0
- package/dist/components/UTRating/components/Faces/index.js +76 -0
- package/dist/components/UTRating/components/Faces/styles.module.scss +78 -0
- package/dist/components/UTRating/components/Star/index.js +35 -38
- package/dist/components/UTRating/constants.js +5 -4
- package/dist/components/UTRating/index.js +35 -46
- package/dist/components/UTRating/styles.module.scss +1 -0
- package/dist/components/UTRating/theme.js +52 -3
- package/dist/components/UTRipple/Ripple.js +21 -37
- package/dist/components/UTRipple/index.js +17 -35
- package/dist/components/UTSelect/components/Option/index.js +12 -11
- package/dist/components/UTSelect/constants.js +4 -4
- package/dist/components/UTSelect/index.js +62 -83
- package/dist/components/UTSelect/theme.js +9 -5
- package/dist/components/UTSelect/utils.js +5 -14
- package/dist/components/UTSidebar/components/ListOption/index.js +33 -47
- package/dist/components/UTSidebar/components/LogosContainer/components/DynamicIcon/index.js +7 -6
- package/dist/components/UTSidebar/components/LogosContainer/index.js +13 -12
- package/dist/components/UTSidebar/components/Option/constants.js +1 -1
- package/dist/components/UTSidebar/components/Option/index.js +27 -30
- package/dist/components/UTSidebar/components/Toggler/index.js +10 -9
- package/dist/components/UTSidebar/index.js +41 -51
- package/dist/components/UTSidebar/theme.js +6 -3
- package/dist/components/UTSidebar/types.js +5 -5
- package/dist/components/UTSkeleton/index.js +9 -34
- package/dist/components/UTStatus/constants.js +4 -4
- package/dist/components/UTStatus/index.js +15 -13
- package/dist/components/UTStatus/theme.js +70 -49
- package/dist/components/UTSwitch/constants.js +3 -3
- package/dist/components/UTSwitch/index.js +41 -55
- package/dist/components/UTSwitch/theme.js +6 -3
- package/dist/components/UTTable/components/ActionIcons/constants.js +1 -1
- package/dist/components/UTTable/components/ActionIcons/index.js +46 -83
- package/dist/components/UTTable/components/Cell/components/ActionButton/index.js +9 -10
- package/dist/components/UTTable/components/Cell/index.js +17 -21
- package/dist/components/UTTable/components/HeaderCell/constants.js +1 -1
- package/dist/components/UTTable/components/HeaderCell/index.js +22 -28
- package/dist/components/UTTable/components/HeaderCell/utils.js +5 -4
- package/dist/components/UTTable/components/PrimaryAction/index.js +11 -9
- package/dist/components/UTTable/components/ResponsiveCell/index.js +18 -18
- package/dist/components/UTTable/components/Status/index.js +17 -17
- package/dist/components/UTTable/components/TableFooter/components/PageSizeSelector/index.js +9 -7
- package/dist/components/UTTable/components/TableFooter/components/PageSizeSelector/utils.js +9 -14
- package/dist/components/UTTable/components/TableFooter/components/Pagination/components/NavigationButton/index.js +11 -10
- package/dist/components/UTTable/components/TableFooter/components/Pagination/index.js +20 -30
- package/dist/components/UTTable/components/TableFooter/components/Pagination/utils.js +10 -15
- package/dist/components/UTTable/components/TableFooter/constants.js +1 -1
- package/dist/components/UTTable/components/TableFooter/index.js +14 -13
- package/dist/components/UTTable/components/TableHeader/index.js +10 -9
- package/dist/components/UTTable/components/TableRow/constants.js +2 -4
- package/dist/components/UTTable/components/TableRow/index.js +78 -92
- package/dist/components/UTTable/constants.js +26 -24
- package/dist/components/UTTable/hook.js +13 -27
- package/dist/components/UTTable/index.js +125 -213
- package/dist/components/UTTable/theme.js +19 -18
- package/dist/components/UTTable/types.js +4 -4
- package/dist/components/UTTable/utils.js +80 -75
- package/dist/components/UTTabs/components/TooltipTab/index.js +19 -28
- package/dist/components/UTTabs/constants.js +4 -4
- package/dist/components/UTTabs/index.js +56 -84
- package/dist/components/UTTabs/theme.js +6 -3
- package/dist/components/UTTabs/utils.js +3 -2
- package/dist/components/UTTextArea/constants.js +2 -4
- package/dist/components/UTTextArea/index.js +22 -21
- package/dist/components/UTTextArea/theme.js +6 -3
- package/dist/components/UTTextInput/constants.js +1 -1
- package/dist/components/UTTextInput/index.js +136 -163
- package/dist/components/UTTextInput/theme.js +9 -5
- package/dist/components/UTThirdPartyCookieChecker/index.js +16 -19
- package/dist/components/UTToggle/components/ToggleOption/index.js +15 -15
- package/dist/components/UTToggle/index.js +24 -24
- package/dist/components/UTToggle/theme.js +6 -3
- package/dist/components/UTTooltip/index.js +22 -28
- package/dist/components/UTTooltip/theme.js +6 -3
- package/dist/components/UTTopbar/components/Notifications/index.js +10 -12
- package/dist/components/UTTopbar/components/UserMenu/index.js +14 -13
- package/dist/components/UTTopbar/index.js +27 -29
- package/dist/components/UTTopbar/theme.js +6 -3
- package/dist/components/UTTopbar/types.js +4 -4
- package/dist/components/UTTouchableWithoutFeedback/index.js +13 -25
- package/dist/components/UTVirtualizedList/components/VirtualizedData/components/ListRow/constants.js +2 -2
- package/dist/components/UTVirtualizedList/components/VirtualizedData/components/ListRow/index.js +33 -29
- package/dist/components/UTVirtualizedList/components/VirtualizedData/components/ListRow/utils.js +6 -5
- package/dist/components/UTVirtualizedList/components/VirtualizedData/constants.js +6 -6
- package/dist/components/UTVirtualizedList/components/VirtualizedData/hooks/use-ledger.js +7 -16
- package/dist/components/UTVirtualizedList/components/VirtualizedData/hooks/use-virtualized-data.js +22 -45
- package/dist/components/UTVirtualizedList/components/VirtualizedData/index.js +30 -32
- package/dist/components/UTVirtualizedList/components/VirtualizedData/utils.js +89 -94
- package/dist/components/UTVirtualizedList/constants.js +4 -4
- package/dist/components/UTVirtualizedList/index.js +25 -36
- package/dist/components/UTWorkflowContainer/components/ActionButton/index.js +14 -17
- package/dist/components/UTWorkflowContainer/constants.js +3 -3
- package/dist/components/UTWorkflowContainer/hooks/use-previous.js +5 -4
- package/dist/components/UTWorkflowContainer/index.js +31 -49
- package/dist/components/UTWorkflowContainer/theme.js +62 -54
- package/dist/components/UTWorkflowContainer/types.js +1 -1
- package/dist/components/WithLoading/index.js +9 -13
- package/dist/components/WithTheme/index.js +9 -15
- package/dist/components/WithTheme/layout.js +21 -26
- package/dist/components/WithTouch/index.js +11 -17
- package/dist/constants/UTTable.js +1 -1
- package/dist/index.js +58 -58
- package/dist/theme.js +8 -4
- package/dist/types/commonTypes.js +2 -2
- package/dist/types/consumptionTypes.js +2 -2
- package/dist/types/formTypes.js +3 -3
- package/dist/types/tableTypes.js +1 -1
- package/dist/utils/classesUtils.js +7 -13
- package/dist/utils/componentUtils.js +8 -10
- package/dist/utils/helperFunctions.js +6 -5
- package/dist/utils/shadowUtils.js +15 -12
- package/dist/utils/useScreenSize.js +1 -1
- package/package.json +2 -2
- package/CHANGELOG.md +0 -2234
|
@@ -8,14 +8,12 @@ var _seamlessImmutable = require("seamless-immutable");
|
|
|
8
8
|
var _colorsModule = _interopRequireDefault(require("../../scss/variables/colors.module.scss"));
|
|
9
9
|
var _classesUtils = require("../../utils/classesUtils");
|
|
10
10
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
var theme = _ref.theme;
|
|
18
|
-
var tabletMobile = (0, _seamlessImmutable.getIn)(theme, ['Media', 'tabletMobile']);
|
|
11
|
+
const retrieveStyle = _ref => {
|
|
12
|
+
var _theme$UTTable, _theme$UTTable2, _theme$UTTable3, _theme$UTTable4, _theme$UTTable5, _theme$UTTable6, _theme$UTTable7, _theme$UTTable8, _theme$UTTable9, _theme$UTTable10, _theme$UTTable11, _theme$UTTable12, _theme$UTTable13, _theme$UTTable14, _theme$UTTable15, _theme$UTTable16, _theme$UTTable17, _theme$UTTable18, _theme$UTTable19, _theme$UTTable20, _theme$UTTable21, _theme$UTTable22, _theme$UTTable23, _theme$UTTable24, _theme$UTTable25, _theme$UTTable26, _theme$UTTable27;
|
|
13
|
+
let {
|
|
14
|
+
theme
|
|
15
|
+
} = _ref;
|
|
16
|
+
const tabletMobile = (0, _seamlessImmutable.getIn)(theme, ['Media', 'tabletMobile']);
|
|
19
17
|
return {
|
|
20
18
|
table: {
|
|
21
19
|
fontFamily: (0, _seamlessImmutable.getIn)(theme, ['UTTable', 'table', 'fontFamily'], (0, _seamlessImmutable.getIn)(theme, ['Fonts', 'fontFamily']))
|
|
@@ -121,20 +119,22 @@ var retrieveStyle = exports.retrieveStyle = function retrieveStyle(_ref) {
|
|
|
121
119
|
fontSize: (0, _seamlessImmutable.getIn)(theme, ['UTTable', 'rowCell', 'fontSize'], (0, _seamlessImmutable.getIn)(theme, ['Fonts', 'medium'])),
|
|
122
120
|
fontWeight: (0, _seamlessImmutable.getIn)(theme, ['UTTable', 'rowCell', 'fontWeight'])
|
|
123
121
|
},
|
|
124
|
-
responsiveCell:
|
|
122
|
+
responsiveCell: {
|
|
125
123
|
borderColor: (0, _seamlessImmutable.getIn)(theme, ['UTTable', 'rowCell', 'borderColor']),
|
|
126
124
|
borderStyle: (0, _seamlessImmutable.getIn)(theme, ['UTTable', 'rowCell', 'borderStyle'], 'solid'),
|
|
127
125
|
borderWidth: (0, _seamlessImmutable.getIn)(theme, ['UTTable', 'rowCell', 'borderWidth'], '1px'),
|
|
128
126
|
color: (0, _seamlessImmutable.getIn)(theme, ['UTTable', 'rowCell', 'color']),
|
|
129
127
|
fontSize: (0, _seamlessImmutable.getIn)(theme, ['UTTable', 'rowCell', 'fontSize'], (0, _seamlessImmutable.getIn)(theme, ['Fonts', 'medium'])),
|
|
130
|
-
fontWeight: (0, _seamlessImmutable.getIn)(theme, ['UTTable', 'rowCell', 'fontWeight'])
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
128
|
+
fontWeight: (0, _seamlessImmutable.getIn)(theme, ['UTTable', 'rowCell', 'fontWeight']),
|
|
129
|
+
[tabletMobile]: {
|
|
130
|
+
fontSize: (0, _seamlessImmutable.getIn)(theme, ['UTTable', 'rowCell', 'tabletMobile', 'fontSize']),
|
|
131
|
+
fontWeight: (0, _seamlessImmutable.getIn)(theme, ['UTTable', 'rowCell', 'tabletMobile', 'fontWeight'])
|
|
132
|
+
},
|
|
133
|
+
'&:first-child': {
|
|
134
|
+
borderTopLeftRadius: (0, _classesUtils.withImportant)(theme === null || theme === void 0 || (_theme$UTTable11 = theme.UTTable) === null || _theme$UTTable11 === void 0 || (_theme$UTTable11 = _theme$UTTable11.responsiveRow) === null || _theme$UTTable11 === void 0 ? void 0 : _theme$UTTable11.borderRadius),
|
|
135
|
+
borderTopRightRadius: (0, _classesUtils.withImportant)(theme === null || theme === void 0 || (_theme$UTTable12 = theme.UTTable) === null || _theme$UTTable12 === void 0 || (_theme$UTTable12 = _theme$UTTable12.responsiveRow) === null || _theme$UTTable12 === void 0 ? void 0 : _theme$UTTable12.borderRadius)
|
|
136
|
+
}
|
|
137
|
+
},
|
|
138
138
|
lastCellContainer: {
|
|
139
139
|
borderBottomRightRadius: (0, _seamlessImmutable.getIn)(theme, ['UTTable', 'responsiveRow', 'borderRadius']),
|
|
140
140
|
borderBottomLeftRadius: (0, _seamlessImmutable.getIn)(theme, ['UTTable', 'responsiveRow', 'borderRadius'])
|
|
@@ -361,4 +361,5 @@ var retrieveStyle = exports.retrieveStyle = function retrieveStyle(_ref) {
|
|
|
361
361
|
}
|
|
362
362
|
}
|
|
363
363
|
};
|
|
364
|
-
};
|
|
364
|
+
};
|
|
365
|
+
exports.retrieveStyle = retrieveStyle;
|
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.columnsType = exports.columnType = exports.columnSizesType = exports.classesType = void 0;
|
|
7
7
|
var _propTypes = require("prop-types");
|
|
8
|
-
|
|
8
|
+
const columnType = exports.columnType = (0, _propTypes.shape)({
|
|
9
9
|
cellRenderer: _propTypes.func,
|
|
10
10
|
key: _propTypes.string,
|
|
11
11
|
name: _propTypes.string,
|
|
@@ -21,8 +21,8 @@ var columnType = exports.columnType = (0, _propTypes.shape)({
|
|
|
21
21
|
loading: _propTypes.bool
|
|
22
22
|
}))
|
|
23
23
|
});
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
const columnsType = exports.columnsType = (0, _propTypes.arrayOf)(columnType);
|
|
25
|
+
const classesType = exports.classesType = (0, _propTypes.shape)({
|
|
26
26
|
table: _propTypes.string,
|
|
27
27
|
header: _propTypes.string,
|
|
28
28
|
headerCellHover: _propTypes.string,
|
|
@@ -47,4 +47,4 @@ var classesType = exports.classesType = (0, _propTypes.shape)({
|
|
|
47
47
|
checkBoxRoot: _propTypes.string,
|
|
48
48
|
checkboxColorPrimary: _propTypes.string
|
|
49
49
|
});
|
|
50
|
-
|
|
50
|
+
const columnSizesType = exports.columnSizesType = (0, _propTypes.oneOfType)([(0, _propTypes.objectOf)(_propTypes.string), (0, _propTypes.objectOf)(_propTypes.number), _propTypes.object]);
|
|
@@ -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,50 +32,54 @@ var getColumnDefinition = exports.getColumnDefinition = function getColumnDefini
|
|
|
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
|
-
|
|
49
|
-
|
|
50
|
-
|
|
42
|
+
exports.getColumnDefinition = getColumnDefinition;
|
|
43
|
+
const customSort = (a, b, order) => {
|
|
44
|
+
const firstValue = a[order.key] || '';
|
|
45
|
+
const secondValue = b[order.key] || '';
|
|
51
46
|
if (firstValue < secondValue) return order.direction === 'asc' ? -1 : 1;
|
|
52
47
|
if (firstValue > secondValue) return order.direction === 'asc' ? 1 : -1;
|
|
53
48
|
return 0;
|
|
54
49
|
};
|
|
55
|
-
|
|
50
|
+
exports.customSort = customSort;
|
|
51
|
+
const orderRows = (rows, order, defaultRows, columns) => {
|
|
56
52
|
if ((0, _object.objectIsEmpty)(order)) return defaultRows;
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
53
|
+
const ordererRows = [...rows];
|
|
54
|
+
const sortFunction = columns.find(_ref => {
|
|
55
|
+
let {
|
|
56
|
+
key
|
|
57
|
+
} = _ref;
|
|
60
58
|
return key === order.key;
|
|
61
59
|
}).customSort || customSort;
|
|
62
|
-
ordererRows.sort(
|
|
63
|
-
return sortFunction(a, b, order);
|
|
64
|
-
});
|
|
60
|
+
ordererRows.sort((a, b) => sortFunction(a, b, order));
|
|
65
61
|
return ordererRows;
|
|
66
62
|
};
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
63
|
+
exports.orderRows = orderRows;
|
|
64
|
+
const getCurrentRows = (rows, currentPage, rowsPerPage) => {
|
|
65
|
+
const initialIndex = currentPage * rowsPerPage;
|
|
66
|
+
const lastIndex = (currentPage + 1) * rowsPerPage;
|
|
70
67
|
return rows.slice(initialIndex, lastIndex);
|
|
71
68
|
};
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
69
|
+
exports.getCurrentRows = getCurrentRows;
|
|
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;
|
|
77
75
|
return {
|
|
78
76
|
fixedRowsLeft: {
|
|
79
|
-
borderRadius
|
|
77
|
+
borderRadius,
|
|
80
78
|
borderWidth: "".concat(_constants.ROWS_BORDER_SIZE, "px"),
|
|
81
79
|
paddingLeft: _constants.CELL_SIDE_PADDING
|
|
82
80
|
},
|
|
83
81
|
fixedRowsRight: {
|
|
84
|
-
borderRadius
|
|
82
|
+
borderRadius,
|
|
85
83
|
borderWidth: "".concat(_constants.ROWS_BORDER_SIZE, "px"),
|
|
86
84
|
paddingRight: _constants.CELL_SIDE_PADDING
|
|
87
85
|
},
|
|
@@ -111,7 +109,7 @@ var createRowStyles = exports.createRowStyles = function createRowStyles(rowPadd
|
|
|
111
109
|
paddingTop: headerPaddingValue
|
|
112
110
|
},
|
|
113
111
|
rowBackground: {
|
|
114
|
-
borderRadius
|
|
112
|
+
borderRadius,
|
|
115
113
|
borderBottomWidth: "".concat(_constants.ROWS_BORDER_SIZE, "px"),
|
|
116
114
|
borderTopWidth: "".concat(_constants.ROWS_BORDER_SIZE, "px"),
|
|
117
115
|
borderLeftWidth: 0,
|
|
@@ -135,56 +133,62 @@ var createRowStyles = exports.createRowStyles = function createRowStyles(rowPadd
|
|
|
135
133
|
}
|
|
136
134
|
};
|
|
137
135
|
};
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
return _row[rowKey];
|
|
143
|
-
});
|
|
144
|
-
};
|
|
145
|
-
var getInitialValidRowsPerPage = exports.getInitialValidRowsPerPage = function getInitialValidRowsPerPage(externalOption, originalOptions, data) {
|
|
136
|
+
exports.createRowStyles = createRowStyles;
|
|
137
|
+
const getSelectableRowIds = (rows, rowKey, disableRowSelection) => (disableRowSelection ? rows.filter(_row => !disableRowSelection(_row)) : rows).map(_row => _row[rowKey]);
|
|
138
|
+
exports.getSelectableRowIds = getSelectableRowIds;
|
|
139
|
+
const getInitialValidRowsPerPage = (externalOption, originalOptions, data) => {
|
|
146
140
|
if (externalOption === undefined) return originalOptions[0];
|
|
147
|
-
|
|
148
|
-
|
|
141
|
+
const options = (0, _utils.getPageSizeOptions)(originalOptions, data.length).map(_ref2 => {
|
|
142
|
+
let {
|
|
143
|
+
value
|
|
144
|
+
} = _ref2;
|
|
149
145
|
return value;
|
|
150
146
|
});
|
|
151
147
|
return options.includes(externalOption) ? externalOption : options[0];
|
|
152
148
|
};
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
149
|
+
exports.getInitialValidRowsPerPage = getInitialValidRowsPerPage;
|
|
150
|
+
const getInitialValidPage = (externalPage, rowsPerPage, data, integrationType) => integrationType === _UTTable.INTEGRATION_TYPES.EXTERNAL ? externalPage : externalPage === undefined || Math.floor(data.length / rowsPerPage) < externalPage ? 0 : externalPage;
|
|
151
|
+
exports.getInitialValidPage = getInitialValidPage;
|
|
152
|
+
const getColumnsSizes = _ref3 => {
|
|
153
|
+
let {
|
|
154
|
+
columns,
|
|
155
|
+
fitColumnsWidth,
|
|
156
|
+
selectable
|
|
157
|
+
} = _ref3;
|
|
158
|
+
const columnSizes = {};
|
|
161
159
|
if (fitColumnsWidth) {
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
columns.forEach(
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
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;
|
|
170
170
|
columnsFullSize += columnSize;
|
|
171
171
|
if (position === _constants.COLUMN_POSITION.LEFT) leftColumnsSize += columnSize;else if (position === _constants.COLUMN_POSITION.RIGHT) rightColumnsSize += columnSize;else secondaryColumnsSize += columnSize;
|
|
172
172
|
});
|
|
173
|
-
columns.forEach(
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
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);
|
|
179
181
|
columnSizes[key] = "".concat(finalSize, "%");
|
|
180
182
|
});
|
|
181
183
|
columnSizes.leftColumnsSize = "".concat(leftColumnsSize * 100 / columnsFullSize, "%");
|
|
182
184
|
columnSizes.secondaryColumnsSize = "".concat(secondaryColumnsSize * 100 / columnsFullSize, "%");
|
|
183
185
|
columnSizes.rightColumnsSize = "".concat(rightColumnsSize * 100 / columnsFullSize, "%");
|
|
184
186
|
} else {
|
|
185
|
-
columns.forEach(
|
|
186
|
-
|
|
187
|
-
|
|
187
|
+
columns.forEach(_ref6 => {
|
|
188
|
+
let {
|
|
189
|
+
key,
|
|
190
|
+
size
|
|
191
|
+
} = _ref6;
|
|
188
192
|
columnSizes[key] = _constants.COLUMN_SIZES[size] || _constants.COLUMN_SIZES.medium;
|
|
189
193
|
});
|
|
190
194
|
columnSizes.leftColumnsSize = 'auto';
|
|
@@ -192,4 +196,5 @@ var getColumnsSizes = exports.getColumnsSizes = function getColumnsSizes(_ref3)
|
|
|
192
196
|
columnSizes.rightColumnsSize = 'auto';
|
|
193
197
|
}
|
|
194
198
|
return columnSizes;
|
|
195
|
-
};
|
|
199
|
+
};
|
|
200
|
+
exports.getColumnsSizes = getColumnsSizes;
|
|
@@ -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(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function
|
|
16
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" !=
|
|
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, {
|
|
@@ -4,13 +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
|
-
|
|
11
|
+
const variants = exports.variants = {
|
|
12
12
|
BASE: 'base',
|
|
13
13
|
SECONDARY: 'secondary'
|
|
14
14
|
};
|
|
15
|
-
|
|
16
|
-
|
|
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(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function
|
|
21
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" !=
|
|
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(arg) { var key = _toPrimitive(arg, "string"); return
|
|
36
|
-
function _toPrimitive(input, hint) { if (
|
|
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(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
25
|
+
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); }
|
|
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: {},
|
|
@@ -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),
|
|
@@ -123,4 +125,5 @@ var retrieveStyle = exports.retrieveStyle = function retrieveStyle(_ref) {
|
|
|
123
125
|
fontWeight: (0, _seamlessImmutable.getIn)(theme, ['UTTabs', 'secondaryLabel', 'fontWeight'])
|
|
124
126
|
}
|
|
125
127
|
};
|
|
126
|
-
};
|
|
128
|
+
};
|
|
129
|
+
exports.retrieveStyle = retrieveStyle;
|
|
@@ -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 {
|
|
@@ -26,4 +26,5 @@ var retrieveClassNamesFromVariants = exports.retrieveClassNamesFromVariants = fu
|
|
|
26
26
|
label: classes.baseLabel
|
|
27
27
|
};
|
|
28
28
|
}
|
|
29
|
-
};
|
|
29
|
+
};
|
|
30
|
+
exports.retrieveClassNamesFromVariants = retrieveClassNamesFromVariants;
|
|
@@ -4,9 +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
10
|
};
|