react-hook-core 0.1.23 → 0.1.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/lib/index.js +2 -2
- package/package.json +1 -1
- package/src/index.ts +2 -2
package/lib/index.js
CHANGED
|
@@ -52,7 +52,7 @@ exports.Loading = function (props) {
|
|
|
52
52
|
return (React.createElement('div', { className: 'loader-wrapper' }, React.createElement('div', { className: 'loader-sign', style: loadingStyle }, React.createElement('div', { className: 'loader' }))));
|
|
53
53
|
}
|
|
54
54
|
};
|
|
55
|
-
exports.
|
|
55
|
+
exports.CurrencyInput = function (props) {
|
|
56
56
|
var _a;
|
|
57
57
|
var _b = react_1.useState(undefined), state = _b[0], setState = _b[1];
|
|
58
58
|
react_1.useEffect(function () {
|
|
@@ -93,7 +93,7 @@ exports.NumberInput = function (props) {
|
|
|
93
93
|
}, 50);
|
|
94
94
|
},
|
|
95
95
|
_a);
|
|
96
|
-
return React.createElement("input", { className: ip.className, type: ip.type, name: ip.name, onChange: ip.onChange, disabled: ip.disabled, "data-field": ip['data-field'], min: ip.min, max: ip.max, value: state });
|
|
96
|
+
return React.createElement("input", { className: ip.className, onBlur: ip.onBlur, type: ip.type, name: ip.name, onChange: ip.onChange, disabled: ip.disabled, "data-field": ip['data-field'], min: ip.min, max: ip.max, value: state });
|
|
97
97
|
};
|
|
98
98
|
function formatDate(date, format) {
|
|
99
99
|
if (!date) {
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -105,7 +105,7 @@ interface InputProps {
|
|
|
105
105
|
max?: string|number;
|
|
106
106
|
allowZero?: boolean;
|
|
107
107
|
}
|
|
108
|
-
export const
|
|
108
|
+
export const CurrencyInput = (props: InputProps) => {
|
|
109
109
|
const [state, setState] = useState<string|undefined>(undefined);
|
|
110
110
|
useEffect(() => {
|
|
111
111
|
setState(props.value);
|
|
@@ -145,7 +145,7 @@ export const NumberInput = (props: InputProps) => {
|
|
|
145
145
|
},
|
|
146
146
|
};
|
|
147
147
|
// return <input className={ip.className} type={ip.type} name={ip.name} onChange={ip.onChange} disabled={ip.disabled} data-field={ip['data-field']} min={ip.min} max={ip.max} value={state} />;
|
|
148
|
-
return React.createElement("input", { className: ip.className, type: ip.type, name: ip.name, onChange: ip.onChange, disabled: ip.disabled, "data-field": ip['data-field'], min: ip.min, max: ip.max, value: state });
|
|
148
|
+
return React.createElement("input", { className: ip.className, onBlur: ip.onBlur, type: ip.type, name: ip.name, onChange: ip.onChange, disabled: ip.disabled, "data-field": ip['data-field'], min: ip.min, max: ip.max, value: state });
|
|
149
149
|
};
|
|
150
150
|
export type OnClick = React.MouseEvent<HTMLElement, MouseEvent>;
|
|
151
151
|
export function formatDate(date: Date | null | undefined, format: string): string {
|