@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___EVTeN","input":"InputField__input___rfpBC","beforeAndAfter":"InputField__beforeAndAfter___oqO-V","before":"InputField__before___GeS6- InputField__beforeAndAfter___oqO-V","after":"InputField__after___Cl38- InputField__beforeAndAfter___oqO-V","error":"InputField__error___hSs8w","label":"InputField__label___bwxYk","labelRequired":"InputField__labelRequired___bTTTw"};
|
|
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___EVTeN","input":"InputField__input___rfpBC","beforeAndAfter":"InputField__beforeAndAfter___oqO-V","before":"InputField__before___GeS6- InputField__beforeAndAfter___oqO-V","after":"InputField__after___Cl38- InputField__beforeAndAfter___oqO-V","error":"InputField__error___hSs8w"};
|
|
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
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("@prom-ui/core/Input"),n=require("@prom-ui/core/Button"),r=require("@prom-ui/core/Icon"),a=require("@prom-ui/core/BodyProvider"),i=require("@prom-ui/icons/EyeOpen"),o=require("@prom-ui/icons/EyeClose"),u=require("@prom-ui/core/Spinner"),c=require("@prom-ui/icons/Ok"),l=require("@prom-ui/icons/Cancel");function d(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}})),t.default=e,Object.freeze(t)}var s=d(e),f=function(){return f=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var a in t=arguments[n])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e},f.apply(this,arguments)};function p(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}var v,h,m,_=function(e){var t=e.inputType,u=e.onChange,c=a.useBodyLocale().t;return"text"===t?s.createElement(n.Button,{type:"button","button-height":"1-1","button-width":"1-1","button-padding":"none",onClick:function(){return u("password")},title:c(v||(v=p(["Скрыть пароль"],["Скрыть пароль"]))),tabIndex:-1,"data-qaid":"input_field_hide_password","data-testid":"input_field_hide_password"},s.createElement(r.Icon,{"icon-as":i.SvgEyeOpen,"icon-color":"black-700","icon-events":"none",style:{width:16,height:16}})):s.createElement(n.Button,{type:"button","button-height":"1-1","button-width":"1-1","button-padding":"none",onClick:function(){return u("text")},title:c(h||(h=p(["Показать пароль"],["Показать пароль"]))),tabIndex:-1,"data-qaid":"input_field_show_password","data-testid":"input_field_show_password"},s.createElement(r.Icon,{"icon-as":o.SvgEyeClose,"icon-color":"black-600","icon-events":"none",style:{width:16,height:16}}))},b=function(){return s.createElement(u.Spinner,{"spinner-color":"violet-500",width:16,height:16,"data-qaid":"input_field_loading","data-testid":"input_field_loading"})},y=function(){return s.createElement(r.Icon,{"icon-as":c.SvgOk,"icon-color":"green-800","icon-events":"none","data-qaid":"input_field_correct_value","data-testid":"input_field_correct_value",style:{width:16,height:16}})},g=function(e){var t=a.useBodyLocale().t;return s.createElement(n.Button,f({type:"button","button-height":"1-1","button-width":"1-1","button-padding":"none",title:t(m||(m=p(["Очистить"],["Очистить"]))),tabIndex:-1,"data-qaid":"input_field_clear_value","data-testid":"input_field_clear_value"},e),s.createElement(r.Icon,{"icon-as":l.SvgCancel,"icon-color":"black-600","icon-events":"none",style:{width:16,height:16}}))},E="UnXum",q="_1Wl0O",w="-TbcG cUXq3",O="QmiGS cUXq3",j="_7Fcq2",x="uV711",B="cxqrg",I=function(e){var t=e.children;return s.createElement("div",{className:j,"data-qaid":"input_field_error","data-testid":"input_field_error"},t)};function C(e,t,n,r){if(n){var a=t;if("click"===t.type){var i=e.cloneNode(!0);return a=Object.create(t,{target:{value:i},currentTarget:{value:i}}),i.value="",void n(a)}if(void 0!==r)return a=Object.create(t,{target:{value:e},currentTarget:{value:e}}),e.value=r,void n(a);n(a)}}function N(e){return function(e){return Number.isInteger(e)||e?"".concat(e):""}(e).length<=0}var S=s.forwardRef((function(e,n){var r=e.addonBefore,a=e.addonAfter,i=e.addonBeforeWidth,o=void 0===i?40:i,u=e.addonAfterWidth,c=void 0===u?40:u,l=e.error,d=void 0!==l&&l,p=e.label,v=e.isLabelRequired,h=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(r=Object.getOwnPropertySymbols(e);a<r.length;a++)t.indexOf(r[a])<0&&Object.prototype.propertyIsEnumerable.call(e,r[a])&&(n[r[a]]=e[r[a]])}return n}(e,["addonBefore","addonAfter","addonBeforeWidth","addonAfterWidth","error","label","isLabelRequired"]),m=s.useRef(!1),j=s.useRef(!1),S=s.useRef(!1),k=function(e,t){void 0===t&&(t=null);var n=s.useRef(t);return s.useEffect((function(){e&&("function"==typeof e?e(n.current):e.current=n.current)}),[e]),n}(n,null),P=s.useState(h.type),A=P[0],F=P[1],R=s.useState(N(h.value||h.defaultValue)),T=R[0],L=R[1];s.useEffect((function(){if(m.current){var e=N(h.value);e!==T&&L(e)}else m.current=!0}),[h.value]);var W=null;W="password"===h.type&&"togglePassword"===a?s.createElement(_,{inputType:A,onChange:function(e){return F(e)}}):"clearValue"===a?T?null:s.createElement(g,{onClick:function(e){var t;N(h.value)||h.onChange?k.current&&(L(!0),k.current.focus(),C(k.current,e,h.onChange),N(h.value)&&(k.current.value="")):null===(t=k.current)||void 0===t||t.focus()},onMouseEnter:function(){j.current=!0,S.current=!0},onTouchStart:function(){j.current=!0,S.current=!0},onMouseLeave:function(){j.current=!1,S.current=!1},onTouchEnd:function(){j.current=!1,S.current=!1}}):"correctValue"===a?s.createElement(y,null):"loading"===a?s.createElement(b,null):a;var M,V=!!p,U=!!r,X=!!W,G=(M=d,Array.isArray(M)&&M.length>0||!!d);return s.createElement("div",{className:h.className,style:h.style,"data-qaid":h["data-qaid"]||"input_field","data-testid":h["data-testid"]||"input_field"},V&&s.createElement("div",{className:x},s.createElement("label",{"data-qaid":"input_field_label","data-testid":"input_field_label",htmlFor:h.id},p),!!v&&s.createElement(s.Fragment,null," ",s.createElement("span",{className:B,"data-qaid":"input_field_label_required","data-testid":"input_field_label_required"},"*"))),s.createElement("div",{className:E},s.createElement(t.Input,f({ref:k,"input-theme":G?"red":"white"},h,{"data-qaid":"input_field_textbox","data-testid":"input_field_textbox",style:{paddingLeft:U?o:void 0,paddingRight:X?c:void 0},className:q,type:A,onFocus:function(e){!j.current&&h.onFocus&&h.onFocus(e),j.current=!1},onBlur:function(e){!S.current&&h.onBlur&&h.onBlur(e),S.current=!1},onChange:function(e){L(N(e.target.value)),C(e.currentTarget,e,h.onChange)}})),U&&s.createElement("div",{className:w,style:{width:o}},r),X&&s.createElement("div",{className:O,style:{width:c}},W)),G&&(Array.isArray(d)?d.map((function(e){return s.createElement(I,{key:e},e)})):!0===d?null:s.createElement(I,null,d)))}));S.displayName="InputField",exports.InputField=S,require("./style.production.css");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("@prom-ui/core/Input"),n=require("@prom-ui/core/Button"),r=require("@prom-ui/core/Icon"),a=require("@prom-ui/core/BodyProvider"),i=require("@prom-ui/icons/EyeOpen"),o=require("@prom-ui/icons/EyeClose"),u=require("@prom-ui/core/Spinner"),l=require("@prom-ui/icons/Ok"),c=require("@prom-ui/icons/Cancel");function d(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}})),t.default=e,Object.freeze(t)}var s=d(e),f=function(){return f=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var a in t=arguments[n])Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a]);return e},f.apply(this,arguments)};function p(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}var v,h,b,m=function(e){var t=e.inputType,u=e.onChange,l=a.useBodyLocale().t;return"text"===t?s.createElement(n.Button,{type:"button","button-height":"1-1","button-width":"1-1","button-padding":"none",onClick:function(){return u("password")},title:l(v||(v=p(["Скрыть пароль"],["Скрыть пароль"]))),tabIndex:-1,"data-qaid":"input_field_hide_password","data-testid":"input_field_hide_password"},s.createElement(r.Icon,{"icon-as":i.SvgEyeOpen,"icon-color":"black-700","icon-events":"none",style:{width:16,height:16}})):s.createElement(n.Button,{type:"button","button-height":"1-1","button-width":"1-1","button-padding":"none",onClick:function(){return u("text")},title:l(h||(h=p(["Показать пароль"],["Показать пароль"]))),tabIndex:-1,"data-qaid":"input_field_show_password","data-testid":"input_field_show_password"},s.createElement(r.Icon,{"icon-as":o.SvgEyeClose,"icon-color":"black-600","icon-events":"none",style:{width:16,height:16}}))},_=function(){return s.createElement(u.Spinner,{"spinner-color":"violet-500",width:16,height:16,"data-qaid":"input_field_loading","data-testid":"input_field_loading"})},y=function(){return s.createElement(r.Icon,{"icon-as":l.SvgOk,"icon-color":"green-800","icon-events":"none","data-qaid":"input_field_correct_value","data-testid":"input_field_correct_value",style:{width:16,height:16}})},g=function(e){var t=a.useBodyLocale().t;return s.createElement(n.Button,f({type:"button","button-height":"1-1","button-width":"1-1","button-padding":"none",title:t(b||(b=p(["Очистить"],["Очистить"]))),tabIndex:-1,"data-qaid":"input_field_clear_value","data-testid":"input_field_clear_value"},e),s.createElement(r.Icon,{"icon-as":c.SvgCancel,"icon-color":"black-600","icon-events":"none",style:{width:16,height:16}}))},E="EVTeN",w="rfpBC",O="GeS6- oqO-V",q="Cl38- oqO-V",j="hSs8w",B="bwxYk",C="bTTTw",x=function(e){var t=e.children;return s.createElement("div",{className:j,"data-qaid":"input_field_error","data-testid":"input_field_error"},t)};function I(e,t,n,r){if(n){var a=t;if("click"===t.type){var i=e.cloneNode(!0);return a=Object.create(t,{target:{value:i},currentTarget:{value:i}}),i.value="",void n(a)}if(void 0!==r)return a=Object.create(t,{target:{value:e},currentTarget:{value:e}}),e.value=r,void n(a);n(a)}}function N(e){return function(e){return Number.isInteger(e)||e?"".concat(e):""}(e).length<=0}var S=s.forwardRef((function(e,n){var r=e.addonBefore,a=e.addonAfter,i=e.addonBeforeWidth,o=void 0===i?40:i,u=e.addonAfterWidth,l=void 0===u?40:u,c=e.error,d=void 0!==c&&c,p=e.label,v=e.isLabelRequired,h=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(r=Object.getOwnPropertySymbols(e);a<r.length;a++)t.indexOf(r[a])<0&&Object.prototype.propertyIsEnumerable.call(e,r[a])&&(n[r[a]]=e[r[a]])}return n}(e,["addonBefore","addonAfter","addonBeforeWidth","addonAfterWidth","error","label","isLabelRequired"]),b=s.useRef(!1),j=s.useRef(!1),S=s.useRef(!1),k=function(e,t){void 0===t&&(t=null);var n=s.useRef(t);return s.useEffect((function(){e&&("function"==typeof e?e(n.current):e.current=n.current)}),[e]),n}(n,null),P=s.useState(h.type),T=P[0],A=P[1],R=s.useState(N(h.value||h.defaultValue)),F=R[0],L=R[1];s.useEffect((function(){if(b.current){var e=N(h.value);e!==F&&L(e)}else b.current=!0}),[h.value]);var V=null;V="password"===h.type&&"togglePassword"===a?s.createElement(m,{inputType:T,onChange:function(e){return A(e)}}):"clearValue"===a?F?null:s.createElement(g,{onClick:function(e){var t;N(h.value)||h.onChange?k.current&&(L(!0),k.current.focus(),I(k.current,e,h.onChange),N(h.value)&&(k.current.value="")):null===(t=k.current)||void 0===t||t.focus()},onMouseEnter:function(){j.current=!0,S.current=!0},onTouchStart:function(){j.current=!0,S.current=!0},onMouseLeave:function(){j.current=!1,S.current=!1},onTouchEnd:function(){j.current=!1,S.current=!1}}):"correctValue"===a?s.createElement(y,null):"loading"===a?s.createElement(_,null):a;var M,W=!!p,z=!!r,D=!!V,G=(M=d,Array.isArray(M)&&M.length>0||!!d);return s.createElement("div",{className:h.className,style:h.style,"data-qaid":h["data-qaid"]||"input_field","data-testid":h["data-testid"]||"input_field"},W&&s.createElement("div",{className:B},s.createElement("label",{"data-qaid":"input_field_label","data-testid":"input_field_label",htmlFor:h.id},p),!!v&&s.createElement(s.Fragment,null," ",s.createElement("span",{className:C,"data-qaid":"input_field_label_required","data-testid":"input_field_label_required"},"*"))),s.createElement("div",{className:E},s.createElement(t.Input,f({ref:k,"input-theme":G?"red":"white"},h,{"data-qaid":"input_field_textbox","data-testid":"input_field_textbox",style:{paddingLeft:z?o:void 0,paddingRight:D?l:void 0},className:w,type:T,onFocus:function(e){!j.current&&h.onFocus&&h.onFocus(e),j.current=!1},onBlur:function(e){!S.current&&h.onBlur&&h.onBlur(e),S.current=!1},onChange:function(e){L(N(e.target.value)),I(e.currentTarget,e,h.onChange)}})),z&&s.createElement("div",{className:O,style:{width:o}},r),D&&s.createElement("div",{className:q,style:{width:l}},V)),G&&(Array.isArray(d)?d.map((function(e){return s.createElement(x,{key:e},e)})):!0===d?null:s.createElement(x,null,d)))}));S.displayName="InputField",exports.InputField=S,require("./style.production.v2.css");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.InputField__root___UnXum{position:relative}.InputField__input___1Wl0O[type=search]::-ms-clear,.InputField__input___1Wl0O[type=search]::-ms-reveal{display:none;width:0;height:0}.InputField__input___1Wl0O[type=search]::-webkit-search-decoration,.InputField__input___1Wl0O[type=search]::-webkit-search-cancel-button,.InputField__input___1Wl0O[type=search]::-webkit-search-results-button,.InputField__input___1Wl0O[type=search]::-webkit-search-results-decoration{-webkit-appearance:none;appearance:none;display:none}.InputField__beforeAndAfter___cUXq3{position:absolute;top:0;height:100%;display:flex;align-items:center;justify-content:center}.InputField__before___-TbcG{left:0}.InputField__after___QmiGS{right:0}.InputField__error___7Fcq2{margin-top:var(--pds-spacing-xxs);color:var(--red-900)}.InputField__error___7Fcq2+.InputField__error___7Fcq2{margin-top:calc(var(--pds-spacing-xxs)/2)}
|
|
1
|
+
.InputField__root___UnXum{position:relative}.InputField__input___1Wl0O[type=search]::-ms-clear,.InputField__input___1Wl0O[type=search]::-ms-reveal{display:none;width:0;height:0}.InputField__input___1Wl0O[type=search]::-webkit-search-decoration,.InputField__input___1Wl0O[type=search]::-webkit-search-cancel-button,.InputField__input___1Wl0O[type=search]::-webkit-search-results-button,.InputField__input___1Wl0O[type=search]::-webkit-search-results-decoration{-webkit-appearance:none;appearance:none;display:none}.InputField__beforeAndAfter___cUXq3{position:absolute;top:0;height:100%;display:flex;align-items:center;justify-content:center}.InputField__before___-TbcG{left:0}.InputField__after___QmiGS{right:0}.InputField__error___7Fcq2{margin-top:var(--pds-spacing-xxs);color:var(--red-900)}.InputField__error___7Fcq2+.InputField__error___7Fcq2{margin-top:calc(var(--pds-spacing-xxs)/2)}.InputField__label___uV711{margin-bottom:var(--pds-spacing-xxs)}.InputField__labelRequired___cxqrg{color:var(--red-900)}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.InputField__root___EVTeN{position:relative}.InputField__input___rfpBC[type=search]::-ms-clear,.InputField__input___rfpBC[type=search]::-ms-reveal{display:none;width:0;height:0}.InputField__input___rfpBC[type=search]::-webkit-search-decoration,.InputField__input___rfpBC[type=search]::-webkit-search-cancel-button,.InputField__input___rfpBC[type=search]::-webkit-search-results-button,.InputField__input___rfpBC[type=search]::-webkit-search-results-decoration{-webkit-appearance:none;appearance:none;display:none}.InputField__beforeAndAfter___oqO-V{position:absolute;top:0;height:100%;display:flex;align-items:center;justify-content:center}.InputField__before___GeS6-{left:0}.InputField__after___Cl38-{right:0}.InputField__error___hSs8w{margin-top:var(--pds-spacing-xxs);color:var(--red-900)}.InputField__error___hSs8w+.InputField__error___hSs8w{margin-top:calc(var(--pds-spacing-xxs)/2)}
|
|
1
|
+
.InputField__root___EVTeN{position:relative}.InputField__input___rfpBC[type=search]::-ms-clear,.InputField__input___rfpBC[type=search]::-ms-reveal{display:none;width:0;height:0}.InputField__input___rfpBC[type=search]::-webkit-search-decoration,.InputField__input___rfpBC[type=search]::-webkit-search-cancel-button,.InputField__input___rfpBC[type=search]::-webkit-search-results-button,.InputField__input___rfpBC[type=search]::-webkit-search-results-decoration{-webkit-appearance:none;appearance:none;display:none}.InputField__beforeAndAfter___oqO-V{position:absolute;top:0;height:100%;display:flex;align-items:center;justify-content:center}.InputField__before___GeS6-{left:0}.InputField__after___Cl38-{right:0}.InputField__error___hSs8w{margin-top:var(--pds-spacing-xxs);color:var(--red-900)}.InputField__error___hSs8w+.InputField__error___hSs8w{margin-top:calc(var(--pds-spacing-xxs)/2)}.InputField__label___bwxYk{margin-bottom:var(--pds-spacing-xxs)}.InputField__labelRequired___bTTTw{color:var(--red-900)}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.UnXum{position:relative}._1Wl0O[type=search]::-ms-clear,._1Wl0O[type=search]::-ms-reveal{display:none;width:0;height:0}._1Wl0O[type=search]::-webkit-search-decoration,._1Wl0O[type=search]::-webkit-search-cancel-button,._1Wl0O[type=search]::-webkit-search-results-button,._1Wl0O[type=search]::-webkit-search-results-decoration{-webkit-appearance:none;appearance:none;display:none}.cUXq3{position:absolute;top:0;height:100%;display:flex;align-items:center;justify-content:center}.-TbcG{left:0}.QmiGS{right:0}._7Fcq2{margin-top:var(--pds-spacing-xxs);color:var(--red-900)}._7Fcq2+._7Fcq2{margin-top:calc(var(--pds-spacing-xxs)/2)}
|
|
1
|
+
.UnXum{position:relative}._1Wl0O[type=search]::-ms-clear,._1Wl0O[type=search]::-ms-reveal{display:none;width:0;height:0}._1Wl0O[type=search]::-webkit-search-decoration,._1Wl0O[type=search]::-webkit-search-cancel-button,._1Wl0O[type=search]::-webkit-search-results-button,._1Wl0O[type=search]::-webkit-search-results-decoration{-webkit-appearance:none;appearance:none;display:none}.cUXq3{position:absolute;top:0;height:100%;display:flex;align-items:center;justify-content:center}.-TbcG{left:0}.QmiGS{right:0}._7Fcq2{margin-top:var(--pds-spacing-xxs);color:var(--red-900)}._7Fcq2+._7Fcq2{margin-top:calc(var(--pds-spacing-xxs)/2)}.uV711{margin-bottom:var(--pds-spacing-xxs)}.cxqrg{color:var(--red-900)}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.EVTeN{position:relative}.rfpBC[type=search]::-ms-clear,.rfpBC[type=search]::-ms-reveal{display:none;width:0;height:0}.rfpBC[type=search]::-webkit-search-decoration,.rfpBC[type=search]::-webkit-search-cancel-button,.rfpBC[type=search]::-webkit-search-results-button,.rfpBC[type=search]::-webkit-search-results-decoration{-webkit-appearance:none;appearance:none;display:none}.oqO-V{position:absolute;top:0;height:100%;display:flex;align-items:center;justify-content:center}.GeS6-{left:0}.Cl38-{right:0}.hSs8w{margin-top:var(--pds-spacing-xxs);color:var(--red-900)}.hSs8w+.hSs8w{margin-top:calc(var(--pds-spacing-xxs)/2)}
|
|
1
|
+
.EVTeN{position:relative}.rfpBC[type=search]::-ms-clear,.rfpBC[type=search]::-ms-reveal{display:none;width:0;height:0}.rfpBC[type=search]::-webkit-search-decoration,.rfpBC[type=search]::-webkit-search-cancel-button,.rfpBC[type=search]::-webkit-search-results-button,.rfpBC[type=search]::-webkit-search-results-decoration{-webkit-appearance:none;appearance:none;display:none}.oqO-V{position:absolute;top:0;height:100%;display:flex;align-items:center;justify-content:center}.GeS6-{left:0}.Cl38-{right:0}.hSs8w{margin-top:var(--pds-spacing-xxs);color:var(--red-900)}.hSs8w+.hSs8w{margin-top:calc(var(--pds-spacing-xxs)/2)}.bwxYk{margin-bottom:var(--pds-spacing-xxs)}.bTTTw{color:var(--red-900)}
|
package/InputField/index.d.ts
CHANGED
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
export declare type InputFieldProps = React.ComponentPropsWithRef<"input"> & {
|
|
3
|
+
/** Заголовок */
|
|
4
|
+
label?: string;
|
|
5
|
+
/** Ошибка */
|
|
6
|
+
error?: boolean | string | string[];
|
|
3
7
|
/** Дополнение слева */
|
|
4
8
|
addonBefore?: React.ReactNode;
|
|
5
9
|
/** Дополнение справа */
|
|
6
10
|
addonAfter?: ('togglePassword' | 'clearValue' | 'correctValue' | 'loading') & React.ReactNode;
|
|
7
11
|
addonBeforeWidth?: string | number;
|
|
8
12
|
addonAfterWidth?: string | number;
|
|
9
|
-
/**
|
|
10
|
-
|
|
13
|
+
/** Добавляет красную звездочку заголовку */
|
|
14
|
+
isLabelRequired?: boolean;
|
|
11
15
|
};
|
|
12
|
-
export declare const InputField: React.ForwardRefExoticComponent<Pick<InputFieldProps, "key" | keyof React.InputHTMLAttributes<HTMLInputElement> | "addonBefore" | "addonAfter" | "addonBeforeWidth" | "addonAfterWidth" | "error"> & React.RefAttributes<HTMLInputElement>>;
|
|
16
|
+
export declare const InputField: React.ForwardRefExoticComponent<Pick<InputFieldProps, "label" | "key" | keyof React.InputHTMLAttributes<HTMLInputElement> | "addonBefore" | "addonAfter" | "addonBeforeWidth" | "addonAfterWidth" | "error" | "isLabelRequired"> & React.RefAttributes<HTMLInputElement>>;
|
package/InputField/package.json
CHANGED
|
@@ -27,21 +27,19 @@ var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
|
|
27
27
|
|
|
28
28
|
var KeyPressApp = function (_a) {
|
|
29
29
|
var code = _a.code,
|
|
30
|
-
|
|
31
|
-
|
|
30
|
+
onKeyDown = _a.onKeyDown,
|
|
31
|
+
onKeyUp = _a.onKeyUp;
|
|
32
32
|
useKeyPress.useKeyPress(code, onKeyDown, onKeyUp);
|
|
33
33
|
return null;
|
|
34
34
|
};
|
|
35
|
-
|
|
36
35
|
var KeyPress = function (_a) {
|
|
37
36
|
var _b = _a.isActive,
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
37
|
+
isActive = _b === void 0 ? true : _b,
|
|
38
|
+
code = _a.code,
|
|
39
|
+
_c = _a.onKeyDown,
|
|
40
|
+
onKeyDown = _c === void 0 ? function () {} : _c,
|
|
41
|
+
_d = _a.onKeyUp,
|
|
42
|
+
onKeyUp = _d === void 0 ? function () {} : _d;
|
|
45
43
|
if (isActive) {
|
|
46
44
|
return React__namespace.createElement(KeyPressApp, {
|
|
47
45
|
code: code,
|
|
@@ -49,7 +47,6 @@ var KeyPress = function (_a) {
|
|
|
49
47
|
onKeyUp: onKeyUp
|
|
50
48
|
});
|
|
51
49
|
}
|
|
52
|
-
|
|
53
50
|
return null;
|
|
54
51
|
};
|
|
55
52
|
|
|
@@ -27,21 +27,19 @@ var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
|
|
27
27
|
|
|
28
28
|
var KeyPressApp = function (_a) {
|
|
29
29
|
var code = _a.code,
|
|
30
|
-
|
|
31
|
-
|
|
30
|
+
onKeyDown = _a.onKeyDown,
|
|
31
|
+
onKeyUp = _a.onKeyUp;
|
|
32
32
|
useKeyPress.useKeyPress(code, onKeyDown, onKeyUp);
|
|
33
33
|
return null;
|
|
34
34
|
};
|
|
35
|
-
|
|
36
35
|
var KeyPress = function (_a) {
|
|
37
36
|
var _b = _a.isActive,
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
37
|
+
isActive = _b === void 0 ? true : _b,
|
|
38
|
+
code = _a.code,
|
|
39
|
+
_c = _a.onKeyDown,
|
|
40
|
+
onKeyDown = _c === void 0 ? function () {} : _c,
|
|
41
|
+
_d = _a.onKeyUp,
|
|
42
|
+
onKeyUp = _d === void 0 ? function () {} : _d;
|
|
45
43
|
if (isActive) {
|
|
46
44
|
return React__namespace.createElement(KeyPressApp, {
|
|
47
45
|
code: code,
|
|
@@ -49,7 +47,6 @@ var KeyPress = function (_a) {
|
|
|
49
47
|
onKeyUp: onKeyUp
|
|
50
48
|
});
|
|
51
49
|
}
|
|
52
|
-
|
|
53
50
|
return null;
|
|
54
51
|
};
|
|
55
52
|
|
package/KeyPress/package.json
CHANGED
package/Line/package.json
CHANGED