@justifi/webcomponents 4.19.3-rc → 4.19.3-rc-2
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/{Analytics-57e3b5a8.js → Analytics-adc90fc6.js} +1 -1
- package/dist/cjs/justifi-bank-account-form.cjs.entry.js +2 -2
- package/dist/cjs/justifi-business-details.cjs.entry.js +2 -2
- package/dist/cjs/justifi-business-form.cjs.entry.js +2 -2
- package/dist/cjs/justifi-card-form.cjs.entry.js +2 -2
- package/dist/cjs/justifi-checkout-core.cjs.entry.js +2 -1
- package/dist/cjs/justifi-checkout.cjs.entry.js +2 -2
- package/dist/cjs/justifi-gross-payment-chart.cjs.entry.js +2 -2
- package/dist/cjs/justifi-new-payment-method_4.cjs.entry.js +4 -1
- package/dist/cjs/justifi-payment-details.cjs.entry.js +2 -2
- package/dist/cjs/justifi-payment-form.cjs.entry.js +2 -2
- package/dist/cjs/justifi-payment-method-form.cjs.entry.js +1 -1
- package/dist/cjs/justifi-payment-provisioning.cjs.entry.js +2 -2
- package/dist/cjs/justifi-payments-list.cjs.entry.js +2 -2
- package/dist/cjs/justifi-payout-details.cjs.entry.js +2 -2
- package/dist/cjs/justifi-payouts-list.cjs.entry.js +2 -2
- package/dist/cjs/justifi-season-interruption-insurance.cjs.entry.js +2 -2
- package/dist/cjs/{package-97b9c902.js → package-22d30c5d.js} +1 -1
- package/dist/collection/components/checkout/checkout-core.js +2 -1
- package/dist/collection/components/checkout/new-payment-method.js +4 -1
- package/dist/docs.json +1 -1
- package/dist/esm/{Analytics-7cb9826b.js → Analytics-a8eb7344.js} +1 -1
- package/dist/esm/justifi-bank-account-form.entry.js +2 -2
- package/dist/esm/justifi-business-details.entry.js +2 -2
- package/dist/esm/justifi-business-form.entry.js +2 -2
- package/dist/esm/justifi-card-form.entry.js +2 -2
- package/dist/esm/justifi-checkout-core.entry.js +2 -1
- package/dist/esm/justifi-checkout.entry.js +2 -2
- package/dist/esm/justifi-gross-payment-chart.entry.js +2 -2
- package/dist/esm/justifi-new-payment-method_4.entry.js +4 -1
- package/dist/esm/justifi-payment-details.entry.js +2 -2
- package/dist/esm/justifi-payment-form.entry.js +2 -2
- package/dist/esm/justifi-payment-method-form.entry.js +1 -1
- package/dist/esm/justifi-payment-provisioning.entry.js +2 -2
- package/dist/esm/justifi-payments-list.entry.js +2 -2
- package/dist/esm/justifi-payout-details.entry.js +2 -2
- package/dist/esm/justifi-payouts-list.entry.js +2 -2
- package/dist/esm/justifi-season-interruption-insurance.entry.js +2 -2
- package/dist/esm/{package-93884871.js → package-ccb774a9.js} +1 -1
- package/dist/module/checkout-core.js +2 -1
- package/dist/module/new-payment-method.js +4 -1
- package/dist/module/package.js +1 -1
- package/dist/types/components/checkout/new-payment-method.d.ts +1 -0
- package/dist/webcomponents/index.esm.js +1 -0
- package/dist/webcomponents/p-01a404ca.entry.js +44 -0
- package/dist/webcomponents/p-03d35880.entry.js +130 -0
- package/dist/webcomponents/p-06ff0429.entry.js +65 -0
- package/dist/webcomponents/p-08b0fb31.js +41 -1
- package/dist/webcomponents/p-0e1bc91e.js +28 -1
- package/dist/webcomponents/p-10875f3d.entry.js +97 -0
- package/dist/webcomponents/p-14c91ffd.js +20 -1
- package/dist/webcomponents/p-157acba8.entry.js +98 -0
- package/dist/webcomponents/p-15eafa87.js +77 -0
- package/dist/webcomponents/p-18fa0479.entry.js +131 -0
- package/dist/webcomponents/p-1a5120f4.entry.js +145 -0
- package/dist/webcomponents/p-1ad5995e.js +3599 -1
- package/dist/webcomponents/p-1ff8810b.js +29 -1
- package/dist/webcomponents/p-2338affa.js +213 -1
- package/dist/webcomponents/p-24dc023a.entry.js +791 -0
- package/dist/webcomponents/p-25d8cd65.entry.js +102 -0
- package/dist/webcomponents/p-27d87fe2.entry.js +133 -0
- package/dist/webcomponents/p-29c0b182.js +114 -1
- package/dist/webcomponents/p-2b6c9c4f.js +7 -1
- package/dist/webcomponents/p-2e8f4937.js +79 -0
- package/dist/webcomponents/p-2eab3c90.js +3052 -1
- package/dist/webcomponents/p-3395e896.entry.js +74 -0
- package/dist/webcomponents/p-3fd13ca3.js +52 -1
- package/dist/webcomponents/p-47d79529.js +18 -1
- package/dist/webcomponents/p-525db3e8.js +22 -1
- package/dist/webcomponents/p-53ecc8b9.entry.js +261 -0
- package/dist/webcomponents/p-5482d030.entry.js +21 -0
- package/dist/webcomponents/p-56f6ce4c.js +10 -1
- package/dist/webcomponents/p-576826b1.entry.js +43 -0
- package/dist/webcomponents/p-5968ff8a.js +178 -1
- package/dist/webcomponents/p-5f835b89.entry.js +606 -0
- package/dist/webcomponents/p-6078a370.js +244 -1
- package/dist/webcomponents/p-6124b1b3.entry.js +80 -0
- package/dist/webcomponents/p-70a2aa74.entry.js +76 -0
- package/dist/webcomponents/p-7582b554.entry.js +18 -0
- package/dist/webcomponents/p-75fd6367.entry.js +149 -0
- package/dist/webcomponents/p-79646550.entry.js +61 -0
- package/dist/webcomponents/p-7d85af5c.js +16 -1
- package/dist/webcomponents/p-800d31fe.entry.js +162 -0
- package/dist/webcomponents/p-8115b2f4.js +28 -1
- package/dist/webcomponents/p-83125497.js +4027 -1
- package/dist/webcomponents/p-85fc69e5.js +90 -1
- package/dist/webcomponents/p-89887332.js +301 -1
- package/dist/webcomponents/p-8df7bde8.js +27 -1
- package/dist/webcomponents/p-8eb774df.entry.js +54 -0
- package/dist/webcomponents/p-9c9c7dac.js +24 -1
- package/dist/webcomponents/p-9e17630d.entry.js +1684 -0
- package/dist/webcomponents/p-9f94bbb6.entry.js +118 -0
- package/dist/webcomponents/p-a4e8573e.entry.js +94 -0
- package/dist/webcomponents/p-a5a225d9.entry.js +125 -0
- package/dist/webcomponents/p-a5fb51dc.entry.js +131 -0
- package/dist/webcomponents/p-ab4816e1.entry.js +117 -0
- package/dist/webcomponents/p-ac086069.entry.js +58 -0
- package/dist/webcomponents/p-af244664.js +126 -1
- package/dist/webcomponents/p-b4b8b531.js +44 -1
- package/dist/webcomponents/p-b82c146f.entry.js +111 -0
- package/dist/webcomponents/p-ba4bae6f.js +12 -1
- package/dist/webcomponents/p-ba5fae28.js +90 -1
- package/dist/webcomponents/p-bd66f9d2.entry.js +101 -0
- package/dist/webcomponents/p-cc39384f.entry.js +99 -0
- package/dist/webcomponents/p-d17aee2b.entry.js +26 -0
- package/dist/webcomponents/p-d89bad72.js +39 -1
- package/dist/webcomponents/p-dad3e069.entry.js +298 -0
- package/dist/webcomponents/p-dce846bf.js +27 -1
- package/dist/webcomponents/p-df21aaad.js +120 -1
- package/dist/webcomponents/p-e1255160.js +3 -1
- package/dist/webcomponents/p-e1e7525b.entry.js +73 -0
- package/dist/webcomponents/p-e333620e.js +34 -1
- package/dist/webcomponents/p-e356f280.entry.js +29 -0
- package/dist/webcomponents/p-e3fab0e2.js +43 -1
- package/dist/webcomponents/p-e9a5cb95.entry.js +94 -0
- package/dist/webcomponents/p-ec854a3e.entry.js +11053 -0
- package/dist/webcomponents/p-edc37d1f.entry.js +75 -0
- package/dist/webcomponents/p-f02b75dc.entry.js +96 -0
- package/dist/webcomponents/p-fad19d75.js +1638 -2
- package/dist/webcomponents/webcomponents.css +362 -4
- package/dist/webcomponents/webcomponents.esm.js +20 -1
- package/package.json +1 -1
- package/dist/webcomponents/p-03419b17.js +0 -1
- package/dist/webcomponents/p-07109641.entry.js +0 -1
- package/dist/webcomponents/p-0bbe1f1c.entry.js +0 -1
- package/dist/webcomponents/p-0cd89142.entry.js +0 -1
- package/dist/webcomponents/p-0f7b9555.entry.js +0 -1
- package/dist/webcomponents/p-16887e04.entry.js +0 -1
- package/dist/webcomponents/p-17baca7d.entry.js +0 -1
- package/dist/webcomponents/p-17e4246f.entry.js +0 -1
- package/dist/webcomponents/p-1a43e355.entry.js +0 -19
- package/dist/webcomponents/p-1f761d16.entry.js +0 -1
- package/dist/webcomponents/p-276cc368.entry.js +0 -1
- package/dist/webcomponents/p-30a493cd.entry.js +0 -1
- package/dist/webcomponents/p-32211b2f.entry.js +0 -1
- package/dist/webcomponents/p-3352353a.entry.js +0 -1
- package/dist/webcomponents/p-462dc522.entry.js +0 -1
- package/dist/webcomponents/p-487b72a8.entry.js +0 -1
- package/dist/webcomponents/p-4a485cce.js +0 -1
- package/dist/webcomponents/p-4abc17f0.entry.js +0 -1
- package/dist/webcomponents/p-4c849993.entry.js +0 -1
- package/dist/webcomponents/p-52021fa1.entry.js +0 -1
- package/dist/webcomponents/p-53e64f15.entry.js +0 -1
- package/dist/webcomponents/p-62b32c4c.entry.js +0 -1
- package/dist/webcomponents/p-83876625.entry.js +0 -1
- package/dist/webcomponents/p-8e541a32.entry.js +0 -1
- package/dist/webcomponents/p-97272668.entry.js +0 -1
- package/dist/webcomponents/p-b1257354.entry.js +0 -1
- package/dist/webcomponents/p-b29f5084.entry.js +0 -1
- package/dist/webcomponents/p-babd56c3.entry.js +0 -1
- package/dist/webcomponents/p-bbed6107.entry.js +0 -1
- package/dist/webcomponents/p-be39c802.entry.js +0 -1
- package/dist/webcomponents/p-c607f049.entry.js +0 -1
- package/dist/webcomponents/p-c9f8f7ec.entry.js +0 -1
- package/dist/webcomponents/p-cd37a87e.entry.js +0 -1
- package/dist/webcomponents/p-cff82e78.entry.js +0 -1
- package/dist/webcomponents/p-d8355f91.entry.js +0 -1
- package/dist/webcomponents/p-e2c88817.entry.js +0 -1
- package/dist/webcomponents/p-e31f0f3e.entry.js +0 -1
- package/dist/webcomponents/p-f0866375.entry.js +0 -1
- package/dist/webcomponents/p-f117d1d1.entry.js +0 -1
- package/dist/webcomponents/p-f883bf32.entry.js +0 -1
- package/dist/webcomponents/p-fb58feb5.entry.js +0 -1
- package/dist/webcomponents/p-fe33151d.entry.js +0 -1
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { r as registerInstance, c as createEvent, h } from './p-fad19d75.js';
|
|
2
|
+
import { J as JustifiAnalytics } from './p-15eafa87.js';
|
|
3
|
+
import './p-2e8f4937.js';
|
|
4
|
+
import './p-29c0b182.js';
|
|
5
|
+
|
|
6
|
+
const BankAccountForm = class {
|
|
7
|
+
constructor(hostRef) {
|
|
8
|
+
registerInstance(this, hostRef);
|
|
9
|
+
this.bankAccountFormReady = createEvent(this, "bankAccountFormReady", 7);
|
|
10
|
+
this.ready = createEvent(this, "ready", 7);
|
|
11
|
+
this.bankAccountFormTokenized = createEvent(this, "bankAccountFormTokenize", 7);
|
|
12
|
+
this.bankAccountFormValidated = createEvent(this, "bankAccountFormValidate", 7);
|
|
13
|
+
this.validationMode = undefined;
|
|
14
|
+
this.iframeOrigin = "";
|
|
15
|
+
this.internalStyleOverrides = undefined;
|
|
16
|
+
}
|
|
17
|
+
readyHandler(event) {
|
|
18
|
+
console.warn(`The 'bankAccountFormReady' event is deprecated in the next major release and will be renamed to 'ready'`);
|
|
19
|
+
this.bankAccountFormReady.emit(event);
|
|
20
|
+
this.ready.emit(event);
|
|
21
|
+
}
|
|
22
|
+
tokenizeHandler(event) {
|
|
23
|
+
console.warn(`The 'bankAccountFormTokenized' event is deprecated in the next major release. Please refer to the documentation for the migration process and alternative approach. This method will be removed in the future.`);
|
|
24
|
+
this.bankAccountFormTokenized.emit(event);
|
|
25
|
+
}
|
|
26
|
+
validateHandler(event) {
|
|
27
|
+
console.warn(`The 'bankAccountFormValidate' event is deprecated in the next major release. Please refer to the documentation for the migration process and alternative approach. This method will be removed in the future.`);
|
|
28
|
+
this.bankAccountFormValidated.emit(event);
|
|
29
|
+
}
|
|
30
|
+
componentWillLoad() {
|
|
31
|
+
this.analytics = new JustifiAnalytics(this);
|
|
32
|
+
}
|
|
33
|
+
disconnectedCallback() {
|
|
34
|
+
this.analytics.cleanup();
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Makes a tokenization request to the iframe
|
|
38
|
+
*/
|
|
39
|
+
async tokenize(...args) {
|
|
40
|
+
if (!this.childRef) {
|
|
41
|
+
throw new Error('Cannot call tokenize');
|
|
42
|
+
}
|
|
43
|
+
return this.childRef.tokenize(...args);
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Runs a validation on the form and shows errors if any
|
|
47
|
+
*/
|
|
48
|
+
async validate() {
|
|
49
|
+
if (!this.childRef) {
|
|
50
|
+
throw new Error('Cannot call validate');
|
|
51
|
+
}
|
|
52
|
+
return this.childRef.validate();
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Manually resizes the iframe to fit the contents of the iframe
|
|
56
|
+
* @deprecated This method will be removed in future releases.
|
|
57
|
+
*/
|
|
58
|
+
async resize() {
|
|
59
|
+
console.warn(`The 'resize' method is deprecated and will be removed in the next major release. Please refer to the documentation for the migration process and alternative approach.`);
|
|
60
|
+
if (!this.childRef) {
|
|
61
|
+
throw new Error('Cannot call validate');
|
|
62
|
+
}
|
|
63
|
+
return this.childRef.resize();
|
|
64
|
+
}
|
|
65
|
+
render() {
|
|
66
|
+
return (h("justifi-payment-method-form", { key: '646e392c1a9ed38e73780ed6a01b6f019767794c', ref: el => {
|
|
67
|
+
if (el) {
|
|
68
|
+
this.childRef = el;
|
|
69
|
+
}
|
|
70
|
+
}, "iframe-origin": this.iframeOrigin, "payment-method-form-type": "bankAccount", "payment-method-form-ready": this.bankAccountFormReady, "payment-method-form-validated": this.bankAccountFormValidated, "payment-method-form-tokenize": this.bankAccountFormTokenized, "payment-method-form-validation-mode": this.validationMode || 'onSubmit' }));
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
export { BankAccountForm as justifi_bank_account_form };
|
|
@@ -1 +1,52 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { c as create$3 } from './p-2eab3c90.js';
|
|
2
|
+
import { h as businessNameValidation, w as websiteUrlValidation, e as emailValidation, d as phoneValidation, j as doingBusinessAsValidation, k as businessClassificationValidation, m as industryValidation, t as taxIdValidation, n as dateOfIncorporationValidation, r as revenueValidation, o as paymentVolumeValidation, q as whenServiceReceivedValidation, u as recurringPaymentsValidation, v as recurringPaymentsPercentageValidation, x as seasonalBusinessValidation, y as otherPaymentDetailsValidation } from './p-89887332.js';
|
|
3
|
+
|
|
4
|
+
const businessCoreInfoSchema = (allowOptionalFields) => {
|
|
5
|
+
const schema = create$3({
|
|
6
|
+
legal_name: businessNameValidation.required('Enter legal name'),
|
|
7
|
+
website_url: websiteUrlValidation.required('Enter business website url'),
|
|
8
|
+
email: emailValidation.required('Enter business email'),
|
|
9
|
+
phone: phoneValidation.required('Enter phone number'),
|
|
10
|
+
doing_business_as: doingBusinessAsValidation.required('Enter doing business as'),
|
|
11
|
+
classification: businessClassificationValidation.required('Select business classification'),
|
|
12
|
+
industry: industryValidation.required('Enter a business industry'),
|
|
13
|
+
tax_id: taxIdValidation.required('Enter tax id, SSN, or EIN'),
|
|
14
|
+
date_of_incorporation: dateOfIncorporationValidation.required('Enter date of incorporation'),
|
|
15
|
+
});
|
|
16
|
+
const easySchema = create$3({
|
|
17
|
+
legal_name: businessNameValidation.required('Enter legal name'),
|
|
18
|
+
website_url: websiteUrlValidation.nullable(),
|
|
19
|
+
email: emailValidation.nullable(),
|
|
20
|
+
phone: phoneValidation.nullable(),
|
|
21
|
+
doing_business_as: doingBusinessAsValidation.nullable(),
|
|
22
|
+
classification: businessClassificationValidation.nullable(),
|
|
23
|
+
industry: industryValidation.nullable(),
|
|
24
|
+
tax_id: taxIdValidation.nullable(),
|
|
25
|
+
date_of_incorporation: dateOfIncorporationValidation.nullable(),
|
|
26
|
+
});
|
|
27
|
+
return allowOptionalFields ? easySchema : schema;
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
const additionalQuestionsSchema = (allowOptionalFields) => {
|
|
31
|
+
const schema = create$3({
|
|
32
|
+
business_revenue: revenueValidation.required('Enter business revenue'),
|
|
33
|
+
business_payment_volume: paymentVolumeValidation.required('Enter business payment volume'),
|
|
34
|
+
business_when_service_received: whenServiceReceivedValidation.required('Select when service is received'),
|
|
35
|
+
business_recurring_payments: recurringPaymentsValidation.required('Select recurring payments'),
|
|
36
|
+
business_recurring_payments_percentage: recurringPaymentsPercentageValidation,
|
|
37
|
+
business_seasonal: seasonalBusinessValidation.required('Select business seasonal'),
|
|
38
|
+
business_other_payment_details: otherPaymentDetailsValidation.nullable(),
|
|
39
|
+
});
|
|
40
|
+
const easySchema = create$3({
|
|
41
|
+
business_revenue: revenueValidation.nullable(),
|
|
42
|
+
business_payment_volume: paymentVolumeValidation.nullable(),
|
|
43
|
+
business_when_service_received: whenServiceReceivedValidation.nullable(),
|
|
44
|
+
business_recurring_payments: recurringPaymentsValidation.nullable(),
|
|
45
|
+
business_recurring_payments_percentage: recurringPaymentsPercentageValidation,
|
|
46
|
+
business_seasonal: seasonalBusinessValidation.nullable(),
|
|
47
|
+
business_other_payment_details: otherPaymentDetailsValidation.nullable(),
|
|
48
|
+
});
|
|
49
|
+
return allowOptionalFields ? easySchema : schema;
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
export { additionalQuestionsSchema as a, businessCoreInfoSchema as b };
|
|
@@ -1 +1,18 @@
|
|
|
1
|
-
import{A as
|
|
1
|
+
import { A as Api } from './p-29c0b182.js';
|
|
2
|
+
import './p-56f6ce4c.js';
|
|
3
|
+
import './p-df21aaad.js';
|
|
4
|
+
import './p-e3fab0e2.js';
|
|
5
|
+
|
|
6
|
+
class PaymentService {
|
|
7
|
+
async fetchPayments(accountId, authToken, params) {
|
|
8
|
+
const api = Api({ authToken, apiOrigin: "" });
|
|
9
|
+
const endpoint = `account/${accountId}/payments`;
|
|
10
|
+
return api.get(endpoint, params);
|
|
11
|
+
}
|
|
12
|
+
async fetchPayment(paymentId, authToken) {
|
|
13
|
+
const endpoint = `payments/${paymentId}`;
|
|
14
|
+
return Api({ authToken, apiOrigin: "" }).get(endpoint);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export { PaymentService as P };
|
|
@@ -1 +1,22 @@
|
|
|
1
|
-
const
|
|
1
|
+
const PHONE_MASKS = {
|
|
2
|
+
US: '(000) 000-0000',
|
|
3
|
+
};
|
|
4
|
+
const TAX_ID_MASKS = { US: '00-0000000' };
|
|
5
|
+
const SSN_MASK = '000-00-0000';
|
|
6
|
+
const CURRENCY_MASK = {
|
|
7
|
+
WHOLE: {
|
|
8
|
+
mask: Number,
|
|
9
|
+
thousandsSeparator: ',',
|
|
10
|
+
normalizeZeros: true,
|
|
11
|
+
},
|
|
12
|
+
DECIMAL: {
|
|
13
|
+
mask: Number,
|
|
14
|
+
scale: 2,
|
|
15
|
+
thousandsSeparator: ',',
|
|
16
|
+
padFractionalZeros: true,
|
|
17
|
+
normalizeZeros: true,
|
|
18
|
+
radix: '.',
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export { CURRENCY_MASK as C, PHONE_MASKS as P, SSN_MASK as S, TAX_ID_MASKS as T };
|
|
@@ -0,0 +1,261 @@
|
|
|
1
|
+
import { r as registerInstance, c as createEvent, h } from './p-fad19d75.js';
|
|
2
|
+
import { c as makeGetIdentity, d as makePatchIdentity, e as makePostIdentity } from './p-5968ff8a.js';
|
|
3
|
+
import { I as IdentityService } from './p-0e1bc91e.js';
|
|
4
|
+
import { F as FormController } from './p-2eab3c90.js';
|
|
5
|
+
import { O as Owner } from './p-af244664.js';
|
|
6
|
+
import { a as BusinessFormClickActions } from './p-d89bad72.js';
|
|
7
|
+
import { c as parseIdentityInfo, i as identitySchema } from './p-85fc69e5.js';
|
|
8
|
+
import { B as Button } from './p-9c9c7dac.js';
|
|
9
|
+
import { S as SSN_MASK, P as PHONE_MASKS } from './p-525db3e8.js';
|
|
10
|
+
import { u as updateFormValues, a as updateAddressFormValues, b as updateDateOfBirthFormValues } from './p-7d85af5c.js';
|
|
11
|
+
import './p-14c91ffd.js';
|
|
12
|
+
import './p-8115b2f4.js';
|
|
13
|
+
import './p-29c0b182.js';
|
|
14
|
+
import './p-1ff8810b.js';
|
|
15
|
+
import './p-6078a370.js';
|
|
16
|
+
import './p-89887332.js';
|
|
17
|
+
import './p-ba5fae28.js';
|
|
18
|
+
|
|
19
|
+
const BusinessOwnerForm = class {
|
|
20
|
+
constructor(hostRef) {
|
|
21
|
+
registerInstance(this, hostRef);
|
|
22
|
+
this.errorEvent = createEvent(this, "error-event", 7);
|
|
23
|
+
this.getOwner = undefined;
|
|
24
|
+
this.patchOwner = undefined;
|
|
25
|
+
this.postOwner = undefined;
|
|
26
|
+
this.authToken = undefined;
|
|
27
|
+
this.ownerId = undefined;
|
|
28
|
+
this.businessId = undefined;
|
|
29
|
+
this.allowOptionalFields = undefined;
|
|
30
|
+
this.removeOwner = undefined;
|
|
31
|
+
this.newFormOpen = undefined;
|
|
32
|
+
this.ownersLength = undefined;
|
|
33
|
+
}
|
|
34
|
+
async validate() {
|
|
35
|
+
return this.coreComponent.validate();
|
|
36
|
+
}
|
|
37
|
+
async submit() {
|
|
38
|
+
return this.coreComponent.submit();
|
|
39
|
+
}
|
|
40
|
+
async validateAndSubmit({ onSuccess }) {
|
|
41
|
+
this.coreComponent.validateAndSubmit({ onSuccess });
|
|
42
|
+
}
|
|
43
|
+
componentWillLoad() {
|
|
44
|
+
this.initializeApi();
|
|
45
|
+
}
|
|
46
|
+
initializeApi() {
|
|
47
|
+
if (!this.authToken) {
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
this.getOwner = makeGetIdentity({
|
|
51
|
+
authToken: this.authToken,
|
|
52
|
+
identityId: this.ownerId,
|
|
53
|
+
service: new IdentityService()
|
|
54
|
+
});
|
|
55
|
+
this.patchOwner = makePatchIdentity({
|
|
56
|
+
authToken: this.authToken,
|
|
57
|
+
identityId: this.ownerId,
|
|
58
|
+
service: new IdentityService()
|
|
59
|
+
});
|
|
60
|
+
this.postOwner = makePostIdentity({
|
|
61
|
+
authToken: this.authToken,
|
|
62
|
+
service: new IdentityService()
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
render() {
|
|
66
|
+
return (h("owner-form-core", { key: '332d1e77d01886f13aba09b32b2d5f2199131619', ownerId: this.ownerId, businessId: this.businessId, getOwner: this.getOwner, patchOwner: this.patchOwner, postOwner: this.postOwner, allowOptionalFields: this.allowOptionalFields, removeOwner: this.removeOwner, newFormOpen: this.newFormOpen, ownersLength: this.ownersLength, ref: ref => this.coreComponent = ref }));
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
const BusinessOwnerFormCore = class {
|
|
71
|
+
loadingWatcher() {
|
|
72
|
+
this.formLoading.emit(this.isLoading);
|
|
73
|
+
}
|
|
74
|
+
constructor(hostRef) {
|
|
75
|
+
registerInstance(this, hostRef);
|
|
76
|
+
this.submitted = createEvent(this, "submitted", 7);
|
|
77
|
+
this.ownerSubmitted = createEvent(this, "ownerSubmitted", 7);
|
|
78
|
+
this.clickEvent = createEvent(this, "click-event", 7);
|
|
79
|
+
this.formLoading = createEvent(this, "formLoading", 7);
|
|
80
|
+
this.errorEvent = createEvent(this, "error-event", 7);
|
|
81
|
+
this.getData = () => {
|
|
82
|
+
this.isLoading = true;
|
|
83
|
+
this.getOwner({
|
|
84
|
+
onSuccess: (response) => {
|
|
85
|
+
this.instantiateOwner(response.data);
|
|
86
|
+
},
|
|
87
|
+
onError: ({ error, code, severity }) => {
|
|
88
|
+
this.errorEvent.emit({
|
|
89
|
+
message: error,
|
|
90
|
+
errorCode: code,
|
|
91
|
+
severity: severity
|
|
92
|
+
});
|
|
93
|
+
},
|
|
94
|
+
final: () => this.isLoading = false
|
|
95
|
+
});
|
|
96
|
+
};
|
|
97
|
+
this.sendData = () => {
|
|
98
|
+
this.isLoading = true;
|
|
99
|
+
return new Promise((resolve) => {
|
|
100
|
+
if (this.ownerId) {
|
|
101
|
+
this.patchOwner({
|
|
102
|
+
payload: this.payload,
|
|
103
|
+
onSuccess: (response) => {
|
|
104
|
+
this.submitted.emit({
|
|
105
|
+
data: response,
|
|
106
|
+
metadata: { ownerID: response.data.id }
|
|
107
|
+
});
|
|
108
|
+
this.ownerSubmitted.emit({ id: response.data.id });
|
|
109
|
+
this.instantiateOwner(response.data);
|
|
110
|
+
resolve(true);
|
|
111
|
+
},
|
|
112
|
+
onError: ({ error, code, severity }) => {
|
|
113
|
+
this.submitted.emit({ data: { error } });
|
|
114
|
+
this.errorEvent.emit({
|
|
115
|
+
message: error,
|
|
116
|
+
errorCode: code,
|
|
117
|
+
severity: severity
|
|
118
|
+
});
|
|
119
|
+
resolve(false);
|
|
120
|
+
},
|
|
121
|
+
final: () => this.isLoading = false
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
else {
|
|
125
|
+
this.postOwner({
|
|
126
|
+
payload: this.payload,
|
|
127
|
+
onSuccess: (response) => {
|
|
128
|
+
this.submitted.emit({
|
|
129
|
+
data: response,
|
|
130
|
+
metadata: { ownerID: response.data.id }
|
|
131
|
+
});
|
|
132
|
+
this.ownerSubmitted.emit({ id: response.data.id });
|
|
133
|
+
this.instantiateOwner(response.data);
|
|
134
|
+
resolve(true);
|
|
135
|
+
},
|
|
136
|
+
onError: ({ error, code, severity }) => {
|
|
137
|
+
this.submitted.emit({ data: { error } });
|
|
138
|
+
this.errorEvent.emit({
|
|
139
|
+
message: error,
|
|
140
|
+
errorCode: code,
|
|
141
|
+
severity: severity
|
|
142
|
+
});
|
|
143
|
+
resolve(false);
|
|
144
|
+
},
|
|
145
|
+
final: () => this.isLoading = false
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
});
|
|
149
|
+
};
|
|
150
|
+
this.instantiateOwner = async (data) => {
|
|
151
|
+
this.owner = Object.assign({}, new Owner(data));
|
|
152
|
+
await this.formController.setInitialValues(this.owner);
|
|
153
|
+
};
|
|
154
|
+
this.handleAddOwner = () => {
|
|
155
|
+
const eventName = this.ownerId ? BusinessFormClickActions.updateOwner : BusinessFormClickActions.addOwner;
|
|
156
|
+
this.clickEvent.emit({ name: eventName });
|
|
157
|
+
};
|
|
158
|
+
this.handleRemoveOwner = () => {
|
|
159
|
+
this.removeOwner(this.ownerId);
|
|
160
|
+
this.clickEvent.emit({ name: BusinessFormClickActions.removeOwner });
|
|
161
|
+
};
|
|
162
|
+
this.isLoading = false;
|
|
163
|
+
this.formController = undefined;
|
|
164
|
+
this.errors = {};
|
|
165
|
+
this.owner = {};
|
|
166
|
+
this.ownerId = undefined;
|
|
167
|
+
this.businessId = undefined;
|
|
168
|
+
this.getOwner = undefined;
|
|
169
|
+
this.patchOwner = undefined;
|
|
170
|
+
this.postOwner = undefined;
|
|
171
|
+
this.allowOptionalFields = undefined;
|
|
172
|
+
this.removeOwner = undefined;
|
|
173
|
+
this.newFormOpen = undefined;
|
|
174
|
+
this.ownersLength = undefined;
|
|
175
|
+
this.validate = this.validate.bind(this);
|
|
176
|
+
this.submit = this.submit.bind(this);
|
|
177
|
+
this.validateAndSubmit = this.validateAndSubmit.bind(this);
|
|
178
|
+
}
|
|
179
|
+
async returnOwnerData() {
|
|
180
|
+
return this.ownerId;
|
|
181
|
+
}
|
|
182
|
+
async validate() {
|
|
183
|
+
return this.formController.validate();
|
|
184
|
+
}
|
|
185
|
+
async submit() {
|
|
186
|
+
const isValid = await this.validate();
|
|
187
|
+
if (isValid) {
|
|
188
|
+
return this.sendData();
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
async validateAndSubmit(event) {
|
|
192
|
+
event.preventDefault();
|
|
193
|
+
const isValid = await this.validate();
|
|
194
|
+
if (isValid) {
|
|
195
|
+
this.submit();
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
get payload() {
|
|
199
|
+
let formValues = parseIdentityInfo(this.formController.values.getValue());
|
|
200
|
+
if (this.ownerId) {
|
|
201
|
+
return JSON.stringify(formValues);
|
|
202
|
+
}
|
|
203
|
+
else {
|
|
204
|
+
return JSON.stringify(Object.assign(Object.assign({}, formValues), { business_id: this.businessId }));
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
get formTitle() {
|
|
208
|
+
return this.ownerId ? 'Edit Business Owner' : 'Add Business Owner';
|
|
209
|
+
}
|
|
210
|
+
get submitButtonText() {
|
|
211
|
+
return this.ownerId ? 'Update' : 'Add';
|
|
212
|
+
}
|
|
213
|
+
get showRemoveButton() {
|
|
214
|
+
const blankForm = !this.ownerId && this.newFormOpen;
|
|
215
|
+
if (this.ownersLength <= 1) {
|
|
216
|
+
return false;
|
|
217
|
+
}
|
|
218
|
+
else {
|
|
219
|
+
if (blankForm) {
|
|
220
|
+
return true;
|
|
221
|
+
}
|
|
222
|
+
else if (this.ownerId && !this.newFormOpen) {
|
|
223
|
+
return true;
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
componentWillLoad() {
|
|
228
|
+
this.formController = new FormController(identitySchema('owner', this.allowOptionalFields));
|
|
229
|
+
this.ownerId ? this.getData() : this.instantiateOwner({});
|
|
230
|
+
}
|
|
231
|
+
componentDidLoad() {
|
|
232
|
+
this.formController.errors.subscribe(errors => (this.errors = Object.assign({}, errors)));
|
|
233
|
+
}
|
|
234
|
+
render() {
|
|
235
|
+
return (h("form", { key: 'b2e2aaced859260e9d2ef59bc3f8a0763d05872c', onSubmit: this.validateAndSubmit }, h("fieldset", { key: '2a93ddb4c945be0ec081ce31d6d9eff4b302d622' }, h("legend", { key: 'ea9859e55099e3f8263024d884edfb48b3666eaa', class: "fw-semibold fs-5" }, this.formTitle), h("br", { key: 'f646c1ecc544c358d87e701aba8e151fcb96c54e' }), h("div", { key: '874bf4ebd7cef0afbdee96fa4d5679b6d683b0f0', class: "row gy-3" }, h("owner-form-inputs", { key: '866dbf0002ec1ac70d7942c6011c67f8cd144960', ownerDefaultValue: this.formController.getInitialValues(), errors: this.errors, formController: this.formController }), h("div", { key: '15d907270ecf3d16769cedea39ba279d7ffb0748', class: "d-flex gap-2 justify-content-start" }, h(Button, { key: '84c09ef594e7fa387e64a09014de81ed713cc765', variant: "secondary", type: "button", onClick: this.handleRemoveOwner, hidden: !this.showRemoveButton }, "Remove"), h(Button, { key: '1dafd97aa7b84644c9d011224a152ad7f99ce620', variant: "primary", type: "submit", onClick: this.handleAddOwner, disabled: this.isLoading }, this.submitButtonText))), h("hr", { key: 'f1f31da4d147afcd01ef96acd01d63ee9497dd6b' }))));
|
|
236
|
+
}
|
|
237
|
+
static get watchers() { return {
|
|
238
|
+
"isLoading": ["loadingWatcher"]
|
|
239
|
+
}; }
|
|
240
|
+
};
|
|
241
|
+
|
|
242
|
+
const BusinessOwnerFormInputs = class {
|
|
243
|
+
constructor(hostRef) {
|
|
244
|
+
registerInstance(this, hostRef);
|
|
245
|
+
this.inputHandler = (name, value) => {
|
|
246
|
+
updateFormValues(this.formController, { [name]: value });
|
|
247
|
+
};
|
|
248
|
+
this.onAddressFormUpdate = (values) => {
|
|
249
|
+
updateAddressFormValues(this.formController, Object.assign(Object.assign({}, this.formController.values.getValue().address), values));
|
|
250
|
+
};
|
|
251
|
+
this.ownerDefaultValue = undefined;
|
|
252
|
+
this.errors = undefined;
|
|
253
|
+
this.formController = undefined;
|
|
254
|
+
}
|
|
255
|
+
render() {
|
|
256
|
+
return (h("div", { key: '6fcc165d4bc75b92403d9031ad98f05f6b1dcd34', class: 'row gy-3' }, h("div", { key: '74f1e42a13892e95497a99684ba9de64719edb72', class: 'col-12 col-md-6' }, h("form-control-text", { key: '29caea2b0b0a62822cc20c99e697f3db7c22a541', name: 'name', label: 'Full Name', defaultValue: this.ownerDefaultValue.name, errorText: this.errors.name, inputHandler: this.inputHandler })), h("div", { key: '5b0f8da9a0512de70558baa9cb188b4d5e773dc2', class: 'col-12 col-md-4' }, h("form-control-text", { key: '5967094f115a64876f8dc943a273f5a22b193f1c', name: 'title', label: 'Title', defaultValue: this.ownerDefaultValue.title, errorText: this.errors.title, inputHandler: this.inputHandler })), h("div", { key: '6c05fec9b87f8ba5e3be9ce74ef727a1e4b14905', class: 'col-12 col-md-6' }, h("form-control-text", { key: '8c5b2839b6de605915d8e7c14a0ba22d3f440bda', name: 'email', label: 'Email Address', defaultValue: this.ownerDefaultValue.email, errorText: this.errors.email, inputHandler: this.inputHandler })), h("div", { key: 'd7eae882aea84b8562e459e66bc1ba885c4be3c7', class: 'col-12 col-md-6' }, h("form-control-number-masked", { key: '2d6b33f47e4008745fd65c5ef3cb60dd92b85eba', name: 'phone', label: 'Phone Number', defaultValue: this.ownerDefaultValue.phone, errorText: this.errors.phone, inputHandler: this.inputHandler, mask: PHONE_MASKS.US })), h("div", { key: '92b825163aedf052bdb89721397da69c717e595d', class: 'col-12 col-md-4' }, h("form-control-date", { key: 'cd884b773ef0eb60effc61e8cfbf42b21620cd1c', name: 'dob_full', label: 'Birth Date', defaultValue: this.ownerDefaultValue.dob_full, errorText: this.errors.dob_full, inputHandler: this.inputHandler, onFormControlInput: (e) => updateDateOfBirthFormValues(e, this.formController) })), h("div", { key: '614ba65972946645ba5c7a299c00efd0e85abf5e', class: 'col-12 col-md-8' }, h("form-control-number-masked", { key: '7cd9fe7a1b56d351942a0b962f3c7227459406ae', name: 'identification_number', label: 'SSN', defaultValue: this.ownerDefaultValue.identification_number, errorText: this.errors.identification_number, inputHandler: this.inputHandler, mask: SSN_MASK })), h("div", { key: 'ce08f35a16de4b9be65377cde0a9daa5b4cbe876', class: 'col-12' }, h("justifi-identity-address-form", { key: '79a7f5e8c08fc57383c1975145a6b06bd4e615dd', errors: this.errors.address, defaultValues: this.ownerDefaultValue.address, handleFormUpdate: this.onAddressFormUpdate }))));
|
|
257
|
+
}
|
|
258
|
+
;
|
|
259
|
+
};
|
|
260
|
+
|
|
261
|
+
export { BusinessOwnerForm as justifi_owner_form, BusinessOwnerFormCore as owner_form_core, BusinessOwnerFormInputs as owner_form_inputs };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { r as registerInstance, h, H as Host } from './p-fad19d75.js';
|
|
2
|
+
import { E as ExtendedPagingDefaults } from './p-56f6ce4c.js';
|
|
3
|
+
|
|
4
|
+
const PaginationMenu = class {
|
|
5
|
+
constructor(hostRef) {
|
|
6
|
+
registerInstance(this, hostRef);
|
|
7
|
+
this.paging = ExtendedPagingDefaults;
|
|
8
|
+
this.params = {};
|
|
9
|
+
}
|
|
10
|
+
render() {
|
|
11
|
+
return (h(Host, { key: '645df5028861aa714a814f908ccace8dcd0986f8', exportparts: `page-arrow,page-button,page-button-disabled,page-button-text` }, h("nav", { key: '6cb86ce01c625db9c31204f63258570f8a5d0a0f', "aria-label": "Table pagination", class: "d-flex justify-content-end gap-3" }, h("ul", { key: '7ffb5771a1c51553d64735721b937e53c699949d', class: "pagination m-0" }, h("li", { key: 'b439c2f7fe81ccdfa29670a6fc04715681ed5ab3', class: `page-item ${this.paging.has_previous ? '' : ' disabled'}` }, h("a", { key: 'dc59152e834a3076f09304f6fcd0195058ebefec', href: "#", class: "page-link", onClick: (e) => {
|
|
12
|
+
e.preventDefault();
|
|
13
|
+
this.paging.handleClickPrevious(this.paging.start_cursor);
|
|
14
|
+
}, part: `page-button${this.paging.has_previous ? '' : ' page-button-disabled'}` }, h("span", { key: 'fc640fb9ae2ca672bfed89d23c5641cb346c673d', class: "me-1", part: "page-arrow" }, "\u00AB"), h("span", { key: 'fb6fcd31ebd4d194b37f53a071537133b8c4d369', part: "page-button-text" }, "Previous"))), h("li", { key: 'b10e12ec7bc4a89cd897e868ec7b303c62599cd3', class: `page-item ${this.paging.has_next ? '' : ' disabled'}` }, h("a", { key: '51f91eb7cfef91dcbcfd9f11522213308bf717b5', href: "#", class: "page-link", onClick: (e) => {
|
|
15
|
+
e.preventDefault();
|
|
16
|
+
this.paging.handleClickNext(this.paging.end_cursor);
|
|
17
|
+
}, part: `page-button${this.paging.has_next ? '' : ' page-button-disabled'}` }, h("span", { key: 'd89f50a44dead676d19b8862a92ba636947fe6b1', part: "page-button-text" }, "Next"), h("span", { key: 'f5dd2ddddef86931d935df56101f1fed8118e4f6', class: "ms-1", part: "page-arrow" }, "\u00BB")))))));
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export { PaginationMenu as pagination_menu };
|
|
@@ -1 +1,10 @@
|
|
|
1
|
-
const
|
|
1
|
+
const pagingDefaults = {
|
|
2
|
+
amount: 25,
|
|
3
|
+
start_cursor: '',
|
|
4
|
+
end_cursor: '',
|
|
5
|
+
has_previous: false,
|
|
6
|
+
has_next: false,
|
|
7
|
+
};
|
|
8
|
+
const ExtendedPagingDefaults = Object.assign(Object.assign({}, pagingDefaults), { handleClickNext: () => { }, handleClickPrevious: () => { } });
|
|
9
|
+
|
|
10
|
+
export { ExtendedPagingDefaults as E, pagingDefaults as p };
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './p-fad19d75.js';
|
|
2
|
+
|
|
3
|
+
const NumberInput = class {
|
|
4
|
+
constructor(hostRef) {
|
|
5
|
+
registerInstance(this, hostRef);
|
|
6
|
+
this.formControlInput = createEvent(this, "formControlInput", 7);
|
|
7
|
+
this.formControlBlur = createEvent(this, "formControlBlur", 7);
|
|
8
|
+
this.handleFormControlInput = (event) => {
|
|
9
|
+
const target = event.target;
|
|
10
|
+
const name = target.getAttribute('name');
|
|
11
|
+
this.inputHandler(name, target.value);
|
|
12
|
+
this.formControlInput.emit({ name, value: target.value });
|
|
13
|
+
};
|
|
14
|
+
this.updateInput = (newValue) => {
|
|
15
|
+
const inputElement = this.el.querySelector('input');
|
|
16
|
+
if (inputElement) {
|
|
17
|
+
inputElement.value = newValue || '';
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
this.label = undefined;
|
|
21
|
+
this.name = undefined;
|
|
22
|
+
this.helpText = undefined;
|
|
23
|
+
this.errorText = undefined;
|
|
24
|
+
this.defaultValue = undefined;
|
|
25
|
+
this.inputHandler = undefined;
|
|
26
|
+
this.disabled = undefined;
|
|
27
|
+
}
|
|
28
|
+
handleDefaultValueChange(newValue) {
|
|
29
|
+
this.updateInput(newValue);
|
|
30
|
+
}
|
|
31
|
+
componentDidLoad() {
|
|
32
|
+
this.updateInput(this.defaultValue);
|
|
33
|
+
}
|
|
34
|
+
render() {
|
|
35
|
+
return (h(Host, { key: 'dd43d75b327c05e75b453b954346c6ffcd85a2f5', exportparts: 'label,input,input-invalid' }, h("div", { key: '5215f62251bd89be493ddffe46bf0c466b42e314', class: 'form-group d-flex flex-column' }, h("label", { key: 'f0409970f8d43bcdef92b81363cc24aa1bb691a0', part: "label", class: "form-label", htmlFor: this.name }, this.label), h("input", { key: '9c6a5899e64ba1a8af6af80c63b6a0895351da63', id: this.name, name: this.name, onBlur: this.formControlBlur.emit, onInput: this.handleFormControlInput, part: `input ${this.errorText && 'input-invalid'}`, class: this.errorText ? 'form-control is-invalid' : 'form-control', type: "number", disabled: this.disabled }), h("form-control-help-text", { key: 'cd7b4a724427383cafc04137f6feca473695b020', helpText: this.helpText, name: this.name }), h("form-control-error-text", { key: '04748d3c5b1067b0312a2b7c36369e2a21a7215f', errorText: this.errorText, name: this.name }))));
|
|
36
|
+
}
|
|
37
|
+
get el() { return getElement(this); }
|
|
38
|
+
static get watchers() { return {
|
|
39
|
+
"defaultValue": ["handleDefaultValueChange"]
|
|
40
|
+
}; }
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
export { NumberInput as form_control_number };
|