dhre-ui-kit 0.0.250 → 0.0.252
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/lib/index.d.ts +1 -0
- package/lib/index.js +18 -21
- package/lib/index.js.map +1 -1
- package/lib/index.mjs +18 -21
- package/lib/index.mjs.map +1 -1
- package/package.json +1 -1
package/lib/index.d.ts
CHANGED
|
@@ -612,6 +612,7 @@ interface CommonTextInputProps extends TextInputProps$1 {
|
|
|
612
612
|
handlePress?: () => void;
|
|
613
613
|
rightIcon?: () => React$1.ReactElement;
|
|
614
614
|
onRightIconPress?: () => void;
|
|
615
|
+
onlyErrorBorderLabel?: boolean;
|
|
615
616
|
}
|
|
616
617
|
declare const CommonTextInput: (props: CommonTextInputProps) => React$1.JSX.Element;
|
|
617
618
|
|
package/lib/index.js
CHANGED
|
@@ -3400,7 +3400,8 @@ const CommonTextInput = (props) => {
|
|
|
3400
3400
|
multiline = false,
|
|
3401
3401
|
// Default multiline to false
|
|
3402
3402
|
rightIcon,
|
|
3403
|
-
onRightIconPress
|
|
3403
|
+
onRightIconPress,
|
|
3404
|
+
onlyErrorBorderLabel
|
|
3404
3405
|
} = props;
|
|
3405
3406
|
return /* @__PURE__ */ React__default["default"].createElement(reactNative.Pressable, { onPress: handlePress, style: styles$9.container }, /* @__PURE__ */ React__default["default"].createElement(
|
|
3406
3407
|
reactNativePaper.TextInput,
|
|
@@ -3412,7 +3413,7 @@ const CommonTextInput = (props) => {
|
|
|
3412
3413
|
autoCorrect: false,
|
|
3413
3414
|
outlineStyle: {
|
|
3414
3415
|
...styles$9.outlineStyle,
|
|
3415
|
-
borderColor: errorMessage?.length ? DHRE_DEFAULT.DH_SEMENTIC_ERROR : value?.length ? activeBorderColor : inactiveBorderColor
|
|
3416
|
+
borderColor: errorMessage?.length || onlyErrorBorderLabel ? DHRE_DEFAULT.DH_SEMENTIC_ERROR : value?.length ? activeBorderColor : inactiveBorderColor
|
|
3416
3417
|
},
|
|
3417
3418
|
label,
|
|
3418
3419
|
value,
|
|
@@ -3422,12 +3423,12 @@ const CommonTextInput = (props) => {
|
|
|
3422
3423
|
theme: {
|
|
3423
3424
|
colors: {
|
|
3424
3425
|
onSurfaceVariant: value?.length ? activeBorderColor : inactiveBorderColor,
|
|
3425
|
-
error: errorMessage?.length ? DHRE_DEFAULT.DH_SEMENTIC_ERROR : DHRE_COLORS_TEXT.DH_BLACK,
|
|
3426
|
+
error: errorMessage?.length || onlyErrorBorderLabel ? DHRE_DEFAULT.DH_SEMENTIC_ERROR : DHRE_COLORS_TEXT.DH_BLACK,
|
|
3426
3427
|
primary: labelColor ? errorMessage?.length ? DHRE_DEFAULT.DH_SEMENTIC_ERROR : labelColor : DHRE_COLORS_TEXT.DH_BLACK
|
|
3427
3428
|
}
|
|
3428
3429
|
},
|
|
3429
3430
|
style: [
|
|
3430
|
-
errorMessage ? styles$9.errorInput : styles$9.input,
|
|
3431
|
+
errorMessage || onlyErrorBorderLabel ? styles$9.errorInput : styles$9.input,
|
|
3431
3432
|
inputStyle,
|
|
3432
3433
|
multiline && styles$9.multilineInput
|
|
3433
3434
|
// Apply multiline style if true
|
|
@@ -3437,7 +3438,7 @@ const CommonTextInput = (props) => {
|
|
|
3437
3438
|
placeholder: placeholderText,
|
|
3438
3439
|
editable,
|
|
3439
3440
|
pointerEvents,
|
|
3440
|
-
error: errorMessage?.length ? true : false,
|
|
3441
|
+
error: errorMessage?.length || onlyErrorBorderLabel ? true : false,
|
|
3441
3442
|
multiline,
|
|
3442
3443
|
numberOfLines: multiline ? 4 : 1,
|
|
3443
3444
|
right: rightIcon ? /* @__PURE__ */ React__default["default"].createElement(
|
|
@@ -4030,8 +4031,7 @@ const OTPInput = React__default["default"].forwardRef(
|
|
|
4030
4031
|
}
|
|
4031
4032
|
return () => clearInterval(timer);
|
|
4032
4033
|
}, [timeLeft, isResendOtpEnable]);
|
|
4033
|
-
const refs = React.useRef(
|
|
4034
|
-
refs.current = Array(length).fill(0).map((_, index) => refs.current[index] || null);
|
|
4034
|
+
const refs = React.useRef(Array(length).fill(null));
|
|
4035
4035
|
React.useEffect(() => {
|
|
4036
4036
|
enableResendOtp();
|
|
4037
4037
|
}, []);
|
|
@@ -4084,15 +4084,12 @@ const OTPInput = React__default["default"].forwardRef(
|
|
|
4084
4084
|
}
|
|
4085
4085
|
});
|
|
4086
4086
|
};
|
|
4087
|
+
const reset = () => {
|
|
4088
|
+
setOTP("");
|
|
4089
|
+
refs?.current?.[0]?.focus();
|
|
4090
|
+
};
|
|
4087
4091
|
React__default["default"].useImperativeHandle(ref, () => ({
|
|
4088
|
-
reset
|
|
4089
|
-
setOTP("");
|
|
4090
|
-
refs.current[0]?.focus();
|
|
4091
|
-
},
|
|
4092
|
-
set(newOtp) {
|
|
4093
|
-
setOTP(newOtp);
|
|
4094
|
-
refs.current[newOtp?.length - 1]?.focus();
|
|
4095
|
-
}
|
|
4092
|
+
reset
|
|
4096
4093
|
}));
|
|
4097
4094
|
const handleChange = (index, value) => {
|
|
4098
4095
|
const regex = /^\d+$/;
|
|
@@ -4448,10 +4445,7 @@ const CustomSlideButton = React__default["default"].forwardRef(
|
|
|
4448
4445
|
}
|
|
4449
4446
|
};
|
|
4450
4447
|
const resetAll = () => {
|
|
4451
|
-
|
|
4452
|
-
toValue: 0,
|
|
4453
|
-
useNativeDriver: false
|
|
4454
|
-
}).start();
|
|
4448
|
+
onReset?.();
|
|
4455
4449
|
reactNative.Animated.timing(sliderBackgroundColorRef, {
|
|
4456
4450
|
toValue: 0,
|
|
4457
4451
|
duration: 0,
|
|
@@ -4461,12 +4455,15 @@ const CustomSlideButton = React__default["default"].forwardRef(
|
|
|
4461
4455
|
}).start();
|
|
4462
4456
|
reactNative.Animated.timing(color, {
|
|
4463
4457
|
toValue: 0,
|
|
4464
|
-
delay:
|
|
4458
|
+
delay: 0,
|
|
4465
4459
|
// no transition time, immediate change
|
|
4466
4460
|
useNativeDriver: false
|
|
4467
4461
|
// because we're animating the color, not layout
|
|
4468
4462
|
}).start();
|
|
4469
|
-
|
|
4463
|
+
reactNative.Animated.timing(translateX, {
|
|
4464
|
+
toValue: 0,
|
|
4465
|
+
useNativeDriver: false
|
|
4466
|
+
}).start();
|
|
4470
4467
|
};
|
|
4471
4468
|
const panResponder = reactNative.PanResponder.create({
|
|
4472
4469
|
onMoveShouldSetPanResponder: (e, gestureState) => {
|