x-ui-design 1.0.20 → 1.0.22
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/index.esm.js +14 -10
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +14 -10
- package/dist/index.js.map +1 -1
- package/lib/components/Input/Input.tsx +18 -10
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -3885,17 +3885,21 @@ const InputComponent = ({
|
|
|
3885
3885
|
const [maskValue, setMaskValue] = useState(internalValue);
|
|
3886
3886
|
const [iconRenderVisible, setIconRenderVisible] = useState(false);
|
|
3887
3887
|
const animationRef = useRef(null);
|
|
3888
|
-
useImperativeHandle(ref, () =>
|
|
3889
|
-
|
|
3890
|
-
|
|
3891
|
-
|
|
3892
|
-
|
|
3893
|
-
|
|
3894
|
-
|
|
3895
|
-
|
|
3896
|
-
}
|
|
3888
|
+
useImperativeHandle(ref, () => {
|
|
3889
|
+
if (inputRef.current) {
|
|
3890
|
+
const input = inputRef.current;
|
|
3891
|
+
input.setSelectionRangeCustom = (start, end) => {
|
|
3892
|
+
input.setSelectionRange(start, end);
|
|
3893
|
+
};
|
|
3894
|
+
input.nativeElement = input;
|
|
3895
|
+
return input;
|
|
3897
3896
|
}
|
|
3898
|
-
|
|
3897
|
+
return {
|
|
3898
|
+
focus: () => inputRef.current?.focus(),
|
|
3899
|
+
blur: () => inputRef.current?.blur(),
|
|
3900
|
+
setSelectionRange: () => {}
|
|
3901
|
+
};
|
|
3902
|
+
}, [inputRef]);
|
|
3899
3903
|
useEffect(() => {
|
|
3900
3904
|
setMaskValue(mask ? applyMask(stripMask(`${value ?? ''}`, mask, maskChar), mask, maskChar).masked : value ?? '');
|
|
3901
3905
|
}, [value, mask, maskChar]);
|