@flywire/react-headlessui
Advanced tools
Comparing version 0.4.0 to 0.4.2-0
@@ -32,2 +32,4 @@ "use strict"; | ||
}); | ||
const newEvent = createUserEvent(evt, formattedText); | ||
onChange === null || onChange === void 0 ? void 0 : onChange(newEvent); | ||
} | ||
@@ -37,3 +39,3 @@ } | ||
inputProps: { | ||
onChange: (0, utils_1.callAll)(onChange, handleInputChange), | ||
onChange: handleInputChange, | ||
value, | ||
@@ -46,2 +48,15 @@ ref: inputRef, | ||
} | ||
function createUserEvent(origEvent, newValue) { | ||
return { | ||
...origEvent, | ||
target: { | ||
...origEvent.target, | ||
value: newValue, | ||
}, | ||
currentTarget: { | ||
...origEvent.currentTarget, | ||
value: newValue, | ||
}, | ||
}; | ||
} | ||
exports.default = useMaskInput; |
@@ -1,4 +0,4 @@ | ||
import { useRef, useState } from 'react'; | ||
import { useRef, useState, } from 'react'; | ||
import useRunAfterUpdate from '../useRunAfterUpdate'; | ||
import { applyPattern, callAll } from '../../utils'; | ||
import { applyPattern } from '../../utils'; | ||
const NO_VALUE = ''; | ||
@@ -27,2 +27,4 @@ function useMaskInput({ initialValue = NO_VALUE, mask, onChange = () => { | ||
}); | ||
const newEvent = createUserEvent(evt, formattedText); | ||
onChange === null || onChange === void 0 ? void 0 : onChange(newEvent); | ||
} | ||
@@ -32,3 +34,3 @@ } | ||
inputProps: { | ||
onChange: callAll(onChange, handleInputChange), | ||
onChange: handleInputChange, | ||
value, | ||
@@ -41,2 +43,15 @@ ref: inputRef, | ||
} | ||
function createUserEvent(origEvent, newValue) { | ||
return { | ||
...origEvent, | ||
target: { | ||
...origEvent.target, | ||
value: newValue, | ||
}, | ||
currentTarget: { | ||
...origEvent.currentTarget, | ||
value: newValue, | ||
}, | ||
}; | ||
} | ||
export default useMaskInput; |
@@ -41,2 +41,4 @@ var __importDefault = (this && this.__importDefault) || function (mod) { | ||
}); | ||
const newEvent = createUserEvent(evt, formattedText); | ||
onChange === null || onChange === void 0 ? void 0 : onChange(newEvent); | ||
} | ||
@@ -46,3 +48,3 @@ } | ||
inputProps: { | ||
onChange: (0, utils_1.callAll)(onChange, handleInputChange), | ||
onChange: handleInputChange, | ||
value, | ||
@@ -55,3 +57,16 @@ ref: inputRef, | ||
} | ||
function createUserEvent(origEvent, newValue) { | ||
return { | ||
...origEvent, | ||
target: { | ||
...origEvent.target, | ||
value: newValue, | ||
}, | ||
currentTarget: { | ||
...origEvent.currentTarget, | ||
value: newValue, | ||
}, | ||
}; | ||
} | ||
exports.default = useMaskInput; | ||
}); |
{ | ||
"name": "@flywire/react-headlessui", | ||
"version": "0.4.0", | ||
"version": "0.4.2-0", | ||
"description": "Headless UI components", | ||
@@ -67,2 +67,3 @@ "main": "./dist/umd/index.js", | ||
"@testing-library/react-hooks": "^7.0.2", | ||
"@testing-library/user-event": "^14.5.2", | ||
"@types/jest": "^27.4.1", | ||
@@ -69,0 +70,0 @@ "@types/jest-axe": "^3.5.4", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
339475
5220
29
1