@itcase/ui 1.0.45 → 1.0.47
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.
|
@@ -34,6 +34,7 @@ const Choice = /*#__PURE__*/React__default.default.forwardRef((props, ref) => {
|
|
|
34
34
|
type,
|
|
35
35
|
options,
|
|
36
36
|
active,
|
|
37
|
+
set,
|
|
37
38
|
setActiveSegment,
|
|
38
39
|
size,
|
|
39
40
|
labelTextColor,
|
|
@@ -71,7 +72,7 @@ const Choice = /*#__PURE__*/React__default.default.forwardRef((props, ref) => {
|
|
|
71
72
|
propsKey: 'fillActive'
|
|
72
73
|
});
|
|
73
74
|
return /*#__PURE__*/React__default.default.createElement("div", {
|
|
74
|
-
className: clsx__default.default(className, 'choice', shapeClass, fillClass, borderColorClass, borderWidthClass, borderTypeClass, size && `choice_size_${size}`, type && `choice_type_${type}`),
|
|
75
|
+
className: clsx__default.default(className, 'choice', shapeClass, fillClass, borderColorClass, borderWidthClass, borderTypeClass, set && `choice_set_${set}`, size && `choice_size_${size}`, type && `choice_type_${type}`),
|
|
75
76
|
ref: controlRef
|
|
76
77
|
}, /*#__PURE__*/React__default.default.createElement("div", {
|
|
77
78
|
className: "choice__wrapper"
|
package/dist/components/Code.js
CHANGED
|
@@ -4,22 +4,11 @@ var React = require('react');
|
|
|
4
4
|
var PropTypes = require('prop-types');
|
|
5
5
|
var clsx = require('clsx');
|
|
6
6
|
var useDeviceTargetClass = require('../hooks/useDeviceTargetClass.js');
|
|
7
|
-
require('./Text.js');
|
|
8
7
|
require('lodash/castArray');
|
|
9
8
|
require('lodash/camelCase');
|
|
10
9
|
require('../context/UIContext.js');
|
|
11
10
|
require('../hooks/useMediaQueries.js');
|
|
12
11
|
require('react-responsive');
|
|
13
|
-
require('../constants/componentProps/textColor.js');
|
|
14
|
-
require('../constants/componentProps/textColorActive.js');
|
|
15
|
-
require('../constants/componentProps/textColorHover.js');
|
|
16
|
-
require('../constants/componentProps/size.js');
|
|
17
|
-
require('../constants/componentProps/textStyle.js');
|
|
18
|
-
require('../constants/componentProps/textWeight.js');
|
|
19
|
-
require('../hooks/useStyles.js');
|
|
20
|
-
require('lodash/maxBy');
|
|
21
|
-
require('lodash/upperFirst');
|
|
22
|
-
require('../hooks/styleAttributes.js');
|
|
23
12
|
|
|
24
13
|
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
25
14
|
|
|
@@ -196,14 +185,12 @@ function Code(props) {
|
|
|
196
185
|
inputType,
|
|
197
186
|
before,
|
|
198
187
|
after,
|
|
199
|
-
separatorComponent
|
|
188
|
+
separatorComponent,
|
|
189
|
+
onBlur,
|
|
190
|
+
onChange,
|
|
191
|
+
onFocus
|
|
200
192
|
} = props;
|
|
201
193
|
const [otp, setOtp] = React.useState('');
|
|
202
|
-
|
|
203
|
-
// const formattedHelpText = useMemo(() => {
|
|
204
|
-
// return helpText.replace('{fields}', inputCount)
|
|
205
|
-
// }, [])
|
|
206
|
-
|
|
207
194
|
const fillClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
208
195
|
prefix: 'fill_',
|
|
209
196
|
propsKey: 'inputFill'
|
|
@@ -264,17 +251,33 @@ function Code(props) {
|
|
|
264
251
|
prefix: 'width_',
|
|
265
252
|
propsKey: 'width'
|
|
266
253
|
});
|
|
254
|
+
|
|
255
|
+
// NOTE: too many dependencies for "useCallback" and possible too many checks
|
|
256
|
+
const renderInput = otpInputProps => {
|
|
257
|
+
return /*#__PURE__*/React__default.default.createElement("input", Object.assign({}, otpInputProps, {
|
|
258
|
+
autocomplete: "one-time-code",
|
|
259
|
+
className: clsx__default.default('code__input', caretClass, fillClass, fillHoverClass, placeholderClass, shapeClass, textSizeClass, textColorClass, weightClass, borderWidthClass, borderColorClass, borderColorHoverClass, borderColorFocusClass, sizeClass, fillClass),
|
|
260
|
+
onBlur: event => {
|
|
261
|
+
onBlur && onBlur(event);
|
|
262
|
+
otpInputProps.onBlur(event);
|
|
263
|
+
},
|
|
264
|
+
onFocus: event => {
|
|
265
|
+
onFocus && onFocus(event);
|
|
266
|
+
otpInputProps.onFocus(event);
|
|
267
|
+
}
|
|
268
|
+
}));
|
|
269
|
+
};
|
|
270
|
+
React.useEffect(() => {
|
|
271
|
+
onChange && onChange(otp);
|
|
272
|
+
}, [otp]);
|
|
267
273
|
return /*#__PURE__*/React__default.default.createElement("div", {
|
|
268
274
|
className: clsx__default.default(className, 'code', widthClass)
|
|
269
275
|
}, before, /*#__PURE__*/React__default.default.createElement(OTPInput, {
|
|
270
276
|
containerStyle: clsx__default.default(className, 'code__wrapper', gapClass),
|
|
271
|
-
numInputs: inputCount,
|
|
272
277
|
inputType: inputType,
|
|
278
|
+
numInputs: inputCount,
|
|
273
279
|
placeholder: inputPlaceholder,
|
|
274
|
-
renderInput:
|
|
275
|
-
autocomplete: "one-time-code",
|
|
276
|
-
className: clsx__default.default('code__input', caretClass, fillClass, fillHoverClass, placeholderClass, shapeClass, textSizeClass, textColorClass, weightClass, borderWidthClass, borderColorClass, borderColorHoverClass, borderColorFocusClass, sizeClass, fillClass)
|
|
277
|
-
})),
|
|
280
|
+
renderInput: renderInput,
|
|
278
281
|
renderSeparator: separatorComponent || null,
|
|
279
282
|
shouldAutoFocus: inputAutoFocus,
|
|
280
283
|
value: otp,
|
|
@@ -4805,6 +4805,7 @@ function Swiper(props) {
|
|
|
4805
4805
|
const isLoop = loop ?? true;
|
|
4806
4806
|
React.useImperativeHandle(forwardedRef, () => swiperRef.current, []);
|
|
4807
4807
|
const onInitSwiper = React.useCallback(swiper => {
|
|
4808
|
+
// swiper.touchEventsData.formElements = 'undefined'
|
|
4808
4809
|
// Set "disabled" state to navigation buttons on init
|
|
4809
4810
|
if (!isLoop && setPrevBtnDisabled && setNextBtnDisabled) {
|
|
4810
4811
|
setPrevBtnDisabled(swiper.isBeginning);
|
|
@@ -4872,6 +4873,15 @@ function Swiper(props) {
|
|
|
4872
4873
|
freeMode: freeMode,
|
|
4873
4874
|
init: isInit ?? true,
|
|
4874
4875
|
loop: isLoop,
|
|
4876
|
+
noSwipingClass: "swiper-no-swiping",
|
|
4877
|
+
noSwiping: true,
|
|
4878
|
+
a11y: false,
|
|
4879
|
+
watchSlidesProgress: true,
|
|
4880
|
+
noSwipingSelector: 'button',
|
|
4881
|
+
allowTouchMove: false,
|
|
4882
|
+
preventClicks: false,
|
|
4883
|
+
preventClicksPropagation: false,
|
|
4884
|
+
simulateTouch: false,
|
|
4875
4885
|
modules: modules,
|
|
4876
4886
|
mousewheel: mousewheel,
|
|
4877
4887
|
navigation: isNavigation ? {
|
|
@@ -4883,7 +4893,14 @@ function Swiper(props) {
|
|
|
4883
4893
|
ref: swiperRef,
|
|
4884
4894
|
scrollbar: isScrollbar,
|
|
4885
4895
|
slidesPerView: slidesPerView,
|
|
4886
|
-
spaceBetween: spaceBetween
|
|
4896
|
+
spaceBetween: spaceBetween
|
|
4897
|
+
// noSwiping={true}
|
|
4898
|
+
// allowTouchMove={false}
|
|
4899
|
+
// touchStartPreventDefault={false}
|
|
4900
|
+
// touchMoveStopPropagation={false}
|
|
4901
|
+
// preventClicks={false}
|
|
4902
|
+
// preventClicksPropagation={false}
|
|
4903
|
+
,
|
|
4887
4904
|
speed: speed ?? 500,
|
|
4888
4905
|
onInit: onInitSwiper,
|
|
4889
4906
|
onSlideChange: onSlideChange,
|
|
@@ -5,12 +5,12 @@
|
|
|
5
5
|
position: relative;
|
|
6
6
|
display: flex;
|
|
7
7
|
^&__item {
|
|
8
|
-
min-width:
|
|
9
|
-
position: relative;
|
|
10
|
-
display: flex;
|
|
11
|
-
border-top: 0;
|
|
8
|
+
min-width: 30px;
|
|
12
9
|
border-left: 0;
|
|
10
|
+
border-top: 0;
|
|
13
11
|
border-bottom: 0;
|
|
12
|
+
position: relative;
|
|
13
|
+
display: flex;
|
|
14
14
|
&:hover {
|
|
15
15
|
background: var(--choice-item-background-hover);
|
|
16
16
|
}
|
|
@@ -22,16 +22,13 @@
|
|
|
22
22
|
& input {
|
|
23
23
|
width: 100%;
|
|
24
24
|
height: 100%;
|
|
25
|
+
margin: 0;
|
|
26
|
+
border: 0;
|
|
25
27
|
position: absolute;
|
|
26
|
-
|
|
27
|
-
top: 0;
|
|
28
|
-
right: 0;
|
|
29
|
-
bottom: 0;
|
|
28
|
+
inset: 0 0 0 0;
|
|
30
29
|
z-index: 2;
|
|
31
30
|
opacity: 0%;
|
|
32
31
|
cursor: pointer;
|
|
33
|
-
border: 0;
|
|
34
|
-
margin: 0;
|
|
35
32
|
}
|
|
36
33
|
&-label {
|
|
37
34
|
width: 100%;
|
|
@@ -65,7 +62,7 @@
|
|
|
65
62
|
}
|
|
66
63
|
.choice {
|
|
67
64
|
&_size {
|
|
68
|
-
@each $size in
|
|
65
|
+
@each $size in tiny, compact, normal {
|
|
69
66
|
&_$(size) {
|
|
70
67
|
^^&__item {
|
|
71
68
|
&-label {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@itcase/ui",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.47",
|
|
4
4
|
"description": "UI components (Modal, Loader, Popup, etc)",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Modal",
|
|
@@ -83,7 +83,7 @@
|
|
|
83
83
|
"eslint-config-standard": "^17.1.0",
|
|
84
84
|
"eslint-plugin-babel": "^5.3.1",
|
|
85
85
|
"eslint-plugin-import": "^2.28.1",
|
|
86
|
-
"eslint-plugin-n": "^16.0
|
|
86
|
+
"eslint-plugin-n": "^16.1.0",
|
|
87
87
|
"eslint-plugin-node": "^11.1.0",
|
|
88
88
|
"eslint-plugin-prettier": "^5.0.0",
|
|
89
89
|
"eslint-plugin-promise": "^6.1.1",
|