@dxc-technology/halstack-react 0.0.0-e441916 → 0.0.0-e628009
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/README.md +1 -1
- package/babel.config.js +6 -2
- package/dist/BackgroundColorContext.js +46 -0
- package/dist/ThemeContext.js +235 -2
- package/dist/V3Textarea/V3Textarea.js +264 -0
- package/dist/accordion/Accordion.js +170 -81
- package/dist/accordion-group/AccordionGroup.js +186 -0
- package/dist/alert/Alert.js +184 -83
- package/dist/alert/index.d.ts +51 -0
- package/dist/badge/Badge.js +63 -0
- package/dist/box/Box.js +39 -19
- package/dist/button/Button.js +84 -29
- package/dist/card/Card.js +64 -56
- package/dist/checkbox/Checkbox.js +108 -32
- package/dist/chip/Chip.js +135 -40
- package/dist/common/RequiredComponent.js +2 -8
- package/dist/common/utils.js +2 -22
- package/dist/common/variables.js +1486 -105
- package/dist/date/Date.js +115 -78
- package/dist/date-input/DateInput.js +400 -0
- package/dist/date-input/index.d.ts +95 -0
- package/dist/dialog/Dialog.js +61 -36
- package/dist/dropdown/Dropdown.js +226 -94
- package/dist/file-input/FileInput.js +644 -0
- package/dist/file-input/FileItem.js +280 -0
- package/dist/file-input/index.d.ts +81 -0
- package/dist/footer/Footer.js +125 -45
- package/dist/footer/Icons.js +77 -0
- package/dist/header/Header.js +174 -90
- package/dist/header/Icons.js +59 -0
- package/dist/heading/Heading.js +93 -22
- package/dist/input-text/Icons.js +22 -0
- package/dist/input-text/InputText.js +298 -108
- package/dist/layout/ApplicationLayout.js +327 -0
- package/dist/layout/Icons.js +55 -0
- package/dist/link/Link.js +142 -34
- package/dist/main.d.ts +8 -0
- package/dist/main.js +111 -7
- package/dist/new-select/NewSelect.js +836 -0
- package/dist/new-select/index.d.ts +53 -0
- package/dist/number-input/NumberInput.js +136 -0
- package/dist/number-input/NumberInputContext.js +16 -0
- package/dist/number-input/index.d.ts +113 -0
- package/dist/paginator/Icons.js +66 -0
- package/dist/paginator/Paginator.js +162 -57
- package/dist/password-input/PasswordInput.js +198 -0
- package/dist/password-input/index.d.ts +94 -0
- package/dist/progress-bar/ProgressBar.js +97 -44
- package/dist/radio/Radio.js +39 -21
- package/dist/resultsetTable/ResultsetTable.js +93 -69
- package/dist/select/Select.js +253 -129
- package/dist/sidenav/Sidenav.js +87 -125
- package/dist/slider/Slider.js +219 -73
- package/dist/spinner/Spinner.js +249 -64
- package/dist/switch/Switch.js +52 -25
- package/dist/table/Table.js +63 -15
- package/dist/tabs/Tabs.js +210 -50
- package/dist/tabs-for-sections/TabsForSections.js +1 -16
- package/dist/tag/Tag.js +100 -35
- package/dist/text-input/TextInput.js +971 -0
- package/dist/text-input/index.d.ts +135 -0
- package/dist/textarea/Textarea.js +250 -107
- package/dist/textarea/index.d.ts +117 -0
- package/dist/toggle/Toggle.js +16 -19
- package/dist/toggle-group/ToggleGroup.js +327 -0
- package/dist/upload/Upload.js +16 -11
- package/dist/upload/buttons-upload/ButtonsUpload.js +35 -25
- package/dist/upload/buttons-upload/Icons.js +40 -0
- package/dist/upload/dragAndDropArea/DragAndDropArea.js +84 -37
- package/dist/upload/dragAndDropArea/Icons.js +39 -0
- package/dist/upload/file-upload/FileToUpload.js +64 -33
- package/dist/upload/file-upload/Icons.js +66 -0
- package/dist/upload/files-upload/FilesToUpload.js +16 -16
- package/dist/upload/transaction/Icons.js +160 -0
- package/dist/upload/transaction/Transaction.js +42 -49
- package/dist/upload/transactions/Transactions.js +38 -20
- package/dist/useTheme.js +22 -0
- package/dist/wizard/Icons.js +65 -0
- package/dist/wizard/Wizard.js +156 -61
- package/package.json +14 -6
- package/test/AccordionGroup.test.js +125 -0
- package/test/Date.test.js +49 -45
- package/test/DateInput.test.js +242 -0
- package/test/Dropdown.test.js +19 -4
- package/test/FileInput.test.js +201 -0
- package/test/Footer.test.js +2 -7
- package/test/Header.test.js +5 -10
- package/test/Heading.test.js +60 -12
- package/test/InputText.test.js +53 -41
- package/test/Link.test.js +25 -7
- package/test/NumberInput.test.js +259 -0
- package/test/Paginator.test.js +72 -60
- package/test/PasswordInput.test.js +83 -0
- package/test/ResultsetTable.test.js +66 -19
- package/test/Select.test.js +55 -34
- package/test/Sidenav.test.js +22 -64
- package/test/Slider.test.js +24 -15
- package/test/Spinner.test.js +5 -0
- package/test/Tabs.test.js +21 -0
- package/test/TextInput.test.js +732 -0
- package/test/Textarea.test.js +193 -0
- package/test/ToggleGroup.test.js +85 -0
- package/test/Upload.test.js +5 -5
- package/test/{TextArea.test.js → V3TextArea.test.js} +6 -7
- package/dist/accordion/Accordion.stories.js +0 -207
- package/dist/accordion/readme.md +0 -96
- package/dist/alert/Alert.stories.js +0 -158
- package/dist/alert/close.svg +0 -4
- package/dist/alert/error.svg +0 -4
- package/dist/alert/info.svg +0 -4
- package/dist/alert/readme.md +0 -43
- package/dist/alert/success.svg +0 -4
- package/dist/alert/warning.svg +0 -4
- package/dist/button/Button.stories.js +0 -224
- package/dist/button/readme.md +0 -93
- package/dist/checkbox/Checkbox.stories.js +0 -144
- package/dist/checkbox/readme.md +0 -116
- package/dist/common/services/example-service.js +0 -10
- package/dist/common/services/example-service.test.js +0 -12
- package/dist/date/Date.stories.js +0 -205
- package/dist/date/calendar.svg +0 -1
- package/dist/date/calendar_dark.svg +0 -1
- package/dist/date/readme.md +0 -73
- package/dist/dialog/Dialog.stories.js +0 -217
- package/dist/dialog/readme.md +0 -32
- package/dist/dropdown/Dropdown.stories.js +0 -249
- package/dist/dropdown/baseline-arrow_drop_down.svg +0 -1
- package/dist/dropdown/baseline-arrow_drop_down_wh.svg +0 -4
- package/dist/dropdown/baseline-arrow_drop_up.svg +0 -1
- package/dist/dropdown/baseline-arrow_drop_up_wh.svg +0 -4
- package/dist/dropdown/readme.md +0 -69
- package/dist/footer/Footer.stories.js +0 -94
- package/dist/footer/dxc_logo_wht.png +0 -0
- package/dist/footer/readme.md +0 -41
- package/dist/header/Header.stories.js +0 -176
- package/dist/header/close_icon.svg +0 -1
- package/dist/header/dxc_logo_black.png +0 -0
- package/dist/header/dxc_logo_white.png +0 -0
- package/dist/header/hamb_menu_black.svg +0 -1
- package/dist/header/hamb_menu_white.svg +0 -1
- package/dist/header/readme.md +0 -33
- package/dist/input-text/InputText.stories.js +0 -209
- package/dist/input-text/error.svg +0 -1
- package/dist/input-text/readme.md +0 -91
- package/dist/link/readme.md +0 -51
- package/dist/paginator/images/next.svg +0 -3
- package/dist/paginator/images/nextPage.svg +0 -3
- package/dist/paginator/images/previous.svg +0 -3
- package/dist/paginator/images/previousPage.svg +0 -3
- package/dist/paginator/readme.md +0 -50
- package/dist/progress-bar/ProgressBar.stories.js +0 -280
- package/dist/progress-bar/readme.md +0 -63
- package/dist/radio/Radio.stories.js +0 -166
- package/dist/radio/readme.md +0 -70
- package/dist/resultsetTable/arrow_downward-24px_wht.svg +0 -1
- package/dist/resultsetTable/arrow_upward-24px_wht.svg +0 -1
- package/dist/resultsetTable/unfold_more-24px_wht.svg +0 -1
- package/dist/select/Select.stories.js +0 -235
- package/dist/select/readme.md +0 -72
- package/dist/sidenav/arrow_icon.svg +0 -3
- package/dist/slider/Slider.stories.js +0 -241
- package/dist/slider/readme.md +0 -64
- package/dist/spinner/Spinner.stories.js +0 -183
- package/dist/spinner/readme.md +0 -65
- package/dist/switch/Switch.stories.js +0 -134
- package/dist/switch/readme.md +0 -133
- package/dist/tabs/Tabs.stories.js +0 -130
- package/dist/tabs/readme.md +0 -78
- package/dist/tabs-for-sections/readme.md +0 -78
- package/dist/toggle/Toggle.stories.js +0 -297
- package/dist/toggle/readme.md +0 -80
- package/dist/upload/Upload.stories.js +0 -72
- package/dist/upload/buttons-upload/drag-drop-icon.svg +0 -4
- package/dist/upload/buttons-upload/upload-button.svg +0 -1
- package/dist/upload/dragAndDropArea/upload_drop.svg +0 -4
- package/dist/upload/dragAndDropArea/upload_file.svg +0 -4
- package/dist/upload/file-upload/audio-icon.svg +0 -4
- package/dist/upload/file-upload/close.svg +0 -4
- package/dist/upload/file-upload/file-icon.svg +0 -4
- package/dist/upload/file-upload/video-icon.svg +0 -4
- package/dist/upload/readme.md +0 -37
- package/dist/upload/transaction/audio-icon-err.svg +0 -4
- package/dist/upload/transaction/audio-icon.svg +0 -4
- package/dist/upload/transaction/error-icon.svg +0 -4
- package/dist/upload/transaction/file-icon-err.svg +0 -4
- package/dist/upload/transaction/file-icon.svg +0 -4
- package/dist/upload/transaction/image-icon-err.svg +0 -4
- package/dist/upload/transaction/image-icon.svg +0 -4
- package/dist/upload/transaction/success-icon.svg +0 -4
- package/dist/upload/transaction/video-icon-err.svg +0 -4
- package/dist/upload/transaction/video-icon.svg +0 -4
- package/dist/wizard/invalid_icon.svg +0 -6
- package/dist/wizard/valid_icon.svg +0 -6
- package/dist/wizard/validation-wrong.svg +0 -6
- package/test/Toggle.test.js +0 -43
package/dist/select/Select.js
CHANGED
|
@@ -11,10 +11,10 @@ exports["default"] = void 0;
|
|
|
11
11
|
|
|
12
12
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
13
13
|
|
|
14
|
-
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
|
15
|
-
|
|
16
14
|
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
17
15
|
|
|
16
|
+
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
|
17
|
+
|
|
18
18
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
19
19
|
|
|
20
20
|
var _react = _interopRequireWildcard(require("react"));
|
|
@@ -25,26 +25,58 @@ var _InputLabel = _interopRequireDefault(require("@material-ui/core/InputLabel")
|
|
|
25
25
|
|
|
26
26
|
var _FormControl = _interopRequireDefault(require("@material-ui/core/FormControl"));
|
|
27
27
|
|
|
28
|
+
var _FormHelperText = _interopRequireDefault(require("@material-ui/core/FormHelperText"));
|
|
29
|
+
|
|
28
30
|
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
29
31
|
|
|
30
32
|
var _MenuItem = _interopRequireDefault(require("@material-ui/core/MenuItem"));
|
|
31
33
|
|
|
32
|
-
var _styles = require("@material-ui/core/styles");
|
|
33
|
-
|
|
34
34
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
35
35
|
|
|
36
36
|
var _Checkbox = _interopRequireDefault(require("../checkbox/Checkbox"));
|
|
37
37
|
|
|
38
|
-
require("../common/OpenSans.css");
|
|
39
|
-
|
|
40
38
|
var _variables = require("../common/variables.js");
|
|
41
39
|
|
|
42
40
|
var _utils = require("../common/utils.js");
|
|
43
41
|
|
|
44
|
-
var
|
|
42
|
+
var _useTheme = _interopRequireDefault(require("../useTheme.js"));
|
|
43
|
+
|
|
44
|
+
var _RequiredComponent = _interopRequireDefault(require("../common/RequiredComponent"));
|
|
45
|
+
|
|
46
|
+
var _BackgroundColorContext = _interopRequireWildcard(require("../BackgroundColorContext.js"));
|
|
47
|
+
|
|
48
|
+
function _templateObject10() {
|
|
49
|
+
var data = (0, _taggedTemplateLiteral2["default"])(["\n width: ", ";\n margin: ", ";\n margin-top: ", ";\n margin-right: ", ";\n margin-bottom: ", ";\n margin-left: ", ";\n display: inline-block;\n\n .MuiFormControl-root {\n width: 100%;\n }\n\n .MuiFormHelperText-root {\n font-family: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n color: ", ";\n margin-top: 6px;\n\n &.Mui-disabled {\n color: ", ";\n cursor: not-allowed;\n }\n }\n\n .MuiFormLabel-root {\n font-family: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n color: ", ";\n margin-top: -3px;\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: nowrap;\n height: 22px;\n display: flex;\n align-items: center;\n\n &.Mui-disabled {\n color: ", ";\n }\n &.Mui-focused {\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n color: ", ";\n }\n }\n\n .MuiSelect-select.MuiSelect-select {\n padding-right: unset;\n }\n\n .MuiSelect-select {\n width: 100%;\n height: 20px;\n display: flex;\n padding-right: 10px;\n align-items: center;\n\n :focus {\n background-color: transparent;\n outline: ", "\n auto 2px;\n }\n & > *:last-child::after {\n content: unset;\n }\n & > *:last-child::before {\n content: unset;\n }\n &.Mui-disabled {\n color: ", ";\n cursor: not-allowed;\n &:focus {\n outline: none;\n }\n }\n }\n .MuiInputBase-input {\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n color: ", ";\n }\n .MuiInput-underline {\n &.Mui-focused {\n border-bottom-width: ", ";\n border-bottom-color: ", ";\n }\n &.Mui-disabled:before {\n border-bottom-style: solid;\n }\n }\n .MuiInput-underline:hover:not(.Mui-disabled):before {\n border-bottom: ", " solid;\n border-bottom-color: ", ";\n }\n .MuiInput-underline:after {\n border-bottom: ", " solid;\n border-bottom-color: ", ";\n }\n .MuiInput-underline:before {\n border-bottom: ", " solid;\n border-bottom-color: ", ";\n }\n .MuiSelect-icon {\n color: ", " !important;\n }\n & label {\n text-overflow: ellipsis;\n overflow: hidden;\n width: calc(100% - 24px);\n }\n\n .MuiMenu-paper {\n background-color: ", ";\n box-shadow: 0px 2px 10px 0px rgba(0, 0, 0, 0.3);\n min-width: auto;\n width: auto;\n max-height: 250px;\n border-color: ", ";\n border-width: ", ";\n border-style: ", ";\n\n &::-webkit-scrollbar {\n width: 3px;\n margin: 5px;\n }\n &::-webkit-scrollbar-track {\n border-radius: 3px;\n background-color: ", ";\n }\n &::-webkit-scrollbar-thumb {\n border-radius: 3px;\n background-color: ", ";\n }\n }\n .MuiList-root {\n width: auto !important;\n padding-right: 0 !important;\n }\n .MuiList-padding {\n padding-bottom: 0px;\n padding-top: 0px;\n }\n .MuiMenuItem-root {\n padding-bottom: ", ";\n padding-top: ", ";\n\n &:hover {\n background-color: ", ";\n }\n &:active {\n background-color: ", ";\n }\n &:focus {\n outline: ", "\n auto 2px;\n outline-offset: -1px;\n }\n &.MuiListItem-root.Mui-selected {\n background-color: ", ";\n }\n & span.MuiButtonBase-root {\n // multiple checkbox\n padding: 0px;\n margin: 5px 0px;\n }\n }\n"]);
|
|
50
|
+
|
|
51
|
+
_templateObject10 = function _templateObject10() {
|
|
52
|
+
return data;
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
return data;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
function _templateObject9() {
|
|
59
|
+
var data = (0, _taggedTemplateLiteral2["default"])(["\n color: ", ";\n width: ", ";\n height: ", ";\n margin-left: ", ";\n margin-right: ", ";\n overflow: hidden;\n\n img,\n svg {\n height: 100%;\n width: 100%;\n }\n"]);
|
|
60
|
+
|
|
61
|
+
_templateObject9 = function _templateObject9() {
|
|
62
|
+
return data;
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
return data;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
function _templateObject8() {
|
|
69
|
+
var data = (0, _taggedTemplateLiteral2["default"])(["\n width: ", ";\n height: ", ";\n margin-left: ", ";\n margin-right: ", ";\n"]);
|
|
70
|
+
|
|
71
|
+
_templateObject8 = function _templateObject8() {
|
|
72
|
+
return data;
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
return data;
|
|
76
|
+
}
|
|
45
77
|
|
|
46
78
|
function _templateObject7() {
|
|
47
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n
|
|
79
|
+
var data = (0, _taggedTemplateLiteral2["default"])(["\n font-family: ", ";\n overflow: hidden;\n text-overflow: ellipsis;\n"]);
|
|
48
80
|
|
|
49
81
|
_templateObject7 = function _templateObject7() {
|
|
50
82
|
return data;
|
|
@@ -54,7 +86,7 @@ function _templateObject7() {
|
|
|
54
86
|
}
|
|
55
87
|
|
|
56
88
|
function _templateObject6() {
|
|
57
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n
|
|
89
|
+
var data = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-direction: ", ";\n justify-content: ", ";\n margin-right: ", ";\n overflow: hidden;\n text-overflow: ellipsis;\n width: ", ";\n\n &::before {\n margin: 0 4px;\n ", ";\n }\n &::after {\n margin: 0 4px;\n ", ";\n }\n"]);
|
|
58
90
|
|
|
59
91
|
_templateObject6 = function _templateObject6() {
|
|
60
92
|
return data;
|
|
@@ -64,7 +96,7 @@ function _templateObject6() {
|
|
|
64
96
|
}
|
|
65
97
|
|
|
66
98
|
function _templateObject5() {
|
|
67
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n
|
|
99
|
+
var data = (0, _taggedTemplateLiteral2["default"])(["\n overflow: hidden;\n text-overflow: ellipsis;\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n color: ", ";\n"]);
|
|
68
100
|
|
|
69
101
|
_templateObject5 = function _templateObject5() {
|
|
70
102
|
return data;
|
|
@@ -74,7 +106,7 @@ function _templateObject5() {
|
|
|
74
106
|
}
|
|
75
107
|
|
|
76
108
|
function _templateObject4() {
|
|
77
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n
|
|
109
|
+
var data = (0, _taggedTemplateLiteral2["default"])(["\n width: ", ";\n height: ", ";\n margin-left: ", ";\n margin-right: ", ";\n"]);
|
|
78
110
|
|
|
79
111
|
_templateObject4 = function _templateObject4() {
|
|
80
112
|
return data;
|
|
@@ -84,7 +116,7 @@ function _templateObject4() {
|
|
|
84
116
|
}
|
|
85
117
|
|
|
86
118
|
function _templateObject3() {
|
|
87
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n
|
|
119
|
+
var data = (0, _taggedTemplateLiteral2["default"])(["\n color: ", ";\n width: ", ";\n height: ", ";\n margin-left: ", ";\n margin-right: ", ";\n overflow: hidden;\n\n img,\n svg {\n height: 100%;\n width: 100%;\n }\n"]);
|
|
88
120
|
|
|
89
121
|
_templateObject3 = function _templateObject3() {
|
|
90
122
|
return data;
|
|
@@ -94,7 +126,7 @@ function _templateObject3() {
|
|
|
94
126
|
}
|
|
95
127
|
|
|
96
128
|
function _templateObject2() {
|
|
97
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n overflow: hidden;\n text-overflow: ellipsis;\n"]);
|
|
129
|
+
var data = (0, _taggedTemplateLiteral2["default"])(["\n font-family: ", ";\n display: flex;\n align-items: center;\n flex-direction: ", ";\n overflow: hidden;\n text-overflow: ellipsis;\n ", "\n"]);
|
|
98
130
|
|
|
99
131
|
_templateObject2 = function _templateObject2() {
|
|
100
132
|
return data;
|
|
@@ -113,82 +145,37 @@ function _templateObject() {
|
|
|
113
145
|
return data;
|
|
114
146
|
}
|
|
115
147
|
|
|
116
|
-
var useStyles = (0, _styles.makeStyles)(function (theme) {
|
|
117
|
-
return {
|
|
118
|
-
root: function root(props) {
|
|
119
|
-
return {
|
|
120
|
-
minWidth: props.width
|
|
121
|
-
};
|
|
122
|
-
},
|
|
123
|
-
dropdownStyle: function dropdownStyle(props) {
|
|
124
|
-
return {
|
|
125
|
-
boxShadow: "0px 2px 10px 0px rgba(0, 0, 0, 0.3)",
|
|
126
|
-
minWidth: props.width,
|
|
127
|
-
width: props.width
|
|
128
|
-
};
|
|
129
|
-
},
|
|
130
|
-
itemList: function itemList(props) {
|
|
131
|
-
return {
|
|
132
|
-
color: props.darkGrey,
|
|
133
|
-
"&.MuiList-padding": {
|
|
134
|
-
paddingBottom: "0px",
|
|
135
|
-
paddingTop: "0px"
|
|
136
|
-
},
|
|
137
|
-
"& li": {
|
|
138
|
-
fontSize: "16px",
|
|
139
|
-
"&:hover": {
|
|
140
|
-
backgroundColor: props.darkWhite,
|
|
141
|
-
color: props.darkGrey
|
|
142
|
-
},
|
|
143
|
-
"&:active": {
|
|
144
|
-
backgroundColor: props.lightGrey,
|
|
145
|
-
color: props.black
|
|
146
|
-
},
|
|
147
|
-
"&.Mui-selected": {
|
|
148
|
-
backgroundColor: props.lightGrey,
|
|
149
|
-
color: props.black
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
};
|
|
153
|
-
}
|
|
154
|
-
};
|
|
155
|
-
});
|
|
156
|
-
|
|
157
148
|
var DxcSelect = function DxcSelect(_ref) {
|
|
158
149
|
var value = _ref.value,
|
|
159
150
|
name = _ref.name,
|
|
160
151
|
onChange = _ref.onChange,
|
|
161
152
|
label = _ref.label,
|
|
153
|
+
assistiveText = _ref.assistiveText,
|
|
162
154
|
_ref$required = _ref.required,
|
|
163
155
|
required = _ref$required === void 0 ? false : _ref$required,
|
|
164
156
|
_ref$disabled = _ref.disabled,
|
|
165
157
|
disabled = _ref$disabled === void 0 ? false : _ref$disabled,
|
|
158
|
+
_ref$invalid = _ref.invalid,
|
|
159
|
+
invalid = _ref$invalid === void 0 ? false : _ref$invalid,
|
|
166
160
|
_ref$options = _ref.options,
|
|
167
161
|
options = _ref$options === void 0 ? [] : _ref$options,
|
|
168
|
-
_ref$theme = _ref.theme,
|
|
169
|
-
theme = _ref$theme === void 0 ? "light" : _ref$theme,
|
|
170
|
-
_ref$disableRipple = _ref.disableRipple,
|
|
171
|
-
disableRipple = _ref$disableRipple === void 0 ? false : _ref$disableRipple,
|
|
172
162
|
_ref$iconPosition = _ref.iconPosition,
|
|
173
163
|
iconPosition = _ref$iconPosition === void 0 ? "before" : _ref$iconPosition,
|
|
174
164
|
_ref$multiple = _ref.multiple,
|
|
175
165
|
multiple = _ref$multiple === void 0 ? false : _ref$multiple,
|
|
176
166
|
margin = _ref.margin,
|
|
177
167
|
_ref$size = _ref.size,
|
|
178
|
-
size = _ref$size === void 0 ? "medium" : _ref$size
|
|
179
|
-
|
|
180
|
-
|
|
168
|
+
size = _ref$size === void 0 ? "medium" : _ref$size,
|
|
169
|
+
_ref$tabIndex = _ref.tabIndex,
|
|
170
|
+
tabIndex = _ref$tabIndex === void 0 ? 0 : _ref$tabIndex;
|
|
171
|
+
var colorsTheme = (0, _useTheme["default"])();
|
|
172
|
+
var backgroundType = (0, _react.useContext)(_BackgroundColorContext["default"]);
|
|
181
173
|
|
|
182
174
|
var _useState = (0, _react.useState)(multiple && [] || ""),
|
|
183
175
|
_useState2 = (0, _slicedToArray2["default"])(_useState, 2),
|
|
184
176
|
selectedValue = _useState2[0],
|
|
185
177
|
setSelectedValue = _useState2[1];
|
|
186
178
|
|
|
187
|
-
var selectValues = {
|
|
188
|
-
width: "auto"
|
|
189
|
-
};
|
|
190
|
-
var classes = useStyles(selectValues, colorsTheme);
|
|
191
|
-
|
|
192
179
|
var handleSelectChange = function handleSelectChange(selectedOption) {
|
|
193
180
|
if (multiple) {
|
|
194
181
|
setSelectedValue(selectedOption.target.value);
|
|
@@ -209,16 +196,23 @@ var DxcSelect = function DxcSelect(_ref) {
|
|
|
209
196
|
var selectedItem = options.filter(function (option) {
|
|
210
197
|
return option.value === selected;
|
|
211
198
|
})[0];
|
|
212
|
-
return _react["default"].createElement(
|
|
199
|
+
return _react["default"].createElement(SelectedOptionContainer, {
|
|
213
200
|
iconPosition: iconPosition,
|
|
214
201
|
multiple: multiple,
|
|
215
|
-
label: selectedItem && selectedItem.label
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
202
|
+
label: selectedItem && selectedItem.label,
|
|
203
|
+
key: selectedItem && selectedItem.label
|
|
204
|
+
}, selectedItem && selectedItem.icon ? _react["default"].createElement(SelectedOptionIconContainer, {
|
|
205
|
+
backgroundType: backgroundType,
|
|
206
|
+
disabled: disabled,
|
|
207
|
+
label: selectedItem.label,
|
|
208
|
+
iconPosition: iconPosition
|
|
209
|
+
}, (0, _typeof2["default"])(selectedItem.icon) === "object" ? selectedItem.icon : _react["default"].createElement(selectedItem.icon)) : selectedItem && selectedItem.iconSrc && _react["default"].createElement(SelectedOptionIcon, {
|
|
210
|
+
src: selectedItem && selectedItem.iconSrc,
|
|
211
|
+
label: selectedItem.label,
|
|
212
|
+
iconPosition: iconPosition
|
|
213
|
+
}), selectedItem && selectedItem.label && _react["default"].createElement(SelectedOptionLabelContainer, {
|
|
214
|
+
iconSrc: selectedItem && selectedItem.iconSrc && selectedItem.icon,
|
|
220
215
|
iconPosition: iconPosition,
|
|
221
|
-
brightness: theme,
|
|
222
216
|
disabled: disabled
|
|
223
217
|
}, selectedItem && selectedItem.label));
|
|
224
218
|
};
|
|
@@ -232,7 +226,7 @@ var DxcSelect = function DxcSelect(_ref) {
|
|
|
232
226
|
};
|
|
233
227
|
|
|
234
228
|
var getSelectedValuesWithIcons = function getSelectedValuesWithIcons(optionsList, selected) {
|
|
235
|
-
return
|
|
229
|
+
return optionsList.filter(function (x) {
|
|
236
230
|
return selected.includes(x.value);
|
|
237
231
|
}).map(function (optionToRender) {
|
|
238
232
|
return getLabelForSingleSelect(optionToRender.value);
|
|
@@ -265,51 +259,71 @@ var DxcSelect = function DxcSelect(_ref) {
|
|
|
265
259
|
}
|
|
266
260
|
};
|
|
267
261
|
|
|
262
|
+
var ThemedOption = function ThemedOption(_ref2) {
|
|
263
|
+
var option = _ref2.option;
|
|
264
|
+
var backgroundType = (0, _react.useContext)(_BackgroundColorContext["default"]);
|
|
265
|
+
return _react["default"].createElement(_react["default"].Fragment, null, multiple && _react["default"].createElement(_Checkbox["default"], {
|
|
266
|
+
size: "fitContent",
|
|
267
|
+
checked: isChecked(selectedValue, value, option)
|
|
268
|
+
}), _react["default"].createElement(OptionListContainer, {
|
|
269
|
+
iconPosition: iconPosition,
|
|
270
|
+
multiple: multiple
|
|
271
|
+
}, option.icon ? _react["default"].createElement(OptionListIconContainer, {
|
|
272
|
+
backgroundType: backgroundType,
|
|
273
|
+
disabled: disabled,
|
|
274
|
+
label: option.label,
|
|
275
|
+
iconPosition: iconPosition
|
|
276
|
+
}, (0, _typeof2["default"])(option.icon) === "object" ? option.icon : _react["default"].createElement(option.icon)) : option.iconSrc && _react["default"].createElement(OptionListIcon, {
|
|
277
|
+
src: option.iconSrc,
|
|
278
|
+
label: option.label,
|
|
279
|
+
iconPosition: iconPosition
|
|
280
|
+
}), " ", _react["default"].createElement(OptionListLabelContainer, {
|
|
281
|
+
backgroundType: backgroundType
|
|
282
|
+
}, option.label)));
|
|
283
|
+
};
|
|
284
|
+
|
|
268
285
|
return _react["default"].createElement(_styledComponents.ThemeProvider, {
|
|
269
|
-
theme: colorsTheme
|
|
286
|
+
theme: colorsTheme.select
|
|
270
287
|
}, _react["default"].createElement(SelectContainer, {
|
|
271
288
|
margin: margin,
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
289
|
+
size: size,
|
|
290
|
+
invalid: invalid,
|
|
291
|
+
disabled: disabled,
|
|
292
|
+
backgroundType: backgroundType
|
|
275
293
|
}, _react["default"].createElement(_FormControl["default"], null, _react["default"].createElement(_InputLabel["default"], {
|
|
276
294
|
disabled: disabled
|
|
277
|
-
}, label), _react["default"].createElement(_Select["default"], {
|
|
295
|
+
}, required && _react["default"].createElement(_RequiredComponent["default"], null), label), _react["default"].createElement(_Select["default"], {
|
|
278
296
|
name: name,
|
|
279
|
-
brightness: theme,
|
|
280
297
|
multiple: multiple,
|
|
281
298
|
renderValue: getRenderValue,
|
|
282
299
|
onChange: handleSelectChange,
|
|
283
300
|
value: value !== undefined ? value : selectedValue,
|
|
284
301
|
disabled: disabled,
|
|
285
302
|
MenuProps: {
|
|
286
|
-
classes: {
|
|
287
|
-
paper: classes.dropdownStyle,
|
|
288
|
-
list: classes.itemList
|
|
289
|
-
},
|
|
290
303
|
getContentAnchorEl: null,
|
|
291
304
|
anchorOrigin: {
|
|
292
305
|
vertical: "bottom",
|
|
293
306
|
horizontal: "left"
|
|
294
|
-
}
|
|
307
|
+
},
|
|
308
|
+
disablePortal: true
|
|
309
|
+
},
|
|
310
|
+
inputProps: {
|
|
311
|
+
tabIndex: disabled ? -1 : tabIndex
|
|
295
312
|
}
|
|
296
313
|
}, options.map(function (option) {
|
|
297
314
|
return _react["default"].createElement(_MenuItem["default"], {
|
|
298
315
|
id: option.value,
|
|
299
316
|
value: option.value,
|
|
300
|
-
disableRipple: disableRipple
|
|
301
|
-
}, multiple && _react["default"].createElement(_Checkbox["default"], {
|
|
302
|
-
size: "fitContent",
|
|
303
317
|
disableRipple: true,
|
|
304
|
-
|
|
305
|
-
}
|
|
306
|
-
|
|
307
|
-
},
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
}))))
|
|
318
|
+
key: option.value
|
|
319
|
+
}, _react["default"].createElement(_BackgroundColorContext.BackgroundColorProvider, {
|
|
320
|
+
color: colorsTheme.select.optionBackgroundColor
|
|
321
|
+
}, _react["default"].createElement(ThemedOption, {
|
|
322
|
+
option: option
|
|
323
|
+
})));
|
|
324
|
+
})), assistiveText && _react["default"].createElement(_FormHelperText["default"], {
|
|
325
|
+
disabled: disabled
|
|
326
|
+
}, assistiveText))));
|
|
313
327
|
};
|
|
314
328
|
|
|
315
329
|
var sizes = {
|
|
@@ -320,18 +334,52 @@ var sizes = {
|
|
|
320
334
|
};
|
|
321
335
|
|
|
322
336
|
var calculateWidth = function calculateWidth(margin, size) {
|
|
323
|
-
|
|
324
|
-
return "calc(".concat(sizes[size], " - ").concat((0, _utils.getMargin)(margin, "left"), " - ").concat((0, _utils.getMargin)(margin, "right"), ")");
|
|
325
|
-
}
|
|
326
|
-
|
|
327
|
-
return sizes[size];
|
|
337
|
+
return size === "fillParent" ? "calc(".concat(sizes[size], " - ").concat((0, _utils.getMargin)(margin, "left"), " - ").concat((0, _utils.getMargin)(margin, "right"), ")") : sizes[size];
|
|
328
338
|
};
|
|
329
339
|
|
|
330
340
|
var MultipleLabelSelected = _styledComponents["default"].div(_templateObject());
|
|
331
341
|
|
|
332
|
-
var
|
|
342
|
+
var OptionListContainer = _styledComponents["default"].div(_templateObject2(), function (props) {
|
|
343
|
+
return props.theme.fontFamily;
|
|
344
|
+
}, function (props) {
|
|
345
|
+
return props.iconPosition === "before" && "row" || "row-reverse";
|
|
346
|
+
}, function (props) {
|
|
347
|
+
return props.multiple && "margin-left: ".concat(props.theme.optionCheckboxSpacing, ";");
|
|
348
|
+
});
|
|
349
|
+
|
|
350
|
+
var OptionListIconContainer = _styledComponents["default"].div(_templateObject3(), function (props) {
|
|
351
|
+
return props.disabled ? props.backgroundType === "dark" ? props.theme.disabledColorOnDark : props.theme.disabledColor : props.backgroundType === "dark" ? props.theme.optionIconColorOnDark : props.theme.optionIconColor;
|
|
352
|
+
}, function (props) {
|
|
353
|
+
return props.theme.optionIconSize;
|
|
354
|
+
}, function (props) {
|
|
355
|
+
return props.theme.optionIconSize;
|
|
356
|
+
}, function (props) {
|
|
357
|
+
return props.iconPosition === "after" && props.label && props.theme.optionIconSpacing || "0px";
|
|
358
|
+
}, function (props) {
|
|
359
|
+
return props.iconPosition === "before" && props.label && props.theme.optionIconSpacing || "0px";
|
|
360
|
+
});
|
|
361
|
+
|
|
362
|
+
var OptionListIcon = _styledComponents["default"].img(_templateObject4(), function (props) {
|
|
363
|
+
return props.theme.optionIconSize;
|
|
364
|
+
}, function (props) {
|
|
365
|
+
return props.theme.optionIconSize;
|
|
366
|
+
}, function (props) {
|
|
367
|
+
return props.iconPosition === "after" && props.label !== "" && props.theme.optionIconSpacing || "0px";
|
|
368
|
+
}, function (props) {
|
|
369
|
+
return props.iconPosition === "before" && props.label !== "" && props.theme.optionIconSpacing || "0px";
|
|
370
|
+
});
|
|
371
|
+
|
|
372
|
+
var OptionListLabelContainer = _styledComponents["default"].span(_templateObject5(), function (props) {
|
|
373
|
+
return props.theme.optionFontSize;
|
|
374
|
+
}, function (props) {
|
|
375
|
+
return props.theme.optionFontStyle;
|
|
376
|
+
}, function (props) {
|
|
377
|
+
return props.theme.optionFontWeight;
|
|
378
|
+
}, function (props) {
|
|
379
|
+
return props.backgroundType === "dark" ? props.theme.optionFontColorOnDark : props.theme.optionFontColor;
|
|
380
|
+
});
|
|
333
381
|
|
|
334
|
-
var
|
|
382
|
+
var SelectedOptionContainer = _styledComponents["default"].div(_templateObject6(), function (props) {
|
|
335
383
|
return props.iconPosition === "before" && "row" || "row-reverse";
|
|
336
384
|
}, function (props) {
|
|
337
385
|
return props.iconPosition === "before" && "flex-start" || "flex-end";
|
|
@@ -345,23 +393,33 @@ var SelectedIconContainer = _styledComponents["default"].div(_templateObject3(),
|
|
|
345
393
|
return props.iconPosition === "before" && (props.label !== "" || props.label === undefined) && "content:','";
|
|
346
394
|
});
|
|
347
395
|
|
|
348
|
-
var
|
|
349
|
-
return
|
|
350
|
-
}, function (props) {
|
|
351
|
-
return (props.iconPosition === "before" || !props.iconSrc) && "0px" || "10px";
|
|
396
|
+
var SelectedOptionLabelContainer = _styledComponents["default"].span(_templateObject7(), function (props) {
|
|
397
|
+
return props.theme.fontFamily;
|
|
352
398
|
});
|
|
353
399
|
|
|
354
|
-
var
|
|
355
|
-
return props.
|
|
400
|
+
var SelectedOptionIcon = _styledComponents["default"].img(_templateObject8(), function (props) {
|
|
401
|
+
return props.theme.valueIconSize;
|
|
402
|
+
}, function (props) {
|
|
403
|
+
return props.theme.valueIconSize;
|
|
404
|
+
}, function (props) {
|
|
405
|
+
return props.iconPosition === "after" && props.label !== "" && props.theme.valueIconSpacing || "0px";
|
|
406
|
+
}, function (props) {
|
|
407
|
+
return props.iconPosition === "before" && props.label !== "" && props.theme.valueIconSpacing || "0px";
|
|
356
408
|
});
|
|
357
409
|
|
|
358
|
-
var
|
|
359
|
-
return props.
|
|
410
|
+
var SelectedOptionIconContainer = _styledComponents["default"].div(_templateObject9(), function (props) {
|
|
411
|
+
return props.disabled ? props.backgroundType === "dark" ? props.theme.disabledColorOnDark : props.theme.disabledColor : props.backgroundType === "dark" ? props.theme.valueIconColorOnDark : props.theme.valueIconColor;
|
|
360
412
|
}, function (props) {
|
|
361
|
-
return props.
|
|
413
|
+
return props.theme.valueIconSize;
|
|
414
|
+
}, function (props) {
|
|
415
|
+
return props.theme.valueIconSize;
|
|
416
|
+
}, function (props) {
|
|
417
|
+
return props.iconPosition === "after" && props.label !== "" && props.theme.valueIconSpacing || "0px";
|
|
418
|
+
}, function (props) {
|
|
419
|
+
return props.iconPosition === "before" && props.label !== "" && props.theme.valueIconSpacing || "0px";
|
|
362
420
|
});
|
|
363
421
|
|
|
364
|
-
var SelectContainer = _styledComponents["default"].div(
|
|
422
|
+
var SelectContainer = _styledComponents["default"].div(_templateObject10(), function (props) {
|
|
365
423
|
return calculateWidth(props.margin, props.size);
|
|
366
424
|
}, function (props) {
|
|
367
425
|
return props.margin && (0, _typeof2["default"])(props.margin) !== "object" ? _variables.spaces[props.margin] : "0px";
|
|
@@ -374,43 +432,108 @@ var SelectContainer = _styledComponents["default"].div(_templateObject7(), funct
|
|
|
374
432
|
}, function (props) {
|
|
375
433
|
return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.left ? _variables.spaces[props.margin.left] : "";
|
|
376
434
|
}, function (props) {
|
|
377
|
-
return props.
|
|
435
|
+
return props.theme.fontFamily;
|
|
436
|
+
}, function (props) {
|
|
437
|
+
return props.theme.assistiveTextFontSize;
|
|
438
|
+
}, function (props) {
|
|
439
|
+
return props.theme.assistiveTextFontStyle;
|
|
440
|
+
}, function (props) {
|
|
441
|
+
return props.theme.assistiveTextFontWeight;
|
|
442
|
+
}, function (props) {
|
|
443
|
+
return props.backgroundType === "dark" ? props.invalid === true ? props.theme.errorColorOnDark : props.theme.assistiveTextFontColorOnDark : props.invalid === true ? props.theme.errorColor : props.theme.assistiveTextFontColor;
|
|
444
|
+
}, function (props) {
|
|
445
|
+
return props.backgroundType === "dark" ? props.theme.disabledColorOnDark : props.theme.disabledColor;
|
|
446
|
+
}, function (props) {
|
|
447
|
+
return props.theme.fontFamily;
|
|
448
|
+
}, function (props) {
|
|
449
|
+
return props.theme.labelFontSize;
|
|
450
|
+
}, function (props) {
|
|
451
|
+
return props.theme.labelFontStyle;
|
|
452
|
+
}, function (props) {
|
|
453
|
+
return props.theme.labelFontWeight;
|
|
454
|
+
}, function (props) {
|
|
455
|
+
return props.backgroundType === "dark" ? props.invalid === true ? props.theme.errorColorOnDark : props.theme.labelFontColorOnDark : props.invalid === true ? props.theme.errorColor : props.theme.labelFontColor;
|
|
456
|
+
}, function (props) {
|
|
457
|
+
return props.backgroundType === "dark" ? props.theme.disabledColorOnDark : props.theme.disabledColor;
|
|
458
|
+
}, function (props) {
|
|
459
|
+
return props.theme.labelFontSize;
|
|
460
|
+
}, function (props) {
|
|
461
|
+
return props.theme.labelFontStyle;
|
|
462
|
+
}, function (props) {
|
|
463
|
+
return props.theme.labelFontWeight;
|
|
464
|
+
}, function (props) {
|
|
465
|
+
return props.backgroundType === "dark" ? props.invalid === true ? props.theme.errorColorOnDark : props.theme.labelFontColorOnDark : props.invalid === true ? props.theme.errorColor : props.theme.labelFontColor;
|
|
466
|
+
}, function (props) {
|
|
467
|
+
return props.backgroundType === "dark" ? props.theme.focusColorOnDark : props.theme.focusColor;
|
|
468
|
+
}, function (props) {
|
|
469
|
+
return props.backgroundType === "dark" ? props.theme.disabledColorOnDark : props.theme.disabledColor;
|
|
470
|
+
}, function (props) {
|
|
471
|
+
return props.theme.valueFontSize;
|
|
472
|
+
}, function (props) {
|
|
473
|
+
return props.theme.valueFontStyle;
|
|
474
|
+
}, function (props) {
|
|
475
|
+
return props.theme.valueFontWeight;
|
|
476
|
+
}, function (props) {
|
|
477
|
+
return props.backgroundType === "dark" ? props.theme.valueFontColorOnDark : props.theme.valueFontColor;
|
|
478
|
+
}, function (props) {
|
|
479
|
+
return props.theme.underlineThickness;
|
|
480
|
+
}, function (props) {
|
|
481
|
+
return props.backgroundType === "dark" ? props.invalid === true && props.theme.errorColorOnDark || props.disabled && props.theme.disabledColorOnDark || props.theme.underlineFocusColorOnDark : props.invalid === true && props.theme.errorColor || props.disabled && props.theme.disabledColor || props.theme.underlineFocusColor;
|
|
482
|
+
}, function (props) {
|
|
483
|
+
return props.theme.underlineThickness;
|
|
484
|
+
}, function (props) {
|
|
485
|
+
return props.backgroundType === "dark" ? props.invalid === true && props.theme.errorColorOnDark || props.disabled && props.theme.disabledColorOnDark || props.theme.underlineColorOnDark : props.invalid === true && props.theme.errorColor || props.disabled && props.theme.disabledColor || props.theme.underlineColor;
|
|
486
|
+
}, function (props) {
|
|
487
|
+
return props.theme.underlineThickness;
|
|
488
|
+
}, function (props) {
|
|
489
|
+
return props.backgroundType === "dark" ? props.invalid === true ? props.theme.errorColorOnDark : props.theme.underlineFocusColorOnDark : props.invalid === true ? props.theme.errorColor : props.theme.underlineFocusColor;
|
|
490
|
+
}, function (props) {
|
|
491
|
+
return props.theme.underlineThickness;
|
|
492
|
+
}, function (props) {
|
|
493
|
+
return props.backgroundType === "dark" ? props.invalid === true && props.theme.errorColorOnDark || props.disabled && props.theme.disabledColorOnDark || props.theme.underlineColorOnDark : props.invalid === true && props.theme.errorColor || props.disabled && props.theme.disabledColor || props.theme.underlineColor;
|
|
494
|
+
}, function (props) {
|
|
495
|
+
return props.backgroundType === "dark" ? props.disabled && props.theme.disabledColorOnDark || props.theme.arrowColorOnDark : props.disabled && props.theme.disabledColor || props.theme.arrowColor;
|
|
496
|
+
}, function (props) {
|
|
497
|
+
return props.theme.optionBackgroundColor;
|
|
498
|
+
}, function (props) {
|
|
499
|
+
return props.theme.optionBorderColor;
|
|
378
500
|
}, function (props) {
|
|
379
|
-
return props.
|
|
501
|
+
return props.theme.optionBorderThickness;
|
|
380
502
|
}, function (props) {
|
|
381
|
-
return props.
|
|
503
|
+
return props.theme.optionBorderStyle;
|
|
382
504
|
}, function (props) {
|
|
383
|
-
return props.
|
|
505
|
+
return props.theme.scrollBarTrackColor;
|
|
384
506
|
}, function (props) {
|
|
385
|
-
return props.
|
|
507
|
+
return props.theme.scrollBarThumbColor;
|
|
386
508
|
}, function (props) {
|
|
387
|
-
return props.
|
|
509
|
+
return props.theme.optionPaddingBottom;
|
|
388
510
|
}, function (props) {
|
|
389
|
-
return props.
|
|
511
|
+
return props.theme.optionPaddingTop;
|
|
390
512
|
}, function (props) {
|
|
391
|
-
return props.
|
|
513
|
+
return props.backgroundType === "dark" ? props.theme.hoverOptionBackgroundColorOnDark : props.theme.hoverOptionBackgroundColor;
|
|
392
514
|
}, function (props) {
|
|
393
|
-
return props.
|
|
515
|
+
return props.backgroundType === "dark" ? props.theme.activeOptionBackgroundColorOnDark : props.theme.activeOptionBackgroundColor;
|
|
394
516
|
}, function (props) {
|
|
395
|
-
return props.
|
|
517
|
+
return props.backgroundType === "dark" ? props.theme.focusColorOnDark : props.theme.focusColor;
|
|
396
518
|
}, function (props) {
|
|
397
|
-
return props.
|
|
519
|
+
return props.backgroundType === "dark" ? props.theme.selectedOptionBackgroundColorOnDark : props.theme.selectedOptionBackgroundColor;
|
|
398
520
|
});
|
|
399
521
|
|
|
400
522
|
DxcSelect.propTypes = {
|
|
401
523
|
size: _propTypes["default"].oneOf((0, _toConsumableArray2["default"])(Object.keys(sizes))),
|
|
402
524
|
label: _propTypes["default"].string,
|
|
525
|
+
assistiveText: _propTypes["default"].string,
|
|
403
526
|
name: _propTypes["default"].string,
|
|
404
527
|
value: _propTypes["default"].oneOfType([_propTypes["default"].string, _propTypes["default"].number, _propTypes["default"].arrayOf(_propTypes["default"].oneOfType([_propTypes["default"].string, _propTypes["default"].number]))]),
|
|
405
528
|
disabled: _propTypes["default"].bool,
|
|
406
529
|
required: _propTypes["default"].bool,
|
|
407
|
-
|
|
408
|
-
theme: _propTypes["default"].oneOf(["dark", "light"]),
|
|
530
|
+
invalid: _propTypes["default"].bool,
|
|
409
531
|
iconPosition: _propTypes["default"].oneOf(["after", "before"]),
|
|
410
532
|
onChange: _propTypes["default"].func,
|
|
411
533
|
options: _propTypes["default"].arrayOf(_propTypes["default"].shape({
|
|
412
534
|
value: _propTypes["default"].any.isRequired,
|
|
413
|
-
label: _propTypes["default"].
|
|
535
|
+
label: _propTypes["default"].string,
|
|
536
|
+
icon: _propTypes["default"].oneOfType([_propTypes["default"].element, _propTypes["default"].func]),
|
|
414
537
|
iconSrc: _propTypes["default"].string
|
|
415
538
|
})),
|
|
416
539
|
multiple: _propTypes["default"].bool,
|
|
@@ -419,7 +542,8 @@ DxcSelect.propTypes = {
|
|
|
419
542
|
bottom: _propTypes["default"].oneOf(Object.keys(_variables.spaces)),
|
|
420
543
|
left: _propTypes["default"].oneOf(Object.keys(_variables.spaces)),
|
|
421
544
|
right: _propTypes["default"].oneOf(Object.keys(_variables.spaces))
|
|
422
|
-
}), _propTypes["default"].oneOf((0, _toConsumableArray2["default"])(Object.keys(_variables.spaces)))])
|
|
545
|
+
}), _propTypes["default"].oneOf((0, _toConsumableArray2["default"])(Object.keys(_variables.spaces)))]),
|
|
546
|
+
tabIndex: _propTypes["default"].number
|
|
423
547
|
};
|
|
424
548
|
var _default = DxcSelect;
|
|
425
549
|
exports["default"] = _default;
|