@itcase/ui 1.0.83 → 1.0.85
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/dist/SelectContainer-6GiJFRo0.js +8677 -0
- package/dist/components/Badge.js +3 -3
- package/dist/components/Button.js +10 -10
- package/dist/components/Card.js +2 -2
- package/dist/components/Cell.js +63 -51
- package/dist/components/Choice.js +109 -15
- package/dist/components/Code.js +13 -3
- package/dist/components/DatePicker.js +3 -2
- package/dist/components/FormField.js +2 -2
- package/dist/components/Icon.js +72 -72
- package/dist/components/Label.js +19 -4
- package/dist/components/Notification.js +2 -2
- package/dist/components/Search.js +38 -25
- package/dist/components/Select.js +34 -8668
- package/dist/components/Swiper.js +6 -4
- package/dist/components/Tab.js +12 -7
- package/dist/constants/componentProps/size.js +1 -1
- package/dist/constants/componentProps/textColor.js +1 -1
- package/dist/constants/componentProps/textColorActive.js +1 -1
- package/dist/constants/componentProps/textColorHover.js +1 -1
- package/dist/context/Notifications.js +28 -30
- package/dist/css/components/Cell/Cell.css +40 -1
- package/dist/css/components/DatePicker/DatePicker.css +34 -8
- package/dist/css/components/Label/Label.css +37 -1
- package/dist/css/components/Select/Select.css +5 -0
- package/dist/css/components/Select/css/__menu/select__menu.css +5 -0
- package/dist/css/components/Swiper/Swiper.css +2 -2
- package/package.json +27 -27
package/dist/components/Badge.js
CHANGED
|
@@ -80,11 +80,11 @@ function Badge(props) {
|
|
|
80
80
|
styles: badgeStyles
|
|
81
81
|
} = useStyles.useStyles(props);
|
|
82
82
|
return /*#__PURE__*/React__default.default.createElement("div", {
|
|
83
|
-
|
|
84
|
-
|
|
83
|
+
className: clsx__default.default(className, 'badge', !value && 'badge_type_status', borderColorClass, borderColorHoverClass, borderWidthClass, borderTypeClass, fillClass || badgeConfig.appearance[appearance] && `fill_${badgeConfig.appearance[appearance].fillClass}`?.replace(/([A-Z])/g, '-$1').toLowerCase(), positionClass, sizeClass, shapeClass),
|
|
84
|
+
style: badgeStyles
|
|
85
85
|
}, children || value && /*#__PURE__*/React__default.default.createElement(index.Text, {
|
|
86
86
|
size: textSize,
|
|
87
|
-
textColor: textColor || badgeConfig.appearance[appearance]
|
|
87
|
+
textColor: textColor || badgeConfig.appearance[appearance]?.textColor
|
|
88
88
|
}, value));
|
|
89
89
|
}
|
|
90
90
|
Badge.propTypes = {
|
|
@@ -153,15 +153,15 @@ const Button = /*#__PURE__*/React__default.default.forwardRef(function Button(pr
|
|
|
153
153
|
set: loaderSet
|
|
154
154
|
}), before, (iconBefore || iconBeforeSrc) && /*#__PURE__*/React__default.default.createElement(index$2.Icon, {
|
|
155
155
|
className: "button__icon_before",
|
|
156
|
-
iconFill: iconBeforeFill || buttonConfig.appearance[appearance]
|
|
157
|
-
iconStroke: iconBeforeStroke || buttonConfig.appearance[appearance]
|
|
156
|
+
iconFill: iconBeforeFill || buttonConfig.appearance[appearance]?.iconBeforeFill,
|
|
157
|
+
iconStroke: iconBeforeStroke || buttonConfig.appearance[appearance]?.iconBeforeStroke,
|
|
158
158
|
imageSrc: iconBeforeSrc,
|
|
159
159
|
size: iconBeforeSize,
|
|
160
160
|
SvgImage: iconBefore
|
|
161
161
|
}), (icon || iconSrc) && /*#__PURE__*/React__default.default.createElement(index$2.Icon, {
|
|
162
162
|
className: "button__icon",
|
|
163
|
-
iconFill: iconFill || buttonConfig.appearance[appearance]
|
|
164
|
-
iconStroke: iconStroke || buttonConfig.appearance[appearance]
|
|
163
|
+
iconFill: iconFill || buttonConfig.appearance[appearance]?.iconFill,
|
|
164
|
+
iconStroke: iconStroke || buttonConfig.appearance[appearance]?.iconStroke,
|
|
165
165
|
imageSrc: iconSrc,
|
|
166
166
|
size: iconSize,
|
|
167
167
|
SvgImage: icon
|
|
@@ -169,13 +169,13 @@ const Button = /*#__PURE__*/React__default.default.forwardRef(function Button(pr
|
|
|
169
169
|
className: "button__label",
|
|
170
170
|
size: labelTextSize,
|
|
171
171
|
style: labelStyles,
|
|
172
|
-
textColor: labelTextColor || buttonConfig.appearance[appearance]
|
|
173
|
-
textColorHover: labelTextColorHover || buttonConfig.appearance[appearance]
|
|
172
|
+
textColor: labelTextColor || buttonConfig.appearance[appearance]?.labelTextColor,
|
|
173
|
+
textColorHover: labelTextColorHover || buttonConfig.appearance[appearance]?.labelTextColorHover,
|
|
174
174
|
textWrap: labelTextWrap
|
|
175
175
|
}, children || label), (iconAfter || iconAfterSrc) && /*#__PURE__*/React__default.default.createElement(index$2.Icon, {
|
|
176
176
|
className: "button__icon_after",
|
|
177
|
-
iconFill: iconAfterFill || buttonConfig.appearance[appearance]
|
|
178
|
-
iconStroke: iconAfterStroke || buttonConfig.appearance[appearance]
|
|
177
|
+
iconFill: iconAfterFill || buttonConfig.appearance[appearance]?.iconAfterFill,
|
|
178
|
+
iconStroke: iconAfterStroke || buttonConfig.appearance[appearance]?.iconAfterStroke,
|
|
179
179
|
imageSrc: iconAfterSrc,
|
|
180
180
|
size: iconAfterSize,
|
|
181
181
|
SvgImage: iconAfter
|
|
@@ -200,7 +200,7 @@ Button.propTypes = {
|
|
|
200
200
|
iconFill: PropTypes__default.default.string,
|
|
201
201
|
iconSize: PropTypes__default.default.string,
|
|
202
202
|
iconStroke: PropTypes__default.default.string,
|
|
203
|
-
isDisabled: PropTypes__default.default.
|
|
203
|
+
isDisabled: PropTypes__default.default.bool,
|
|
204
204
|
label: PropTypes__default.default.string,
|
|
205
205
|
labelTextColor: PropTypes__default.default.string,
|
|
206
206
|
labelTextColorHover: PropTypes__default.default.string,
|
|
@@ -420,7 +420,7 @@ Button.__docgenInfo = {
|
|
|
420
420
|
"isDisabled": {
|
|
421
421
|
"description": "",
|
|
422
422
|
"type": {
|
|
423
|
-
"name": "
|
|
423
|
+
"name": "bool"
|
|
424
424
|
},
|
|
425
425
|
"required": false
|
|
426
426
|
},
|
package/dist/components/Card.js
CHANGED
|
@@ -62,8 +62,8 @@ function Card(props) {
|
|
|
62
62
|
propsKey: 'width'
|
|
63
63
|
});
|
|
64
64
|
return /*#__PURE__*/React__default.default.createElement("div", {
|
|
65
|
-
|
|
66
|
-
|
|
65
|
+
className: clsx__default.default(className, 'card', shapeClass, size && `card_size_${size}`, type && `card_type_${type}`, widthClass),
|
|
66
|
+
onClick: onClick
|
|
67
67
|
}, /*#__PURE__*/React__default.default.createElement("div", {
|
|
68
68
|
className: "card__wrapper"
|
|
69
69
|
}, image, src && /*#__PURE__*/React__default.default.createElement(index.Image, {
|
package/dist/components/Cell.js
CHANGED
|
@@ -5,6 +5,7 @@ var PropTypes = require('prop-types');
|
|
|
5
5
|
var clsx = require('clsx');
|
|
6
6
|
var index$1 = require('./Icon.js');
|
|
7
7
|
var index = require('./Text.js');
|
|
8
|
+
var index$2 = require('./Label.js');
|
|
8
9
|
var size = require('../constants/componentProps/size.js');
|
|
9
10
|
var useDeviceTargetClass = require('../hooks/useDeviceTargetClass.js');
|
|
10
11
|
require('react-inlinesvg');
|
|
@@ -31,6 +32,7 @@ require('../constants/componentProps/shape.js');
|
|
|
31
32
|
require('../constants/componentProps/strokeColor.js');
|
|
32
33
|
require('../constants/componentProps/textColorActive.js');
|
|
33
34
|
require('../constants/componentProps/textColorHover.js');
|
|
35
|
+
require('../constants/componentProps/textAlign.js');
|
|
34
36
|
require('lodash/castArray');
|
|
35
37
|
|
|
36
38
|
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
@@ -42,18 +44,24 @@ var clsx__default = /*#__PURE__*/_interopDefault(clsx);
|
|
|
42
44
|
function Cell(props) {
|
|
43
45
|
const {
|
|
44
46
|
className,
|
|
45
|
-
|
|
46
|
-
titleIconSize,
|
|
47
|
-
titleIconSrc,
|
|
48
|
-
titleIconBgFill,
|
|
47
|
+
isShowTitleIcon,
|
|
49
48
|
titleIconFill,
|
|
49
|
+
titleIconFillSize,
|
|
50
|
+
titleIconIconFill,
|
|
51
|
+
titleIconFillHover,
|
|
50
52
|
titleIconStroke,
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
53
|
+
titleIconSrc,
|
|
54
|
+
titleIconShape,
|
|
55
|
+
titleIcon,
|
|
56
|
+
isShowValueIcon,
|
|
55
57
|
valueIconFill,
|
|
58
|
+
valueIconFillSize,
|
|
59
|
+
valueIconIconFill,
|
|
60
|
+
valueIconFillHover,
|
|
56
61
|
valueIconStroke,
|
|
62
|
+
valueIconSrc,
|
|
63
|
+
valueIconShape,
|
|
64
|
+
valueIcon,
|
|
57
65
|
isActive,
|
|
58
66
|
isDisabled,
|
|
59
67
|
set,
|
|
@@ -70,6 +78,21 @@ function Cell(props) {
|
|
|
70
78
|
titleTextSize,
|
|
71
79
|
titleTextColor,
|
|
72
80
|
titleTextWeight,
|
|
81
|
+
isShowTitleLabel,
|
|
82
|
+
titleLabelAppearance,
|
|
83
|
+
titleLabel,
|
|
84
|
+
titleLabelTextSize,
|
|
85
|
+
titleLabelShape,
|
|
86
|
+
titleLabelSize,
|
|
87
|
+
isShowValueLabel,
|
|
88
|
+
valueLabelAppearance,
|
|
89
|
+
valueLabel,
|
|
90
|
+
valueLabelTextSize,
|
|
91
|
+
valueLabelShape,
|
|
92
|
+
valueLabelSize,
|
|
93
|
+
isZeroPadding,
|
|
94
|
+
isZeroGap,
|
|
95
|
+
isReverse,
|
|
73
96
|
onClick,
|
|
74
97
|
onMouseEnter
|
|
75
98
|
} = props;
|
|
@@ -122,7 +145,7 @@ function Cell(props) {
|
|
|
122
145
|
propsKey: 'width'
|
|
123
146
|
});
|
|
124
147
|
return /*#__PURE__*/React__default.default.createElement("div", {
|
|
125
|
-
className: clsx__default.default(className, 'cell', size && `cell_size_${size}`, set && `cell_set_${set}`, bgFillClass, bgFillHoverClass, isActive && bgFillActiveClass, isDisabled && bgFillDisabledClass, bgShapeClass, widthClass),
|
|
148
|
+
className: clsx__default.default(className, 'cell', size && `cell_size_${size}`, set && `cell_set_${set}`, bgFillClass, bgFillHoverClass, isActive && bgFillActiveClass, isDisabled && bgFillDisabledClass, bgShapeClass, widthClass, isZeroPadding && 'cell_reset-padding', isZeroGap && 'cell_reset-gap', isReverse && 'cell_reverse'),
|
|
126
149
|
onClick: onClick,
|
|
127
150
|
onMouseEnter: onMouseEnter
|
|
128
151
|
}, before && /*#__PURE__*/React__default.default.createElement("div", {
|
|
@@ -137,14 +160,22 @@ function Cell(props) {
|
|
|
137
160
|
tag: titleTag,
|
|
138
161
|
textColor: titleTextColor,
|
|
139
162
|
textWeight: titleTextWeight
|
|
140
|
-
}, title),
|
|
141
|
-
bgFill: titleIconBgFill,
|
|
163
|
+
}, title), isShowTitleIcon && /*#__PURE__*/React__default.default.createElement(index$1.Icon, {
|
|
142
164
|
className: "cell__icon",
|
|
143
|
-
|
|
144
|
-
|
|
165
|
+
fill: titleIconFill,
|
|
166
|
+
fillSize: titleIconFillSize,
|
|
167
|
+
iconFill: titleIconIconFill,
|
|
168
|
+
iconFillHover: titleIconFillHover,
|
|
145
169
|
iconStroke: titleIconStroke,
|
|
146
170
|
imageSrc: titleIconSrc,
|
|
171
|
+
shape: titleIconShape,
|
|
147
172
|
SvgImage: titleIcon
|
|
173
|
+
}), isShowTitleLabel && /*#__PURE__*/React__default.default.createElement(index$2.Label, {
|
|
174
|
+
appearance: titleLabelAppearance,
|
|
175
|
+
label: titleLabel,
|
|
176
|
+
labelTextSize: titleLabelTextSize,
|
|
177
|
+
shape: titleLabelShape,
|
|
178
|
+
size: titleLabelSize
|
|
148
179
|
})), value && /*#__PURE__*/React__default.default.createElement("div", {
|
|
149
180
|
className: "cell__data"
|
|
150
181
|
}, /*#__PURE__*/React__default.default.createElement(index.Text, {
|
|
@@ -153,14 +184,22 @@ function Cell(props) {
|
|
|
153
184
|
tag: valueTag,
|
|
154
185
|
textColor: valueTextColor,
|
|
155
186
|
textWeight: valueTextWeight
|
|
156
|
-
}, value),
|
|
157
|
-
bgFill: valueIconBgFill,
|
|
187
|
+
}, value), isShowValueIcon && /*#__PURE__*/React__default.default.createElement(index$1.Icon, {
|
|
158
188
|
className: "cell__icon",
|
|
159
|
-
|
|
160
|
-
|
|
189
|
+
fill: valueIconFill,
|
|
190
|
+
fillSize: valueIconFillSize,
|
|
191
|
+
iconFill: valueIconIconFill,
|
|
192
|
+
iconFillHover: valueIconFillHover,
|
|
161
193
|
iconStroke: valueIconStroke,
|
|
162
194
|
imageSrc: valueIconSrc,
|
|
195
|
+
shape: valueIconShape,
|
|
163
196
|
SvgImage: valueIcon
|
|
197
|
+
}), isShowValueLabel && /*#__PURE__*/React__default.default.createElement(index$2.Label, {
|
|
198
|
+
appearance: valueLabelAppearance,
|
|
199
|
+
label: valueLabel,
|
|
200
|
+
labelTextSize: valueLabelTextSize,
|
|
201
|
+
shape: valueLabelShape,
|
|
202
|
+
size: valueLabelSize
|
|
164
203
|
}))), after && /*#__PURE__*/React__default.default.createElement("div", {
|
|
165
204
|
className: "cell__after"
|
|
166
205
|
}, after));
|
|
@@ -171,21 +210,17 @@ Cell.propTypes = {
|
|
|
171
210
|
children: PropTypes__default.default.any,
|
|
172
211
|
className: PropTypes__default.default.string,
|
|
173
212
|
titleIcon: PropTypes__default.default.any,
|
|
174
|
-
titleIconBgFill: PropTypes__default.default.string,
|
|
175
213
|
titleIconFill: PropTypes__default.default.string,
|
|
176
|
-
titleIconSize: PropTypes__default.default.string,
|
|
177
214
|
titleIconStroke: PropTypes__default.default.string,
|
|
178
215
|
valueIcon: PropTypes__default.default.any,
|
|
179
|
-
valueIconBgFill: PropTypes__default.default.string,
|
|
180
216
|
valueIconFill: PropTypes__default.default.string,
|
|
181
|
-
valueIconSize: PropTypes__default.default.string,
|
|
182
217
|
valueIconStroke: PropTypes__default.default.string,
|
|
183
218
|
isActive: PropTypes__default.default.bool,
|
|
184
219
|
isDisabled: PropTypes__default.default.bool,
|
|
185
220
|
title: PropTypes__default.default.string,
|
|
186
221
|
titleTextColor: PropTypes__default.default.string,
|
|
187
222
|
titleTextSize: PropTypes__default.default.oneOf(size.default),
|
|
188
|
-
value: PropTypes__default.default.string,
|
|
223
|
+
value: PropTypes__default.default.oneOfType([PropTypes__default.default.element, PropTypes__default.default.string]),
|
|
189
224
|
valueTextColor: PropTypes__default.default.string,
|
|
190
225
|
valueTextSize: PropTypes__default.default.oneOf(size.default),
|
|
191
226
|
onClick: PropTypes__default.default.func,
|
|
@@ -253,13 +288,6 @@ Cell.__docgenInfo = {
|
|
|
253
288
|
},
|
|
254
289
|
"required": false
|
|
255
290
|
},
|
|
256
|
-
"titleIconBgFill": {
|
|
257
|
-
"description": "",
|
|
258
|
-
"type": {
|
|
259
|
-
"name": "string"
|
|
260
|
-
},
|
|
261
|
-
"required": false
|
|
262
|
-
},
|
|
263
291
|
"titleIconFill": {
|
|
264
292
|
"description": "",
|
|
265
293
|
"type": {
|
|
@@ -267,13 +295,6 @@ Cell.__docgenInfo = {
|
|
|
267
295
|
},
|
|
268
296
|
"required": false
|
|
269
297
|
},
|
|
270
|
-
"titleIconSize": {
|
|
271
|
-
"description": "",
|
|
272
|
-
"type": {
|
|
273
|
-
"name": "string"
|
|
274
|
-
},
|
|
275
|
-
"required": false
|
|
276
|
-
},
|
|
277
298
|
"titleIconStroke": {
|
|
278
299
|
"description": "",
|
|
279
300
|
"type": {
|
|
@@ -288,13 +309,6 @@ Cell.__docgenInfo = {
|
|
|
288
309
|
},
|
|
289
310
|
"required": false
|
|
290
311
|
},
|
|
291
|
-
"valueIconBgFill": {
|
|
292
|
-
"description": "",
|
|
293
|
-
"type": {
|
|
294
|
-
"name": "string"
|
|
295
|
-
},
|
|
296
|
-
"required": false
|
|
297
|
-
},
|
|
298
312
|
"valueIconFill": {
|
|
299
313
|
"description": "",
|
|
300
314
|
"type": {
|
|
@@ -302,13 +316,6 @@ Cell.__docgenInfo = {
|
|
|
302
316
|
},
|
|
303
317
|
"required": false
|
|
304
318
|
},
|
|
305
|
-
"valueIconSize": {
|
|
306
|
-
"description": "",
|
|
307
|
-
"type": {
|
|
308
|
-
"name": "string"
|
|
309
|
-
},
|
|
310
|
-
"required": false
|
|
311
|
-
},
|
|
312
319
|
"valueIconStroke": {
|
|
313
320
|
"description": "",
|
|
314
321
|
"type": {
|
|
@@ -349,7 +356,12 @@ Cell.__docgenInfo = {
|
|
|
349
356
|
"value": {
|
|
350
357
|
"description": "",
|
|
351
358
|
"type": {
|
|
352
|
-
"name": "
|
|
359
|
+
"name": "union",
|
|
360
|
+
"value": [{
|
|
361
|
+
"name": "element"
|
|
362
|
+
}, {
|
|
363
|
+
"name": "string"
|
|
364
|
+
}]
|
|
353
365
|
},
|
|
354
366
|
"required": false
|
|
355
367
|
},
|
|
@@ -28,7 +28,7 @@ var React__default = /*#__PURE__*/_interopDefault(React);
|
|
|
28
28
|
var PropTypes__default = /*#__PURE__*/_interopDefault(PropTypes);
|
|
29
29
|
var clsx__default = /*#__PURE__*/_interopDefault(clsx);
|
|
30
30
|
|
|
31
|
-
const Choice = /*#__PURE__*/React__default.default.forwardRef((props, ref)
|
|
31
|
+
const Choice = /*#__PURE__*/React__default.default.forwardRef(function Choice(props, ref) {
|
|
32
32
|
const {
|
|
33
33
|
name,
|
|
34
34
|
className,
|
|
@@ -42,10 +42,15 @@ const Choice = /*#__PURE__*/React__default.default.forwardRef((props, ref) => {
|
|
|
42
42
|
labelTextActiveColor,
|
|
43
43
|
labelTextSize,
|
|
44
44
|
before,
|
|
45
|
-
after
|
|
45
|
+
after,
|
|
46
|
+
isMultiple
|
|
46
47
|
} = props;
|
|
47
48
|
const controlRef = React.useRef(null);
|
|
48
49
|
const optionsRefs = React.useMemo(() => new Map(options.map(item => [item.value, /*#__PURE__*/React.createRef()])), [options]);
|
|
50
|
+
const onChange = React.useCallback((event, item) => {
|
|
51
|
+
const isChecked = isMultiple ? event.target.checked : true;
|
|
52
|
+
setActiveSegment && setActiveSegment(item, isChecked);
|
|
53
|
+
}, [isMultiple, setActiveSegment]);
|
|
49
54
|
const borderColorClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
50
55
|
prefix: 'border-color_',
|
|
51
56
|
propsKey: 'borderColor'
|
|
@@ -86,31 +91,44 @@ const Choice = /*#__PURE__*/React__default.default.forwardRef((props, ref) => {
|
|
|
86
91
|
}, /*#__PURE__*/React__default.default.createElement("input", {
|
|
87
92
|
checked: item.value === active.value,
|
|
88
93
|
className: "choice__item-radio",
|
|
89
|
-
id: item.
|
|
94
|
+
id: `${name}-${item.value}`,
|
|
90
95
|
name: name,
|
|
91
|
-
type:
|
|
96
|
+
type: isMultiple ? 'checkbox' : 'radio',
|
|
92
97
|
value: item.value,
|
|
93
|
-
onChange:
|
|
98
|
+
onChange: event => onChange(event, item)
|
|
94
99
|
}), /*#__PURE__*/React__default.default.createElement("label", {
|
|
95
100
|
className: clsx__default.default('choice__item-label'),
|
|
96
|
-
htmlFor: item.
|
|
101
|
+
htmlFor: `${name}-${item.value}`
|
|
97
102
|
}, before, /*#__PURE__*/React__default.default.createElement(index.Text, {
|
|
98
103
|
size: labelTextSize,
|
|
99
104
|
textColor: item.value === active.value ? labelTextActiveColor : labelTextColor
|
|
100
105
|
}, item.label), after)))));
|
|
101
106
|
});
|
|
102
|
-
Choice.displayName = 'Choice';
|
|
103
107
|
Choice.propTypes = {
|
|
104
|
-
active: PropTypes__default.default.
|
|
108
|
+
active: PropTypes__default.default.shape({
|
|
109
|
+
value: PropTypes__default.default.string,
|
|
110
|
+
label: PropTypes__default.default.string
|
|
111
|
+
}),
|
|
112
|
+
after: PropTypes__default.default.any,
|
|
113
|
+
before: PropTypes__default.default.any,
|
|
105
114
|
className: PropTypes__default.default.string,
|
|
106
|
-
|
|
115
|
+
isMultiple: PropTypes__default.default.bool,
|
|
116
|
+
labelTextActiveColor: PropTypes__default.default.string,
|
|
117
|
+
labelTextColor: PropTypes__default.default.string,
|
|
118
|
+
labelTextSize: PropTypes__default.default.string,
|
|
107
119
|
name: PropTypes__default.default.string,
|
|
108
|
-
options: PropTypes__default.default.
|
|
120
|
+
options: PropTypes__default.default.arrayOf(PropTypes__default.default.shape({
|
|
121
|
+
value: PropTypes__default.default.string,
|
|
122
|
+
label: PropTypes__default.default.string
|
|
123
|
+
})),
|
|
124
|
+
set: PropTypes__default.default.string,
|
|
109
125
|
setActiveSegment: PropTypes__default.default.func,
|
|
126
|
+
size: PropTypes__default.default.string,
|
|
110
127
|
type: PropTypes__default.default.string
|
|
111
128
|
};
|
|
112
129
|
Choice.defaultProps = {
|
|
113
|
-
active: {}
|
|
130
|
+
active: {},
|
|
131
|
+
options: []
|
|
114
132
|
};
|
|
115
133
|
Choice.__docgenInfo = {
|
|
116
134
|
"description": "",
|
|
@@ -124,7 +142,55 @@ Choice.__docgenInfo = {
|
|
|
124
142
|
},
|
|
125
143
|
"description": "",
|
|
126
144
|
"type": {
|
|
127
|
-
"name": "
|
|
145
|
+
"name": "shape",
|
|
146
|
+
"value": {
|
|
147
|
+
"value": {
|
|
148
|
+
"name": "string",
|
|
149
|
+
"required": false
|
|
150
|
+
},
|
|
151
|
+
"label": {
|
|
152
|
+
"name": "string",
|
|
153
|
+
"required": false
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
},
|
|
157
|
+
"required": false
|
|
158
|
+
},
|
|
159
|
+
"options": {
|
|
160
|
+
"defaultValue": {
|
|
161
|
+
"value": "[]",
|
|
162
|
+
"computed": false
|
|
163
|
+
},
|
|
164
|
+
"description": "",
|
|
165
|
+
"type": {
|
|
166
|
+
"name": "arrayOf",
|
|
167
|
+
"value": {
|
|
168
|
+
"name": "shape",
|
|
169
|
+
"value": {
|
|
170
|
+
"value": {
|
|
171
|
+
"name": "string",
|
|
172
|
+
"required": false
|
|
173
|
+
},
|
|
174
|
+
"label": {
|
|
175
|
+
"name": "string",
|
|
176
|
+
"required": false
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
},
|
|
181
|
+
"required": false
|
|
182
|
+
},
|
|
183
|
+
"after": {
|
|
184
|
+
"description": "",
|
|
185
|
+
"type": {
|
|
186
|
+
"name": "any"
|
|
187
|
+
},
|
|
188
|
+
"required": false
|
|
189
|
+
},
|
|
190
|
+
"before": {
|
|
191
|
+
"description": "",
|
|
192
|
+
"type": {
|
|
193
|
+
"name": "any"
|
|
128
194
|
},
|
|
129
195
|
"required": false
|
|
130
196
|
},
|
|
@@ -135,7 +201,28 @@ Choice.__docgenInfo = {
|
|
|
135
201
|
},
|
|
136
202
|
"required": false
|
|
137
203
|
},
|
|
138
|
-
"
|
|
204
|
+
"isMultiple": {
|
|
205
|
+
"description": "",
|
|
206
|
+
"type": {
|
|
207
|
+
"name": "bool"
|
|
208
|
+
},
|
|
209
|
+
"required": false
|
|
210
|
+
},
|
|
211
|
+
"labelTextActiveColor": {
|
|
212
|
+
"description": "",
|
|
213
|
+
"type": {
|
|
214
|
+
"name": "string"
|
|
215
|
+
},
|
|
216
|
+
"required": false
|
|
217
|
+
},
|
|
218
|
+
"labelTextColor": {
|
|
219
|
+
"description": "",
|
|
220
|
+
"type": {
|
|
221
|
+
"name": "string"
|
|
222
|
+
},
|
|
223
|
+
"required": false
|
|
224
|
+
},
|
|
225
|
+
"labelTextSize": {
|
|
139
226
|
"description": "",
|
|
140
227
|
"type": {
|
|
141
228
|
"name": "string"
|
|
@@ -149,10 +236,10 @@ Choice.__docgenInfo = {
|
|
|
149
236
|
},
|
|
150
237
|
"required": false
|
|
151
238
|
},
|
|
152
|
-
"
|
|
239
|
+
"set": {
|
|
153
240
|
"description": "",
|
|
154
241
|
"type": {
|
|
155
|
-
"name": "
|
|
242
|
+
"name": "string"
|
|
156
243
|
},
|
|
157
244
|
"required": false
|
|
158
245
|
},
|
|
@@ -163,6 +250,13 @@ Choice.__docgenInfo = {
|
|
|
163
250
|
},
|
|
164
251
|
"required": false
|
|
165
252
|
},
|
|
253
|
+
"size": {
|
|
254
|
+
"description": "",
|
|
255
|
+
"type": {
|
|
256
|
+
"name": "string"
|
|
257
|
+
},
|
|
258
|
+
"required": false
|
|
259
|
+
},
|
|
166
260
|
"type": {
|
|
167
261
|
"description": "",
|
|
168
262
|
"type": {
|
package/dist/components/Code.js
CHANGED
|
@@ -56,8 +56,19 @@ var OTPInput = function (_a) {
|
|
|
56
56
|
};
|
|
57
57
|
var handleInputChange = function (event) {
|
|
58
58
|
var nativeEvent = event.nativeEvent;
|
|
59
|
-
|
|
60
|
-
|
|
59
|
+
var value = event.target.value;
|
|
60
|
+
if (!isInputValueValid(value)) {
|
|
61
|
+
// Pasting from the native autofill suggestion on a mobile device can pass
|
|
62
|
+
// the pasted string as one long input to one of the cells. This ensures
|
|
63
|
+
// that we handle the full input and not just the first character.
|
|
64
|
+
if (value.length === numInputs) {
|
|
65
|
+
var hasInvalidInput = value.split('').some(function (cellInput) { return !isInputValueValid(cellInput); });
|
|
66
|
+
if (!hasInvalidInput) {
|
|
67
|
+
handleOTPChange(value.split(''));
|
|
68
|
+
focusInput(numInputs - 1);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
// @ts-expect-error - This was added previously to handle and edge case
|
|
61
72
|
// for dealing with keyCode "229 Unidentified" on Android. Check if this is
|
|
62
73
|
// still needed.
|
|
63
74
|
if (nativeEvent.data === null && nativeEvent.inputType === 'deleteContentBackward') {
|
|
@@ -164,7 +175,6 @@ var OTPInput = function (_a) {
|
|
|
164
175
|
onKeyDown: handleKeyDown,
|
|
165
176
|
onPaste: handlePaste,
|
|
166
177
|
autoComplete: 'off',
|
|
167
|
-
maxLength: 1,
|
|
168
178
|
'aria-label': "Please enter OTP character ".concat(index + 1),
|
|
169
179
|
style: Object.assign(!skipDefaultStyles ? { width: '1em', textAlign: 'center' } : {}, isStyleObject(inputStyle) ? inputStyle : {}),
|
|
170
180
|
className: typeof inputStyle === 'string' ? inputStyle : undefined,
|