x-ui-design 1.0.23 → 1.0.24
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/esm/types/components/Input/Input.d.ts +1 -7
- package/dist/esm/types/index.d.ts +1 -7
- package/dist/index.d.ts +1 -7
- package/dist/index.esm.js +13 -4
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +13 -4
- package/dist/index.js.map +1 -1
- package/lib/components/Input/Input.tsx +15 -6
- package/package.json +1 -1
|
@@ -2,13 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import { InputProps } from '../../types/input';
|
|
3
3
|
import Textarea from './Textarea/Textarea';
|
|
4
4
|
import './style.css';
|
|
5
|
-
declare const InputComponent: React.ForwardRefExoticComponent<Omit<InputProps, "ref"> & React.RefAttributes<
|
|
6
|
-
focus: () => void;
|
|
7
|
-
blur: () => void;
|
|
8
|
-
input: HTMLInputElement | null;
|
|
9
|
-
nativeElement: HTMLInputElement | null;
|
|
10
|
-
setSelectionRange: (start: number, end: number) => void;
|
|
11
|
-
}>>;
|
|
5
|
+
declare const InputComponent: React.ForwardRefExoticComponent<Omit<InputProps, "ref"> & React.RefAttributes<unknown>>;
|
|
12
6
|
declare const Input: typeof InputComponent & {
|
|
13
7
|
TextArea: typeof Textarea;
|
|
14
8
|
};
|
|
@@ -9,13 +9,7 @@ declare const RangePicker: import("react").ComponentType<import("@/types/datepic
|
|
|
9
9
|
declare const TimePicker: import("react").ComponentType<import("@/types/datepicker").TimePickerProps>;
|
|
10
10
|
declare const Form: import("react").ComponentType<import("@/types/form").FormProps>;
|
|
11
11
|
declare const FormItem: import("react").ComponentType<import("@/types/form").FormItemProps>;
|
|
12
|
-
declare const Input: import("react").ComponentType<Omit<import("@/types/input").InputProps, "ref"> & import("react").RefAttributes<
|
|
13
|
-
focus: () => void;
|
|
14
|
-
blur: () => void;
|
|
15
|
-
input: HTMLInputElement | null;
|
|
16
|
-
nativeElement: HTMLInputElement | null;
|
|
17
|
-
setSelectionRange: (start: number, end: number) => void;
|
|
18
|
-
}>>;
|
|
12
|
+
declare const Input: import("react").ComponentType<Omit<import("@/types/input").InputProps, "ref"> & import("react").RefAttributes<unknown>>;
|
|
19
13
|
declare const Textarea: import("react").ComponentType<import("@/types/input").TextareaProps>;
|
|
20
14
|
declare const Radio: import("react").ComponentType<import("@/types/radio").RadioProps>;
|
|
21
15
|
declare const RadioButton: import("react").ComponentType<import("@/types/radio").RadioButtonProps>;
|
package/dist/index.d.ts
CHANGED
|
@@ -122,13 +122,7 @@ declare const RangePicker: react.ComponentType<__types_datepicker.TRangePickerPr
|
|
|
122
122
|
declare const TimePicker: react.ComponentType<__types_datepicker.TimePickerProps>;
|
|
123
123
|
declare const Form: react.ComponentType<__types_form.FormProps>;
|
|
124
124
|
declare const FormItem: react.ComponentType<__types_form.FormItemProps>;
|
|
125
|
-
declare const Input: react.ComponentType<Omit<__types_input.InputProps, "ref"> & react.RefAttributes<
|
|
126
|
-
focus: () => void;
|
|
127
|
-
blur: () => void;
|
|
128
|
-
input: HTMLInputElement | null;
|
|
129
|
-
nativeElement: HTMLInputElement | null;
|
|
130
|
-
setSelectionRange: (start: number, end: number) => void;
|
|
131
|
-
}>>;
|
|
125
|
+
declare const Input: react.ComponentType<Omit<__types_input.InputProps, "ref"> & react.RefAttributes<unknown>>;
|
|
132
126
|
declare const Textarea: react.ComponentType<__types_input.TextareaProps>;
|
|
133
127
|
declare const Radio: react.ComponentType<__types_radio.RadioProps>;
|
|
134
128
|
declare const RadioButton: react.ComponentType<__types_radio.RadioButtonProps>;
|
package/dist/index.esm.js
CHANGED
|
@@ -3872,7 +3872,9 @@ const InputComponent = /*#__PURE__*/forwardRef(({
|
|
|
3872
3872
|
// @ts-expect-error
|
|
3873
3873
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
3874
3874
|
__injected,
|
|
3875
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
3875
3876
|
defaultValue,
|
|
3877
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
3876
3878
|
child,
|
|
3877
3879
|
...props
|
|
3878
3880
|
}, ref) => {
|
|
@@ -3883,14 +3885,21 @@ const InputComponent = /*#__PURE__*/forwardRef(({
|
|
|
3883
3885
|
const [iconRenderVisible, setIconRenderVisible] = useState(false);
|
|
3884
3886
|
const animationRef = useRef(null);
|
|
3885
3887
|
useImperativeHandle(ref, () => ({
|
|
3886
|
-
focus: () =>
|
|
3887
|
-
|
|
3888
|
+
focus: () => {
|
|
3889
|
+
console.info('focusing');
|
|
3890
|
+
inputRef.current?.focus();
|
|
3891
|
+
},
|
|
3892
|
+
blur: () => {
|
|
3893
|
+
inputRef.current?.blur();
|
|
3894
|
+
},
|
|
3888
3895
|
input: inputRef.current,
|
|
3889
3896
|
nativeElement: inputRef.current,
|
|
3890
3897
|
setSelectionRange: (start, end) => {
|
|
3891
|
-
inputRef.current
|
|
3898
|
+
if (inputRef.current) {
|
|
3899
|
+
inputRef.current.setSelectionRange(start, end);
|
|
3900
|
+
}
|
|
3892
3901
|
}
|
|
3893
|
-
}), [
|
|
3902
|
+
}), [ref]);
|
|
3894
3903
|
useEffect(() => {
|
|
3895
3904
|
setMaskValue(mask ? applyMask(stripMask(`${value ?? ''}`, mask, maskChar), mask, maskChar).masked : value ?? '');
|
|
3896
3905
|
}, [value, mask, maskChar]);
|