x-ui-design 0.4.36 → 0.4.37
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 +7 -7
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +7 -7
- package/dist/index.js.map +1 -1
- package/lib/components/Form/Form.tsx +0 -1
- package/lib/components/Form/Item/Item.tsx +1 -1
- package/lib/components/Input/Input.tsx +8 -9
- package/package.json +1 -1
- package/src/app/page.tsx +99 -33
package/dist/index.esm.js
CHANGED
|
@@ -1022,7 +1022,7 @@ const FormItem$1 = ({
|
|
|
1022
1022
|
value,
|
|
1023
1023
|
...childProps
|
|
1024
1024
|
} = child.props;
|
|
1025
|
-
const fieldValue = getFieldValue(name) ?? initialValue;
|
|
1025
|
+
const fieldValue = value ?? getFieldValue(name) ?? initialValue;
|
|
1026
1026
|
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(FormItemChildComponent, _extends({}, props, {
|
|
1027
1027
|
key: `${key}_${isReseting}`,
|
|
1028
1028
|
name: name,
|
|
@@ -2795,7 +2795,7 @@ const InputComponent = /*#__PURE__*/forwardRef(({
|
|
|
2795
2795
|
}, ref) => {
|
|
2796
2796
|
const inputRef = useRef(null);
|
|
2797
2797
|
const lastKeyPressed = useRef(null);
|
|
2798
|
-
const
|
|
2798
|
+
const internalValue = mask ? applyMask(stripMask(`${value ?? ''}`, mask, maskChar), mask, maskChar) : value ?? '';
|
|
2799
2799
|
const [iconRenderVisible, setIconRenderVisible] = useState(false);
|
|
2800
2800
|
useImperativeHandle(ref, () => ({
|
|
2801
2801
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
@@ -2810,9 +2810,9 @@ const InputComponent = /*#__PURE__*/forwardRef(({
|
|
|
2810
2810
|
}
|
|
2811
2811
|
}
|
|
2812
2812
|
}));
|
|
2813
|
-
useEffect(() => {
|
|
2814
|
-
|
|
2815
|
-
}, [value, mask, maskChar]);
|
|
2813
|
+
// useEffect(() => {
|
|
2814
|
+
// setInternalValue(mask ? applyMask(stripMask(`${value ?? ''}`, mask, maskChar), mask, maskChar) : `${value ?? ''}`);
|
|
2815
|
+
// }, [value, mask, maskChar]);
|
|
2816
2816
|
const handleChange = e => {
|
|
2817
2817
|
const inputEl = inputRef.current;
|
|
2818
2818
|
if (!inputEl) return;
|
|
@@ -2820,7 +2820,7 @@ const InputComponent = /*#__PURE__*/forwardRef(({
|
|
|
2820
2820
|
let nextCaret = inputEl.selectionStart ?? rawInput.length;
|
|
2821
2821
|
const raw = mask ? rawInput.replace(maskRegex, '') : rawInput;
|
|
2822
2822
|
const masked = mask ? applyMask(raw, mask, maskChar) : rawInput;
|
|
2823
|
-
setInternalValue(masked);
|
|
2823
|
+
// setInternalValue(masked);
|
|
2824
2824
|
if (mask) {
|
|
2825
2825
|
requestAnimationFrame(() => {
|
|
2826
2826
|
if (!inputEl) return;
|
|
@@ -2846,7 +2846,7 @@ const InputComponent = /*#__PURE__*/forwardRef(({
|
|
|
2846
2846
|
props.onChange?.(eventWithMaskedValue);
|
|
2847
2847
|
};
|
|
2848
2848
|
const handleClear = e => {
|
|
2849
|
-
setInternalValue('');
|
|
2849
|
+
// setInternalValue('');
|
|
2850
2850
|
e.target.value = '';
|
|
2851
2851
|
props.onChange?.(e);
|
|
2852
2852
|
};
|