@prom-ui/core 0.0.120 → 0.0.130
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/Avatar/cjs/index.development.js +9 -19
- package/Avatar/cjs/index.development.v2.js +9 -19
- package/Avatar/package.json +1 -1
- package/Body/package.json +1 -1
- package/BodyProvider/BodyContext.d.ts +5 -0
- package/BodyProvider/cjs/index.development.js +264 -0
- package/BodyProvider/cjs/index.development.v2.js +264 -0
- package/BodyProvider/cjs/index.production.js +1 -0
- package/BodyProvider/cjs/index.production.v2.js +1 -0
- package/BodyProvider/index.d.ts +9 -0
- package/BodyProvider/index.js +7 -0
- package/BodyProvider/index.v2.js +7 -0
- package/BodyProvider/package.json +12 -0
- package/BodyProvider/useBodyLocale.d.ts +2 -0
- package/Box/package.json +1 -1
- package/Button/cjs/index.development.js +3 -4
- package/Button/cjs/index.development.v2.js +3 -4
- package/Button/package.json +1 -1
- package/ButtonPageUp/cjs/index.development.js +16 -20
- package/ButtonPageUp/cjs/index.development.v2.js +16 -20
- package/ButtonPageUp/cjs/index.production.js +1 -1
- package/ButtonPageUp/cjs/index.production.v2.js +1 -1
- package/ButtonPageUp/package.json +2 -3
- package/Checkbox/cjs/index.development.js +5 -7
- package/Checkbox/cjs/index.development.v2.js +5 -7
- package/Checkbox/package.json +1 -1
- package/Flex/package.json +1 -1
- package/Grid/package.json +1 -1
- package/Icon/package.json +1 -1
- package/Image/package.json +1 -1
- package/ImageEmoji/cjs/index.development.js +7 -8
- package/ImageEmoji/cjs/index.development.v2.js +7 -8
- package/ImageEmoji/package.json +1 -1
- package/Input/package.json +1 -1
- package/InputField/addons/AfterClearValue.d.ts +1 -2
- package/InputField/addons/AfterTogglePassword.d.ts +1 -2
- package/InputField/addons/ErrorText.d.ts +5 -0
- package/InputField/cjs/index.development.js +79 -74
- package/InputField/cjs/index.development.v2.js +79 -74
- package/InputField/cjs/index.production.js +1 -1
- package/InputField/cjs/index.production.v2.js +1 -1
- package/InputField/cjs/style.development.css +1 -1
- package/InputField/cjs/style.development.v2.css +1 -1
- package/InputField/cjs/style.production.css +1 -1
- package/InputField/cjs/style.production.v2.css +1 -1
- package/InputField/index.d.ts +7 -3
- package/InputField/package.json +2 -5
- package/KeyPress/cjs/index.development.js +8 -11
- package/KeyPress/cjs/index.development.v2.js +8 -11
- package/KeyPress/package.json +1 -1
- package/Line/package.json +1 -1
- package/Link/cjs/index.development.js +0 -1
- package/Link/cjs/index.development.v2.js +0 -1
- package/Link/package.json +1 -1
- package/List/package.json +1 -1
- package/Media/cjs/index.development.js +12 -18
- package/Media/cjs/index.development.v2.js +12 -18
- package/Media/package.json +1 -1
- package/OutsideClick/cjs/index.development.js +4 -7
- package/OutsideClick/cjs/index.development.v2.js +4 -7
- package/OutsideClick/package.json +1 -1
- package/Overlay/cjs/index.development.js +67 -90
- package/Overlay/cjs/index.development.v2.js +67 -90
- package/Overlay/cjs/index.production.js +1 -1
- package/Overlay/cjs/index.production.v2.js +1 -1
- package/Overlay/package.json +2 -3
- package/Picture/package.json +1 -1
- package/PortableOverlay/cjs/index.development.js +19 -20
- package/PortableOverlay/cjs/index.development.v2.js +19 -20
- package/PortableOverlay/package.json +1 -1
- package/Portal/cjs/index.development.js +5 -10
- package/Portal/cjs/index.development.v2.js +5 -10
- package/Portal/package.json +1 -1
- package/QRCode/cjs/index.development.js +8 -8
- package/QRCode/cjs/index.development.v2.js +8 -8
- package/QRCode/package.json +1 -1
- package/Rating/cjs/index.development.js +8 -9
- package/Rating/cjs/index.development.v2.js +8 -9
- package/Rating/package.json +1 -1
- package/SafeQuery/cjs/index.development.js +19 -19
- package/SafeQuery/cjs/index.development.v2.js +19 -19
- package/SafeQuery/cjs/index.production.js +1 -1
- package/SafeQuery/cjs/index.production.v2.js +1 -1
- package/SafeQuery/package.json +1 -1
- package/Scroll/package.json +1 -1
- package/ScrollControls/cjs/index.development.js +37 -51
- package/ScrollControls/cjs/index.development.v2.js +37 -51
- package/ScrollControls/cjs/index.production.js +1 -1
- package/ScrollControls/cjs/index.production.v2.js +1 -1
- package/ScrollControls/package.json +2 -3
- package/SideOverlay/cjs/index.development.js +40 -41
- package/SideOverlay/cjs/index.development.v2.js +40 -41
- package/SideOverlay/cjs/index.production.js +1 -1
- package/SideOverlay/cjs/index.production.v2.js +1 -1
- package/SideOverlay/package.json +2 -3
- package/SimpleSlider/cjs/index.development.js +53 -89
- package/SimpleSlider/cjs/index.development.v2.js +53 -89
- package/SimpleSlider/cjs/index.production.js +1 -1
- package/SimpleSlider/cjs/index.production.v2.js +1 -1
- package/SimpleSlider/package.json +2 -3
- package/Skeleton/cjs/index.development.js +10 -11
- package/Skeleton/cjs/index.development.v2.js +10 -11
- package/Skeleton/package.json +1 -1
- package/Spinner/package.json +1 -1
- package/Text/package.json +1 -1
- package/TextEmoji/cjs/index.development.js +5 -6
- package/TextEmoji/cjs/index.development.v2.js +5 -6
- package/TextEmoji/package.json +1 -1
- package/Tooltip/cjs/index.development.js +53 -55
- package/Tooltip/cjs/index.development.v2.js +53 -55
- package/Tooltip/package.json +1 -1
- package/Tumbler/cjs/index.development.js +5 -7
- package/Tumbler/cjs/index.development.v2.js +5 -7
- package/Tumbler/package.json +1 -1
- package/package.json +6 -3
|
@@ -3,18 +3,16 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var React = require('react');
|
|
6
|
-
var classNames = require('classnames');
|
|
7
6
|
var Input = require('@prom-ui/core/Input');
|
|
8
7
|
var Button = require('@prom-ui/core/Button');
|
|
9
8
|
var Icon = require('@prom-ui/core/Icon');
|
|
9
|
+
var BodyProvider = require('@prom-ui/core/BodyProvider');
|
|
10
10
|
var EyeOpen = require('@prom-ui/icons/EyeOpen');
|
|
11
11
|
var EyeClose = require('@prom-ui/icons/EyeClose');
|
|
12
12
|
var Spinner = require('@prom-ui/core/Spinner');
|
|
13
13
|
var Ok = require('@prom-ui/icons/Ok');
|
|
14
14
|
var Cancel = require('@prom-ui/icons/Cancel');
|
|
15
15
|
|
|
16
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
17
|
-
|
|
18
16
|
function _interopNamespace(e) {
|
|
19
17
|
if (e && e.__esModule) return e;
|
|
20
18
|
var n = Object.create(null);
|
|
@@ -34,7 +32,6 @@ function _interopNamespace(e) {
|
|
|
34
32
|
}
|
|
35
33
|
|
|
36
34
|
var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
|
37
|
-
var classNames__default = /*#__PURE__*/_interopDefaultLegacy(classNames);
|
|
38
35
|
|
|
39
36
|
/******************************************************************************
|
|
40
37
|
Copyright (c) Microsoft Corporation.
|
|
@@ -72,12 +69,17 @@ function __rest(s, e) {
|
|
|
72
69
|
t[p[i]] = s[p[i]];
|
|
73
70
|
}
|
|
74
71
|
return t;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
function __makeTemplateObject(cooked, raw) {
|
|
75
|
+
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
|
76
|
+
return cooked;
|
|
75
77
|
}
|
|
76
78
|
|
|
77
79
|
var AfterTogglePassword = function (_a) {
|
|
78
80
|
var inputType = _a.inputType,
|
|
79
|
-
|
|
80
|
-
|
|
81
|
+
onChange = _a.onChange;
|
|
82
|
+
var t = BodyProvider.useBodyLocale().t;
|
|
81
83
|
if (inputType === 'text') {
|
|
82
84
|
return React__namespace.createElement(Button.Button, {
|
|
83
85
|
type: 'button',
|
|
@@ -87,10 +89,10 @@ var AfterTogglePassword = function (_a) {
|
|
|
87
89
|
onClick: function () {
|
|
88
90
|
return onChange('password');
|
|
89
91
|
},
|
|
90
|
-
title:
|
|
92
|
+
title: t(templateObject_1$1 || (templateObject_1$1 = __makeTemplateObject(["\u0421\u043A\u0440\u044B\u0442\u044C \u043F\u0430\u0440\u043E\u043B\u044C"], ["\u0421\u043A\u0440\u044B\u0442\u044C \u043F\u0430\u0440\u043E\u043B\u044C"]))),
|
|
91
93
|
tabIndex: -1,
|
|
92
|
-
"data-qaid": '
|
|
93
|
-
"data-testid": '
|
|
94
|
+
"data-qaid": 'input_field_hide_password',
|
|
95
|
+
"data-testid": 'input_field_hide_password'
|
|
94
96
|
}, React__namespace.createElement(Icon.Icon, {
|
|
95
97
|
"icon-as": EyeOpen.SvgEyeOpen,
|
|
96
98
|
"icon-color": 'black-700',
|
|
@@ -101,7 +103,6 @@ var AfterTogglePassword = function (_a) {
|
|
|
101
103
|
}
|
|
102
104
|
}));
|
|
103
105
|
}
|
|
104
|
-
|
|
105
106
|
return React__namespace.createElement(Button.Button, {
|
|
106
107
|
type: 'button',
|
|
107
108
|
"button-height": '1-1',
|
|
@@ -110,10 +111,10 @@ var AfterTogglePassword = function (_a) {
|
|
|
110
111
|
onClick: function () {
|
|
111
112
|
return onChange('text');
|
|
112
113
|
},
|
|
113
|
-
title:
|
|
114
|
+
title: t(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\u041F\u043E\u043A\u0430\u0437\u0430\u0442\u044C \u043F\u0430\u0440\u043E\u043B\u044C"], ["\u041F\u043E\u043A\u0430\u0437\u0430\u0442\u044C \u043F\u0430\u0440\u043E\u043B\u044C"]))),
|
|
114
115
|
tabIndex: -1,
|
|
115
|
-
"data-qaid": '
|
|
116
|
-
"data-testid": '
|
|
116
|
+
"data-qaid": 'input_field_show_password',
|
|
117
|
+
"data-testid": 'input_field_show_password'
|
|
117
118
|
}, React__namespace.createElement(Icon.Icon, {
|
|
118
119
|
"icon-as": EyeClose.SvgEyeClose,
|
|
119
120
|
"icon-color": 'black-600',
|
|
@@ -124,14 +125,15 @@ var AfterTogglePassword = function (_a) {
|
|
|
124
125
|
}
|
|
125
126
|
}));
|
|
126
127
|
};
|
|
128
|
+
var templateObject_1$1, templateObject_2;
|
|
127
129
|
|
|
128
130
|
var AfterLoading = function () {
|
|
129
131
|
return React__namespace.createElement(Spinner.Spinner, {
|
|
130
132
|
"spinner-color": 'violet-500',
|
|
131
133
|
width: 16,
|
|
132
134
|
height: 16,
|
|
133
|
-
"data-qaid": '
|
|
134
|
-
"data-testid": '
|
|
135
|
+
"data-qaid": 'input_field_loading',
|
|
136
|
+
"data-testid": 'input_field_loading'
|
|
135
137
|
});
|
|
136
138
|
};
|
|
137
139
|
|
|
@@ -140,8 +142,8 @@ var AfterCorrectValue = function () {
|
|
|
140
142
|
"icon-as": Ok.SvgOk,
|
|
141
143
|
"icon-color": 'green-800',
|
|
142
144
|
"icon-events": 'none',
|
|
143
|
-
"data-qaid": '
|
|
144
|
-
"data-testid": '
|
|
145
|
+
"data-qaid": 'input_field_correct_value',
|
|
146
|
+
"data-testid": 'input_field_correct_value',
|
|
145
147
|
style: {
|
|
146
148
|
width: 16,
|
|
147
149
|
height: 16
|
|
@@ -150,15 +152,16 @@ var AfterCorrectValue = function () {
|
|
|
150
152
|
};
|
|
151
153
|
|
|
152
154
|
var AfterClearValue = function (props) {
|
|
155
|
+
var t = BodyProvider.useBodyLocale().t;
|
|
153
156
|
return React__namespace.createElement(Button.Button, __assign({
|
|
154
157
|
type: 'button',
|
|
155
158
|
"button-height": '1-1',
|
|
156
159
|
"button-width": '1-1',
|
|
157
160
|
"button-padding": 'none',
|
|
158
|
-
title:
|
|
161
|
+
title: t(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\u041E\u0447\u0438\u0441\u0442\u0438\u0442\u044C"], ["\u041E\u0447\u0438\u0441\u0442\u0438\u0442\u044C"]))),
|
|
159
162
|
tabIndex: -1,
|
|
160
|
-
"data-qaid": '
|
|
161
|
-
"data-testid": '
|
|
163
|
+
"data-qaid": 'input_field_clear_value',
|
|
164
|
+
"data-testid": 'input_field_clear_value'
|
|
162
165
|
}, props), React__namespace.createElement(Icon.Icon, {
|
|
163
166
|
"icon-as": Cancel.SvgCancel,
|
|
164
167
|
"icon-color": 'black-600',
|
|
@@ -169,14 +172,25 @@ var AfterClearValue = function (props) {
|
|
|
169
172
|
}
|
|
170
173
|
}));
|
|
171
174
|
};
|
|
175
|
+
var templateObject_1;
|
|
176
|
+
|
|
177
|
+
var css = {"root":"InputField__root___UnXum","input":"InputField__input___1Wl0O","beforeAndAfter":"InputField__beforeAndAfter___cUXq3","before":"InputField__before___-TbcG InputField__beforeAndAfter___cUXq3","after":"InputField__after___QmiGS InputField__beforeAndAfter___cUXq3","error":"InputField__error___7Fcq2","label":"InputField__label___uV711","labelRequired":"InputField__labelRequired___cxqrg"};
|
|
172
178
|
|
|
179
|
+
var ErrorText = function (_a) {
|
|
180
|
+
var children = _a.children;
|
|
181
|
+
return React__namespace.createElement("div", {
|
|
182
|
+
className: css.error,
|
|
183
|
+
"data-qaid": 'input_field_error',
|
|
184
|
+
"data-testid": 'input_field_error'
|
|
185
|
+
}, children);
|
|
186
|
+
};
|
|
187
|
+
|
|
188
|
+
// https://github.com/ant-design/ant-design/blob/master/components/input/Input.tsx:36
|
|
173
189
|
function resolveOnChange(target, e, onChange, targetValue) {
|
|
174
190
|
if (!onChange) {
|
|
175
191
|
return;
|
|
176
192
|
}
|
|
177
|
-
|
|
178
193
|
var event = e;
|
|
179
|
-
|
|
180
194
|
if (e.type === 'click') {
|
|
181
195
|
// Clone a new target for event.
|
|
182
196
|
// Avoid the following usage, the setQuery method gets the original value.
|
|
@@ -188,8 +202,8 @@ function resolveOnChange(target, e, onChange, targetValue) {
|
|
|
188
202
|
// setQuery((prevStatus) => e.target.value);
|
|
189
203
|
// }}
|
|
190
204
|
// />
|
|
191
|
-
var currentTarget = target.cloneNode(true);
|
|
192
|
-
|
|
205
|
+
var currentTarget = target.cloneNode(true);
|
|
206
|
+
// Click clear button
|
|
193
207
|
event = Object.create(e, {
|
|
194
208
|
target: {
|
|
195
209
|
value: currentTarget
|
|
@@ -201,9 +215,8 @@ function resolveOnChange(target, e, onChange, targetValue) {
|
|
|
201
215
|
currentTarget.value = '';
|
|
202
216
|
onChange(event);
|
|
203
217
|
return;
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
|
|
218
|
+
}
|
|
219
|
+
// Trigger by composition event, this means we need force change the input value
|
|
207
220
|
if (targetValue !== undefined) {
|
|
208
221
|
event = Object.create(e, {
|
|
209
222
|
target: {
|
|
@@ -217,18 +230,15 @@ function resolveOnChange(target, e, onChange, targetValue) {
|
|
|
217
230
|
onChange(event);
|
|
218
231
|
return;
|
|
219
232
|
}
|
|
220
|
-
|
|
221
233
|
onChange(event);
|
|
222
234
|
}
|
|
223
235
|
function valueToString(value) {
|
|
224
236
|
if (Number.isInteger(value)) {
|
|
225
237
|
return "".concat(value);
|
|
226
238
|
}
|
|
227
|
-
|
|
228
239
|
if (!value) {
|
|
229
240
|
return '';
|
|
230
241
|
}
|
|
231
|
-
|
|
232
242
|
return "".concat(value);
|
|
233
243
|
}
|
|
234
244
|
function isNotEmptyArray(arr) {
|
|
@@ -241,11 +251,9 @@ var useForwardRef = function (ref, initialValue) {
|
|
|
241
251
|
if (initialValue === void 0) {
|
|
242
252
|
initialValue = null;
|
|
243
253
|
}
|
|
244
|
-
|
|
245
254
|
var targetRef = React__namespace.useRef(initialValue);
|
|
246
255
|
React__namespace.useEffect(function () {
|
|
247
256
|
if (!ref) return;
|
|
248
|
-
|
|
249
257
|
if (typeof ref === 'function') {
|
|
250
258
|
ref(targetRef.current);
|
|
251
259
|
} else {
|
|
@@ -255,36 +263,31 @@ var useForwardRef = function (ref, initialValue) {
|
|
|
255
263
|
return targetRef;
|
|
256
264
|
};
|
|
257
265
|
|
|
258
|
-
var css = {"root":"InputField__root___UnXum","input":"InputField__input___1Wl0O","beforeAndAfter":"InputField__beforeAndAfter___cUXq3","before":"InputField__before___-TbcG InputField__beforeAndAfter___cUXq3","after":"InputField__after___QmiGS InputField__beforeAndAfter___cUXq3","error":"InputField__error___7Fcq2"};
|
|
259
|
-
|
|
260
266
|
var InputField = React__namespace.forwardRef(function (_a, ref) {
|
|
261
267
|
var addonBefore = _a.addonBefore,
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
268
|
+
addonAfter = _a.addonAfter,
|
|
269
|
+
_b = _a.addonBeforeWidth,
|
|
270
|
+
addonBeforeWidth = _b === void 0 ? 40 : _b,
|
|
271
|
+
_c = _a.addonAfterWidth,
|
|
272
|
+
addonAfterWidth = _c === void 0 ? 40 : _c,
|
|
273
|
+
_d = _a.error,
|
|
274
|
+
error = _d === void 0 ? false : _d,
|
|
275
|
+
label = _a.label,
|
|
276
|
+
isLabelRequired = _a.isLabelRequired,
|
|
277
|
+
props = __rest(_a, ["addonBefore", "addonAfter", "addonBeforeWidth", "addonAfterWidth", "error", "label", "isLabelRequired"]);
|
|
271
278
|
var isMounted = React__namespace.useRef(false);
|
|
272
279
|
var isSkipOnFocus = React__namespace.useRef(false);
|
|
273
280
|
var isSkipOnBlur = React__namespace.useRef(false);
|
|
274
281
|
var inputRef = useForwardRef(ref, null);
|
|
275
|
-
|
|
276
282
|
var _e = React__namespace.useState(props.type),
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
283
|
+
localType = _e[0],
|
|
284
|
+
setLocalType = _e[1];
|
|
280
285
|
var _f = React__namespace.useState(getIsValueEmpty(props.value || props.defaultValue)),
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
286
|
+
isValueEmpty = _f[0],
|
|
287
|
+
setIsValueEmpty = _f[1];
|
|
284
288
|
React__namespace.useEffect(function () {
|
|
285
289
|
if (isMounted.current) {
|
|
286
290
|
var nextIsValueEmpty = getIsValueEmpty(props.value);
|
|
287
|
-
|
|
288
291
|
if (nextIsValueEmpty !== isValueEmpty) {
|
|
289
292
|
setIsValueEmpty(nextIsValueEmpty);
|
|
290
293
|
}
|
|
@@ -293,7 +296,6 @@ var InputField = React__namespace.forwardRef(function (_a, ref) {
|
|
|
293
296
|
}
|
|
294
297
|
}, [props.value]);
|
|
295
298
|
var currentAddonAfter = null;
|
|
296
|
-
|
|
297
299
|
if (props.type === 'password' && addonAfter === 'togglePassword') {
|
|
298
300
|
currentAddonAfter = React__namespace.createElement(AfterTogglePassword, {
|
|
299
301
|
inputType: localType,
|
|
@@ -305,17 +307,14 @@ var InputField = React__namespace.forwardRef(function (_a, ref) {
|
|
|
305
307
|
currentAddonAfter = isValueEmpty ? null : React__namespace.createElement(AfterClearValue, {
|
|
306
308
|
onClick: function (e) {
|
|
307
309
|
var _a;
|
|
308
|
-
|
|
309
310
|
if (!getIsValueEmpty(props.value) && !props.onChange) {
|
|
310
311
|
(_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.focus();
|
|
311
312
|
return;
|
|
312
313
|
}
|
|
313
|
-
|
|
314
314
|
if (inputRef.current) {
|
|
315
315
|
setIsValueEmpty(true);
|
|
316
316
|
inputRef.current.focus();
|
|
317
317
|
resolveOnChange(inputRef.current, e, props.onChange);
|
|
318
|
-
|
|
319
318
|
if (getIsValueEmpty(props.value)) {
|
|
320
319
|
inputRef.current.value = '';
|
|
321
320
|
}
|
|
@@ -345,19 +344,33 @@ var InputField = React__namespace.forwardRef(function (_a, ref) {
|
|
|
345
344
|
} else {
|
|
346
345
|
currentAddonAfter = addonAfter;
|
|
347
346
|
}
|
|
348
|
-
|
|
347
|
+
var isLabel = !!label;
|
|
349
348
|
var isBefore = !!addonBefore;
|
|
350
349
|
var isAfter = !!currentAddonAfter;
|
|
351
350
|
var isError = isNotEmptyArray(error) || !!error;
|
|
352
|
-
return React__namespace.createElement(
|
|
353
|
-
className:
|
|
354
|
-
style: props.style
|
|
351
|
+
return React__namespace.createElement("div", {
|
|
352
|
+
className: props.className,
|
|
353
|
+
style: props.style,
|
|
354
|
+
"data-qaid": props['data-qaid'] || 'input_field',
|
|
355
|
+
"data-testid": props['data-testid'] || 'input_field'
|
|
356
|
+
}, isLabel && React__namespace.createElement("div", {
|
|
357
|
+
className: css.label
|
|
358
|
+
}, React__namespace.createElement("label", {
|
|
359
|
+
"data-qaid": 'input_field_label',
|
|
360
|
+
"data-testid": 'input_field_label',
|
|
361
|
+
htmlFor: props.id
|
|
362
|
+
}, label), !!isLabelRequired && React__namespace.createElement(React__namespace.Fragment, null, "\u00A0", React__namespace.createElement("span", {
|
|
363
|
+
className: css.labelRequired,
|
|
364
|
+
"data-qaid": 'input_field_label_required',
|
|
365
|
+
"data-testid": 'input_field_label_required'
|
|
366
|
+
}, "*"))), React__namespace.createElement("div", {
|
|
367
|
+
className: css.root
|
|
355
368
|
}, React__namespace.createElement(Input.Input, __assign({
|
|
356
369
|
ref: inputRef,
|
|
357
|
-
"input-theme": isError ? 'red' : 'white'
|
|
358
|
-
"data-qaid": 'inputField',
|
|
359
|
-
"data-testid": 'inputField'
|
|
370
|
+
"input-theme": isError ? 'red' : 'white'
|
|
360
371
|
}, props, {
|
|
372
|
+
"data-qaid": 'input_field_textbox',
|
|
373
|
+
"data-testid": 'input_field_textbox',
|
|
361
374
|
style: {
|
|
362
375
|
paddingLeft: isBefore ? addonBeforeWidth : undefined,
|
|
363
376
|
paddingRight: isAfter ? addonAfterWidth : undefined
|
|
@@ -368,14 +381,12 @@ var InputField = React__namespace.forwardRef(function (_a, ref) {
|
|
|
368
381
|
if (!isSkipOnFocus.current && props.onFocus) {
|
|
369
382
|
props.onFocus(e);
|
|
370
383
|
}
|
|
371
|
-
|
|
372
384
|
isSkipOnFocus.current = false;
|
|
373
385
|
},
|
|
374
386
|
onBlur: function (e) {
|
|
375
387
|
if (!isSkipOnBlur.current && props.onBlur) {
|
|
376
388
|
props.onBlur(e);
|
|
377
389
|
}
|
|
378
|
-
|
|
379
390
|
isSkipOnBlur.current = false;
|
|
380
391
|
},
|
|
381
392
|
onChange: function (e) {
|
|
@@ -393,18 +404,12 @@ var InputField = React__namespace.forwardRef(function (_a, ref) {
|
|
|
393
404
|
width: addonAfterWidth
|
|
394
405
|
}
|
|
395
406
|
}, currentAddonAfter)), isError && (Array.isArray(error) ? error.map(function (errorItem) {
|
|
396
|
-
return React__namespace.createElement(
|
|
397
|
-
|
|
398
|
-
key: errorItem,
|
|
399
|
-
"data-qaid": 'inputFieldError',
|
|
400
|
-
"data-testid": 'inputFieldError'
|
|
407
|
+
return React__namespace.createElement(ErrorText, {
|
|
408
|
+
key: errorItem
|
|
401
409
|
}, errorItem);
|
|
402
|
-
}) : error === true ? null : React__namespace.createElement(
|
|
403
|
-
className: css.error,
|
|
404
|
-
"data-qaid": 'inputFieldError',
|
|
405
|
-
"data-testid": 'inputFieldError'
|
|
406
|
-
}, error)));
|
|
410
|
+
}) : error === true ? null : React__namespace.createElement(ErrorText, null, error)));
|
|
407
411
|
});
|
|
412
|
+
InputField.displayName = 'InputField';
|
|
408
413
|
|
|
409
414
|
exports.InputField = InputField;
|
|
410
415
|
|