@justifi/webcomponents 4.12.0 → 4.12.1
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/cjs/{Business-f8e37adb.js → Business-c928bf29.js} +2 -0
- package/dist/cjs/business-additional-questions-schema-3813615c.js +47 -0
- package/dist/cjs/{business-form-types-61b8196a.js → business-form-types-4b138bf2.js} +1 -1
- package/dist/cjs/{form-control-date_4.cjs.entry.js → form-control-date_3.cjs.entry.js} +0 -44
- package/dist/cjs/{form-control-datepart.cjs.entry.js → form-control-datepart_2.cjs.entry.js} +46 -2
- package/dist/cjs/{form-input-masks-baa06faf.js → form-input-masks-efd44b8e.js} +2 -0
- package/dist/cjs/justifi-additional-questions-form-step_5.cjs.entry.js +6 -6
- package/dist/cjs/justifi-additional-questions_4.cjs.entry.js +4 -4
- package/dist/cjs/justifi-billing-form_4.cjs.entry.js +1 -1
- package/dist/cjs/justifi-business-details.cjs.entry.js +1 -1
- package/dist/cjs/justifi-business-form.cjs.entry.js +4 -4
- package/dist/cjs/justifi-business-list.cjs.entry.js +1 -1
- package/dist/cjs/justifi-business-owners.cjs.entry.js +1 -1
- package/dist/cjs/justifi-owner-form.cjs.entry.js +5 -5
- package/dist/cjs/justifi-payment-provisioning.cjs.entry.js +2 -2
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{payload-parsers-32c43c76.js → payload-parsers-58d3798e.js} +93 -36
- package/dist/cjs/webcomponents.cjs.js +1 -1
- package/dist/collection/api/Identity.js +2 -0
- package/dist/collection/components/business-forms/business-form/business-representative/business-representative.js +2 -2
- package/dist/collection/components/business-forms/owner-form/owner-form.js +2 -2
- package/dist/collection/components/business-forms/payment-provisioning/business-representative/business-representative-form-step.js +2 -2
- package/dist/collection/components/business-forms/schemas/business-address-schema.js +1 -22
- package/dist/collection/components/business-forms/schemas/business-core-info-schema.js +4 -35
- package/dist/collection/components/business-forms/schemas/business-identity-schema.js +15 -32
- package/dist/collection/components/business-forms/schemas/schema-helpers.js +1 -0
- package/dist/collection/components/business-forms/schemas/schema-validations.js +92 -0
- package/dist/collection/components/business-forms/utils/payload-parsers.js +1 -0
- package/dist/collection/utils/form-input-masks.js +1 -0
- package/dist/docs.json +3 -25
- package/dist/esm/{Business-2410f7e3.js → Business-6cb1b9c8.js} +2 -0
- package/dist/esm/{business-additional-questions-schema-5571d40f.js → business-additional-questions-schema-228d86e0.js} +4 -35
- package/dist/esm/{business-form-types-46ecd908.js → business-form-types-5ba52d61.js} +1 -1
- package/dist/esm/{form-control-date_4.entry.js → form-control-date_3.entry.js} +2 -45
- package/dist/esm/{form-control-datepart.entry.js → form-control-datepart_2.entry.js} +47 -4
- package/dist/esm/{form-input-masks-850c8cd4.js → form-input-masks-84875967.js} +2 -1
- package/dist/esm/justifi-additional-questions-form-step_5.entry.js +6 -6
- package/dist/esm/justifi-additional-questions_4.entry.js +4 -4
- package/dist/esm/justifi-billing-form_4.entry.js +1 -1
- package/dist/esm/justifi-business-details.entry.js +1 -1
- package/dist/esm/justifi-business-form.entry.js +4 -4
- package/dist/esm/justifi-business-list.entry.js +1 -1
- package/dist/esm/justifi-business-owners.entry.js +1 -1
- package/dist/esm/justifi-owner-form.entry.js +5 -5
- package/dist/esm/justifi-payment-provisioning.entry.js +2 -2
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{payload-parsers-192e0c3e.js → payload-parsers-3e817fe9.js} +86 -31
- package/dist/esm/webcomponents.js +1 -1
- package/dist/module/Business.js +2 -0
- package/dist/module/business-address-schema.js +2 -23
- package/dist/module/business-core-info-schema.js +4 -35
- package/dist/module/business-identity-schema.js +15 -32
- package/dist/module/business-owners-form-step.js +2 -8
- package/dist/module/business-representative-form-step.js +5 -11
- package/dist/module/business-representative.js +4 -10
- package/dist/module/form-input-masks.js +2 -1
- package/dist/module/justifi-business-form.js +5 -11
- package/dist/module/justifi-payment-provisioning.js +4 -10
- package/dist/module/legal-address-form-step.js +1 -1
- package/dist/module/owner-form.js +5 -11
- package/dist/module/payload-parsers.js +96 -1
- package/dist/module/payment-method-form.js +1 -1
- package/dist/types/api/Identity.d.ts +3 -0
- package/dist/types/components/business-forms/schemas/business-form-schema.d.ts +2 -0
- package/dist/types/components/business-forms/schemas/business-identity-schema.d.ts +3 -1
- package/dist/types/components/business-forms/schemas/schema-helpers.d.ts +1 -0
- package/dist/types/components/business-forms/schemas/schema-validations.d.ts +17 -0
- package/dist/types/utils/form-input-masks.d.ts +1 -0
- package/dist/webcomponents/p-01913426.js +1 -0
- package/dist/webcomponents/{p-99d6b67e.entry.js → p-07080c01.entry.js} +1 -1
- package/dist/webcomponents/p-0d371ff5.entry.js +1 -0
- package/dist/webcomponents/p-2fbe8823.entry.js +1 -0
- package/dist/webcomponents/{p-56780f10.entry.js → p-31ccb5f0.entry.js} +1 -1
- package/dist/webcomponents/{p-3fe05c4a.entry.js → p-31e70d65.entry.js} +1 -1
- package/dist/webcomponents/p-4c705f56.js +1 -0
- package/dist/webcomponents/{p-9f3facf1.entry.js → p-5f5e730c.entry.js} +1 -1
- package/dist/webcomponents/{p-84b9ffc9.entry.js → p-71b8e2da.entry.js} +1 -1
- package/dist/webcomponents/p-737473d8.js +1 -0
- package/dist/webcomponents/{p-b318b899.js → p-787d8f52.js} +1 -1
- package/dist/webcomponents/p-889a83d2.js +1 -0
- package/dist/webcomponents/p-9b0e5c25.entry.js +1 -0
- package/dist/webcomponents/p-b9f04fb0.entry.js +1 -0
- package/dist/webcomponents/p-c865cda8.entry.js +1 -0
- package/dist/webcomponents/{p-8c9d9812.entry.js → p-edab5f2b.entry.js} +1 -1
- package/dist/webcomponents/webcomponents.esm.js +1 -1
- package/package.json +1 -1
- package/dist/cjs/business-additional-questions-schema-bdfd29c3.js +0 -78
- package/dist/webcomponents/p-0315876e.entry.js +0 -1
- package/dist/webcomponents/p-41b1ad3a.entry.js +0 -1
- package/dist/webcomponents/p-5c269619.js +0 -1
- package/dist/webcomponents/p-910bb656.js +0 -1
- package/dist/webcomponents/p-96cebc8b.entry.js +0 -1
- package/dist/webcomponents/p-e2ba8d84.entry.js +0 -1
- package/dist/webcomponents/p-f4ae621e.entry.js +0 -1
- package/dist/webcomponents/p-fd60d5af.js +0 -1
- package/dist/webcomponents/p-ff211f76.js +0 -1
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
import { a as create$6 } from './index.esm.js';
|
|
2
|
+
import { a as BusinessTypeOptions } from './business-form-types.js';
|
|
3
|
+
import { S as StateOptions } from './state-options.js';
|
|
4
|
+
|
|
1
5
|
const transformEmptyString = (value) => {
|
|
2
6
|
return value === '' ? null : value;
|
|
3
7
|
};
|
|
@@ -6,6 +10,96 @@ const phoneRegex = /^\d{10}$/;
|
|
|
6
10
|
const urlRegex = /^(?:http(s)?:\/\/)?(?:www\.)?[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_\+.~#?&//=]*)$/;
|
|
7
11
|
const taxIdRegex = /^\d{9}$/;
|
|
8
12
|
const stringLettersOnlyRegex = /^(?!^\s+$)[a-zA-Z\s]*$/;
|
|
13
|
+
const ssnRegex = /^(?!000|666|9\d{2})\d{3}(?!00)\d{2}(?!0000)\d{4}$/;
|
|
14
|
+
|
|
15
|
+
// Common Validations
|
|
16
|
+
const emailValidation = create$6()
|
|
17
|
+
.email('Enter valid email')
|
|
18
|
+
.transform(transformEmptyString);
|
|
19
|
+
const phoneValidation = create$6()
|
|
20
|
+
.matches(phoneRegex, 'Enter valid phone number')
|
|
21
|
+
.transform(transformEmptyString);
|
|
22
|
+
// Core Info Validations
|
|
23
|
+
const businessNameValidation = create$6()
|
|
24
|
+
.min(2, 'Name must be at least 2 characters')
|
|
25
|
+
.max(100, 'Name must be less than 100 characters')
|
|
26
|
+
.matches(businessNameRegex, 'Enter valid business name')
|
|
27
|
+
.transform(transformEmptyString);
|
|
28
|
+
const doingBusinessAsValidation = create$6()
|
|
29
|
+
.min(2, 'Name must be at least 2 characters')
|
|
30
|
+
.max(100, 'Name must be less than 100 characters')
|
|
31
|
+
.matches(businessNameRegex, 'Enter valid doing business as')
|
|
32
|
+
.transform(transformEmptyString);
|
|
33
|
+
const websiteUrlValidation = create$6()
|
|
34
|
+
.matches(urlRegex, 'Enter valid website url')
|
|
35
|
+
.transform(transformEmptyString);
|
|
36
|
+
const businessTypeValidation = create$6()
|
|
37
|
+
.oneOf(BusinessTypeOptions.map((option) => option.value), 'Select business type')
|
|
38
|
+
.transform(transformEmptyString);
|
|
39
|
+
const industryValidation = create$6()
|
|
40
|
+
.min(2, 'Industry must be at least 2 characters')
|
|
41
|
+
.max(50, 'Industry must be less than 50 characters')
|
|
42
|
+
.matches(stringLettersOnlyRegex, 'Enter valid industry')
|
|
43
|
+
.transform(transformEmptyString);
|
|
44
|
+
const taxIdValidation = create$6()
|
|
45
|
+
.matches(taxIdRegex, 'Enter valid tax id')
|
|
46
|
+
.transform(transformEmptyString);
|
|
47
|
+
// Identity Validations
|
|
48
|
+
const identityNameValidation = create$6()
|
|
49
|
+
.min(2, 'Name must be at least 2 characters')
|
|
50
|
+
.max(100, 'Name must be less than 100 characters')
|
|
51
|
+
.matches(stringLettersOnlyRegex, 'Enter valid name')
|
|
52
|
+
.transform(transformEmptyString);
|
|
53
|
+
const identityTitleValidation = create$6()
|
|
54
|
+
.min(2, 'Title must be at least 2 characters')
|
|
55
|
+
.max(50, 'Title must be less than 50 characters')
|
|
56
|
+
.matches(stringLettersOnlyRegex, 'Enter valid title')
|
|
57
|
+
.transform(transformEmptyString);
|
|
58
|
+
const dobValidation = (role) => {
|
|
59
|
+
return (create$6()
|
|
60
|
+
.test('min', 'Enter a valid date', (value) => {
|
|
61
|
+
const date = new Date(value);
|
|
62
|
+
const minDate = new Date('1902-01-01');
|
|
63
|
+
return date >= minDate;
|
|
64
|
+
})
|
|
65
|
+
.test('age', `${role} must be at least 18 years old`, (value) => {
|
|
66
|
+
const date = new Date(value);
|
|
67
|
+
const minAgeDate = new Date();
|
|
68
|
+
minAgeDate.setFullYear(minAgeDate.getFullYear() - 18);
|
|
69
|
+
return date <= minAgeDate;
|
|
70
|
+
})
|
|
71
|
+
.transform(transformEmptyString));
|
|
72
|
+
};
|
|
73
|
+
const ssnValidation = create$6()
|
|
74
|
+
.matches(ssnRegex, 'Enter valid SSN')
|
|
75
|
+
.test('not-repeat', 'Enter valid SSN', (value) => {
|
|
76
|
+
return !/^(\d)\1+$/.test(value);
|
|
77
|
+
})
|
|
78
|
+
.test('not-seq', 'Enter valid SSN', (value) => {
|
|
79
|
+
return value !== '123456789';
|
|
80
|
+
})
|
|
81
|
+
.transform(transformEmptyString);
|
|
82
|
+
// Address Validations
|
|
83
|
+
const lineOneValidation = create$6()
|
|
84
|
+
.min(5, 'Address must be at least 5 characters')
|
|
85
|
+
.max(100, 'Address must be less than 100 characters')
|
|
86
|
+
.matches(/^(?!^\s+$)[a-zA-Z0-9\s,.'-]*$/, 'Enter valid address line 1')
|
|
87
|
+
.transform(transformEmptyString);
|
|
88
|
+
const lineTwoValidation = create$6()
|
|
89
|
+
.max(100, 'Address must be less than 100 characters')
|
|
90
|
+
.matches(/^(?!^\s+$)[a-zA-Z0-9\s,.'-]*$/, 'Enter valid address line 2')
|
|
91
|
+
.transform(transformEmptyString);
|
|
92
|
+
const cityValidation = create$6()
|
|
93
|
+
.min(2, 'City must be at least 2 characters')
|
|
94
|
+
.max(50, 'City must be less than 50 characters')
|
|
95
|
+
.matches(/^(?!^\s+$)[a-zA-Z\s]*$/, 'Enter valid city')
|
|
96
|
+
.transform(transformEmptyString);
|
|
97
|
+
const stateValidation = create$6()
|
|
98
|
+
.oneOf(StateOptions.map((option) => option.value), 'Select state')
|
|
99
|
+
.transform(transformEmptyString);
|
|
100
|
+
const postalValidation = create$6()
|
|
101
|
+
.matches(/^[0-9]{5}$/, 'Enter valid postal code')
|
|
102
|
+
.transform(transformEmptyString);
|
|
9
103
|
|
|
10
104
|
// These props should not be sent to the server
|
|
11
105
|
// This function is for the larger business form.
|
|
@@ -43,7 +137,8 @@ const parseIdentityInfo = (values) => {
|
|
|
43
137
|
delete values.address.updated_at;
|
|
44
138
|
delete values.business_id;
|
|
45
139
|
delete values.dob_full;
|
|
140
|
+
delete values.ssn_last4;
|
|
46
141
|
return values;
|
|
47
142
|
};
|
|
48
143
|
|
|
49
|
-
export {
|
|
144
|
+
export { phoneValidation as a, businessNameValidation as b, businessTypeValidation as c, doingBusinessAsValidation as d, emailValidation as e, parseBusiness as f, identityNameValidation as g, identityTitleValidation as h, industryValidation as i, dobValidation as j, lineTwoValidation as k, lineOneValidation as l, cityValidation as m, stateValidation as n, postalValidation as o, parseCoreInfo as p, parseIdentityInfo as q, parseAddressInfo as r, ssnValidation as s, taxIdValidation as t, websiteUrlValidation as w };
|
|
@@ -1490,7 +1490,7 @@ const MessageEventType = {
|
|
|
1490
1490
|
};
|
|
1491
1491
|
|
|
1492
1492
|
const name = "@justifi/webcomponents";
|
|
1493
|
-
const version = "4.12.
|
|
1493
|
+
const version = "4.12.1";
|
|
1494
1494
|
const description = "JustiFi Web Components";
|
|
1495
1495
|
const main = "dist/module/index.js";
|
|
1496
1496
|
const module = "dist/module/index.js";
|
|
@@ -14,6 +14,7 @@ export interface Identity {
|
|
|
14
14
|
name?: string;
|
|
15
15
|
phone?: string;
|
|
16
16
|
platform_account_id?: string;
|
|
17
|
+
identification_number?: string;
|
|
17
18
|
ssn_last4?: string;
|
|
18
19
|
title?: string;
|
|
19
20
|
updated_at?: string;
|
|
@@ -34,6 +35,7 @@ export declare class Owner implements Identity {
|
|
|
34
35
|
name?: string;
|
|
35
36
|
phone?: string;
|
|
36
37
|
platform_account_id?: string;
|
|
38
|
+
identification_number?: string;
|
|
37
39
|
ssn_last4?: string;
|
|
38
40
|
title?: string;
|
|
39
41
|
updated_at?: string;
|
|
@@ -55,6 +57,7 @@ export declare class Representative implements Identity {
|
|
|
55
57
|
name?: string;
|
|
56
58
|
phone?: string;
|
|
57
59
|
platform_account_id?: string;
|
|
60
|
+
identification_number?: string;
|
|
58
61
|
ssn_last4?: string;
|
|
59
62
|
title?: string;
|
|
60
63
|
updated_at?: string;
|
|
@@ -22,6 +22,7 @@ export declare const businessFormSchema: import("yup").ObjectSchema<{
|
|
|
22
22
|
postal_code?: string;
|
|
23
23
|
country?: string;
|
|
24
24
|
};
|
|
25
|
+
title?: string;
|
|
25
26
|
name?: string;
|
|
26
27
|
email?: string;
|
|
27
28
|
phone?: string;
|
|
@@ -53,6 +54,7 @@ export declare const businessFormSchema: import("yup").ObjectSchema<{
|
|
|
53
54
|
};
|
|
54
55
|
representative: {
|
|
55
56
|
name: undefined;
|
|
57
|
+
title: undefined;
|
|
56
58
|
email: undefined;
|
|
57
59
|
phone: undefined;
|
|
58
60
|
dob_full: undefined;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
export declare const identitySchema: (
|
|
1
|
+
export declare const identitySchema: (role: string, allowOptionalFields?: boolean) => import("yup").ObjectSchema<{
|
|
2
2
|
name: string;
|
|
3
|
+
title: string;
|
|
3
4
|
email: string;
|
|
4
5
|
phone: string;
|
|
5
6
|
dob_full: string;
|
|
@@ -14,6 +15,7 @@ export declare const identitySchema: (title: string, allowOptionalFields?: boole
|
|
|
14
15
|
};
|
|
15
16
|
}, import("yup").AnyObject, {
|
|
16
17
|
name: undefined;
|
|
18
|
+
title: undefined;
|
|
17
19
|
email: undefined;
|
|
18
20
|
phone: undefined;
|
|
19
21
|
dob_full: undefined;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export declare const emailValidation: import("yup").StringSchema<string, import("yup").AnyObject, undefined, "">;
|
|
2
|
+
export declare const phoneValidation: import("yup").StringSchema<string, import("yup").AnyObject, undefined, "">;
|
|
3
|
+
export declare const businessNameValidation: import("yup").StringSchema<string, import("yup").AnyObject, undefined, "">;
|
|
4
|
+
export declare const doingBusinessAsValidation: import("yup").StringSchema<string, import("yup").AnyObject, undefined, "">;
|
|
5
|
+
export declare const websiteUrlValidation: import("yup").StringSchema<string, import("yup").AnyObject, undefined, "">;
|
|
6
|
+
export declare const businessTypeValidation: import("yup").StringSchema<string, import("yup").AnyObject, undefined, "">;
|
|
7
|
+
export declare const industryValidation: import("yup").StringSchema<string, import("yup").AnyObject, undefined, "">;
|
|
8
|
+
export declare const taxIdValidation: import("yup").StringSchema<string, import("yup").AnyObject, undefined, "">;
|
|
9
|
+
export declare const identityNameValidation: import("yup").StringSchema<string, import("yup").AnyObject, undefined, "">;
|
|
10
|
+
export declare const identityTitleValidation: import("yup").StringSchema<string, import("yup").AnyObject, undefined, "">;
|
|
11
|
+
export declare const dobValidation: (role: string) => import("yup").StringSchema<string, import("yup").AnyObject, undefined, "">;
|
|
12
|
+
export declare const ssnValidation: import("yup").StringSchema<string, import("yup").AnyObject, undefined, "">;
|
|
13
|
+
export declare const lineOneValidation: import("yup").StringSchema<string, import("yup").AnyObject, undefined, "">;
|
|
14
|
+
export declare const lineTwoValidation: import("yup").StringSchema<string, import("yup").AnyObject, undefined, "">;
|
|
15
|
+
export declare const cityValidation: import("yup").StringSchema<string, import("yup").AnyObject, undefined, "">;
|
|
16
|
+
export declare const stateValidation: import("yup").StringSchema<string, import("yup").AnyObject, undefined, "">;
|
|
17
|
+
export declare const postalValidation: import("yup").StringSchema<string, import("yup").AnyObject, undefined, "">;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const s={US:"(000) 000-0000"},a={US:"00-0000000"},S="000-00-0000";export{s as P,S,a as T}
|