@dxc-technology/halstack-react 0.0.0-4a5e7d8 → 0.0.0-4b95ba0
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/BackgroundColorContext.js +0 -1
- package/ThemeContext.js +23 -31
- package/accordion/Accordion.d.ts +1 -1
- package/accordion/Accordion.js +9 -20
- package/accordion/Accordion.stories.tsx +9 -2
- package/accordion/types.d.ts +3 -7
- package/accordion-group/types.d.ts +3 -7
- package/badge/Badge.d.ts +4 -0
- package/badge/types.d.ts +4 -0
- package/badge/types.js +5 -0
- package/bleed/Bleed.d.ts +3 -0
- package/bleed/Bleed.js +84 -0
- package/bleed/Bleed.stories.tsx +342 -0
- package/bleed/types.d.ts +13 -0
- package/bleed/types.js +5 -0
- package/button/Button.d.ts +1 -1
- package/button/Button.js +7 -15
- package/button/Button.stories.tsx +6 -8
- package/button/types.d.ts +3 -7
- package/card/Card.stories.tsx +1 -1
- package/checkbox/types.d.ts +1 -1
- package/chip/Chip.d.ts +1 -1
- package/chip/Chip.js +14 -52
- package/chip/Chip.stories.tsx +6 -8
- package/chip/types.d.ts +5 -13
- package/common/variables.js +38 -234
- package/date-input/DateInput.js +6 -6
- package/dialog/Dialog.js +2 -1
- package/dropdown/Dropdown.d.ts +1 -1
- package/dropdown/Dropdown.js +12 -34
- package/dropdown/Dropdown.stories.tsx +25 -23
- package/dropdown/types.d.ts +5 -14
- package/file-input/FileInput.js +102 -33
- package/file-input/FileInput.stories.tsx +507 -0
- package/footer/Footer.js +18 -20
- package/heading/Heading.stories.tsx +3 -2
- package/inset/Inset.d.ts +3 -0
- package/inset/Inset.js +84 -0
- package/inset/Inset.stories.tsx +229 -0
- package/inset/types.d.ts +13 -0
- package/inset/types.js +5 -0
- package/layout/ApplicationLayout.js +9 -3
- package/link/Link.js +7 -15
- package/link/Link.stories.tsx +6 -1
- package/link/types.d.ts +5 -9
- package/list/List.d.ts +3 -7
- package/list/List.js +4 -4
- package/list/List.stories.tsx +10 -0
- package/list/types.d.ts +7 -0
- package/list/types.js +5 -0
- package/main.d.ts +4 -6
- package/main.js +20 -36
- package/package.json +4 -2
- package/password-input/PasswordInput.stories.tsx +3 -3
- package/progress-bar/ProgressBar.js +2 -2
- package/radio-group/Radio.d.ts +4 -0
- package/radio-group/Radio.js +140 -0
- package/radio-group/RadioGroup.d.ts +4 -0
- package/radio-group/RadioGroup.js +273 -0
- package/radio-group/RadioGroup.stories.tsx +79 -0
- package/radio-group/RadioGroup.test.js +248 -0
- package/radio-group/types.d.ts +36 -0
- package/radio-group/types.js +5 -0
- package/resultsetTable/ResultsetTable.js +5 -2
- package/resultsetTable/ResultsetTable.stories.tsx +7 -8
- package/row/Row.d.ts +3 -11
- package/row/Row.js +12 -9
- package/row/Row.stories.tsx +20 -6
- package/row/types.d.ts +10 -0
- package/row/types.js +5 -0
- package/select/Select.d.ts +4 -0
- package/select/Select.js +12 -6
- package/select/types.d.ts +170 -0
- package/select/types.js +5 -0
- package/sidenav/Sidenav.stories.tsx +18 -1
- package/spinner/Spinner.stories.jsx +1 -0
- package/stack/Stack.d.ts +3 -10
- package/stack/Stack.js +12 -9
- package/stack/Stack.stories.tsx +20 -6
- package/stack/types.d.ts +9 -0
- package/stack/types.js +5 -0
- package/switch/Switch.stories.tsx +1 -1
- package/table/Table.stories.jsx +2 -1
- package/tabs/Tabs.js +7 -7
- package/tabs/Tabs.stories.tsx +7 -8
- package/tabs/types.d.ts +23 -15
- package/tag/Tag.d.ts +1 -1
- package/tag/Tag.js +6 -11
- package/tag/Tag.stories.tsx +15 -22
- package/tag/types.d.ts +23 -14
- package/text/Text.js +1 -1
- package/text-input/TextInput.js +17 -7
- package/text-input/TextInput.stories.tsx +4 -4
- package/text-input/types.d.ts +1 -1
- package/textarea/Textarea.js +5 -3
- package/textarea/Textarea.stories.jsx +4 -3
- package/V3Select/V3Select.js +0 -455
- package/V3Select/index.d.ts +0 -27
- package/V3Textarea/V3Textarea.js +0 -260
- package/V3Textarea/index.d.ts +0 -27
- package/date/Date.js +0 -373
- package/date/index.d.ts +0 -27
- package/input-text/Icons.js +0 -22
- package/input-text/InputText.js +0 -611
- package/input-text/index.d.ts +0 -36
- package/select/index.d.ts +0 -131
- package/toggle/Toggle.js +0 -186
- package/toggle/index.d.ts +0 -21
- package/upload/Upload.js +0 -201
- package/upload/buttons-upload/ButtonsUpload.js +0 -111
- package/upload/buttons-upload/Icons.js +0 -40
- package/upload/dragAndDropArea/DragAndDropArea.js +0 -225
- package/upload/dragAndDropArea/Icons.js +0 -39
- package/upload/file-upload/FileToUpload.js +0 -115
- package/upload/file-upload/Icons.js +0 -66
- package/upload/files-upload/FilesToUpload.js +0 -109
- package/upload/index.d.ts +0 -15
- package/upload/transaction/Icons.js +0 -160
- package/upload/transaction/Transaction.js +0 -104
- package/upload/transactions/Transactions.js +0 -94
package/text/Text.js
CHANGED
|
@@ -24,7 +24,7 @@ function Text(_ref) {
|
|
|
24
24
|
}, children);
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
var StyledText = _styledComponents["default"].span(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n margin: 0px;\n font-family: Open Sans, sans-serif;\n"])));
|
|
27
|
+
var StyledText = _styledComponents["default"].span(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n margin: 0px;\n font-family: Open Sans, sans-serif;\n line-height: 1.5em;\n"])));
|
|
28
28
|
|
|
29
29
|
var _default = Text;
|
|
30
30
|
exports["default"] = _default;
|
package/text-input/TextInput.js
CHANGED
|
@@ -205,7 +205,7 @@ var DxcTextInput = /*#__PURE__*/_react["default"].forwardRef(function (_ref, ref
|
|
|
205
205
|
var colorsTheme = (0, _useTheme["default"])();
|
|
206
206
|
var backgroundType = (0, _react.useContext)(_BackgroundColorContext["default"]);
|
|
207
207
|
var autosuggestId = "".concat(inputId, "-listBox");
|
|
208
|
-
var errorId = "error-
|
|
208
|
+
var errorId = "error-".concat(inputId);
|
|
209
209
|
var numberInputContext = (0, _react.useContext)(_NumberInputContext["default"]);
|
|
210
210
|
var lastOptionIndex = (0, _react.useMemo)(function () {
|
|
211
211
|
return getLastOptionIndex(filteredSuggestions);
|
|
@@ -539,16 +539,19 @@ var DxcTextInput = /*#__PURE__*/_react["default"].forwardRef(function (_ref, ref
|
|
|
539
539
|
role: isTextInputType() && hasSuggestions() ? "combobox" : "textbox",
|
|
540
540
|
"aria-autocomplete": isTextInputType() && hasSuggestions() ? "list" : undefined,
|
|
541
541
|
"aria-controls": isTextInputType() && hasSuggestions() ? autosuggestId : undefined,
|
|
542
|
+
"aria-disabled": disabled,
|
|
542
543
|
"aria-expanded": isTextInputType() && hasSuggestions() ? isOpen ? "true" : "false" : undefined,
|
|
543
544
|
"aria-activedescendant": isTextInputType() && hasSuggestions() && isOpen && visualFocusedSuggIndex !== -1 ? "suggestion-".concat(visualFocusedSuggIndex) : undefined,
|
|
544
545
|
"aria-invalid": error ? "true" : "false",
|
|
545
|
-
"aria-
|
|
546
|
+
"aria-errormessage": error ? errorId : undefined,
|
|
546
547
|
"aria-required": optional ? "false" : "true"
|
|
547
548
|
}), !disabled && error && /*#__PURE__*/_react["default"].createElement(ErrorIcon, {
|
|
548
549
|
backgroundType: backgroundType,
|
|
549
550
|
"aria-label": "Error"
|
|
550
551
|
}, textInputIcons.error), !disabled && clearable && (value !== null && value !== void 0 ? value : innerValue).length > 0 && /*#__PURE__*/_react["default"].createElement(Action, {
|
|
551
|
-
onClick:
|
|
552
|
+
onClick: function onClick() {
|
|
553
|
+
return handleClearActionOnClick();
|
|
554
|
+
},
|
|
552
555
|
onMouseDown: function onMouseDown(event) {
|
|
553
556
|
event.stopPropagation();
|
|
554
557
|
},
|
|
@@ -559,7 +562,9 @@ var DxcTextInput = /*#__PURE__*/_react["default"].forwardRef(function (_ref, ref
|
|
|
559
562
|
}, textInputIcons.clear), (numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.typeNumber) === "number" ? /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(Action, {
|
|
560
563
|
ref: actionRef,
|
|
561
564
|
disabled: disabled,
|
|
562
|
-
onClick:
|
|
565
|
+
onClick: function onClick() {
|
|
566
|
+
return handleDecrementActionOnClick();
|
|
567
|
+
},
|
|
563
568
|
onMouseDown: function onMouseDown(event) {
|
|
564
569
|
event.stopPropagation();
|
|
565
570
|
},
|
|
@@ -570,7 +575,9 @@ var DxcTextInput = /*#__PURE__*/_react["default"].forwardRef(function (_ref, ref
|
|
|
570
575
|
}, textInputIcons.decrement), /*#__PURE__*/_react["default"].createElement(Action, {
|
|
571
576
|
ref: actionRef,
|
|
572
577
|
disabled: disabled,
|
|
573
|
-
onClick:
|
|
578
|
+
onClick: function onClick() {
|
|
579
|
+
return handleIncrementActionOnClick();
|
|
580
|
+
},
|
|
574
581
|
onMouseDown: function onMouseDown(event) {
|
|
575
582
|
event.stopPropagation();
|
|
576
583
|
},
|
|
@@ -581,7 +588,9 @@ var DxcTextInput = /*#__PURE__*/_react["default"].forwardRef(function (_ref, ref
|
|
|
581
588
|
}, textInputIcons.increment)) : action && /*#__PURE__*/_react["default"].createElement(Action, {
|
|
582
589
|
ref: actionRef,
|
|
583
590
|
disabled: disabled,
|
|
584
|
-
onClick:
|
|
591
|
+
onClick: function onClick() {
|
|
592
|
+
return action.onClick();
|
|
593
|
+
},
|
|
585
594
|
onMouseDown: function onMouseDown(event) {
|
|
586
595
|
event.stopPropagation();
|
|
587
596
|
},
|
|
@@ -613,7 +622,8 @@ var DxcTextInput = /*#__PURE__*/_react["default"].forwardRef(function (_ref, ref
|
|
|
613
622
|
backgroundType: backgroundType
|
|
614
623
|
}, textInputIcons.error), "Error fetching data"))), !disabled && typeof error === "string" && /*#__PURE__*/_react["default"].createElement(Error, {
|
|
615
624
|
id: errorId,
|
|
616
|
-
backgroundType: backgroundType
|
|
625
|
+
backgroundType: backgroundType,
|
|
626
|
+
"aria-live": error ? "assertive" : "off"
|
|
617
627
|
}, error)));
|
|
618
628
|
});
|
|
619
629
|
|
|
@@ -262,14 +262,14 @@ export const Chromatic = () => (
|
|
|
262
262
|
);
|
|
263
263
|
|
|
264
264
|
const FocusedActionTextInput = () => (
|
|
265
|
-
<ExampleContainer>
|
|
265
|
+
<ExampleContainer expanded>
|
|
266
266
|
<Title title="Focused action" theme="light" level={4} />
|
|
267
267
|
<DxcTextInput label="Text input" action={action} clearable />
|
|
268
268
|
</ExampleContainer>
|
|
269
269
|
);
|
|
270
270
|
|
|
271
271
|
const ActivedActionTextInput = () => (
|
|
272
|
-
<ExampleContainer pseudoState="pseudo-active">
|
|
272
|
+
<ExampleContainer pseudoState="pseudo-active" expanded>
|
|
273
273
|
<Title title="Actived action" theme="light" level={4} />
|
|
274
274
|
<DxcTextInput label="Text input" action={action} clearable />
|
|
275
275
|
</ExampleContainer>
|
|
@@ -306,7 +306,7 @@ const ActivedOptionAutosuggest = () => (
|
|
|
306
306
|
const FocusedActionTextInputOnDark = () => (
|
|
307
307
|
<BackgroundColorProvider color="#333333">
|
|
308
308
|
<DarkContainer>
|
|
309
|
-
<ExampleContainer>
|
|
309
|
+
<ExampleContainer expanded>
|
|
310
310
|
<Title title="Focused action" theme="dark" level={4} />
|
|
311
311
|
<DxcTextInput label="Text input" action={action} clearable />
|
|
312
312
|
</ExampleContainer>
|
|
@@ -317,7 +317,7 @@ const FocusedActionTextInputOnDark = () => (
|
|
|
317
317
|
const ActivedActionTextInputOnDark = () => (
|
|
318
318
|
<BackgroundColorProvider color="#333333">
|
|
319
319
|
<DarkContainer>
|
|
320
|
-
<ExampleContainer pseudoState="pseudo-active">
|
|
320
|
+
<ExampleContainer pseudoState="pseudo-active" expanded>
|
|
321
321
|
<Title title="Actived action" theme="dark" level={4} />
|
|
322
322
|
<DxcTextInput label="Text input" action={action} clearable />
|
|
323
323
|
</ExampleContainer>
|
package/text-input/types.d.ts
CHANGED
package/textarea/Textarea.js
CHANGED
|
@@ -89,7 +89,7 @@ var DxcTextarea = /*#__PURE__*/_react["default"].forwardRef(function (_ref, ref)
|
|
|
89
89
|
var colorsTheme = (0, _useTheme["default"])();
|
|
90
90
|
var backgroundType = (0, _react.useContext)(_BackgroundColorContext["default"]);
|
|
91
91
|
var textareaRef = (0, _react.useRef)(null);
|
|
92
|
-
var errorId = "error-
|
|
92
|
+
var errorId = "error-".concat(textareaId);
|
|
93
93
|
|
|
94
94
|
var getLengthErrorMessage = function getLengthErrorMessage() {
|
|
95
95
|
return "Min length ".concat(minLength, ", max length ").concat(maxLength, ".");
|
|
@@ -180,12 +180,14 @@ var DxcTextarea = /*#__PURE__*/_react["default"].forwardRef(function (_ref, ref)
|
|
|
180
180
|
backgroundType: backgroundType,
|
|
181
181
|
ref: textareaRef,
|
|
182
182
|
tabIndex: tabIndex,
|
|
183
|
+
"aria-disabled": disabled,
|
|
183
184
|
"aria-invalid": error ? "true" : "false",
|
|
184
|
-
"aria-
|
|
185
|
+
"aria-errormessage": error ? errorId : undefined,
|
|
185
186
|
"aria-required": optional ? "false" : "true"
|
|
186
187
|
}), !disabled && typeof error === "string" && /*#__PURE__*/_react["default"].createElement(Error, {
|
|
187
188
|
id: errorId,
|
|
188
|
-
backgroundType: backgroundType
|
|
189
|
+
backgroundType: backgroundType,
|
|
190
|
+
"aria-live": error ? "assertive" : "off"
|
|
189
191
|
}, error)));
|
|
190
192
|
});
|
|
191
193
|
|
|
@@ -105,15 +105,15 @@ export const Chromatic = () => (
|
|
|
105
105
|
<Title title="Margins" theme="light" level={2} />
|
|
106
106
|
<ExampleContainer>
|
|
107
107
|
<Title title="Xxsmall margin" theme="light" level={4} />
|
|
108
|
-
<DxcTextarea label="
|
|
108
|
+
<DxcTextarea label="Xxsmall" margin="xxsmall" />
|
|
109
109
|
</ExampleContainer>
|
|
110
110
|
<ExampleContainer>
|
|
111
111
|
<Title title="Xsmall margin" theme="light" level={4} />
|
|
112
|
-
<DxcTextarea label="
|
|
112
|
+
<DxcTextarea label="xsmall" margin="xsmall" />
|
|
113
113
|
</ExampleContainer>
|
|
114
114
|
<ExampleContainer>
|
|
115
115
|
<Title title="Small margin" theme="light" level={4} />
|
|
116
|
-
<DxcTextarea label="
|
|
116
|
+
<DxcTextarea label="small" margin="small" />
|
|
117
117
|
</ExampleContainer>
|
|
118
118
|
<ExampleContainer>
|
|
119
119
|
<Title title="Medium margin" theme="light" level={4} />
|
|
@@ -130,6 +130,7 @@ export const Chromatic = () => (
|
|
|
130
130
|
<ExampleContainer>
|
|
131
131
|
<Title title="Xxlarge margin" theme="light" level={4} />
|
|
132
132
|
<DxcTextarea label="Xxlarge" margin="xxlarge" />
|
|
133
|
+
<hr />
|
|
133
134
|
</ExampleContainer>
|
|
134
135
|
</>
|
|
135
136
|
);
|
package/V3Select/V3Select.js
DELETED
|
@@ -1,455 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
var _typeof3 = require("@babel/runtime/helpers/typeof");
|
|
6
|
-
|
|
7
|
-
Object.defineProperty(exports, "__esModule", {
|
|
8
|
-
value: true
|
|
9
|
-
});
|
|
10
|
-
exports["default"] = void 0;
|
|
11
|
-
|
|
12
|
-
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
13
|
-
|
|
14
|
-
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
15
|
-
|
|
16
|
-
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
|
17
|
-
|
|
18
|
-
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
19
|
-
|
|
20
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
21
|
-
|
|
22
|
-
var _Select = _interopRequireDefault(require("@material-ui/core/Select"));
|
|
23
|
-
|
|
24
|
-
var _InputLabel = _interopRequireDefault(require("@material-ui/core/InputLabel"));
|
|
25
|
-
|
|
26
|
-
var _FormControl = _interopRequireDefault(require("@material-ui/core/FormControl"));
|
|
27
|
-
|
|
28
|
-
var _FormHelperText = _interopRequireDefault(require("@material-ui/core/FormHelperText"));
|
|
29
|
-
|
|
30
|
-
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
31
|
-
|
|
32
|
-
var _MenuItem = _interopRequireDefault(require("@material-ui/core/MenuItem"));
|
|
33
|
-
|
|
34
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
35
|
-
|
|
36
|
-
var _Checkbox = _interopRequireDefault(require("../checkbox/Checkbox"));
|
|
37
|
-
|
|
38
|
-
var _variables = require("../common/variables.js");
|
|
39
|
-
|
|
40
|
-
var _utils = require("../common/utils.js");
|
|
41
|
-
|
|
42
|
-
var _useTheme = _interopRequireDefault(require("../useTheme"));
|
|
43
|
-
|
|
44
|
-
var _RequiredComponent = _interopRequireDefault(require("../common/RequiredComponent"));
|
|
45
|
-
|
|
46
|
-
var _BackgroundColorContext = _interopRequireWildcard(require("../BackgroundColorContext"));
|
|
47
|
-
|
|
48
|
-
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10;
|
|
49
|
-
|
|
50
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
51
|
-
|
|
52
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof3(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
53
|
-
|
|
54
|
-
var V3DxcSelect = function V3DxcSelect(_ref) {
|
|
55
|
-
var value = _ref.value,
|
|
56
|
-
name = _ref.name,
|
|
57
|
-
onChange = _ref.onChange,
|
|
58
|
-
label = _ref.label,
|
|
59
|
-
assistiveText = _ref.assistiveText,
|
|
60
|
-
_ref$required = _ref.required,
|
|
61
|
-
required = _ref$required === void 0 ? false : _ref$required,
|
|
62
|
-
_ref$disabled = _ref.disabled,
|
|
63
|
-
disabled = _ref$disabled === void 0 ? false : _ref$disabled,
|
|
64
|
-
_ref$invalid = _ref.invalid,
|
|
65
|
-
invalid = _ref$invalid === void 0 ? false : _ref$invalid,
|
|
66
|
-
_ref$options = _ref.options,
|
|
67
|
-
options = _ref$options === void 0 ? [] : _ref$options,
|
|
68
|
-
_ref$iconPosition = _ref.iconPosition,
|
|
69
|
-
iconPosition = _ref$iconPosition === void 0 ? "before" : _ref$iconPosition,
|
|
70
|
-
_ref$multiple = _ref.multiple,
|
|
71
|
-
multiple = _ref$multiple === void 0 ? false : _ref$multiple,
|
|
72
|
-
margin = _ref.margin,
|
|
73
|
-
_ref$size = _ref.size,
|
|
74
|
-
size = _ref$size === void 0 ? "medium" : _ref$size,
|
|
75
|
-
_ref$tabIndex = _ref.tabIndex,
|
|
76
|
-
tabIndex = _ref$tabIndex === void 0 ? 0 : _ref$tabIndex;
|
|
77
|
-
var colorsTheme = (0, _useTheme["default"])();
|
|
78
|
-
var backgroundType = (0, _react.useContext)(_BackgroundColorContext["default"]);
|
|
79
|
-
|
|
80
|
-
var _useState = (0, _react.useState)(multiple && [] || ""),
|
|
81
|
-
_useState2 = (0, _slicedToArray2["default"])(_useState, 2),
|
|
82
|
-
selectedValue = _useState2[0],
|
|
83
|
-
setSelectedValue = _useState2[1];
|
|
84
|
-
|
|
85
|
-
var handleSelectChange = function handleSelectChange(selectedOption) {
|
|
86
|
-
if (multiple) {
|
|
87
|
-
setSelectedValue(selectedOption.target.value);
|
|
88
|
-
|
|
89
|
-
if (typeof onChange === "function") {
|
|
90
|
-
onChange(selectedOption.target.value);
|
|
91
|
-
}
|
|
92
|
-
} else {
|
|
93
|
-
setSelectedValue(selectedOption.target.value);
|
|
94
|
-
|
|
95
|
-
if (typeof onChange === "function") {
|
|
96
|
-
onChange(selectedOption.target.value);
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
};
|
|
100
|
-
|
|
101
|
-
var getLabelForSingleSelect = function getLabelForSingleSelect(selected) {
|
|
102
|
-
var selectedItem = options.filter(function (option) {
|
|
103
|
-
return option.value === selected;
|
|
104
|
-
})[0];
|
|
105
|
-
return /*#__PURE__*/_react["default"].createElement(SelectedOptionContainer, {
|
|
106
|
-
iconPosition: iconPosition,
|
|
107
|
-
multiple: multiple,
|
|
108
|
-
label: selectedItem && selectedItem.label,
|
|
109
|
-
key: selectedItem && selectedItem.label
|
|
110
|
-
}, selectedItem && selectedItem.icon ? /*#__PURE__*/_react["default"].createElement(SelectedOptionIconContainer, {
|
|
111
|
-
backgroundType: backgroundType,
|
|
112
|
-
disabled: disabled,
|
|
113
|
-
label: selectedItem.label,
|
|
114
|
-
iconPosition: iconPosition
|
|
115
|
-
}, (0, _typeof2["default"])(selectedItem.icon) === "object" ? selectedItem.icon : /*#__PURE__*/_react["default"].createElement(selectedItem.icon)) : selectedItem && selectedItem.iconSrc && /*#__PURE__*/_react["default"].createElement(SelectedOptionIcon, {
|
|
116
|
-
src: selectedItem && selectedItem.iconSrc,
|
|
117
|
-
label: selectedItem.label,
|
|
118
|
-
iconPosition: iconPosition
|
|
119
|
-
}), selectedItem && selectedItem.label && /*#__PURE__*/_react["default"].createElement(SelectedOptionLabelContainer, {
|
|
120
|
-
iconSrc: selectedItem && selectedItem.iconSrc && selectedItem.icon,
|
|
121
|
-
iconPosition: iconPosition,
|
|
122
|
-
disabled: disabled
|
|
123
|
-
}, selectedItem && selectedItem.label));
|
|
124
|
-
};
|
|
125
|
-
|
|
126
|
-
var getSelectedValuesWithLabel = function getSelectedValuesWithLabel(optionsList, selected) {
|
|
127
|
-
return /*#__PURE__*/_react["default"].createElement(MultipleLabelSelected, null, optionsList.filter(function (x) {
|
|
128
|
-
return selected.includes(x.value);
|
|
129
|
-
}).map(function (optionToRender) {
|
|
130
|
-
return optionToRender.label;
|
|
131
|
-
}).join(", "));
|
|
132
|
-
};
|
|
133
|
-
|
|
134
|
-
var getSelectedValuesWithIcons = function getSelectedValuesWithIcons(optionsList, selected) {
|
|
135
|
-
return optionsList.filter(function (x) {
|
|
136
|
-
return selected.includes(x.value);
|
|
137
|
-
}).map(function (optionToRender) {
|
|
138
|
-
return getLabelForSingleSelect(optionToRender.value);
|
|
139
|
-
});
|
|
140
|
-
};
|
|
141
|
-
|
|
142
|
-
var labelForMultipleSelect = function labelForMultipleSelect(selected) {
|
|
143
|
-
return options.findIndex(function (option) {
|
|
144
|
-
return !option.label;
|
|
145
|
-
}) !== -1 ? getSelectedValuesWithIcons(options, selected) : getSelectedValuesWithLabel(options, selected);
|
|
146
|
-
};
|
|
147
|
-
|
|
148
|
-
var getRenderValue = function getRenderValue(selected) {
|
|
149
|
-
return multiple && labelForMultipleSelect(selected) || getLabelForSingleSelect(selected);
|
|
150
|
-
};
|
|
151
|
-
|
|
152
|
-
var isChecked = function isChecked(checkedValue, value, option) {
|
|
153
|
-
if (value !== undefined) {
|
|
154
|
-
var result = false;
|
|
155
|
-
value.map(function (val) {
|
|
156
|
-
if (val === option.value) {
|
|
157
|
-
result = true;
|
|
158
|
-
}
|
|
159
|
-
});
|
|
160
|
-
return result;
|
|
161
|
-
} else if (checkedValue) {
|
|
162
|
-
return checkedValue.findIndex(function (element) {
|
|
163
|
-
return element === option.value;
|
|
164
|
-
}) !== -1 || false;
|
|
165
|
-
}
|
|
166
|
-
};
|
|
167
|
-
|
|
168
|
-
var ThemedOption = function ThemedOption(_ref2) {
|
|
169
|
-
var option = _ref2.option;
|
|
170
|
-
var backgroundType = (0, _react.useContext)(_BackgroundColorContext["default"]);
|
|
171
|
-
return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, multiple && /*#__PURE__*/_react["default"].createElement(_Checkbox["default"], {
|
|
172
|
-
size: "fitContent",
|
|
173
|
-
checked: isChecked(selectedValue, value, option)
|
|
174
|
-
}), /*#__PURE__*/_react["default"].createElement(OptionListContainer, {
|
|
175
|
-
iconPosition: iconPosition,
|
|
176
|
-
multiple: multiple
|
|
177
|
-
}, option.icon ? /*#__PURE__*/_react["default"].createElement(OptionListIconContainer, {
|
|
178
|
-
backgroundType: backgroundType,
|
|
179
|
-
disabled: disabled,
|
|
180
|
-
label: option.label,
|
|
181
|
-
iconPosition: iconPosition
|
|
182
|
-
}, (0, _typeof2["default"])(option.icon) === "object" ? option.icon : /*#__PURE__*/_react["default"].createElement(option.icon)) : option.iconSrc && /*#__PURE__*/_react["default"].createElement(OptionListIcon, {
|
|
183
|
-
src: option.iconSrc,
|
|
184
|
-
label: option.label,
|
|
185
|
-
iconPosition: iconPosition
|
|
186
|
-
}), " ", /*#__PURE__*/_react["default"].createElement(OptionListLabelContainer, {
|
|
187
|
-
backgroundType: backgroundType
|
|
188
|
-
}, option.label)));
|
|
189
|
-
};
|
|
190
|
-
|
|
191
|
-
return /*#__PURE__*/_react["default"].createElement(_styledComponents.ThemeProvider, {
|
|
192
|
-
theme: colorsTheme.V3Select
|
|
193
|
-
}, /*#__PURE__*/_react["default"].createElement(SelectContainer, {
|
|
194
|
-
margin: margin,
|
|
195
|
-
size: size,
|
|
196
|
-
invalid: invalid,
|
|
197
|
-
disabled: disabled,
|
|
198
|
-
backgroundType: backgroundType
|
|
199
|
-
}, /*#__PURE__*/_react["default"].createElement(_FormControl["default"], null, /*#__PURE__*/_react["default"].createElement(_InputLabel["default"], {
|
|
200
|
-
disabled: disabled
|
|
201
|
-
}, required && /*#__PURE__*/_react["default"].createElement(_RequiredComponent["default"], null), label), /*#__PURE__*/_react["default"].createElement(_Select["default"], {
|
|
202
|
-
name: name,
|
|
203
|
-
multiple: multiple,
|
|
204
|
-
renderValue: getRenderValue,
|
|
205
|
-
onChange: handleSelectChange,
|
|
206
|
-
value: value !== undefined ? value : selectedValue,
|
|
207
|
-
disabled: disabled,
|
|
208
|
-
MenuProps: {
|
|
209
|
-
getContentAnchorEl: null,
|
|
210
|
-
anchorOrigin: {
|
|
211
|
-
vertical: "bottom",
|
|
212
|
-
horizontal: "left"
|
|
213
|
-
},
|
|
214
|
-
disablePortal: true
|
|
215
|
-
},
|
|
216
|
-
inputProps: {
|
|
217
|
-
tabIndex: disabled ? -1 : tabIndex
|
|
218
|
-
}
|
|
219
|
-
}, options.map(function (option) {
|
|
220
|
-
return /*#__PURE__*/_react["default"].createElement(_MenuItem["default"], {
|
|
221
|
-
id: option.value,
|
|
222
|
-
value: option.value,
|
|
223
|
-
disableRipple: true,
|
|
224
|
-
key: option.value
|
|
225
|
-
}, /*#__PURE__*/_react["default"].createElement(_BackgroundColorContext.BackgroundColorProvider, {
|
|
226
|
-
color: colorsTheme.V3Select.optionBackgroundColor
|
|
227
|
-
}, /*#__PURE__*/_react["default"].createElement(ThemedOption, {
|
|
228
|
-
option: option
|
|
229
|
-
})));
|
|
230
|
-
})), assistiveText && /*#__PURE__*/_react["default"].createElement(_FormHelperText["default"], {
|
|
231
|
-
disabled: disabled
|
|
232
|
-
}, assistiveText))));
|
|
233
|
-
};
|
|
234
|
-
|
|
235
|
-
var sizes = {
|
|
236
|
-
small: "60px",
|
|
237
|
-
medium: "240px",
|
|
238
|
-
large: "480px",
|
|
239
|
-
fillParent: "100%"
|
|
240
|
-
};
|
|
241
|
-
|
|
242
|
-
var calculateWidth = function calculateWidth(margin, size) {
|
|
243
|
-
return size === "fillParent" ? "calc(".concat(sizes[size], " - ").concat((0, _utils.getMargin)(margin, "left"), " - ").concat((0, _utils.getMargin)(margin, "right"), ")") : sizes[size];
|
|
244
|
-
};
|
|
245
|
-
|
|
246
|
-
var MultipleLabelSelected = _styledComponents["default"].div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n width: calc(100% - 24px);\n overflow: hidden;\n text-overflow: ellipsis;\n"])));
|
|
247
|
-
|
|
248
|
-
var OptionListContainer = _styledComponents["default"].div(_templateObject2 || (_templateObject2 = (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"])), function (props) {
|
|
249
|
-
return props.theme.fontFamily;
|
|
250
|
-
}, function (props) {
|
|
251
|
-
return props.iconPosition === "before" && "row" || "row-reverse";
|
|
252
|
-
}, function (props) {
|
|
253
|
-
return props.multiple && "margin-left: ".concat(props.theme.optionCheckboxSpacing, ";");
|
|
254
|
-
});
|
|
255
|
-
|
|
256
|
-
var OptionListIconContainer = _styledComponents["default"].div(_templateObject3 || (_templateObject3 = (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"])), function (props) {
|
|
257
|
-
return props.disabled ? props.backgroundType === "dark" ? props.theme.disabledColorOnDark : props.theme.disabledColor : props.backgroundType === "dark" ? props.theme.optionIconColorOnDark : props.theme.optionIconColor;
|
|
258
|
-
}, function (props) {
|
|
259
|
-
return props.theme.optionIconSize;
|
|
260
|
-
}, function (props) {
|
|
261
|
-
return props.theme.optionIconSize;
|
|
262
|
-
}, function (props) {
|
|
263
|
-
return props.iconPosition === "after" && props.label && props.theme.optionIconSpacing || "0px";
|
|
264
|
-
}, function (props) {
|
|
265
|
-
return props.iconPosition === "before" && props.label && props.theme.optionIconSpacing || "0px";
|
|
266
|
-
});
|
|
267
|
-
|
|
268
|
-
var OptionListIcon = _styledComponents["default"].img(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2["default"])(["\n width: ", ";\n height: ", ";\n margin-left: ", ";\n margin-right: ", ";\n"])), function (props) {
|
|
269
|
-
return props.theme.optionIconSize;
|
|
270
|
-
}, function (props) {
|
|
271
|
-
return props.theme.optionIconSize;
|
|
272
|
-
}, function (props) {
|
|
273
|
-
return props.iconPosition === "after" && props.label !== "" && props.theme.optionIconSpacing || "0px";
|
|
274
|
-
}, function (props) {
|
|
275
|
-
return props.iconPosition === "before" && props.label !== "" && props.theme.optionIconSpacing || "0px";
|
|
276
|
-
});
|
|
277
|
-
|
|
278
|
-
var OptionListLabelContainer = _styledComponents["default"].span(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2["default"])(["\n overflow: hidden;\n text-overflow: ellipsis;\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n color: ", ";\n"])), function (props) {
|
|
279
|
-
return props.theme.optionFontSize;
|
|
280
|
-
}, function (props) {
|
|
281
|
-
return props.theme.optionFontStyle;
|
|
282
|
-
}, function (props) {
|
|
283
|
-
return props.theme.optionFontWeight;
|
|
284
|
-
}, function (props) {
|
|
285
|
-
return props.backgroundType === "dark" ? props.theme.optionFontColorOnDark : props.theme.optionFontColor;
|
|
286
|
-
});
|
|
287
|
-
|
|
288
|
-
var SelectedOptionContainer = _styledComponents["default"].div(_templateObject6 || (_templateObject6 = (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"])), function (props) {
|
|
289
|
-
return props.iconPosition === "before" && "row" || "row-reverse";
|
|
290
|
-
}, function (props) {
|
|
291
|
-
return props.iconPosition === "before" && "flex-start" || "flex-end";
|
|
292
|
-
}, function (props) {
|
|
293
|
-
return props.multiple && props.label && "15px" || "0px";
|
|
294
|
-
}, function (props) {
|
|
295
|
-
return !props.multiple && "calc(100% - 24px)" || "auto";
|
|
296
|
-
}, function (props) {
|
|
297
|
-
return props.iconPosition === "after" && (props.label !== "" || props.label === undefined) && "content:','";
|
|
298
|
-
}, function (props) {
|
|
299
|
-
return props.iconPosition === "before" && (props.label !== "" || props.label === undefined) && "content:','";
|
|
300
|
-
});
|
|
301
|
-
|
|
302
|
-
var SelectedOptionLabelContainer = _styledComponents["default"].span(_templateObject7 || (_templateObject7 = (0, _taggedTemplateLiteral2["default"])(["\n font-family: ", ";\n overflow: hidden;\n text-overflow: ellipsis;\n"])), function (props) {
|
|
303
|
-
return props.theme.fontFamily;
|
|
304
|
-
});
|
|
305
|
-
|
|
306
|
-
var SelectedOptionIcon = _styledComponents["default"].img(_templateObject8 || (_templateObject8 = (0, _taggedTemplateLiteral2["default"])(["\n width: ", ";\n height: ", ";\n margin-left: ", ";\n margin-right: ", ";\n"])), function (props) {
|
|
307
|
-
return props.theme.valueIconSize;
|
|
308
|
-
}, function (props) {
|
|
309
|
-
return props.theme.valueIconSize;
|
|
310
|
-
}, function (props) {
|
|
311
|
-
return props.iconPosition === "after" && props.label !== "" && props.theme.valueIconSpacing || "0px";
|
|
312
|
-
}, function (props) {
|
|
313
|
-
return props.iconPosition === "before" && props.label !== "" && props.theme.valueIconSpacing || "0px";
|
|
314
|
-
});
|
|
315
|
-
|
|
316
|
-
var SelectedOptionIconContainer = _styledComponents["default"].div(_templateObject9 || (_templateObject9 = (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"])), function (props) {
|
|
317
|
-
return props.disabled ? props.backgroundType === "dark" ? props.theme.disabledColorOnDark : props.theme.disabledColor : props.backgroundType === "dark" ? props.theme.valueIconColorOnDark : props.theme.valueIconColor;
|
|
318
|
-
}, function (props) {
|
|
319
|
-
return props.theme.valueIconSize;
|
|
320
|
-
}, function (props) {
|
|
321
|
-
return props.theme.valueIconSize;
|
|
322
|
-
}, function (props) {
|
|
323
|
-
return props.iconPosition === "after" && props.label !== "" && props.theme.valueIconSpacing || "0px";
|
|
324
|
-
}, function (props) {
|
|
325
|
-
return props.iconPosition === "before" && props.label !== "" && props.theme.valueIconSpacing || "0px";
|
|
326
|
-
});
|
|
327
|
-
|
|
328
|
-
var SelectContainer = _styledComponents["default"].div(_templateObject10 || (_templateObject10 = (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"])), function (props) {
|
|
329
|
-
return calculateWidth(props.margin, props.size);
|
|
330
|
-
}, function (props) {
|
|
331
|
-
return props.margin && (0, _typeof2["default"])(props.margin) !== "object" ? _variables.spaces[props.margin] : "0px";
|
|
332
|
-
}, function (props) {
|
|
333
|
-
return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.top ? _variables.spaces[props.margin.top] : "";
|
|
334
|
-
}, function (props) {
|
|
335
|
-
return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.right ? _variables.spaces[props.margin.right] : "";
|
|
336
|
-
}, function (props) {
|
|
337
|
-
return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.bottom ? _variables.spaces[props.margin.bottom] : "";
|
|
338
|
-
}, function (props) {
|
|
339
|
-
return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.left ? _variables.spaces[props.margin.left] : "";
|
|
340
|
-
}, function (props) {
|
|
341
|
-
return props.theme.fontFamily;
|
|
342
|
-
}, function (props) {
|
|
343
|
-
return props.theme.assistiveTextFontSize;
|
|
344
|
-
}, function (props) {
|
|
345
|
-
return props.theme.assistiveTextFontStyle;
|
|
346
|
-
}, function (props) {
|
|
347
|
-
return props.theme.assistiveTextFontWeight;
|
|
348
|
-
}, function (props) {
|
|
349
|
-
return props.backgroundType === "dark" ? props.invalid === true ? props.theme.errorColorOnDark : props.theme.assistiveTextFontColorOnDark : props.invalid === true ? props.theme.errorColor : props.theme.assistiveTextFontColor;
|
|
350
|
-
}, function (props) {
|
|
351
|
-
return props.backgroundType === "dark" ? props.theme.disabledColorOnDark : props.theme.disabledColor;
|
|
352
|
-
}, function (props) {
|
|
353
|
-
return props.theme.fontFamily;
|
|
354
|
-
}, function (props) {
|
|
355
|
-
return props.theme.labelFontSize;
|
|
356
|
-
}, function (props) {
|
|
357
|
-
return props.theme.labelFontStyle;
|
|
358
|
-
}, function (props) {
|
|
359
|
-
return props.theme.labelFontWeight;
|
|
360
|
-
}, function (props) {
|
|
361
|
-
return props.backgroundType === "dark" ? props.invalid === true ? props.theme.errorColorOnDark : props.theme.labelFontColorOnDark : props.invalid === true ? props.theme.errorColor : props.theme.labelFontColor;
|
|
362
|
-
}, function (props) {
|
|
363
|
-
return props.backgroundType === "dark" ? props.theme.disabledColorOnDark : props.theme.disabledColor;
|
|
364
|
-
}, function (props) {
|
|
365
|
-
return props.theme.labelFontSize;
|
|
366
|
-
}, function (props) {
|
|
367
|
-
return props.theme.labelFontStyle;
|
|
368
|
-
}, function (props) {
|
|
369
|
-
return props.theme.labelFontWeight;
|
|
370
|
-
}, function (props) {
|
|
371
|
-
return props.backgroundType === "dark" ? props.invalid === true ? props.theme.errorColorOnDark : props.theme.labelFontColorOnDark : props.invalid === true ? props.theme.errorColor : props.theme.labelFontColor;
|
|
372
|
-
}, function (props) {
|
|
373
|
-
return props.backgroundType === "dark" ? props.theme.focusColorOnDark : props.theme.focusColor;
|
|
374
|
-
}, function (props) {
|
|
375
|
-
return props.backgroundType === "dark" ? props.theme.disabledColorOnDark : props.theme.disabledColor;
|
|
376
|
-
}, function (props) {
|
|
377
|
-
return props.theme.valueFontSize;
|
|
378
|
-
}, function (props) {
|
|
379
|
-
return props.theme.valueFontStyle;
|
|
380
|
-
}, function (props) {
|
|
381
|
-
return props.theme.valueFontWeight;
|
|
382
|
-
}, function (props) {
|
|
383
|
-
return props.backgroundType === "dark" ? props.theme.valueFontColorOnDark : props.theme.valueFontColor;
|
|
384
|
-
}, function (props) {
|
|
385
|
-
return props.theme.underlineThickness;
|
|
386
|
-
}, function (props) {
|
|
387
|
-
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;
|
|
388
|
-
}, function (props) {
|
|
389
|
-
return props.theme.underlineThickness;
|
|
390
|
-
}, function (props) {
|
|
391
|
-
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;
|
|
392
|
-
}, function (props) {
|
|
393
|
-
return props.theme.underlineThickness;
|
|
394
|
-
}, function (props) {
|
|
395
|
-
return props.backgroundType === "dark" ? props.invalid === true ? props.theme.errorColorOnDark : props.theme.underlineFocusColorOnDark : props.invalid === true ? props.theme.errorColor : props.theme.underlineFocusColor;
|
|
396
|
-
}, function (props) {
|
|
397
|
-
return props.theme.underlineThickness;
|
|
398
|
-
}, function (props) {
|
|
399
|
-
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;
|
|
400
|
-
}, function (props) {
|
|
401
|
-
return props.backgroundType === "dark" ? props.disabled && props.theme.disabledColorOnDark || props.theme.arrowColorOnDark : props.disabled && props.theme.disabledColor || props.theme.arrowColor;
|
|
402
|
-
}, function (props) {
|
|
403
|
-
return props.theme.optionBackgroundColor;
|
|
404
|
-
}, function (props) {
|
|
405
|
-
return props.theme.optionBorderColor;
|
|
406
|
-
}, function (props) {
|
|
407
|
-
return props.theme.optionBorderThickness;
|
|
408
|
-
}, function (props) {
|
|
409
|
-
return props.theme.optionBorderStyle;
|
|
410
|
-
}, function (props) {
|
|
411
|
-
return props.theme.scrollBarTrackColor;
|
|
412
|
-
}, function (props) {
|
|
413
|
-
return props.theme.scrollBarThumbColor;
|
|
414
|
-
}, function (props) {
|
|
415
|
-
return props.theme.optionPaddingBottom;
|
|
416
|
-
}, function (props) {
|
|
417
|
-
return props.theme.optionPaddingTop;
|
|
418
|
-
}, function (props) {
|
|
419
|
-
return props.backgroundType === "dark" ? props.theme.hoverOptionBackgroundColorOnDark : props.theme.hoverOptionBackgroundColor;
|
|
420
|
-
}, function (props) {
|
|
421
|
-
return props.backgroundType === "dark" ? props.theme.activeOptionBackgroundColorOnDark : props.theme.activeOptionBackgroundColor;
|
|
422
|
-
}, function (props) {
|
|
423
|
-
return props.backgroundType === "dark" ? props.theme.focusColorOnDark : props.theme.focusColor;
|
|
424
|
-
}, function (props) {
|
|
425
|
-
return props.backgroundType === "dark" ? props.theme.selectedOptionBackgroundColorOnDark : props.theme.selectedOptionBackgroundColor;
|
|
426
|
-
});
|
|
427
|
-
|
|
428
|
-
V3DxcSelect.propTypes = {
|
|
429
|
-
size: _propTypes["default"].oneOf((0, _toConsumableArray2["default"])(Object.keys(sizes))),
|
|
430
|
-
label: _propTypes["default"].string,
|
|
431
|
-
assistiveText: _propTypes["default"].string,
|
|
432
|
-
name: _propTypes["default"].string,
|
|
433
|
-
value: _propTypes["default"].oneOfType([_propTypes["default"].string, _propTypes["default"].number, _propTypes["default"].arrayOf(_propTypes["default"].oneOfType([_propTypes["default"].string, _propTypes["default"].number]))]),
|
|
434
|
-
disabled: _propTypes["default"].bool,
|
|
435
|
-
required: _propTypes["default"].bool,
|
|
436
|
-
invalid: _propTypes["default"].bool,
|
|
437
|
-
iconPosition: _propTypes["default"].oneOf(["after", "before"]),
|
|
438
|
-
onChange: _propTypes["default"].func,
|
|
439
|
-
options: _propTypes["default"].arrayOf(_propTypes["default"].shape({
|
|
440
|
-
value: _propTypes["default"].any.isRequired,
|
|
441
|
-
label: _propTypes["default"].string,
|
|
442
|
-
icon: _propTypes["default"].oneOfType([_propTypes["default"].element, _propTypes["default"].func]),
|
|
443
|
-
iconSrc: _propTypes["default"].string
|
|
444
|
-
})),
|
|
445
|
-
multiple: _propTypes["default"].bool,
|
|
446
|
-
margin: _propTypes["default"].oneOfType([_propTypes["default"].shape({
|
|
447
|
-
top: _propTypes["default"].oneOf(Object.keys(_variables.spaces)),
|
|
448
|
-
bottom: _propTypes["default"].oneOf(Object.keys(_variables.spaces)),
|
|
449
|
-
left: _propTypes["default"].oneOf(Object.keys(_variables.spaces)),
|
|
450
|
-
right: _propTypes["default"].oneOf(Object.keys(_variables.spaces))
|
|
451
|
-
}), _propTypes["default"].oneOf((0, _toConsumableArray2["default"])(Object.keys(_variables.spaces)))]),
|
|
452
|
-
tabIndex: _propTypes["default"].number
|
|
453
|
-
};
|
|
454
|
-
var _default = V3DxcSelect;
|
|
455
|
-
exports["default"] = _default;
|