@dxc-technology/halstack-react 0.0.0-b821bfb → 0.0.0-ba408d4
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 +8 -4
- package/ThemeContext.js +84 -88
- package/V3Select/V3Select.js +33 -127
- package/V3Textarea/V3Textarea.js +10 -14
- package/accordion/Accordion.js +23 -87
- package/accordion-group/AccordionGroup.js +13 -15
- package/alert/Alert.js +38 -132
- package/badge/Badge.js +9 -13
- package/box/Box.js +9 -13
- package/button/Button.d.ts +4 -0
- package/button/Button.js +15 -71
- package/button/Button.stories.tsx +306 -0
- package/button/types.d.ts +57 -0
- package/button/types.js +5 -0
- package/card/Card.js +19 -73
- package/checkbox/Checkbox.js +13 -37
- package/chip/Chip.js +17 -61
- package/common/RequiredComponent.js +3 -11
- package/common/variables.js +3 -1
- package/date/Date.js +16 -22
- package/date-input/DateInput.js +18 -22
- package/dialog/Dialog.js +16 -50
- package/dropdown/Dropdown.js +37 -131
- package/file-input/FileInput.js +48 -160
- package/file-input/FileItem.js +29 -123
- package/footer/Footer.js +34 -158
- package/footer/Icons.js +13 -13
- package/header/Header.js +35 -179
- package/header/Icons.js +11 -11
- package/heading/Heading.js +18 -72
- package/input-text/Icons.js +2 -2
- package/input-text/InputText.js +36 -130
- package/input-text/index.d.ts +1 -1
- package/layout/ApplicationLayout.js +31 -123
- package/layout/Icons.js +7 -7
- package/link/Link.js +18 -72
- package/main.d.ts +44 -40
- package/main.js +91 -87
- package/number-input/NumberInput.js +5 -13
- package/number-input/NumberInputContext.js +1 -1
- package/package.json +14 -11
- package/paginator/Icons.js +9 -9
- package/paginator/Paginator.d.ts +4 -0
- package/paginator/Paginator.js +24 -131
- package/paginator/types.d.ts +38 -0
- package/paginator/types.js +5 -0
- package/password-input/PasswordInput.js +15 -19
- package/progress-bar/ProgressBar.js +18 -72
- package/radio/Radio.js +12 -26
- package/resultsetTable/ResultsetTable.js +35 -119
- package/select/Select.js +161 -434
- package/sidenav/Sidenav.js +15 -49
- package/slider/Slider.js +19 -83
- package/spinner/Spinner.js +38 -152
- package/switch/Switch.js +12 -26
- package/table/Table.js +10 -24
- package/tabs/Tabs.js +26 -110
- package/tag/Tag.js +22 -96
- package/text-input/TextInput.js +104 -271
- package/textarea/Textarea.js +20 -72
- package/toggle/Toggle.js +15 -49
- package/toggle-group/ToggleGroup.js +23 -107
- package/upload/Upload.js +11 -15
- package/upload/buttons-upload/ButtonsUpload.js +13 -37
- package/upload/buttons-upload/Icons.js +7 -7
- package/upload/dragAndDropArea/DragAndDropArea.js +24 -128
- package/upload/dragAndDropArea/Icons.js +6 -6
- package/upload/file-upload/FileToUpload.js +16 -90
- package/upload/file-upload/Icons.js +13 -13
- package/upload/files-upload/FilesToUpload.js +12 -26
- package/upload/transaction/Icons.js +31 -31
- package/upload/transaction/Transaction.js +17 -61
- package/upload/transactions/Transactions.js +13 -57
- package/wizard/Icons.js +8 -8
- package/wizard/Wizard.js +31 -165
- package/button/Button.stories.js +0 -27
- package/button/index.d.ts +0 -24
- package/paginator/index.d.ts +0 -20
package/text-input/TextInput.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard");
|
|
4
|
-
|
|
5
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
6
4
|
|
|
5
|
+
var _typeof3 = require("@babel/runtime/helpers/typeof");
|
|
6
|
+
|
|
7
7
|
Object.defineProperty(exports, "__esModule", {
|
|
8
8
|
value: true
|
|
9
9
|
});
|
|
@@ -35,230 +35,56 @@ var _BackgroundColorContext = _interopRequireDefault(require("../BackgroundColor
|
|
|
35
35
|
|
|
36
36
|
var _NumberInputContext = _interopRequireDefault(require("../number-input/NumberInputContext.js"));
|
|
37
37
|
|
|
38
|
-
|
|
39
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n padding: 0.25rem 1rem;\n align-items: center;\n line-height: 1.715em;\n color: ", ";\n"]);
|
|
40
|
-
|
|
41
|
-
_templateObject18 = function _templateObject18() {
|
|
42
|
-
return data;
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
return data;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
function _templateObject17() {
|
|
49
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-wrap: wrap;\n align-content: center;\n margin-right: 0.5rem;\n height: 18px;\n width: 18px;\n color: ", ";\n"]);
|
|
50
|
-
|
|
51
|
-
_templateObject17 = function _templateObject17() {
|
|
52
|
-
return data;
|
|
53
|
-
};
|
|
38
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12, _templateObject13, _templateObject14, _templateObject15, _templateObject16, _templateObject17, _templateObject18;
|
|
54
39
|
|
|
55
|
-
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
function _templateObject16() {
|
|
59
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n padding: 0.25rem 1rem;\n color: ", ";\n line-height: 1.715em;\n"]);
|
|
60
|
-
|
|
61
|
-
_templateObject16 = function _templateObject16() {
|
|
62
|
-
return data;
|
|
63
|
-
};
|
|
64
|
-
|
|
65
|
-
return data;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
function _templateObject15() {
|
|
69
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n padding: 0.25rem 0.5rem 0.188rem 0.5rem;\n ", ";\n"]);
|
|
70
|
-
|
|
71
|
-
_templateObject15 = function _templateObject15() {
|
|
72
|
-
return data;
|
|
73
|
-
};
|
|
40
|
+
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); }
|
|
74
41
|
|
|
75
|
-
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
function _templateObject14() {
|
|
79
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n padding: 0 0.5rem;\n line-height: 1.715em;\n cursor: pointer;\n\n box-shadow: inset 0 0 0 2px\n ", ";\n &:hover {\n background-color: ", ";\n }\n &:active {\n background-color: ", ";\n }\n"]);
|
|
80
|
-
|
|
81
|
-
_templateObject14 = function _templateObject14() {
|
|
82
|
-
return data;
|
|
83
|
-
};
|
|
84
|
-
|
|
85
|
-
return data;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
function _templateObject13() {
|
|
89
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n position: absolute;\n z-index: 1;\n max-height: 304px;\n overflow-y: auto;\n top: calc(100% + 4px);\n left: 0;\n margin: 0;\n padding: 0.25rem 0;\n width: 100%;\n background-color: ", ";\n border: 1px solid\n ", ";\n border-radius: 0.25rem;\n box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);\n cursor: default;\n color: ", ";\n font-family: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n"]);
|
|
90
|
-
|
|
91
|
-
_templateObject13 = function _templateObject13() {
|
|
92
|
-
return data;
|
|
93
|
-
};
|
|
94
|
-
|
|
95
|
-
return data;
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
function _templateObject12() {
|
|
99
|
-
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"]);
|
|
100
|
-
|
|
101
|
-
_templateObject12 = function _templateObject12() {
|
|
102
|
-
return data;
|
|
103
|
-
};
|
|
104
|
-
|
|
105
|
-
return data;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
function _templateObject11() {
|
|
109
|
-
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: 0.25rem;\n color: ", ";\n\n svg {\n line-height: 18px;\n font-size: 1.25rem;\n }\n"]);
|
|
110
|
-
|
|
111
|
-
_templateObject11 = function _templateObject11() {
|
|
112
|
-
return data;
|
|
113
|
-
};
|
|
114
|
-
|
|
115
|
-
return data;
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
function _templateObject10() {
|
|
119
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n height: 1.5rem;\n line-height: 1.5rem;\n margin: 0 0.25rem;\n padding: 0 0 0 0.5rem;\n ", ";\n font-family: ", ";\n font-size: 1rem;\n pointer-events: none;\n"]);
|
|
120
|
-
|
|
121
|
-
_templateObject10 = function _templateObject10() {
|
|
122
|
-
return data;
|
|
123
|
-
};
|
|
124
|
-
|
|
125
|
-
return data;
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
function _templateObject9() {
|
|
129
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n height: 1.5rem;\n line-height: 1.5rem;\n margin-left: 0.25rem;\n padding: 0 0.5rem 0 0;\n ", ";\n font-family: ", ";\n font-size: 1rem;\n pointer-events: none;\n"]);
|
|
130
|
-
|
|
131
|
-
_templateObject9 = function _templateObject9() {
|
|
132
|
-
return data;
|
|
133
|
-
};
|
|
134
|
-
|
|
135
|
-
return data;
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
function _templateObject8() {
|
|
139
|
-
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: 2px;\n padding: 3px;\n margin-left: 0.25rem;\n ", "\n\n box-shadow: 0 0 0 2px transparent;\n background-color: ", ";\n\n color: ", ";\n\n ", "\n\n svg {\n line-height: 18px;\n }\n"]);
|
|
140
|
-
|
|
141
|
-
_templateObject8 = function _templateObject8() {
|
|
142
|
-
return data;
|
|
143
|
-
};
|
|
144
|
-
|
|
145
|
-
return data;
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
function _templateObject7() {
|
|
149
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n width: 16px;\n height: 16px;\n"]);
|
|
150
|
-
|
|
151
|
-
_templateObject7 = function _templateObject7() {
|
|
152
|
-
return data;
|
|
153
|
-
};
|
|
154
|
-
|
|
155
|
-
return data;
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
function _templateObject6() {
|
|
159
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n height: calc(2.5rem - 2px);\n width: 100%;\n background: none;\n border: none;\n outline: none;\n padding: 0 0.5rem;\n\n color: ", ";\n\n font-family: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n line-height: 1.5em;\n ", "\n\n ::placeholder {\n color: ", ";\n }\n"]);
|
|
160
|
-
|
|
161
|
-
_templateObject6 = function _templateObject6() {
|
|
162
|
-
return data;
|
|
163
|
-
};
|
|
164
|
-
|
|
165
|
-
return data;
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
function _templateObject5() {
|
|
169
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n position: relative;\n align-items: center;\n height: calc(2.5rem - 2px);\n margin: ", ";\n padding: 0 0.5rem;\n\n ", "\n box-shadow: 0 0 0 2px transparent;\n border-radius: 4px;\n border: 1px solid\n ", ";\n ", "\n ", ";\n\n ", ";\n"]);
|
|
170
|
-
|
|
171
|
-
_templateObject5 = function _templateObject5() {
|
|
172
|
-
return data;
|
|
173
|
-
};
|
|
174
|
-
|
|
175
|
-
return data;
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
function _templateObject4() {
|
|
179
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n color: ", ";\n\n font-family: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n line-height: ", ";\n"]);
|
|
180
|
-
|
|
181
|
-
_templateObject4 = function _templateObject4() {
|
|
182
|
-
return data;
|
|
183
|
-
};
|
|
184
|
-
|
|
185
|
-
return data;
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
function _templateObject3() {
|
|
189
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n font-weight: ", ";\n"]);
|
|
190
|
-
|
|
191
|
-
_templateObject3 = function _templateObject3() {
|
|
192
|
-
return data;
|
|
193
|
-
};
|
|
194
|
-
|
|
195
|
-
return data;
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
function _templateObject2() {
|
|
199
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n color: ", ";\n\n font-family: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n line-height: ", ";\n"]);
|
|
200
|
-
|
|
201
|
-
_templateObject2 = function _templateObject2() {
|
|
202
|
-
return data;
|
|
203
|
-
};
|
|
204
|
-
|
|
205
|
-
return data;
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
function _templateObject() {
|
|
209
|
-
var data = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-direction: column;\n box-sizing: border-box;\n\n width: ", ";\n margin: ", ";\n margin-top: ", ";\n margin-right: ", ";\n margin-bottom: ", ";\n margin-left: ", ";\n"]);
|
|
210
|
-
|
|
211
|
-
_templateObject = function _templateObject() {
|
|
212
|
-
return data;
|
|
213
|
-
};
|
|
214
|
-
|
|
215
|
-
return data;
|
|
216
|
-
}
|
|
42
|
+
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; }
|
|
217
43
|
|
|
218
44
|
var textInputIcons = {
|
|
219
|
-
error: _react["default"].createElement("svg", {
|
|
45
|
+
error: /*#__PURE__*/_react["default"].createElement("svg", {
|
|
220
46
|
xmlns: "http://www.w3.org/2000/svg",
|
|
221
47
|
height: "24px",
|
|
222
48
|
viewBox: "0 0 24 24",
|
|
223
49
|
width: "24px",
|
|
224
50
|
fill: "currentColor"
|
|
225
|
-
}, _react["default"].createElement("path", {
|
|
51
|
+
}, /*#__PURE__*/_react["default"].createElement("path", {
|
|
226
52
|
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"
|
|
227
53
|
})),
|
|
228
|
-
clear: _react["default"].createElement("svg", {
|
|
54
|
+
clear: /*#__PURE__*/_react["default"].createElement("svg", {
|
|
229
55
|
xmlns: "http://www.w3.org/2000/svg",
|
|
230
56
|
width: "24",
|
|
231
57
|
height: "24",
|
|
232
58
|
viewBox: "0 0 24 24",
|
|
233
59
|
fill: "currentColor"
|
|
234
|
-
}, _react["default"].createElement("path", {
|
|
60
|
+
}, /*#__PURE__*/_react["default"].createElement("path", {
|
|
235
61
|
d: "M0 0h24v24H0V0z",
|
|
236
62
|
fill: "none"
|
|
237
|
-
}), _react["default"].createElement("path", {
|
|
63
|
+
}), /*#__PURE__*/_react["default"].createElement("path", {
|
|
238
64
|
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"
|
|
239
65
|
})),
|
|
240
|
-
increment: _react["default"].createElement("svg", {
|
|
66
|
+
increment: /*#__PURE__*/_react["default"].createElement("svg", {
|
|
241
67
|
xmlns: "http://www.w3.org/2000/svg",
|
|
242
68
|
height: "24px",
|
|
243
69
|
viewBox: "0 0 24 24",
|
|
244
70
|
width: "24px",
|
|
245
71
|
fill: "currentColor"
|
|
246
|
-
}, _react["default"].createElement("path", {
|
|
72
|
+
}, /*#__PURE__*/_react["default"].createElement("path", {
|
|
247
73
|
d: "M0 0h24v24H0z",
|
|
248
74
|
fill: "none"
|
|
249
|
-
}), _react["default"].createElement("path", {
|
|
75
|
+
}), /*#__PURE__*/_react["default"].createElement("path", {
|
|
250
76
|
d: "M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"
|
|
251
77
|
})),
|
|
252
|
-
decrement: _react["default"].createElement("svg", {
|
|
78
|
+
decrement: /*#__PURE__*/_react["default"].createElement("svg", {
|
|
253
79
|
xmlns: "http://www.w3.org/2000/svg",
|
|
254
80
|
height: "24px",
|
|
255
81
|
viewBox: "0 0 24 24",
|
|
256
82
|
width: "24px",
|
|
257
83
|
fill: "currentColor"
|
|
258
|
-
}, _react["default"].createElement("path", {
|
|
84
|
+
}, /*#__PURE__*/_react["default"].createElement("path", {
|
|
259
85
|
d: "M0 0h24v24H0z",
|
|
260
86
|
fill: "none"
|
|
261
|
-
}), _react["default"].createElement("path", {
|
|
87
|
+
}), /*#__PURE__*/_react["default"].createElement("path", {
|
|
262
88
|
d: "M19 13H5v-2h14v2z"
|
|
263
89
|
}))
|
|
264
90
|
};
|
|
@@ -300,7 +126,20 @@ var patternMatch = function patternMatch(pattern, value) {
|
|
|
300
126
|
return new RegExp(pattern).test(value);
|
|
301
127
|
};
|
|
302
128
|
|
|
303
|
-
var
|
|
129
|
+
var getLastOptionIndex = function getLastOptionIndex(filteredSuggestions) {
|
|
130
|
+
var last = 0;
|
|
131
|
+
|
|
132
|
+
var reducer = function reducer(acc, current) {
|
|
133
|
+
var _current$options;
|
|
134
|
+
|
|
135
|
+
return acc + ((_current$options = current.options) === null || _current$options === void 0 ? void 0 : _current$options.length);
|
|
136
|
+
};
|
|
137
|
+
|
|
138
|
+
if (filteredSuggestions.length > 0) filteredSuggestions[0].options ? last = filteredSuggestions.reduce(reducer, 0) - 1 : last = filteredSuggestions.length - 1;
|
|
139
|
+
return last;
|
|
140
|
+
};
|
|
141
|
+
|
|
142
|
+
var DxcTextInput = /*#__PURE__*/_react["default"].forwardRef(function (_ref, ref) {
|
|
304
143
|
var _action$title;
|
|
305
144
|
|
|
306
145
|
var _ref$label = _ref.label,
|
|
@@ -380,13 +219,16 @@ var DxcTextInput = _react["default"].forwardRef(function (_ref, ref) {
|
|
|
380
219
|
var autosuggestId = "".concat(inputId, "-listBox");
|
|
381
220
|
var errorId = "error-message-".concat(inputId);
|
|
382
221
|
var numberInputContext = (0, _react.useContext)(_NumberInputContext["default"]);
|
|
222
|
+
var lastOptionIndex = (0, _react.useMemo)(function () {
|
|
223
|
+
return getLastOptionIndex(filteredSuggestions);
|
|
224
|
+
}, [filteredSuggestions]);
|
|
383
225
|
|
|
384
226
|
var isNotOptional = function isNotOptional(value) {
|
|
385
227
|
return value === "" && !optional;
|
|
386
228
|
};
|
|
387
229
|
|
|
388
230
|
var isLengthIncorrect = function isLengthIncorrect(value) {
|
|
389
|
-
return value
|
|
231
|
+
return value && (length === null || length === void 0 ? void 0 : length.min) && (length === null || length === void 0 ? void 0 : length.max) && (value.length < length.min || value.length > length.max);
|
|
390
232
|
};
|
|
391
233
|
|
|
392
234
|
var isNumberIncorrect = function isNumberIncorrect(value) {
|
|
@@ -404,11 +246,11 @@ var DxcTextInput = _react["default"].forwardRef(function (_ref, ref) {
|
|
|
404
246
|
};
|
|
405
247
|
|
|
406
248
|
var hasSuggestions = function hasSuggestions() {
|
|
407
|
-
return typeof suggestions === "function" || suggestions
|
|
249
|
+
return typeof suggestions === "function" || (suggestions === null || suggestions === void 0 ? void 0 : suggestions.length) > 0;
|
|
408
250
|
};
|
|
409
251
|
|
|
410
252
|
var openSuggestions = function openSuggestions() {
|
|
411
|
-
|
|
253
|
+
hasSuggestions() && changeIsOpen(true);
|
|
412
254
|
};
|
|
413
255
|
|
|
414
256
|
var closeSuggestions = function closeSuggestions() {
|
|
@@ -441,13 +283,14 @@ var DxcTextInput = _react["default"].forwardRef(function (_ref, ref) {
|
|
|
441
283
|
document.activeElement !== actionRef.current && inputRef.current.focus();
|
|
442
284
|
};
|
|
443
285
|
|
|
444
|
-
var
|
|
445
|
-
|
|
446
|
-
|
|
286
|
+
var handleInputContainerOnMouseDown = function handleInputContainerOnMouseDown(event) {
|
|
287
|
+
// Avoid input to lose the focus when the container is pressed
|
|
288
|
+
document.activeElement === inputRef.current && event.preventDefault();
|
|
447
289
|
};
|
|
448
290
|
|
|
449
|
-
var
|
|
291
|
+
var handleIOnChange = function handleIOnChange(event) {
|
|
450
292
|
openSuggestions();
|
|
293
|
+
changeValue(event.target.value);
|
|
451
294
|
};
|
|
452
295
|
|
|
453
296
|
var handleIOnBlur = function handleIOnBlur(event) {
|
|
@@ -470,10 +313,6 @@ var DxcTextInput = _react["default"].forwardRef(function (_ref, ref) {
|
|
|
470
313
|
});
|
|
471
314
|
};
|
|
472
315
|
|
|
473
|
-
var handleIOnFocus = function handleIOnFocus() {
|
|
474
|
-
openSuggestions();
|
|
475
|
-
};
|
|
476
|
-
|
|
477
316
|
var handleIOnKeyDown = function handleIOnKeyDown(event) {
|
|
478
317
|
switch (event.keyCode) {
|
|
479
318
|
case 40:
|
|
@@ -636,27 +475,7 @@ var DxcTextInput = _react["default"].forwardRef(function (_ref, ref) {
|
|
|
636
475
|
}
|
|
637
476
|
|
|
638
477
|
numberInputContext && setNumberProps(numberInputContext.typeNumber, numberInputContext.minNumber, numberInputContext.maxNumber, numberInputContext.stepNumber);
|
|
639
|
-
}, [value, innerValue, suggestions]);
|
|
640
|
-
(0, _react.useLayoutEffect)(function () {
|
|
641
|
-
if (filteredSuggestions.length === 0 && !isSearching && !isAutosuggestError) closeSuggestions();
|
|
642
|
-
}, [filteredSuggestions]);
|
|
643
|
-
|
|
644
|
-
var getLastOptionIndex = function getLastOptionIndex() {
|
|
645
|
-
var last = 0;
|
|
646
|
-
|
|
647
|
-
var reducer = function reducer(acc, current) {
|
|
648
|
-
var _current$options;
|
|
649
|
-
|
|
650
|
-
return acc + ((_current$options = current.options) === null || _current$options === void 0 ? void 0 : _current$options.length);
|
|
651
|
-
};
|
|
652
|
-
|
|
653
|
-
if (filteredSuggestions.length > 0) filteredSuggestions[0].options ? last = filteredSuggestions.reduce(reducer, 0) - 1 : last = filteredSuggestions.length - 1;
|
|
654
|
-
return last;
|
|
655
|
-
};
|
|
656
|
-
|
|
657
|
-
var lastOptionIndex = (0, _react.useMemo)(function () {
|
|
658
|
-
return getLastOptionIndex();
|
|
659
|
-
}, [filteredSuggestions]);
|
|
478
|
+
}, [value, innerValue, suggestions, numberInputContext]);
|
|
660
479
|
|
|
661
480
|
var HighlightedSuggestion = function HighlightedSuggestion(_ref2) {
|
|
662
481
|
var suggestion = _ref2.suggestion,
|
|
@@ -665,52 +484,57 @@ var DxcTextInput = _react["default"].forwardRef(function (_ref, ref) {
|
|
|
665
484
|
var matchedWords = suggestion.match(regEx);
|
|
666
485
|
var noMatchedWords = suggestion.replace(regEx, "");
|
|
667
486
|
var isLastOption = index === lastOptionIndex;
|
|
668
|
-
return _react["default"].createElement(Suggestion, {
|
|
487
|
+
return /*#__PURE__*/_react["default"].createElement(Suggestion, {
|
|
669
488
|
id: "suggestion-".concat(index),
|
|
670
489
|
onClick: function onClick() {
|
|
671
490
|
changeValue(suggestion);
|
|
672
491
|
closeSuggestions();
|
|
673
492
|
},
|
|
493
|
+
visualFocused: visualFocusedSuggIndex === index,
|
|
674
494
|
role: "option",
|
|
675
|
-
"aria-selected": visualFocusedSuggIndex === index && "true"
|
|
676
|
-
|
|
677
|
-
}, _react["default"].createElement(StyledSuggestion, {
|
|
495
|
+
"aria-selected": visualFocusedSuggIndex === index && "true"
|
|
496
|
+
}, /*#__PURE__*/_react["default"].createElement(StyledSuggestion, {
|
|
678
497
|
last: isLastOption,
|
|
679
498
|
visualFocused: visualFocusedSuggIndex === index
|
|
680
|
-
}, typeof suggestions === "function" ? suggestion : _react["default"].createElement(_react["default"].Fragment, null, _react["default"].createElement("strong", null, matchedWords), noMatchedWords)));
|
|
499
|
+
}, typeof suggestions === "function" ? suggestion : /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement("strong", null, matchedWords), noMatchedWords)));
|
|
681
500
|
};
|
|
682
501
|
|
|
683
|
-
return _react["default"].createElement(_styledComponents.ThemeProvider, {
|
|
502
|
+
return /*#__PURE__*/_react["default"].createElement(_styledComponents.ThemeProvider, {
|
|
684
503
|
theme: colorsTheme.textInput
|
|
685
|
-
}, _react["default"].createElement(DxcInput, {
|
|
504
|
+
}, /*#__PURE__*/_react["default"].createElement(DxcInput, {
|
|
686
505
|
margin: margin,
|
|
687
506
|
ref: ref,
|
|
688
507
|
size: size
|
|
689
|
-
}, _react["default"].createElement(Label, {
|
|
508
|
+
}, /*#__PURE__*/_react["default"].createElement(Label, {
|
|
690
509
|
htmlFor: inputId,
|
|
691
510
|
disabled: disabled,
|
|
692
511
|
backgroundType: backgroundType
|
|
693
|
-
}, label, " ", optional && _react["default"].createElement(OptionalLabel, null, "(Optional)")), _react["default"].createElement(HelperText, {
|
|
512
|
+
}, label, " ", optional && /*#__PURE__*/_react["default"].createElement(OptionalLabel, null, "(Optional)")), /*#__PURE__*/_react["default"].createElement(HelperText, {
|
|
694
513
|
disabled: disabled,
|
|
695
514
|
backgroundType: backgroundType
|
|
696
|
-
}, helperText), _react["default"].createElement(InputContainer, {
|
|
515
|
+
}, helperText), /*#__PURE__*/_react["default"].createElement(InputContainer, {
|
|
697
516
|
error: error,
|
|
698
517
|
disabled: disabled,
|
|
699
518
|
backgroundType: backgroundType,
|
|
700
|
-
onClick: handleInputContainerOnClick
|
|
701
|
-
|
|
519
|
+
onClick: handleInputContainerOnClick,
|
|
520
|
+
onMouseDown: handleInputContainerOnMouseDown
|
|
521
|
+
}, prefix && /*#__PURE__*/_react["default"].createElement(Prefix, {
|
|
702
522
|
disabled: disabled,
|
|
703
523
|
backgroundType: backgroundType
|
|
704
|
-
}, prefix), _react["default"].createElement(Input, {
|
|
524
|
+
}, prefix), /*#__PURE__*/_react["default"].createElement(Input, {
|
|
705
525
|
id: inputId,
|
|
706
526
|
name: name,
|
|
707
527
|
value: value !== null && value !== void 0 ? value : innerValue,
|
|
708
528
|
placeholder: placeholder,
|
|
709
|
-
onChange: handleIOnChange,
|
|
710
|
-
onClick: handleIOnClick,
|
|
711
529
|
onBlur: handleIOnBlur,
|
|
712
|
-
|
|
530
|
+
onChange: handleIOnChange,
|
|
531
|
+
onFocus: function onFocus() {
|
|
532
|
+
openSuggestions();
|
|
533
|
+
},
|
|
713
534
|
onKeyDown: handleIOnKeyDown,
|
|
535
|
+
onMouseDown: function onMouseDown(event) {
|
|
536
|
+
event.stopPropagation();
|
|
537
|
+
},
|
|
714
538
|
disabled: disabled,
|
|
715
539
|
ref: inputRef,
|
|
716
540
|
backgroundType: backgroundType,
|
|
@@ -727,61 +551,70 @@ var DxcTextInput = _react["default"].forwardRef(function (_ref, ref) {
|
|
|
727
551
|
"aria-invalid": error ? "true" : "false",
|
|
728
552
|
"aria-describedby": error ? errorId : undefined,
|
|
729
553
|
"aria-required": optional ? "false" : "true"
|
|
730
|
-
}), !disabled && error && _react["default"].createElement(ErrorIcon, {
|
|
554
|
+
}), !disabled && error && /*#__PURE__*/_react["default"].createElement(ErrorIcon, {
|
|
731
555
|
backgroundType: backgroundType,
|
|
732
556
|
"aria-label": "Error"
|
|
733
|
-
}, textInputIcons.error), !disabled && clearable && (value !== null && value !== void 0 ? value : innerValue).length > 0 && _react["default"].createElement(Action, {
|
|
557
|
+
}, textInputIcons.error), !disabled && clearable && (value !== null && value !== void 0 ? value : innerValue).length > 0 && /*#__PURE__*/_react["default"].createElement(Action, {
|
|
734
558
|
onClick: handleClearActionOnClick,
|
|
559
|
+
onMouseDown: function onMouseDown(event) {
|
|
560
|
+
event.stopPropagation();
|
|
561
|
+
},
|
|
735
562
|
backgroundType: backgroundType,
|
|
736
563
|
tabIndex: tabIndex,
|
|
737
564
|
"aria-label": "Clear"
|
|
738
|
-
}, textInputIcons.clear), (numberInputContext === null || numberInputContext === void 0 ? void 0 : numberInputContext.typeNumber) === "number" ? _react["default"].createElement(_react["default"].Fragment, null, _react["default"].createElement(Action, {
|
|
565
|
+
}, 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, {
|
|
739
566
|
ref: actionRef,
|
|
740
567
|
disabled: disabled,
|
|
741
568
|
onClick: handleDecrementActionOnClick,
|
|
569
|
+
onMouseDown: function onMouseDown(event) {
|
|
570
|
+
event.stopPropagation();
|
|
571
|
+
},
|
|
742
572
|
backgroundType: backgroundType,
|
|
743
573
|
tabIndex: tabIndex,
|
|
744
574
|
"aria-label": "Decrement"
|
|
745
|
-
}, textInputIcons.decrement), _react["default"].createElement(Action, {
|
|
575
|
+
}, textInputIcons.decrement), /*#__PURE__*/_react["default"].createElement(Action, {
|
|
746
576
|
ref: actionRef,
|
|
747
577
|
disabled: disabled,
|
|
748
578
|
onClick: handleIncrementActionOnClick,
|
|
579
|
+
onMouseDown: function onMouseDown(event) {
|
|
580
|
+
event.stopPropagation();
|
|
581
|
+
},
|
|
749
582
|
backgroundType: backgroundType,
|
|
750
583
|
tabIndex: tabIndex,
|
|
751
584
|
"aria-label": "Increment"
|
|
752
|
-
}, textInputIcons.increment)) : action && _react["default"].createElement(Action, {
|
|
585
|
+
}, textInputIcons.increment)) : action && /*#__PURE__*/_react["default"].createElement(Action, {
|
|
753
586
|
ref: actionRef,
|
|
754
587
|
disabled: disabled,
|
|
755
588
|
onClick: action.onClick,
|
|
589
|
+
onMouseDown: function onMouseDown(event) {
|
|
590
|
+
event.stopPropagation();
|
|
591
|
+
},
|
|
756
592
|
title: (_action$title = action.title) !== null && _action$title !== void 0 ? _action$title : action.title,
|
|
757
593
|
backgroundType: backgroundType,
|
|
758
594
|
tabIndex: tabIndex
|
|
759
|
-
}, typeof action.icon === "string" ? _react["default"].createElement(ActionIcon, {
|
|
595
|
+
}, typeof action.icon === "string" ? /*#__PURE__*/_react["default"].createElement(ActionIcon, {
|
|
760
596
|
src: action.icon
|
|
761
|
-
}) : action.icon), suffix && _react["default"].createElement(Suffix, {
|
|
597
|
+
}) : action.icon), suffix && /*#__PURE__*/_react["default"].createElement(Suffix, {
|
|
762
598
|
disabled: disabled,
|
|
763
599
|
backgroundType: backgroundType
|
|
764
|
-
}, suffix), isOpen && _react["default"].createElement(Suggestions, {
|
|
600
|
+
}, suffix), isOpen && (filteredSuggestions.length > 0 || isSearching || isAutosuggestError) && /*#__PURE__*/_react["default"].createElement(Suggestions, {
|
|
765
601
|
id: autosuggestId,
|
|
766
602
|
isError: isAutosuggestError,
|
|
767
603
|
onMouseDown: function onMouseDown(event) {
|
|
768
604
|
event.preventDefault();
|
|
769
605
|
},
|
|
770
|
-
onMouseLeave: function onMouseLeave() {
|
|
771
|
-
changeVisualFocusedSuggIndex(-1);
|
|
772
|
-
},
|
|
773
606
|
ref: suggestionsRef,
|
|
774
607
|
role: "listbox",
|
|
775
608
|
"aria-label": label
|
|
776
609
|
}, !isSearching && !isAutosuggestError && filteredSuggestions.length > 0 && filteredSuggestions.map(function (suggestion, index) {
|
|
777
|
-
return _react["default"].createElement(HighlightedSuggestion, {
|
|
610
|
+
return /*#__PURE__*/_react["default"].createElement(HighlightedSuggestion, {
|
|
778
611
|
key: "suggestion-".concat((0, _uuid.v4)()),
|
|
779
612
|
suggestion: suggestion,
|
|
780
613
|
index: index
|
|
781
614
|
});
|
|
782
|
-
}), isSearching && _react["default"].createElement(SuggestionsSystemMessage, null, "Searching..."), isAutosuggestError && _react["default"].createElement(SuggestionsError, null, _react["default"].createElement(SuggestionsErrorIcon, {
|
|
615
|
+
}), isSearching && /*#__PURE__*/_react["default"].createElement(SuggestionsSystemMessage, null, "Searching..."), isAutosuggestError && /*#__PURE__*/_react["default"].createElement(SuggestionsError, null, /*#__PURE__*/_react["default"].createElement(SuggestionsErrorIcon, {
|
|
783
616
|
backgroundType: backgroundType
|
|
784
|
-
}, textInputIcons.error), "Error fetching data"))), !disabled && _react["default"].createElement(Error, {
|
|
617
|
+
}, textInputIcons.error), "Error fetching data"))), !disabled && /*#__PURE__*/_react["default"].createElement(Error, {
|
|
785
618
|
id: errorId,
|
|
786
619
|
backgroundType: backgroundType
|
|
787
620
|
}, error)));
|
|
@@ -798,7 +631,7 @@ var calculateWidth = function calculateWidth(margin, size) {
|
|
|
798
631
|
return size === "fillParent" ? "calc(".concat(sizes[size], " - ").concat((0, _utils.getMargin)(margin, "left"), " - ").concat((0, _utils.getMargin)(margin, "right"), ")") : sizes[size];
|
|
799
632
|
};
|
|
800
633
|
|
|
801
|
-
var DxcInput = _styledComponents["default"].div(_templateObject(), function (props) {
|
|
634
|
+
var DxcInput = _styledComponents["default"].div(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-direction: column;\n box-sizing: border-box;\n\n width: ", ";\n margin: ", ";\n margin-top: ", ";\n margin-right: ", ";\n margin-bottom: ", ";\n margin-left: ", ";\n"])), function (props) {
|
|
802
635
|
return calculateWidth(props.margin, props.size);
|
|
803
636
|
}, function (props) {
|
|
804
637
|
return props.margin && (0, _typeof2["default"])(props.margin) !== "object" ? _variables.spaces[props.margin] : "0px";
|
|
@@ -812,7 +645,7 @@ var DxcInput = _styledComponents["default"].div(_templateObject(), function (pro
|
|
|
812
645
|
return props.margin && (0, _typeof2["default"])(props.margin) === "object" && props.margin.left ? _variables.spaces[props.margin.left] : "";
|
|
813
646
|
});
|
|
814
647
|
|
|
815
|
-
var Label = _styledComponents["default"].label(_templateObject2(), function (props) {
|
|
648
|
+
var Label = _styledComponents["default"].label(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2["default"])(["\n color: ", ";\n\n font-family: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n line-height: ", ";\n"])), function (props) {
|
|
816
649
|
return props.disabled ? props.backgroundType === "dark" ? props.theme.disabledLabelFontColorOnDark : props.theme.disabledLabelFontColor : props.backgroundType === "dark" ? props.theme.labelFontColorOnDark : props.theme.labelFontColor;
|
|
817
650
|
}, function (props) {
|
|
818
651
|
return props.theme.fontFamily;
|
|
@@ -826,11 +659,11 @@ var Label = _styledComponents["default"].label(_templateObject2(), function (pro
|
|
|
826
659
|
return props.theme.labelLineHeight;
|
|
827
660
|
});
|
|
828
661
|
|
|
829
|
-
var OptionalLabel = _styledComponents["default"].span(_templateObject3(), function (props) {
|
|
662
|
+
var OptionalLabel = _styledComponents["default"].span(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2["default"])(["\n font-weight: ", ";\n"])), function (props) {
|
|
830
663
|
return props.theme.optionalLabelFontWeight;
|
|
831
664
|
});
|
|
832
665
|
|
|
833
|
-
var HelperText = _styledComponents["default"].span(_templateObject4(), function (props) {
|
|
666
|
+
var HelperText = _styledComponents["default"].span(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2["default"])(["\n color: ", ";\n\n font-family: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n line-height: ", ";\n"])), function (props) {
|
|
834
667
|
return props.disabled ? props.backgroundType === "dark" ? props.theme.disabledHelperTextFontColorOnDark : props.theme.disabledHelperTextFontColor : props.backgroundType === "dark" ? props.theme.helperTextFontColorOnDark : props.theme.helperTextFontColor;
|
|
835
668
|
}, function (props) {
|
|
836
669
|
return props.theme.fontFamily;
|
|
@@ -844,7 +677,7 @@ var HelperText = _styledComponents["default"].span(_templateObject4(), function
|
|
|
844
677
|
return props.theme.helperTextLineHeight;
|
|
845
678
|
});
|
|
846
679
|
|
|
847
|
-
var InputContainer = _styledComponents["default"].div(_templateObject5(), function (props) {
|
|
680
|
+
var InputContainer = _styledComponents["default"].div(_templateObject5 || (_templateObject5 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n position: relative;\n align-items: center;\n height: calc(2.5rem - 2px);\n margin: ", ";\n padding: 0 0.5rem;\n\n ", "\n box-shadow: 0 0 0 2px transparent;\n border-radius: 4px;\n border: 1px solid\n ", ";\n ", "\n ", ";\n\n ", ";\n"])), function (props) {
|
|
848
681
|
return "".concat(props.theme.inputMarginTop, " 0 ").concat(props.theme.inputMarginBottom, " 0");
|
|
849
682
|
}, function (props) {
|
|
850
683
|
if (props.disabled) return props.backgroundType === "dark" ? "background-color: ".concat(props.theme.disabledContainerFillColorOnDark, ";") : "background-color: ".concat(props.theme.disabledContainerFillColor, ";");
|
|
@@ -858,7 +691,7 @@ var InputContainer = _styledComponents["default"].div(_templateObject5(), functi
|
|
|
858
691
|
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 ");
|
|
859
692
|
});
|
|
860
693
|
|
|
861
|
-
var Input = _styledComponents["default"].input(_templateObject6(), function (props) {
|
|
694
|
+
var Input = _styledComponents["default"].input(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2["default"])(["\n height: calc(2.5rem - 2px);\n width: 100%;\n background: none;\n border: none;\n outline: none;\n padding: 0 0.5rem;\n\n color: ", ";\n\n font-family: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n line-height: 1.5em;\n ", "\n\n ::placeholder {\n color: ", ";\n }\n"])), function (props) {
|
|
862
695
|
return props.disabled ? props.backgroundType === "dark" ? props.theme.disabledValueFontColorOnDark : props.theme.disabledValueFontColor : props.backgroundType === "dark" ? props.theme.valueFontColorOnDark : props.theme.valueFontColor;
|
|
863
696
|
}, function (props) {
|
|
864
697
|
return props.theme.fontFamily;
|
|
@@ -874,9 +707,9 @@ var Input = _styledComponents["default"].input(_templateObject6(), function (pro
|
|
|
874
707
|
return props.disabled ? props.backgroundType === "dark" ? props.theme.disabledPlaceholderFontColorOnDark : props.theme.disabledPlaceholderFontColor : props.backgroundType === "dark" ? props.theme.placeholderFontColorOnDark : props.theme.placeholderFontColor;
|
|
875
708
|
});
|
|
876
709
|
|
|
877
|
-
var ActionIcon = _styledComponents["default"].img(_templateObject7());
|
|
710
|
+
var ActionIcon = _styledComponents["default"].img(_templateObject7 || (_templateObject7 = (0, _taggedTemplateLiteral2["default"])(["\n width: 16px;\n height: 16px;\n"])));
|
|
878
711
|
|
|
879
|
-
var Action = _styledComponents["default"].button(_templateObject8(), function (props) {
|
|
712
|
+
var Action = _styledComponents["default"].button(_templateObject8 || (_templateObject8 = (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: 2px;\n padding: 3px;\n margin-left: 0.25rem;\n ", "\n\n box-shadow: 0 0 0 2px transparent;\n background-color: ", ";\n\n color: ", ";\n\n ", "\n\n svg {\n line-height: 18px;\n }\n"])), function (props) {
|
|
880
713
|
return props.theme.fontFamily;
|
|
881
714
|
}, function (props) {
|
|
882
715
|
return props.disabled ? "cursor: not-allowed;" : "cursor: pointer;";
|
|
@@ -888,31 +721,31 @@ var Action = _styledComponents["default"].button(_templateObject8(), function (p
|
|
|
888
721
|
return !props.disabled && "\n &:focus {\n outline: none;\n box-shadow: 0 0 0 2px ".concat(props.backgroundType === "dark" ? props.theme.focusActionBorderColorOnDark : props.theme.focusActionBorderColor, ";\n color: ").concat(props.backgroundType === "dark" ? props.theme.focusActionIconColorOnDark : props.theme.focusActionIconColor, ";\n }\n &:focus-visible {\n outline: none;\n box-shadow: 0 0 0 2px ").concat(props.backgroundType === "dark" ? props.theme.focusActionBorderColorOnDark : props.theme.focusActionBorderColor, ";\n color: ").concat(props.backgroundType === "dark" ? props.theme.focusActionIconColorOnDark : props.theme.focusActionIconColor, ";\n }\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 ");
|
|
889
722
|
});
|
|
890
723
|
|
|
891
|
-
var Prefix = _styledComponents["default"].span(_templateObject9(), function (props) {
|
|
724
|
+
var Prefix = _styledComponents["default"].span(_templateObject9 || (_templateObject9 = (0, _taggedTemplateLiteral2["default"])(["\n height: 1.5rem;\n line-height: 1.5rem;\n margin-left: 0.25rem;\n padding: 0 0.5rem 0 0;\n ", ";\n font-family: ", ";\n font-size: 1rem;\n pointer-events: none;\n"])), function (props) {
|
|
892
725
|
var color = props.disabled ? props.backgroundType === "dark" ? props.theme.disabledPrefixColorOnDark : props.theme.disabledPrefixColor : props.backgroundType === "dark" ? props.theme.prefixColorOnDark : props.theme.prefixColor;
|
|
893
726
|
return "color: ".concat(color, "; border-right: 1px solid ").concat(color, ";");
|
|
894
727
|
}, function (props) {
|
|
895
728
|
return props.theme.fontFamily;
|
|
896
729
|
});
|
|
897
730
|
|
|
898
|
-
var Suffix = _styledComponents["default"].span(_templateObject10(), function (props) {
|
|
731
|
+
var Suffix = _styledComponents["default"].span(_templateObject10 || (_templateObject10 = (0, _taggedTemplateLiteral2["default"])(["\n height: 1.5rem;\n line-height: 1.5rem;\n margin: 0 0.25rem;\n padding: 0 0 0 0.5rem;\n ", ";\n font-family: ", ";\n font-size: 1rem;\n pointer-events: none;\n"])), function (props) {
|
|
899
732
|
var color = props.disabled ? props.backgroundType === "dark" ? props.theme.disabledSuffixColorOnDark : props.theme.disabledSuffixColor : props.backgroundType === "dark" ? props.theme.suffixColorOnDark : props.theme.suffixColor;
|
|
900
733
|
return "color: ".concat(color, "; border-left: 1px solid ").concat(color, ";");
|
|
901
734
|
}, function (props) {
|
|
902
735
|
return props.theme.fontFamily;
|
|
903
736
|
});
|
|
904
737
|
|
|
905
|
-
var ErrorIcon = _styledComponents["default"].span(_templateObject11(), function (props) {
|
|
738
|
+
var ErrorIcon = _styledComponents["default"].span(_templateObject11 || (_templateObject11 = (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: 0.25rem;\n color: ", ";\n\n svg {\n line-height: 18px;\n font-size: 1.25rem;\n }\n"])), function (props) {
|
|
906
739
|
return props.backgroundType === "dark" ? props.theme.errorIconColorOnDark : props.theme.errorIconColor;
|
|
907
740
|
});
|
|
908
741
|
|
|
909
|
-
var Error = _styledComponents["default"].span(_templateObject12(), function (props) {
|
|
742
|
+
var Error = _styledComponents["default"].span(_templateObject12 || (_templateObject12 = (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"])), function (props) {
|
|
910
743
|
return props.backgroundType === "dark" ? props.theme.errorMessageColorOnDark : props.theme.errorMessageColor;
|
|
911
744
|
}, function (props) {
|
|
912
745
|
return props.theme.fontFamily;
|
|
913
746
|
});
|
|
914
747
|
|
|
915
|
-
var Suggestions = _styledComponents["default"].ul(_templateObject13(), function (props) {
|
|
748
|
+
var Suggestions = _styledComponents["default"].ul(_templateObject13 || (_templateObject13 = (0, _taggedTemplateLiteral2["default"])(["\n position: absolute;\n z-index: 1;\n max-height: 304px;\n overflow-y: auto;\n top: calc(100% + 4px);\n left: 0;\n margin: 0;\n padding: 0.25rem 0;\n width: 100%;\n background-color: ", ";\n border: 1px solid\n ", ";\n border-radius: 0.25rem;\n box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);\n cursor: default;\n color: ", ";\n font-family: ", ";\n font-size: ", ";\n font-style: ", ";\n font-weight: ", ";\n"])), function (props) {
|
|
916
749
|
return props.isError ? props.theme.errorListDialogBackgroundColor : props.theme.listDialogBackgroundColor;
|
|
917
750
|
}, function (props) {
|
|
918
751
|
return props.isError ? props.theme.errorListDialogBorderColor : props.theme.listDialogBorderColor;
|
|
@@ -928,7 +761,7 @@ var Suggestions = _styledComponents["default"].ul(_templateObject13(), function
|
|
|
928
761
|
return props.theme.listOptionFontWeight;
|
|
929
762
|
});
|
|
930
763
|
|
|
931
|
-
var Suggestion = _styledComponents["default"].li(_templateObject14(), function (props) {
|
|
764
|
+
var Suggestion = _styledComponents["default"].li(_templateObject14 || (_templateObject14 = (0, _taggedTemplateLiteral2["default"])(["\n padding: 0 0.5rem;\n line-height: 1.715em;\n cursor: pointer;\n\n box-shadow: inset 0 0 0 2px\n ", ";\n &:hover {\n background-color: ", ";\n }\n &:active {\n background-color: ", ";\n }\n"])), function (props) {
|
|
932
765
|
return props.visualFocused ? props.theme.focusListOptionBorderColor : "transparent";
|
|
933
766
|
}, function (props) {
|
|
934
767
|
return props.theme.hoverListOptionBackgroundColor;
|
|
@@ -936,19 +769,19 @@ var Suggestion = _styledComponents["default"].li(_templateObject14(), function (
|
|
|
936
769
|
return props.theme.activeListOptionBackgroundColor;
|
|
937
770
|
});
|
|
938
771
|
|
|
939
|
-
var StyledSuggestion = _styledComponents["default"].span(_templateObject15(), function (props) {
|
|
772
|
+
var StyledSuggestion = _styledComponents["default"].span(_templateObject15 || (_templateObject15 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n padding: 0.25rem 0.5rem 0.188rem 0.5rem;\n ", ";\n"])), function (props) {
|
|
940
773
|
return props.last || props.visualFocused ? "border-bottom: 1px solid transparent" : "border-bottom: 1px solid ".concat(props.theme.listOptionDividerColor);
|
|
941
774
|
});
|
|
942
775
|
|
|
943
|
-
var SuggestionsSystemMessage = _styledComponents["default"].span(_templateObject16(), function (props) {
|
|
776
|
+
var SuggestionsSystemMessage = _styledComponents["default"].span(_templateObject16 || (_templateObject16 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n padding: 0.25rem 1rem;\n color: ", ";\n line-height: 1.715em;\n"])), function (props) {
|
|
944
777
|
return props.theme.systemMessageFontColor;
|
|
945
778
|
});
|
|
946
779
|
|
|
947
|
-
var SuggestionsErrorIcon = _styledComponents["default"].span(_templateObject17(), function (props) {
|
|
780
|
+
var SuggestionsErrorIcon = _styledComponents["default"].span(_templateObject17 || (_templateObject17 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n flex-wrap: wrap;\n align-content: center;\n margin-right: 0.5rem;\n height: 18px;\n width: 18px;\n color: ", ";\n"])), function (props) {
|
|
948
781
|
return props.backgroundType === "dark" ? props.theme.errorIconColorOnDark : props.theme.errorIconColor;
|
|
949
782
|
});
|
|
950
783
|
|
|
951
|
-
var SuggestionsError = _styledComponents["default"].span(_templateObject18(), function (props) {
|
|
784
|
+
var SuggestionsError = _styledComponents["default"].span(_templateObject18 || (_templateObject18 = (0, _taggedTemplateLiteral2["default"])(["\n display: flex;\n padding: 0.25rem 1rem;\n align-items: center;\n line-height: 1.715em;\n color: ", ";\n"])), function (props) {
|
|
952
785
|
return props.theme.errorListDialogFontColor;
|
|
953
786
|
});
|
|
954
787
|
|