@dxc-technology/halstack-react 0.0.0-e628009 → 0.0.0-e961efe
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 +0 -1
- package/dist/ThemeContext.js +40 -38
- package/dist/V3Select/V3Select.js +549 -0
- package/dist/V3Select/index.d.ts +27 -0
- package/dist/V3Textarea/index.d.ts +27 -0
- package/dist/accordion/index.d.ts +28 -0
- package/dist/accordion-group/index.d.ts +16 -0
- package/dist/alert/Alert.js +1 -1
- package/dist/box/index.d.ts +25 -0
- package/dist/button/index.d.ts +24 -0
- package/dist/card/index.d.ts +22 -0
- package/dist/checkbox/Checkbox.js +4 -5
- package/dist/checkbox/index.d.ts +24 -0
- package/dist/chip/index.d.ts +22 -0
- package/dist/common/variables.js +128 -123
- package/dist/date/Date.js +6 -6
- package/dist/date/index.d.ts +27 -0
- package/dist/dialog/index.d.ts +18 -0
- package/dist/dropdown/index.d.ts +26 -0
- package/dist/file-input/FileItem.js +8 -1
- package/dist/file-input/index.d.ts +1 -1
- package/dist/footer/index.d.ts +25 -0
- package/dist/header/Header.js +59 -23
- package/dist/header/index.d.ts +25 -0
- package/dist/heading/index.d.ts +17 -0
- package/dist/input-text/InputText.js +4 -4
- package/dist/input-text/index.d.ts +36 -0
- package/dist/link/index.d.ts +23 -0
- package/dist/main.d.ts +36 -4
- package/dist/main.js +9 -17
- package/dist/paginator/Paginator.js +50 -28
- package/dist/paginator/index.d.ts +20 -0
- package/dist/password-input/PasswordInput.js +6 -1
- package/dist/progress-bar/index.d.ts +18 -0
- package/dist/radio/index.d.ts +23 -0
- package/dist/resultsetTable/index.d.ts +19 -0
- package/dist/select/Select.js +848 -301
- package/dist/{new-select → select}/index.d.ts +1 -1
- package/dist/sidenav/index.d.ts +13 -0
- package/dist/slider/index.d.ts +29 -0
- package/dist/spinner/index.d.ts +17 -0
- package/dist/stories/Button.js +71 -0
- package/dist/stories/Button.stories.js +55 -0
- package/dist/stories/Header.js +67 -0
- package/dist/stories/Header.stories.js +31 -0
- package/dist/stories/Introduction.stories.mdx +211 -0
- package/dist/stories/Page.js +68 -0
- package/dist/stories/Page.stories.js +39 -0
- package/dist/stories/assets/code-brackets.svg +1 -0
- package/dist/stories/assets/colors.svg +1 -0
- package/dist/stories/assets/comments.svg +1 -0
- package/dist/stories/assets/direction.svg +1 -0
- package/dist/stories/assets/flow.svg +1 -0
- package/dist/stories/assets/plugin.svg +1 -0
- package/dist/stories/assets/repo.svg +1 -0
- package/dist/stories/assets/stackalt.svg +1 -0
- package/dist/stories/button.css +30 -0
- package/dist/stories/header.css +26 -0
- package/dist/stories/page.css +69 -0
- package/dist/switch/index.d.ts +24 -0
- package/dist/table/index.d.ts +13 -0
- package/dist/tabs/index.d.ts +19 -0
- package/dist/tag/index.d.ts +24 -0
- package/dist/text-input/TextInput.js +8 -5
- package/dist/toggle/index.d.ts +21 -0
- package/dist/toggle-group/index.d.ts +21 -0
- package/dist/upload/Upload.js +3 -3
- package/dist/upload/index.d.ts +15 -0
- package/dist/wizard/index.d.ts +18 -0
- package/package.json +14 -10
- package/test/Date.test.js +34 -36
- package/test/InputText.test.js +17 -26
- package/test/Paginator.test.js +5 -1
- package/test/ResultsetTable.test.js +5 -4
- package/test/Select.test.js +374 -171
- package/test/TextInput.test.js +5 -5
- package/test/Upload.test.js +4 -4
- package/test/V3Select.test.js +212 -0
- package/dist/new-select/NewSelect.js +0 -836
- package/dist/tabs-for-sections/TabsForSections.js +0 -92
- package/test/TabsForSections.test.js +0 -34
|
@@ -1,836 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard");
|
|
4
|
-
|
|
5
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
6
|
-
|
|
7
|
-
Object.defineProperty(exports, "__esModule", {
|
|
8
|
-
value: true
|
|
9
|
-
});
|
|
10
|
-
exports["default"] = void 0;
|
|
11
|
-
|
|
12
|
-
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
|
13
|
-
|
|
14
|
-
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
15
|
-
|
|
16
|
-
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
17
|
-
|
|
18
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
19
|
-
|
|
20
|
-
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
21
|
-
|
|
22
|
-
var _useTheme = _interopRequireDefault(require("../useTheme.js"));
|
|
23
|
-
|
|
24
|
-
var _variables = require("../common/variables.js");
|
|
25
|
-
|
|
26
|
-
var _BackgroundColorContext = _interopRequireDefault(require("../BackgroundColorContext.js"));
|
|
27
|
-
|
|
28
|
-
var _uuid = require("uuid");
|
|
29
|
-
|
|
30
|
-
var _utils = require("../common/utils.js");
|
|
31
|
-
|
|
32
|
-
function _templateObject22() {
|
|
33
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n height: 16px;\n width: 16px;\n margin-left: 4px;\n color: #4d4d4d;\n"]);
|
|
34
|
-
|
|
35
|
-
_templateObject22 = function _templateObject22() {
|
|
36
|
-
return data;
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
return data;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
function _templateObject21() {
|
|
43
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n"]);
|
|
44
|
-
|
|
45
|
-
_templateObject21 = function _templateObject21() {
|
|
46
|
-
return data;
|
|
47
|
-
};
|
|
48
|
-
|
|
49
|
-
return data;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
function _templateObject20() {
|
|
53
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-wrap: wrap;\n align-content: center;\n height: 24px;\n width: 24px;\n margin-right: ", ";\n"]);
|
|
54
|
-
|
|
55
|
-
_templateObject20 = function _templateObject20() {
|
|
56
|
-
return data;
|
|
57
|
-
};
|
|
58
|
-
|
|
59
|
-
return data;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
function _templateObject19() {
|
|
63
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n overflow: hidden;\n ", "\n"]);
|
|
64
|
-
|
|
65
|
-
_templateObject19 = function _templateObject19() {
|
|
66
|
-
return data;
|
|
67
|
-
};
|
|
68
|
-
|
|
69
|
-
return data;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
function _templateObject18() {
|
|
73
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n justify-content: space-between;\n padding: 4px 8px 3px 8px;\n min-height: 24px;\n ", ";\n"]);
|
|
74
|
-
|
|
75
|
-
_templateObject18 = function _templateObject18() {
|
|
76
|
-
return data;
|
|
77
|
-
};
|
|
78
|
-
|
|
79
|
-
return data;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
function _templateObject17() {
|
|
83
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n padding: 0 8px;\n line-height: 1.715em;\n cursor: pointer;\n\n ", ";\n"]);
|
|
84
|
-
|
|
85
|
-
_templateObject17 = function _templateObject17() {
|
|
86
|
-
return data;
|
|
87
|
-
};
|
|
88
|
-
|
|
89
|
-
return data;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
function _templateObject16() {
|
|
93
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n padding: 4px 16px;\n line-height: 1.715em;\n font-weight: 600;\n"]);
|
|
94
|
-
|
|
95
|
-
_templateObject16 = function _templateObject16() {
|
|
96
|
-
return data;
|
|
97
|
-
};
|
|
98
|
-
|
|
99
|
-
return data;
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
function _templateObject15() {
|
|
103
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-wrap: wrap;\n align-content: center;\n height: 16px;\n width: 16px;\n padding: 4px;\n margin-right: calc(1rem * 0.25);\n"]);
|
|
104
|
-
|
|
105
|
-
_templateObject15 = function _templateObject15() {
|
|
106
|
-
return data;
|
|
107
|
-
};
|
|
108
|
-
|
|
109
|
-
return data;
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
function _templateObject14() {
|
|
113
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n padding: 4px 16px;\n color: ", ";\n font-size: 0.875rem;\n line-height: 1.715em;\n"]);
|
|
114
|
-
|
|
115
|
-
_templateObject14 = function _templateObject14() {
|
|
116
|
-
return data;
|
|
117
|
-
};
|
|
118
|
-
|
|
119
|
-
return data;
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
function _templateObject13() {
|
|
123
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n position: absolute;\n z-index: 1;\n max-height: 304px;\n overflow-x: auto;\n top: calc(100% + 4px);\n left: 0;\n margin: 0;\n padding: 4px 0;\n width: 100%;\n box-sizing: border-box;\n background-color: #ffffff;\n border-radius: 4px;\n border: 1px solid ", ";\n box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);\n cursor: default;\n font-family: ", ";\n color: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n"]);
|
|
124
|
-
|
|
125
|
-
_templateObject13 = function _templateObject13() {
|
|
126
|
-
return data;
|
|
127
|
-
};
|
|
128
|
-
|
|
129
|
-
return data;
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
function _templateObject12() {
|
|
133
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-wrap: wrap;\n align-content: center;\n height: 24px;\n width: 24px;\n font-size: 1rem;\n font-family: ", ";\n border: 1px solid transparent;\n border-radius: 4px;\n padding: 3px;\n margin-left: calc(1rem * 0.25);\n ", "\n\n background-color: ", ";\n color: ", ";\n\n ", "\n\n svg {\n line-height: 18px;\n }\n"]);
|
|
134
|
-
|
|
135
|
-
_templateObject12 = function _templateObject12() {
|
|
136
|
-
return data;
|
|
137
|
-
};
|
|
138
|
-
|
|
139
|
-
return data;
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
function _templateObject11() {
|
|
143
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-wrap: wrap;\n align-content: center;\n height: 16px;\n width: 16px;\n padding: 4px;\n margin-left: calc(1rem * 0.25);\n\n color: ", ";\n"]);
|
|
144
|
-
|
|
145
|
-
_templateObject11 = function _templateObject11() {
|
|
146
|
-
return data;
|
|
147
|
-
};
|
|
148
|
-
|
|
149
|
-
return data;
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
function _templateObject10() {
|
|
153
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n min-height: 1.5em;\n color: ", ";\n font-family: ", ";\n font-size: 0.75rem;\n font-weight: 400;\n line-height: 1.5em;\n"]);
|
|
154
|
-
|
|
155
|
-
_templateObject10 = function _templateObject10() {
|
|
156
|
-
return data;
|
|
157
|
-
};
|
|
158
|
-
|
|
159
|
-
return data;
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
function _templateObject9() {
|
|
163
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-wrap: wrap;\n align-content: center;\n padding: 3px;\n height: 18px;\n width: 18px;\n margin-left: calc(1rem * 0.25);\n pointer-events: none;\n color: ", ";\n\n svg {\n line-height: 18px;\n font-size: 1.25rem;\n }\n"]);
|
|
164
|
-
|
|
165
|
-
_templateObject9 = function _templateObject9() {
|
|
166
|
-
return data;
|
|
167
|
-
};
|
|
168
|
-
|
|
169
|
-
return data;
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
function _templateObject8() {
|
|
173
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n grid-area: 1 / 1 / 1 / 1;\n height: calc(calc(1rem * 2.5) - calc(1px * 2));\n background: none;\n border: none;\n outline: none;\n padding: 0 calc(1rem * 0.5);\n\n color: ", ";\n\n font-family: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n line-height: 1.5em;\n\n ::placeholder {\n color: ", ";\n }\n"]);
|
|
174
|
-
|
|
175
|
-
_templateObject8 = function _templateObject8() {
|
|
176
|
-
return data;
|
|
177
|
-
};
|
|
178
|
-
|
|
179
|
-
return data;
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
function _templateObject7() {
|
|
183
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n grid-area: 1 / 1 / 1 / 1;\n display: inline-flex;\n align-items: center;\n height: calc(calc(1rem * 2.5) - calc(1px * 2));\n padding: 0 calc(1rem * 0.5);\n user-select: none;\n overflow: hidden;\n\n color: ", ";\n\n font-family: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n line-height: 1.5em;\n"]);
|
|
184
|
-
|
|
185
|
-
_templateObject7 = function _templateObject7() {
|
|
186
|
-
return data;
|
|
187
|
-
};
|
|
188
|
-
|
|
189
|
-
return data;
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
function _templateObject6() {
|
|
193
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n display: grid;\n width: 100%;\n"]);
|
|
194
|
-
|
|
195
|
-
_templateObject6 = function _templateObject6() {
|
|
196
|
-
return data;
|
|
197
|
-
};
|
|
198
|
-
|
|
199
|
-
return data;
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
function _templateObject5() {
|
|
203
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n position: relative;\n align-items: center;\n height: calc(calc(1rem * 2.5) - calc(1px * 2));\n margin: calc(1rem * 0.25) 0;\n padding: 0 calc(1rem * 0.5);\n outline: none;\n ", "\n box-shadow: 0 0 0 2px transparent;\n border-radius: 4px;\n border: 1px solid\n ", ";\n ", "\n ", ";\n\n ", ";\n"]);
|
|
204
|
-
|
|
205
|
-
_templateObject5 = function _templateObject5() {
|
|
206
|
-
return data;
|
|
207
|
-
};
|
|
208
|
-
|
|
209
|
-
return data;
|
|
210
|
-
}
|
|
211
|
-
|
|
212
|
-
function _templateObject4() {
|
|
213
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n color: ", ";\n\n font-family: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n line-height: 1.5em;\n"]);
|
|
214
|
-
|
|
215
|
-
_templateObject4 = function _templateObject4() {
|
|
216
|
-
return data;
|
|
217
|
-
};
|
|
218
|
-
|
|
219
|
-
return data;
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
function _templateObject3() {
|
|
223
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n font-weight: ", ";\n"]);
|
|
224
|
-
|
|
225
|
-
_templateObject3 = function _templateObject3() {
|
|
226
|
-
return data;
|
|
227
|
-
};
|
|
228
|
-
|
|
229
|
-
return data;
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
function _templateObject2() {
|
|
233
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n color: ", ";\n\n font-family: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n line-height: 1.715em;\n"]);
|
|
234
|
-
|
|
235
|
-
_templateObject2 = function _templateObject2() {
|
|
236
|
-
return data;
|
|
237
|
-
};
|
|
238
|
-
|
|
239
|
-
return data;
|
|
240
|
-
}
|
|
241
|
-
|
|
242
|
-
function _templateObject() {
|
|
243
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-direction: column;\n\n width: ", ";\n margin: ", ";\n margin-top: ", ";\n margin-right: ", ";\n margin-bottom: ", ";\n margin-left: ", ";\n"]);
|
|
244
|
-
|
|
245
|
-
_templateObject = function _templateObject() {
|
|
246
|
-
return data;
|
|
247
|
-
};
|
|
248
|
-
|
|
249
|
-
return data;
|
|
250
|
-
}
|
|
251
|
-
|
|
252
|
-
var getNotOptionalErrorMessage = function getNotOptionalErrorMessage() {
|
|
253
|
-
return "This field is required. Please, enter a value.";
|
|
254
|
-
};
|
|
255
|
-
|
|
256
|
-
var selectIcons = {
|
|
257
|
-
error: _react["default"].createElement("svg", {
|
|
258
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
259
|
-
height: "24px",
|
|
260
|
-
viewBox: "0 0 24 24",
|
|
261
|
-
width: "24px",
|
|
262
|
-
fill: "currentColor"
|
|
263
|
-
}, _react["default"].createElement("path", {
|
|
264
|
-
d: "M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"
|
|
265
|
-
})),
|
|
266
|
-
arrowUp: _react["default"].createElement("svg", {
|
|
267
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
268
|
-
height: "24px",
|
|
269
|
-
viewBox: "0 0 24 24",
|
|
270
|
-
width: "24px",
|
|
271
|
-
fill: "currentColor"
|
|
272
|
-
}, _react["default"].createElement("path", {
|
|
273
|
-
d: "M0 0h24v24H0V0z",
|
|
274
|
-
fill: "none"
|
|
275
|
-
}), _react["default"].createElement("path", {
|
|
276
|
-
d: "M7.41 15.41L12 10.83l4.59 4.58L18 14l-6-6-6 6 1.41 1.41z"
|
|
277
|
-
})),
|
|
278
|
-
arrowDown: _react["default"].createElement("svg", {
|
|
279
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
280
|
-
height: "24px",
|
|
281
|
-
viewBox: "0 0 24 24",
|
|
282
|
-
width: "24px",
|
|
283
|
-
fill: "currentColor"
|
|
284
|
-
}, _react["default"].createElement("path", {
|
|
285
|
-
d: "M0 0h24v24H0V0z",
|
|
286
|
-
fill: "none"
|
|
287
|
-
}), _react["default"].createElement("path", {
|
|
288
|
-
d: "M7.41 8.59L12 13.17l4.59-4.58L18 10l-6 6-6-6 1.41-1.41z"
|
|
289
|
-
})),
|
|
290
|
-
clear: _react["default"].createElement("svg", {
|
|
291
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
292
|
-
width: "24",
|
|
293
|
-
height: "24",
|
|
294
|
-
viewBox: "0 0 24 24",
|
|
295
|
-
fill: "currentColor"
|
|
296
|
-
}, _react["default"].createElement("path", {
|
|
297
|
-
d: "M0 0h24v24H0V0z",
|
|
298
|
-
fill: "none"
|
|
299
|
-
}), _react["default"].createElement("path", {
|
|
300
|
-
d: "M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"
|
|
301
|
-
})),
|
|
302
|
-
selected: _react["default"].createElement("svg", {
|
|
303
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
304
|
-
height: "24px",
|
|
305
|
-
viewBox: "0 0 24 24",
|
|
306
|
-
width: "24px",
|
|
307
|
-
fill: "currentColor"
|
|
308
|
-
}, _react["default"].createElement("path", {
|
|
309
|
-
d: "M0 0h24v24H0z",
|
|
310
|
-
fill: "none"
|
|
311
|
-
}), _react["default"].createElement("path", {
|
|
312
|
-
d: "M9 16.2L4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4L9 16.2z"
|
|
313
|
-
})),
|
|
314
|
-
searchOff: _react["default"].createElement("svg", {
|
|
315
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
316
|
-
"enable-background": "new 0 0 24 24",
|
|
317
|
-
height: "24px",
|
|
318
|
-
viewBox: "0 0 24 24",
|
|
319
|
-
width: "24px",
|
|
320
|
-
fill: "currentColor"
|
|
321
|
-
}, _react["default"].createElement("g", null, _react["default"].createElement("rect", {
|
|
322
|
-
fill: "none",
|
|
323
|
-
height: "24",
|
|
324
|
-
width: "24"
|
|
325
|
-
})), _react["default"].createElement("g", null, _react["default"].createElement("g", null, _react["default"].createElement("path", {
|
|
326
|
-
d: "M15.5,14h-0.79l-0.28-0.27C15.41,12.59,16,11.11,16,9.5C16,5.91,13.09,3,9.5,3C6.08,3,3.28,5.64,3.03,9h2.02 C5.3,6.75,7.18,5,9.5,5C11.99,5,14,7.01,14,9.5S11.99,14,9.5,14c-0.17,0-0.33-0.03-0.5-0.05v2.02C9.17,15.99,9.33,16,9.5,16 c1.61,0,3.09-0.59,4.23-1.57L14,14.71v0.79l5,4.99L20.49,19L15.5,14z"
|
|
327
|
-
}), _react["default"].createElement("polygon", {
|
|
328
|
-
points: "6.47,10.82 4,13.29 1.53,10.82 0.82,11.53 3.29,14 0.82,16.47 1.53,17.18 4,14.71 6.47,17.18 7.18,16.47 4.71,14 7.18,11.53"
|
|
329
|
-
}))))
|
|
330
|
-
};
|
|
331
|
-
|
|
332
|
-
var DxcNewSelect = _react["default"].forwardRef(function (_ref, ref) {
|
|
333
|
-
var _ref3;
|
|
334
|
-
|
|
335
|
-
var _ref$label = _ref.label,
|
|
336
|
-
label = _ref$label === void 0 ? "" : _ref$label,
|
|
337
|
-
_ref$name = _ref.name,
|
|
338
|
-
name = _ref$name === void 0 ? "" : _ref$name,
|
|
339
|
-
value = _ref.value,
|
|
340
|
-
options = _ref.options,
|
|
341
|
-
_ref$helperText = _ref.helperText,
|
|
342
|
-
helperText = _ref$helperText === void 0 ? "" : _ref$helperText,
|
|
343
|
-
_ref$placeholder = _ref.placeholder,
|
|
344
|
-
placeholder = _ref$placeholder === void 0 ? "" : _ref$placeholder,
|
|
345
|
-
_ref$disabled = _ref.disabled,
|
|
346
|
-
disabled = _ref$disabled === void 0 ? false : _ref$disabled,
|
|
347
|
-
_ref$optional = _ref.optional,
|
|
348
|
-
optional = _ref$optional === void 0 ? false : _ref$optional,
|
|
349
|
-
_ref$searchable = _ref.searchable,
|
|
350
|
-
searchable = _ref$searchable === void 0 ? false : _ref$searchable,
|
|
351
|
-
onChange = _ref.onChange,
|
|
352
|
-
onBlur = _ref.onBlur,
|
|
353
|
-
_ref$error = _ref.error,
|
|
354
|
-
error = _ref$error === void 0 ? "" : _ref$error,
|
|
355
|
-
margin = _ref.margin,
|
|
356
|
-
_ref$size = _ref.size,
|
|
357
|
-
size = _ref$size === void 0 ? "medium" : _ref$size,
|
|
358
|
-
_ref$tabIndex = _ref.tabIndex,
|
|
359
|
-
tabIndex = _ref$tabIndex === void 0 ? 0 : _ref$tabIndex;
|
|
360
|
-
|
|
361
|
-
var _useState = (0, _react.useState)("select-".concat((0, _uuid.v4)())),
|
|
362
|
-
_useState2 = (0, _slicedToArray2["default"])(_useState, 1),
|
|
363
|
-
selectId = _useState2[0];
|
|
364
|
-
|
|
365
|
-
var _useState3 = (0, _react.useState)(""),
|
|
366
|
-
_useState4 = (0, _slicedToArray2["default"])(_useState3, 2),
|
|
367
|
-
innerValue = _useState4[0],
|
|
368
|
-
setInnerValue = _useState4[1];
|
|
369
|
-
|
|
370
|
-
var _useState5 = (0, _react.useState)(""),
|
|
371
|
-
_useState6 = (0, _slicedToArray2["default"])(_useState5, 2),
|
|
372
|
-
searchValue = _useState6[0],
|
|
373
|
-
setSearchValue = _useState6[1];
|
|
374
|
-
|
|
375
|
-
var _useState7 = (0, _react.useState)(false),
|
|
376
|
-
_useState8 = (0, _slicedToArray2["default"])(_useState7, 2),
|
|
377
|
-
isBackgroundValue = _useState8[0],
|
|
378
|
-
changeIsBackgroundValue = _useState8[1];
|
|
379
|
-
|
|
380
|
-
var _useState9 = (0, _react.useState)(false),
|
|
381
|
-
_useState10 = (0, _slicedToArray2["default"])(_useState9, 2),
|
|
382
|
-
isOpen = _useState10[0],
|
|
383
|
-
changeIsOpen = _useState10[1];
|
|
384
|
-
|
|
385
|
-
var _useState11 = (0, _react.useState)(false),
|
|
386
|
-
_useState12 = (0, _slicedToArray2["default"])(_useState11, 2),
|
|
387
|
-
isActiveOption = _useState12[0],
|
|
388
|
-
changeIsActiveOption = _useState12[1];
|
|
389
|
-
|
|
390
|
-
var _useState13 = (0, _react.useState)([]),
|
|
391
|
-
_useState14 = (0, _slicedToArray2["default"])(_useState13, 2),
|
|
392
|
-
filteredOptions = _useState14[0],
|
|
393
|
-
setFilteredOptions = _useState14[1];
|
|
394
|
-
|
|
395
|
-
var _useState15 = (0, _react.useState)(0),
|
|
396
|
-
_useState16 = (0, _slicedToArray2["default"])(_useState15, 2),
|
|
397
|
-
visualFocusIndex = _useState16[0],
|
|
398
|
-
changeVisualFocusIndex = _useState16[1];
|
|
399
|
-
|
|
400
|
-
var selectInputRef = (0, _react.useRef)(null);
|
|
401
|
-
var colorsTheme = (0, _useTheme["default"])();
|
|
402
|
-
var backgroundType = (0, _react.useContext)(_BackgroundColorContext["default"]);
|
|
403
|
-
|
|
404
|
-
var notOptionalCheck = function notOptionalCheck(value) {
|
|
405
|
-
return value === "" && !optional;
|
|
406
|
-
};
|
|
407
|
-
|
|
408
|
-
var canBeOpenOptions = function canBeOpenOptions() {
|
|
409
|
-
return !disabled && (options === null || options === void 0 ? void 0 : options.length) > 0 && groupsHaveOptions();
|
|
410
|
-
};
|
|
411
|
-
|
|
412
|
-
var groupsHaveOptions = function groupsHaveOptions() {
|
|
413
|
-
var _options$;
|
|
414
|
-
|
|
415
|
-
return (_options$ = options[0]) !== null && _options$ !== void 0 && _options$.hasOwnProperty("options") ? options[0].options ? options.some(function (groupOption) {
|
|
416
|
-
return groupOption.options.length > 0;
|
|
417
|
-
}) : false : true;
|
|
418
|
-
};
|
|
419
|
-
|
|
420
|
-
var filteredGroupsHaveOptions = function filteredGroupsHaveOptions() {
|
|
421
|
-
var _filteredOptions$;
|
|
422
|
-
|
|
423
|
-
return (_filteredOptions$ = filteredOptions[0]) !== null && _filteredOptions$ !== void 0 && _filteredOptions$.options ? filteredOptions.some(function (groupOption) {
|
|
424
|
-
var _groupOption$options;
|
|
425
|
-
|
|
426
|
-
return ((_groupOption$options = groupOption.options) === null || _groupOption$options === void 0 ? void 0 : _groupOption$options.length) > 0;
|
|
427
|
-
}) : true;
|
|
428
|
-
};
|
|
429
|
-
|
|
430
|
-
var openOptions = function openOptions() {
|
|
431
|
-
if (canBeOpenOptions()) {
|
|
432
|
-
searchable && changeIsBackgroundValue(true);
|
|
433
|
-
changeIsOpen(true);
|
|
434
|
-
}
|
|
435
|
-
};
|
|
436
|
-
|
|
437
|
-
var closeOptions = function closeOptions() {
|
|
438
|
-
searchable && changeIsBackgroundValue(false);
|
|
439
|
-
changeIsOpen(false);
|
|
440
|
-
changeVisualFocusIndex(0);
|
|
441
|
-
};
|
|
442
|
-
|
|
443
|
-
var handleSelectChangeValue = function handleSelectChangeValue(newValue) {
|
|
444
|
-
value !== null && value !== void 0 ? value : setInnerValue(newValue);
|
|
445
|
-
if (notOptionalCheck(newValue)) onChange === null || onChange === void 0 ? void 0 : onChange({
|
|
446
|
-
value: newValue,
|
|
447
|
-
error: getNotOptionalErrorMessage()
|
|
448
|
-
});else onChange === null || onChange === void 0 ? void 0 : onChange({
|
|
449
|
-
value: newValue,
|
|
450
|
-
error: null
|
|
451
|
-
});
|
|
452
|
-
};
|
|
453
|
-
|
|
454
|
-
var handleSelectOnClick = function handleSelectOnClick() {
|
|
455
|
-
isOpen ? closeOptions() : openOptions();
|
|
456
|
-
searchable && selectInputRef.current.focus();
|
|
457
|
-
};
|
|
458
|
-
|
|
459
|
-
var handleSelectOnFocus = function handleSelectOnFocus() {
|
|
460
|
-
searchable && selectInputRef.current.focus();
|
|
461
|
-
};
|
|
462
|
-
|
|
463
|
-
var handleSelectOnBlur = function handleSelectOnBlur(event) {
|
|
464
|
-
// focus leaves container (outside, not to childs)
|
|
465
|
-
if (!event.currentTarget.contains(event.relatedTarget)) {
|
|
466
|
-
setSearchValue("");
|
|
467
|
-
closeOptions();
|
|
468
|
-
if (notOptionalCheck(value !== null && value !== void 0 ? value : innerValue)) onBlur === null || onBlur === void 0 ? void 0 : onBlur({
|
|
469
|
-
value: value !== null && value !== void 0 ? value : innerValue,
|
|
470
|
-
error: getNotOptionalErrorMessage()
|
|
471
|
-
});else onBlur === null || onBlur === void 0 ? void 0 : onBlur({
|
|
472
|
-
value: value !== null && value !== void 0 ? value : innerValue,
|
|
473
|
-
error: null
|
|
474
|
-
});
|
|
475
|
-
}
|
|
476
|
-
};
|
|
477
|
-
|
|
478
|
-
var handleSearchIOnChange = function handleSearchIOnChange(event) {
|
|
479
|
-
openOptions();
|
|
480
|
-
setSearchValue(event.target.value);
|
|
481
|
-
};
|
|
482
|
-
|
|
483
|
-
var handleClearActionOnClick = function handleClearActionOnClick(event) {
|
|
484
|
-
event.stopPropagation(); // not bubbling, clear not executes select event onClick
|
|
485
|
-
|
|
486
|
-
setSearchValue("");
|
|
487
|
-
};
|
|
488
|
-
|
|
489
|
-
var getSingleSelectedOption = function getSingleSelectedOption() {
|
|
490
|
-
var val = value !== null && value !== void 0 ? value : innerValue;
|
|
491
|
-
var selectedOption;
|
|
492
|
-
|
|
493
|
-
if ((options === null || options === void 0 ? void 0 : options.length) > 0) {
|
|
494
|
-
options.forEach(function (option) {
|
|
495
|
-
if (option.options) {
|
|
496
|
-
option.options.forEach(function (singleOption) {
|
|
497
|
-
if (singleOption.value === val) selectedOption = singleOption;
|
|
498
|
-
});
|
|
499
|
-
} else if (option.value === val) selectedOption = option;
|
|
500
|
-
});
|
|
501
|
-
}
|
|
502
|
-
|
|
503
|
-
return selectedOption;
|
|
504
|
-
};
|
|
505
|
-
|
|
506
|
-
var selectedOption = (0, _react.useMemo)(function () {
|
|
507
|
-
return getSingleSelectedOption();
|
|
508
|
-
}, [value !== null && value !== void 0 ? value : innerValue]);
|
|
509
|
-
(0, _react.useEffect)(function () {
|
|
510
|
-
if (searchable && (options === null || options === void 0 ? void 0 : options.length) > 0) {
|
|
511
|
-
changeVisualFocusIndex(0);
|
|
512
|
-
|
|
513
|
-
if (options[0].options) {
|
|
514
|
-
setFilteredOptions(options.map(function (optionGroup) {
|
|
515
|
-
var group = JSON.parse(JSON.stringify(optionGroup)); // anything better?
|
|
516
|
-
|
|
517
|
-
group.options = group.options.filter(function (option) {
|
|
518
|
-
return option.label.toUpperCase().includes(searchValue.toUpperCase());
|
|
519
|
-
});
|
|
520
|
-
return group;
|
|
521
|
-
}));
|
|
522
|
-
} else setFilteredOptions(options.filter(function (option) {
|
|
523
|
-
return option.label.toUpperCase().includes(searchValue.toUpperCase());
|
|
524
|
-
}));
|
|
525
|
-
}
|
|
526
|
-
}, [options, searchable, searchValue]);
|
|
527
|
-
|
|
528
|
-
var lastIndex = function lastIndex() {
|
|
529
|
-
var _options$2;
|
|
530
|
-
|
|
531
|
-
var last = 0;
|
|
532
|
-
|
|
533
|
-
var reducer = function reducer(acc, current) {
|
|
534
|
-
return acc + current.options.length;
|
|
535
|
-
};
|
|
536
|
-
|
|
537
|
-
if (searchable && filteredOptions.length > 0) filteredOptions[0].options ? last = filteredOptions.reduce(reducer, 0) - 1 : last = filteredOptions.length - 1;else (_options$2 = options[0]) !== null && _options$2 !== void 0 && _options$2.options ? last = options.reduce(reducer, 0) - 1 : last = options.length - 1;
|
|
538
|
-
return last;
|
|
539
|
-
};
|
|
540
|
-
|
|
541
|
-
var lastIndexValue = (0, _react.useMemo)(function () {
|
|
542
|
-
return lastIndex();
|
|
543
|
-
}, [searchable, searchable ? filteredOptions : options]);
|
|
544
|
-
|
|
545
|
-
var Option = function Option(_ref2) {
|
|
546
|
-
var option = _ref2.option,
|
|
547
|
-
index = _ref2.index,
|
|
548
|
-
_ref2$isGroupedOption = _ref2.isGroupedOption,
|
|
549
|
-
isGroupedOption = _ref2$isGroupedOption === void 0 ? false : _ref2$isGroupedOption;
|
|
550
|
-
var isSelected = (value !== null && value !== void 0 ? value : innerValue) === option.value;
|
|
551
|
-
var isLastOption = index === (optional ? lastIndexValue + 1 : lastIndexValue);
|
|
552
|
-
return _react["default"].createElement(OptionItem, {
|
|
553
|
-
onMouseDown: function onMouseDown(event) {
|
|
554
|
-
event.button === 0 && changeIsActiveOption(true); // left button only
|
|
555
|
-
},
|
|
556
|
-
onMouseUp: function onMouseUp(event) {
|
|
557
|
-
if (event.button === 0 && isActiveOption) {
|
|
558
|
-
// left button only
|
|
559
|
-
handleSelectChangeValue(option.value);
|
|
560
|
-
setSearchValue("");
|
|
561
|
-
changeIsActiveOption(false);
|
|
562
|
-
closeOptions(); // if not multiple
|
|
563
|
-
}
|
|
564
|
-
},
|
|
565
|
-
onMouseEnter: function onMouseEnter() {
|
|
566
|
-
changeVisualFocusIndex(index);
|
|
567
|
-
},
|
|
568
|
-
onMouseLeave: function onMouseLeave() {
|
|
569
|
-
changeIsActiveOption(false);
|
|
570
|
-
},
|
|
571
|
-
visualFocused: visualFocusIndex === index,
|
|
572
|
-
active: visualFocusIndex === index && isActiveOption,
|
|
573
|
-
selected: isSelected
|
|
574
|
-
}, _react["default"].createElement(StyledOption, {
|
|
575
|
-
visualFocused: visualFocusIndex === index,
|
|
576
|
-
active: visualFocusIndex === index && isActiveOption,
|
|
577
|
-
selected: isSelected,
|
|
578
|
-
last: isLastOption
|
|
579
|
-
}, _react["default"].createElement(OptionContent, {
|
|
580
|
-
grouped: isGroupedOption
|
|
581
|
-
}, option.icon && _react["default"].createElement(OptionIcon, null, option.icon), _react["default"].createElement(OptionLabel, null, option.label)), isSelected && _react["default"].createElement(SelectedIcon, null, selectIcons.selected)));
|
|
582
|
-
};
|
|
583
|
-
|
|
584
|
-
var global_index = optional
|
|
585
|
-
/*&& !multiple*/
|
|
586
|
-
? 0 : -1; // placeholder becomes an option and its always index = 0
|
|
587
|
-
|
|
588
|
-
var mapOptionFunc = function mapOptionFunc(option, index) {
|
|
589
|
-
if (option.options) {
|
|
590
|
-
return _react["default"].createElement(_react["default"].Fragment, null, option.options.length > 0 && _react["default"].createElement(OptionGroupLabel, null, option.label), option.options.map(function (singleOption) {
|
|
591
|
-
global_index++;
|
|
592
|
-
return _react["default"].createElement(Option, {
|
|
593
|
-
option: singleOption,
|
|
594
|
-
index: global_index,
|
|
595
|
-
isGroupedOption: true
|
|
596
|
-
});
|
|
597
|
-
}));
|
|
598
|
-
} else return _react["default"].createElement(Option, {
|
|
599
|
-
option: option,
|
|
600
|
-
index: optional
|
|
601
|
-
/*&& !multiple*/
|
|
602
|
-
? index + 1 : index
|
|
603
|
-
});
|
|
604
|
-
};
|
|
605
|
-
|
|
606
|
-
return _react["default"].createElement(_styledComponents.ThemeProvider, {
|
|
607
|
-
theme: colorsTheme.newSelect
|
|
608
|
-
}, _react["default"].createElement(DxcSelect, {
|
|
609
|
-
margin: margin,
|
|
610
|
-
size: size,
|
|
611
|
-
ref: ref
|
|
612
|
-
}, _react["default"].createElement(Label, {
|
|
613
|
-
htmlFor: selectId,
|
|
614
|
-
disabled: disabled,
|
|
615
|
-
backgroundType: backgroundType
|
|
616
|
-
}, label, " ", optional && _react["default"].createElement(OptionalLabel, null, "(Optional)")), _react["default"].createElement(HelperText, {
|
|
617
|
-
disabled: disabled,
|
|
618
|
-
backgroundType: backgroundType
|
|
619
|
-
}, helperText), _react["default"].createElement(SelectContainer, {
|
|
620
|
-
backgroundType: backgroundType,
|
|
621
|
-
disabled: disabled,
|
|
622
|
-
error: error,
|
|
623
|
-
onBlur: handleSelectOnBlur,
|
|
624
|
-
onClick: handleSelectOnClick,
|
|
625
|
-
onFocus: handleSelectOnFocus,
|
|
626
|
-
tabIndex: tabIndex
|
|
627
|
-
}, _react["default"].createElement(SearchableValueContainer, null, searchable && _react["default"].createElement(SearchInput, {
|
|
628
|
-
id: selectId,
|
|
629
|
-
name: name,
|
|
630
|
-
value: searchValue,
|
|
631
|
-
disabled: disabled,
|
|
632
|
-
onChange: handleSearchIOnChange,
|
|
633
|
-
ref: selectInputRef,
|
|
634
|
-
autoComplete: "off",
|
|
635
|
-
autoCorrect: "off"
|
|
636
|
-
}), (!searchable || searchValue === "") && _react["default"].createElement(SelectedOption, {
|
|
637
|
-
disabled: disabled,
|
|
638
|
-
placeholder: !(value !== null && value !== void 0 ? value : innerValue) || isBackgroundValue
|
|
639
|
-
}, (selectedOption === null || selectedOption === void 0 ? void 0 : selectedOption.icon) && _react["default"].createElement(OptionIcon, {
|
|
640
|
-
selected: true
|
|
641
|
-
}, selectedOption.icon), _react["default"].createElement(OptionLabel, null, (_ref3 = selectedOption === null || selectedOption === void 0 ? void 0 : selectedOption.label) !== null && _ref3 !== void 0 ? _ref3 : placeholder))), !disabled && error && _react["default"].createElement(ErrorIcon, {
|
|
642
|
-
backgroundType: backgroundType
|
|
643
|
-
}, selectIcons.error), searchable && searchValue.length > 0 && _react["default"].createElement(ClearAction, {
|
|
644
|
-
onClick: handleClearActionOnClick,
|
|
645
|
-
backgroundType: backgroundType,
|
|
646
|
-
tabIndex: -1
|
|
647
|
-
}, selectIcons.clear), _react["default"].createElement(Arrow, {
|
|
648
|
-
disabled: disabled,
|
|
649
|
-
backgroundType: backgroundType
|
|
650
|
-
}, isOpen ? selectIcons.arrowUp : selectIcons.arrowDown), isOpen && _react["default"].createElement(OptionsList, {
|
|
651
|
-
onClick: function onClick(event) {
|
|
652
|
-
event.stopPropagation();
|
|
653
|
-
},
|
|
654
|
-
onMouseDown: function onMouseDown(event) {
|
|
655
|
-
event.preventDefault();
|
|
656
|
-
}
|
|
657
|
-
}, searchable && (filteredOptions.length === 0 || !filteredGroupsHaveOptions()) ? _react["default"].createElement(OptionsSystemMessage, null, _react["default"].createElement(NoMatchesFoundIcon, null, selectIcons.searchOff), "No matches found") : optional &&
|
|
658
|
-
/*!multiple &&*/
|
|
659
|
-
_react["default"].createElement(Option, {
|
|
660
|
-
option: {
|
|
661
|
-
label: placeholder,
|
|
662
|
-
value: ""
|
|
663
|
-
},
|
|
664
|
-
index: 0
|
|
665
|
-
}), searchable ? filteredOptions.map(mapOptionFunc) : options.map(mapOptionFunc))), !disabled && _react["default"].createElement(Error, {
|
|
666
|
-
backgroundType: backgroundType
|
|
667
|
-
}, error)));
|
|
668
|
-
});
|
|
669
|
-
|
|
670
|
-
var sizes = {
|
|
671
|
-
small: "240px",
|
|
672
|
-
medium: "360px",
|
|
673
|
-
large: "480px",
|
|
674
|
-
fillParent: "100%"
|
|
675
|
-
};
|
|
676
|
-
|
|
677
|
-
var calculateWidth = function calculateWidth(margin, size) {
|
|
678
|
-
return size === "fillParent" ? "calc(".concat(sizes[size], " - ").concat((0, _utils.getMargin)(margin, "left"), " - ").concat((0, _utils.getMargin)(margin, "right"), ")") : sizes[size];
|
|
679
|
-
};
|
|
680
|
-
|
|
681
|
-
var DxcSelect = _styledComponents["default"].div(_templateObject(), function (props) {
|
|
682
|
-
return calculateWidth(props.margin, props.size);
|
|
683
|
-
}, function (props) {
|
|
684
|
-
return props.margin && (0, _typeof2["default"])(props.margin) !== "object" ? _variables.spaces[props.margin] : "0px";
|
|
685
|
-
}, function (props) {
|
|
686
|
-
return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.top ? _variables.spaces[props.margin.top] : "";
|
|
687
|
-
}, function (props) {
|
|
688
|
-
return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.right ? _variables.spaces[props.margin.right] : "";
|
|
689
|
-
}, function (props) {
|
|
690
|
-
return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.bottom ? _variables.spaces[props.margin.bottom] : "";
|
|
691
|
-
}, function (props) {
|
|
692
|
-
return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.left ? _variables.spaces[props.margin.left] : "";
|
|
693
|
-
});
|
|
694
|
-
|
|
695
|
-
var Label = _styledComponents["default"].label(_templateObject2(), function (props) {
|
|
696
|
-
return props.disabled ? props.backgroundType === "dark" ? props.theme.disabledLabelFontColorOnDark : props.theme.disabledLabelFontColor : props.backgroundType === "dark" ? props.theme.labelFontColorOnDark : props.theme.labelFontColor;
|
|
697
|
-
}, function (props) {
|
|
698
|
-
return props.theme.fontFamily;
|
|
699
|
-
}, function (props) {
|
|
700
|
-
return props.theme.labelFontSize;
|
|
701
|
-
}, function (props) {
|
|
702
|
-
return props.theme.labelFontStyle;
|
|
703
|
-
}, function (props) {
|
|
704
|
-
return props.theme.labelFontWeight;
|
|
705
|
-
});
|
|
706
|
-
|
|
707
|
-
var OptionalLabel = _styledComponents["default"].span(_templateObject3(), function (props) {
|
|
708
|
-
return props.theme.optionalLabelFontWeight;
|
|
709
|
-
});
|
|
710
|
-
|
|
711
|
-
var HelperText = _styledComponents["default"].span(_templateObject4(), function (props) {
|
|
712
|
-
return props.disabled ? props.backgroundType === "dark" ? props.theme.disabledHelperTextFontColorOnDark : props.theme.disabledHelperTextFontColor : props.backgroundType === "dark" ? props.theme.helperTextFontColorOnDark : props.theme.helperTextFontColor;
|
|
713
|
-
}, function (props) {
|
|
714
|
-
return props.theme.fontFamily;
|
|
715
|
-
}, function (props) {
|
|
716
|
-
return props.theme.helperTextFontSize;
|
|
717
|
-
}, function (props) {
|
|
718
|
-
return props.theme.helperTextFontStyle;
|
|
719
|
-
}, function (props) {
|
|
720
|
-
return props.theme.helperTextFontWeight;
|
|
721
|
-
});
|
|
722
|
-
|
|
723
|
-
var SelectContainer = _styledComponents["default"].div(_templateObject5(), function (props) {
|
|
724
|
-
if (props.disabled) return props.backgroundType === "dark" ? "background-color: ".concat(props.theme.disabledContainerFillColorOnDark, ";") : "background-color: ".concat(props.theme.disabledContainerFillColor, ";");
|
|
725
|
-
}, function (props) {
|
|
726
|
-
if (props.disabled) return props.backgroundType === "dark" ? props.theme.disabledBorderColorOnDark : props.theme.disabledBorderColor;else return props.backgroundType === "dark" ? props.theme.enabledBorderColorOnDark : props.theme.enabledBorderColor;
|
|
727
|
-
}, function (props) {
|
|
728
|
-
return props.error && !props.disabled && "border-color: transparent;\n box-shadow: 0 0 0 2px ".concat(props.backgroundType === "dark" ? props.theme.errorBorderColorOnDark : props.theme.errorBorderColor, ";\n ");
|
|
729
|
-
}, function (props) {
|
|
730
|
-
return props.disabled ? "cursor: not-allowed;" : "cursor: pointer;";
|
|
731
|
-
}, function (props) {
|
|
732
|
-
return !props.disabled && "\n &:hover {\n border-color: ".concat(props.error ? "transparent" : props.backgroundType === "dark" ? props.theme.hoverBorderColorOnDark : props.theme.hoverBorderColor, ";\n ").concat(props.error && "box-shadow: 0 0 0 2px ".concat(props.backgroundType === "dark" ? props.theme.hoverErrorBorderColorOnDark : props.theme.hoverErrorBorderColor, ";"), "\n }\n &:focus-within {\n border-color: transparent;\n box-shadow: 0 0 0 2px ").concat(props.backgroundType === "dark" ? props.theme.focusBorderColorOnDark : props.theme.focusBorderColor, ";\n }\n ");
|
|
733
|
-
});
|
|
734
|
-
|
|
735
|
-
var SearchableValueContainer = _styledComponents["default"].div(_templateObject6());
|
|
736
|
-
|
|
737
|
-
var SelectedOption = _styledComponents["default"].span(_templateObject7(), function (props) {
|
|
738
|
-
if (props.placeholder) return props.disabled ? props.backgroundType === "dark" ? props.theme.disabledPlaceholderFontColorOnDark : props.theme.disabledPlaceholderFontColor : props.backgroundType === "dark" ? props.theme.placeholderFontColorOnDark : props.theme.placeholderFontColor;else return props.disabled ? props.backgroundType === "dark" ? props.theme.disabledValueFontColorOnDark : props.theme.disabledValueFontColor : props.backgroundType === "dark" ? props.theme.valueFontColorOnDark : props.theme.valueFontColor;
|
|
739
|
-
}, function (props) {
|
|
740
|
-
return props.theme.fontFamily;
|
|
741
|
-
}, function (props) {
|
|
742
|
-
return props.theme.valueFontSize;
|
|
743
|
-
}, function (props) {
|
|
744
|
-
return props.theme.valueFontStyle;
|
|
745
|
-
}, function (props) {
|
|
746
|
-
return props.theme.valueFontWeight;
|
|
747
|
-
});
|
|
748
|
-
|
|
749
|
-
var SearchInput = _styledComponents["default"].input(_templateObject8(), function (props) {
|
|
750
|
-
return props.disabled ? props.backgroundType === "dark" ? props.theme.disabledValueFontColorOnDark : props.theme.disabledValueFontColor : props.backgroundType === "dark" ? props.theme.valueFontColorOnDark : props.theme.valueFontColor;
|
|
751
|
-
}, function (props) {
|
|
752
|
-
return props.theme.fontFamily;
|
|
753
|
-
}, function (props) {
|
|
754
|
-
return props.theme.valueFontSize;
|
|
755
|
-
}, function (props) {
|
|
756
|
-
return props.theme.valueFontStyle;
|
|
757
|
-
}, function (props) {
|
|
758
|
-
return props.theme.valueFontWeight;
|
|
759
|
-
}, function (props) {
|
|
760
|
-
return props.disabled ? props.backgroundType === "dark" ? props.theme.disabledPlaceholderFontColorOnDark : props.theme.disabledPlaceholderFontColor : props.backgroundType === "dark" ? props.theme.placeholderFontColorOnDark : props.theme.placeholderFontColor;
|
|
761
|
-
});
|
|
762
|
-
|
|
763
|
-
var ErrorIcon = _styledComponents["default"].span(_templateObject9(), function (props) {
|
|
764
|
-
return props.backgroundType === "dark" ? props.theme.errorIconColorOnDark : props.theme.errorIconColor;
|
|
765
|
-
});
|
|
766
|
-
|
|
767
|
-
var Error = _styledComponents["default"].span(_templateObject10(), function (props) {
|
|
768
|
-
return props.backgroundType === "dark" ? props.theme.errorMessageColorOnDark : props.theme.errorMessageColor;
|
|
769
|
-
}, function (props) {
|
|
770
|
-
return props.theme.fontFamily;
|
|
771
|
-
});
|
|
772
|
-
|
|
773
|
-
var Arrow = _styledComponents["default"].span(_templateObject11(), function (props) {
|
|
774
|
-
return props.disabled ? props.backgroundType === "dark" ? props.theme.disabledArrowColorOnDark : props.theme.disabledArrowColor : props.backgroundType === "dark" ? props.theme.arrowColorOnDark : props.theme.arrowColor;
|
|
775
|
-
});
|
|
776
|
-
|
|
777
|
-
var ClearAction = _styledComponents["default"].button(_templateObject12(), function (props) {
|
|
778
|
-
return props.theme.fontFamily;
|
|
779
|
-
}, function (props) {
|
|
780
|
-
return props.disabled ? "cursor: not-allowed;" : "cursor: pointer;";
|
|
781
|
-
}, function (props) {
|
|
782
|
-
return props.disabled ? props.backgroundType === "dark" ? props.theme.disabledActionBackgroundColorOnDark : props.theme.disabledActionBackgroundColor : props.backgroundType === "dark" ? props.theme.actionBackgroundColorOnDark : props.theme.actionBackgroundColor;
|
|
783
|
-
}, function (props) {
|
|
784
|
-
return props.disabled ? props.backgroundType === "dark" ? props.theme.disabledActionIconColorOnDark : props.theme.disabledActionIconColor : props.backgroundType === "dark" ? props.theme.actionIconColorOnDark : props.theme.actionIconColor;
|
|
785
|
-
}, function (props) {
|
|
786
|
-
return !props.disabled && "\n &:hover {\n background-color: ".concat(props.backgroundType === "dark" ? props.theme.hoverActionBackgroundColorOnDark : props.theme.hoverActionBackgroundColor, ";\n color: ").concat(props.backgroundType === "dark" ? props.theme.hoverActionIconColorOnDark : props.theme.hoverActionIconColor, ";\n }\n &:active {\n background-color: ").concat(props.backgroundType === "dark" ? props.theme.activeActionBackgroundColorOnDark : props.theme.activeActionBackgroundColor, ";\n color: ").concat(props.backgroundType === "dark" ? props.theme.activeActionIconColorOnDark : props.theme.activeActionIconColor, ";\n }\n ");
|
|
787
|
-
});
|
|
788
|
-
|
|
789
|
-
var OptionsList = _styledComponents["default"].ul(_templateObject13(), function (props) {
|
|
790
|
-
return props.theme.enabledListBorderColor;
|
|
791
|
-
}, function (props) {
|
|
792
|
-
return props.theme.fontFamily;
|
|
793
|
-
}, function (props) {
|
|
794
|
-
return props.theme.listOptionFontColor;
|
|
795
|
-
}, function (props) {
|
|
796
|
-
return props.theme.listOptionFontSize;
|
|
797
|
-
}, function (props) {
|
|
798
|
-
return props.theme.listOptionFontStyle;
|
|
799
|
-
}, function (props) {
|
|
800
|
-
return props.theme.listOptionFontWeight;
|
|
801
|
-
});
|
|
802
|
-
|
|
803
|
-
var OptionsSystemMessage = _styledComponents["default"].span(_templateObject14(), function (props) {
|
|
804
|
-
return props.theme.systemMessageFontColor;
|
|
805
|
-
});
|
|
806
|
-
|
|
807
|
-
var NoMatchesFoundIcon = _styledComponents["default"].span(_templateObject15());
|
|
808
|
-
|
|
809
|
-
var OptionGroupLabel = _styledComponents["default"].li(_templateObject16());
|
|
810
|
-
|
|
811
|
-
var OptionItem = _styledComponents["default"].li(_templateObject17(), function (props) {
|
|
812
|
-
if (props.selected) {
|
|
813
|
-
if (props.active) return "background-color: #BFBFBF";else if (props.visualFocused) return "background-color: #CCCCCC";else return "background-color: ".concat(props.theme.selectedListOptionBackgroundColor);
|
|
814
|
-
} else {
|
|
815
|
-
if (props.active) return "background-color: ".concat(props.theme.activeListOptionBackgroundColor, ";");else if (props.visualFocused) return "background-color: ".concat(props.theme.hoverListOptionBackgroundColor, ";");
|
|
816
|
-
}
|
|
817
|
-
});
|
|
818
|
-
|
|
819
|
-
var StyledOption = _styledComponents["default"].span(_templateObject18(), function (props) {
|
|
820
|
-
return props.last ? "border-bottom: 1px solid transparent" : "border-bottom: 1px solid ".concat(props.theme.listOptionBorderBottomColor);
|
|
821
|
-
});
|
|
822
|
-
|
|
823
|
-
var OptionContent = _styledComponents["default"].span(_templateObject19(), function (props) {
|
|
824
|
-
return props.grouped && "padding-left: 8px;";
|
|
825
|
-
});
|
|
826
|
-
|
|
827
|
-
var OptionIcon = _styledComponents["default"].span(_templateObject20(), function (props) {
|
|
828
|
-
return props.selected ? "4px" : "8px";
|
|
829
|
-
});
|
|
830
|
-
|
|
831
|
-
var OptionLabel = _styledComponents["default"].span(_templateObject21());
|
|
832
|
-
|
|
833
|
-
var SelectedIcon = _styledComponents["default"].span(_templateObject22());
|
|
834
|
-
|
|
835
|
-
var _default = DxcNewSelect;
|
|
836
|
-
exports["default"] = _default;
|