Skip to content

Commit

Permalink
feat(form): add currency input
Browse files Browse the repository at this point in the history
  • Loading branch information
Corey Cochran committed Jun 13, 2022
1 parent 1544c93 commit fa9eea6
Show file tree
Hide file tree
Showing 36 changed files with 61 additions and 35 deletions.
2 changes: 1 addition & 1 deletion docusaurus/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,4 @@
"trailingComma": "es5",
"tabWidth": 2
}
}
}
2 changes: 1 addition & 1 deletion packages/analytics/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,4 @@
"publishConfig": {
"access": "public"
}
}
}
2 changes: 1 addition & 1 deletion packages/app-icon/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,4 @@
"publishConfig": {
"access": "public"
}
}
}
2 changes: 1 addition & 1 deletion packages/authorize/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,4 @@
"publishConfig": {
"access": "public"
}
}
}
2 changes: 1 addition & 1 deletion packages/avatar/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,4 @@
"publishConfig": {
"access": "public"
}
}
}
2 changes: 1 addition & 1 deletion packages/badge/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,4 @@
"publishConfig": {
"access": "public"
}
}
}
2 changes: 1 addition & 1 deletion packages/breadcrumbs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,4 @@
"publishConfig": {
"access": "public"
}
}
}
2 changes: 1 addition & 1 deletion packages/button/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,4 @@
"publishConfig": {
"access": "public"
}
}
}
2 changes: 1 addition & 1 deletion packages/date/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,4 @@
"publishConfig": {
"access": "public"
}
}
}
2 changes: 1 addition & 1 deletion packages/favorites/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,4 @@
"publishConfig": {
"access": "public"
}
}
}
2 changes: 1 addition & 1 deletion packages/feature/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,4 @@
"publishConfig": {
"access": "public"
}
}
}
2 changes: 1 addition & 1 deletion packages/feedback/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,4 @@
"publishConfig": {
"access": "public"
}
}
}
2 changes: 1 addition & 1 deletion packages/form-upload/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,4 @@
"publishConfig": {
"access": "public"
}
}
}
2 changes: 1 addition & 1 deletion packages/form/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@availity/form",
"version": "1.4.1-alpha.0",
"version": "1.4.1",
"description": "Form Wrapper around formik using reactstrap components",
"keywords": [
"react",
Expand Down
26 changes: 26 additions & 0 deletions packages/form/tests/CurrencyInput.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,32 @@ describe('CurrencyInput', () => {
});
});

test('should format decimals on blur', async () => {
const { container } = render(
<Form
onSubmit={() => {
console.log('submitted');
}}
initialValues={{}}
>
<>
<CurrencyInput name="paidAmount" value="1" />
<Button type="submit">Submit</Button>
</>
</Form>
);

const currencyInput = container.querySelector('input');

fireEvent.focus(currencyInput);

expect(currencyInput.value).toEqual('1');

fireEvent.blur(currencyInput);

expect(currencyInput.value).toEqual('$1.11');
});

test('should use id when passed in', () => {
const { container } = render(
<Form
Expand Down
2 changes: 1 addition & 1 deletion packages/help/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,4 @@
"publishConfig": {
"access": "public"
}
}
}
2 changes: 1 addition & 1 deletion packages/hooks/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,4 @@
"publishConfig": {
"access": "public"
}
}
}
2 changes: 1 addition & 1 deletion packages/icon/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,4 @@
"publishConfig": {
"access": "public"
}
}
}
2 changes: 1 addition & 1 deletion packages/json-viewer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,4 @@
"publishConfig": {
"access": "public"
}
}
}
2 changes: 1 addition & 1 deletion packages/link/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,4 @@
"publishConfig": {
"access": "public"
}
}
}
2 changes: 1 addition & 1 deletion packages/list-group-item/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,4 @@
"publishConfig": {
"access": "public"
}
}
}
2 changes: 1 addition & 1 deletion packages/list-group/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,4 @@
"publishConfig": {
"access": "public"
}
}
}
2 changes: 1 addition & 1 deletion packages/page-header/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,4 @@
"publishConfig": {
"access": "public"
}
}
}
2 changes: 1 addition & 1 deletion packages/pagination/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,4 @@
"access": "public"
},
"gitHead": "49d436db19e42e3c16b4185b12e9dfcce60ec253"
}
}
2 changes: 1 addition & 1 deletion packages/payer-logo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,4 @@
"publishConfig": {
"access": "public"
}
}
}
2 changes: 1 addition & 1 deletion packages/phone/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,4 @@
"publishConfig": {
"access": "public"
}
}
}
2 changes: 1 addition & 1 deletion packages/progress/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,4 @@
"publishConfig": {
"access": "public"
}
}
}
2 changes: 1 addition & 1 deletion packages/reactstrap-validation-date/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,4 @@
"publishConfig": {
"access": "public"
}
}
}
2 changes: 1 addition & 1 deletion packages/reactstrap-validation-select/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,4 @@
"publishConfig": {
"access": "public"
}
}
}
2 changes: 1 addition & 1 deletion packages/select/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,4 @@
"publishConfig": {
"access": "public"
}
}
}
2 changes: 1 addition & 1 deletion packages/spaces/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,4 @@
"publishConfig": {
"access": "public"
}
}
}
2 changes: 1 addition & 1 deletion packages/step-wizard/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,4 @@
"publishConfig": {
"access": "public"
}
}
}
2 changes: 1 addition & 1 deletion packages/table/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,4 @@
"publishConfig": {
"access": "public"
}
}
}
2 changes: 1 addition & 1 deletion packages/training-link/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,4 @@
"publishConfig": {
"access": "public"
}
}
}
2 changes: 1 addition & 1 deletion packages/typography/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,4 @@
"publishConfig": {
"access": "public"
}
}
}
2 changes: 1 addition & 1 deletion packages/upload/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,4 @@
"publishConfig": {
"access": "public"
}
}
}

0 comments on commit fa9eea6

Please sign in to comment.