@justifi/webcomponents 4.19.1-rc → 4.19.1-rc-4
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-0b3db49d.js → Analytics-985bc298.js} +2 -3
- package/dist/cjs/{business.service-c384784d.js → business.service-6bb7ac82.js} +5 -6
- package/dist/cjs/{get-payout-csv-51a02be7.js → get-payout-csv-1391ff3e.js} +3 -4
- package/dist/cjs/justifi-additional-questions-form-step_10.cjs.entry.js +7 -8
- package/dist/cjs/justifi-bank-account-form.cjs.entry.js +4 -5
- package/dist/cjs/justifi-business-details.cjs.entry.js +3 -4
- package/dist/cjs/justifi-business-form.cjs.entry.js +4 -5
- package/dist/cjs/justifi-card-form.cjs.entry.js +4 -5
- package/dist/cjs/justifi-checkout-core.cjs.entry.js +3 -3
- package/dist/cjs/justifi-checkout.cjs.entry.js +4 -5
- package/dist/cjs/justifi-gross-payment-chart.cjs.entry.js +3 -4
- package/dist/cjs/justifi-new-payment-method_4.cjs.entry.js +11 -9
- package/dist/cjs/justifi-owner-form_3.cjs.entry.js +1 -2
- package/dist/cjs/justifi-payment-details.cjs.entry.js +3 -4
- package/dist/cjs/justifi-payment-form.cjs.entry.js +5 -6
- package/dist/cjs/justifi-payment-method-form.cjs.entry.js +1 -1
- package/dist/cjs/justifi-payment-provisioning.cjs.entry.js +5 -6
- package/dist/cjs/justifi-payments-list.cjs.entry.js +3 -4
- package/dist/cjs/justifi-payout-details.cjs.entry.js +3 -4
- package/dist/cjs/justifi-payouts-list.cjs.entry.js +3 -4
- package/dist/cjs/justifi-refund-form.cjs.entry.js +2 -3
- package/dist/cjs/justifi-season-interruption-insurance.cjs.entry.js +4 -5
- package/dist/cjs/{package-39dc73ed.js → package-cbc08fe3.js} +2 -4
- package/dist/cjs/{payment.service-2dbfb83d.js → payment.service-dfcfa19b.js} +2 -3
- package/dist/collection/api/services/analytics.service.js +1 -2
- package/dist/collection/api/services/business.service.js +5 -6
- package/dist/collection/api/services/checkout.service.js +2 -3
- package/dist/collection/api/services/insurance.service.js +2 -3
- package/dist/collection/api/services/payment.service.js +2 -3
- package/dist/collection/api/services/payout.service.js +3 -4
- package/dist/collection/api/services/provision.service.js +2 -4
- package/dist/collection/api/services/reports.service.js +1 -2
- package/dist/collection/components/bank-account-form/bank-account-form.js +3 -4
- package/dist/collection/components/business-forms/business-form/business-form.js +2 -3
- package/dist/collection/components/business-forms/payment-provisioning/bank-account/business-bank-account-form-step.js +2 -3
- package/dist/collection/components/business-forms/payment-provisioning/document-uploads/business-document-upload-form-step.js +2 -3
- package/dist/collection/components/business-forms/payment-provisioning/terms-and-conditions/business-terms-conditions-form-step.js +2 -3
- package/dist/collection/components/card-form/card-form.js +3 -4
- package/dist/collection/components/checkout/checkout-core.js +4 -4
- package/dist/collection/components/checkout/new-payment-method.js +6 -4
- package/dist/collection/components/checkout/payment-method-options.js +3 -4
- package/dist/collection/components/checkout/saved-payment-method.js +3 -4
- package/dist/collection/components/checkout/sezzle-payment-method.js +3 -4
- package/dist/collection/components/payment-form/payment-form.js +3 -4
- package/dist/collection/components/refund-form/refund-form.js +2 -3
- package/dist/docs.json +8 -8
- package/dist/esm/{Analytics-37556050.js → Analytics-79e20e2d.js} +2 -3
- package/dist/esm/{business.service-eee46ab1.js → business.service-f45decfc.js} +5 -6
- package/dist/esm/{get-payout-csv-4d6b29d8.js → get-payout-csv-e784a2ab.js} +3 -4
- package/dist/esm/justifi-additional-questions-form-step_10.entry.js +7 -8
- package/dist/esm/justifi-bank-account-form.entry.js +4 -5
- package/dist/esm/justifi-business-details.entry.js +3 -4
- package/dist/esm/justifi-business-form.entry.js +4 -5
- package/dist/esm/justifi-card-form.entry.js +4 -5
- package/dist/esm/justifi-checkout-core.entry.js +3 -3
- package/dist/esm/justifi-checkout.entry.js +4 -5
- package/dist/esm/justifi-gross-payment-chart.entry.js +3 -4
- package/dist/esm/justifi-new-payment-method_4.entry.js +11 -9
- package/dist/esm/justifi-owner-form_3.entry.js +1 -2
- package/dist/esm/justifi-payment-details.entry.js +3 -4
- package/dist/esm/justifi-payment-form.entry.js +5 -6
- package/dist/esm/justifi-payment-method-form.entry.js +1 -1
- package/dist/esm/justifi-payment-provisioning.entry.js +5 -6
- package/dist/esm/justifi-payments-list.entry.js +3 -4
- package/dist/esm/justifi-payout-details.entry.js +3 -4
- package/dist/esm/justifi-payouts-list.entry.js +3 -4
- package/dist/esm/justifi-refund-form.entry.js +2 -3
- package/dist/esm/justifi-season-interruption-insurance.entry.js +4 -5
- package/dist/esm/{package-e2a7aa3f.js → package-cf64a48c.js} +2 -4
- package/dist/esm/{payment.service-9005a501.js → payment.service-dad5153b.js} +2 -3
- package/dist/globals.d.ts +2 -0
- package/dist/module/Analytics.js +1 -2
- package/dist/module/business-bank-account-form-step.js +2 -3
- package/dist/module/business-document-upload-form-step.js +2 -3
- package/dist/module/business-terms-conditions-form-step.js +2 -3
- package/dist/module/business.service.js +5 -6
- package/dist/module/checkout-core.js +3 -3
- package/dist/module/get-payout-csv.js +3 -4
- package/dist/module/justifi-bank-account-form.js +2 -3
- package/dist/module/justifi-business-form.js +2 -3
- package/dist/module/justifi-card-form.js +2 -3
- package/dist/module/justifi-checkout.js +2 -3
- package/dist/module/justifi-gross-payment-chart.js +1 -2
- package/dist/module/justifi-payment-form.js +3 -4
- package/dist/module/justifi-payment-provisioning.js +2 -3
- package/dist/module/justifi-refund-form.js +2 -3
- package/dist/module/justifi-season-interruption-insurance.js +2 -3
- package/dist/module/new-payment-method.js +5 -3
- package/dist/module/package.js +2 -4
- package/dist/module/payment-method-options.js +2 -3
- package/dist/module/payment.service.js +2 -3
- package/dist/module/saved-payment-method.js +2 -3
- package/dist/module/sezzle-payment-method.js +2 -3
- 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-02c58e00.entry.js +97 -0
- package/dist/webcomponents/p-03d35880.entry.js +130 -0
- package/dist/webcomponents/p-05f46d63.entry.js +99 -0
- package/dist/webcomponents/p-06ff0429.entry.js +65 -0
- package/dist/webcomponents/p-08b0fb31.js +41 -1
- package/dist/webcomponents/p-14c91ffd.js +20 -1
- 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-258b1ee2.entry.js +149 -0
- package/dist/webcomponents/p-25d8cd65.entry.js +102 -0
- package/dist/webcomponents/p-29c0b182.js +114 -1
- package/dist/webcomponents/p-2b6c9c4f.js +7 -1
- package/dist/webcomponents/p-2eab3c90.js +3052 -1
- package/dist/webcomponents/p-3e9ef4a8.js +28 -0
- package/dist/webcomponents/p-3fd13ca3.js +52 -1
- package/dist/webcomponents/p-492588bf.js +79 -0
- package/dist/webcomponents/p-525db3e8.js +22 -1
- 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-5cb3f0b2.entry.js +261 -0
- package/dist/webcomponents/p-5f835b89.entry.js +606 -0
- package/dist/webcomponents/p-6053809a.entry.js +80 -0
- package/dist/webcomponents/p-6078a370.js +244 -1
- package/dist/webcomponents/p-66e4869f.entry.js +75 -0
- package/dist/webcomponents/p-6f1c56d4.entry.js +94 -0
- package/dist/webcomponents/p-70a2aa74.entry.js +76 -0
- package/dist/webcomponents/p-7582b554.entry.js +18 -0
- package/dist/webcomponents/p-79646550.entry.js +61 -0
- package/dist/webcomponents/p-7a70ff09.entry.js +133 -0
- package/dist/webcomponents/p-7bbf73bd.entry.js +117 -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-890088fc.entry.js +298 -0
- 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-9282eab8.js +77 -0
- package/dist/webcomponents/p-96c12fef.entry.js +73 -0
- package/dist/webcomponents/p-9c9c7dac.js +24 -1
- package/dist/webcomponents/p-9f94bbb6.entry.js +118 -0
- package/dist/webcomponents/p-9fd108be.entry.js +74 -0
- package/dist/webcomponents/p-a5a225d9.entry.js +125 -0
- package/dist/webcomponents/p-a5c5821e.entry.js +101 -0
- package/dist/webcomponents/p-a5fb51dc.entry.js +131 -0
- package/dist/webcomponents/p-a6d04afc.js +44 -0
- package/dist/webcomponents/p-ac086069.entry.js +58 -0
- package/dist/webcomponents/p-acbac8b8.entry.js +131 -0
- package/dist/webcomponents/p-adc30a61.entry.js +145 -0
- package/dist/webcomponents/p-af244664.js +126 -1
- package/dist/webcomponents/p-b6e3d7ed.entry.js +94 -0
- 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-c636f563.entry.js +791 -0
- package/dist/webcomponents/p-cb26f708.js +18 -0
- package/dist/webcomponents/p-d17aee2b.entry.js +26 -0
- package/dist/webcomponents/p-d89bad72.js +39 -1
- 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-e333620e.js +34 -1
- package/dist/webcomponents/p-e356f280.entry.js +29 -0
- package/dist/webcomponents/p-e3e5f95f.entry.js +98 -0
- package/dist/webcomponents/p-e3fab0e2.js +43 -1
- package/dist/webcomponents/p-eb5dbd23.entry.js +1684 -0
- package/dist/webcomponents/p-ec854a3e.entry.js +11053 -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 +2 -4
- package/dist/cjs/config-037e67d0.js +0 -15
- package/dist/config.js +0 -11
- package/dist/esm/config-58e393e2.js +0 -13
- package/dist/module/config.js +0 -13
- package/dist/types/home/runner/work/web-component-library/web-component-library/packages/webcomponents/.stencil/packages/webcomponents/config.d.ts +0 -11
- package/dist/webcomponents/p-023779ee.entry.js +0 -1
- package/dist/webcomponents/p-037763f4.entry.js +0 -1
- package/dist/webcomponents/p-07109641.entry.js +0 -1
- package/dist/webcomponents/p-0f7b9555.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-1f6afff9.entry.js +0 -1
- package/dist/webcomponents/p-246a6c6a.entry.js +0 -1
- package/dist/webcomponents/p-2d3b1692.entry.js +0 -1
- package/dist/webcomponents/p-30a493cd.entry.js +0 -1
- package/dist/webcomponents/p-32286934.js +0 -1
- package/dist/webcomponents/p-3f5e7e86.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-4abc17f0.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-57e1f2fd.js +0 -1
- package/dist/webcomponents/p-5f095525.entry.js +0 -1
- package/dist/webcomponents/p-62b32c4c.entry.js +0 -1
- package/dist/webcomponents/p-69faef3f.entry.js +0 -1
- package/dist/webcomponents/p-6c078cd1.js +0 -1
- package/dist/webcomponents/p-8e541a32.entry.js +0 -1
- package/dist/webcomponents/p-8f325782.entry.js +0 -1
- package/dist/webcomponents/p-987b5de2.entry.js +0 -1
- package/dist/webcomponents/p-a63fc384.entry.js +0 -1
- package/dist/webcomponents/p-a8220709.entry.js +0 -1
- package/dist/webcomponents/p-ae530971.entry.js +0 -1
- package/dist/webcomponents/p-b7cf49f4.entry.js +0 -1
- package/dist/webcomponents/p-b87b27ba.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-c28db166.js +0 -1
- package/dist/webcomponents/p-c9f8f7ec.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-edac2b43.entry.js +0 -1
- package/dist/webcomponents/p-ef23c091.entry.js +0 -1
- package/dist/webcomponents/p-f06910aa.entry.js +0 -1
- package/dist/webcomponents/p-f0866375.entry.js +0 -1
- package/dist/webcomponents/p-f0a06884.entry.js +0 -1
- package/dist/webcomponents/p-f2f94d9f.entry.js +0 -1
- package/dist/webcomponents/p-f49b7170.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,80 @@
|
|
|
1
|
+
import { r as registerInstance, c as createEvent, h, H as Host } from './p-fad19d75.js';
|
|
2
|
+
import { E as ErrorState } from './p-dce846bf.js';
|
|
3
|
+
import { B as BusinessService } from './p-3e9ef4a8.js';
|
|
4
|
+
import { B as Business } from './p-af244664.js';
|
|
5
|
+
import { C as ComponentErrorSeverity, a as ComponentErrorCodes } from './p-14c91ffd.js';
|
|
6
|
+
import { g as getErrorMessage, a as getErrorCode } from './p-8115b2f4.js';
|
|
7
|
+
import { J as JustifiAnalytics } from './p-9282eab8.js';
|
|
8
|
+
import './p-29c0b182.js';
|
|
9
|
+
import './p-1ff8810b.js';
|
|
10
|
+
import './p-6078a370.js';
|
|
11
|
+
import './p-492588bf.js';
|
|
12
|
+
|
|
13
|
+
const makeGetBusiness = ({ id, authToken, service }) => async ({ onSuccess, onError }) => {
|
|
14
|
+
var _a;
|
|
15
|
+
try {
|
|
16
|
+
const response = await service.fetchBusiness(id, authToken);
|
|
17
|
+
if (!response.error) {
|
|
18
|
+
onSuccess({ business: new Business(response.data) });
|
|
19
|
+
}
|
|
20
|
+
else {
|
|
21
|
+
const responseError = getErrorMessage(response.error);
|
|
22
|
+
const code = getErrorCode((_a = response.error) === null || _a === void 0 ? void 0 : _a.code);
|
|
23
|
+
return onError({
|
|
24
|
+
error: responseError,
|
|
25
|
+
code,
|
|
26
|
+
severity: ComponentErrorSeverity.ERROR,
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
catch (error) {
|
|
31
|
+
const code = getErrorCode(error === null || error === void 0 ? void 0 : error.code);
|
|
32
|
+
return onError({
|
|
33
|
+
error: error.message || error,
|
|
34
|
+
code,
|
|
35
|
+
severity: ComponentErrorSeverity.ERROR,
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
const BusinessDetails = class {
|
|
41
|
+
constructor(hostRef) {
|
|
42
|
+
registerInstance(this, hostRef);
|
|
43
|
+
this.errorEvent = createEvent(this, "error-event", 7);
|
|
44
|
+
this.businessId = undefined;
|
|
45
|
+
this.authToken = undefined;
|
|
46
|
+
this.errorMessage = undefined;
|
|
47
|
+
this.getBusiness = undefined;
|
|
48
|
+
}
|
|
49
|
+
componentWillLoad() {
|
|
50
|
+
this.analytics = new JustifiAnalytics(this);
|
|
51
|
+
this.initializeGetBusiness();
|
|
52
|
+
}
|
|
53
|
+
disconnectedCallback() {
|
|
54
|
+
this.analytics.cleanup();
|
|
55
|
+
}
|
|
56
|
+
initializeGetBusiness() {
|
|
57
|
+
if (!this.businessId || !this.authToken) {
|
|
58
|
+
this.errorMessage = 'Invalid business id or auth token';
|
|
59
|
+
this.errorEvent.emit({
|
|
60
|
+
errorCode: ComponentErrorCodes.MISSING_PROPS,
|
|
61
|
+
message: this.errorMessage,
|
|
62
|
+
severity: ComponentErrorSeverity.ERROR,
|
|
63
|
+
});
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
this.getBusiness = makeGetBusiness({
|
|
67
|
+
id: this.businessId,
|
|
68
|
+
authToken: this.authToken,
|
|
69
|
+
service: new BusinessService(),
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
render() {
|
|
73
|
+
if (this.errorMessage) {
|
|
74
|
+
return h(Host, null, ErrorState(this.errorMessage));
|
|
75
|
+
}
|
|
76
|
+
return (h(Host, null, h("business-details-core", { getBusiness: this.getBusiness })));
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
export { BusinessDetails as justifi_business_details };
|
|
@@ -1 +1,244 @@
|
|
|
1
|
-
const
|
|
1
|
+
const StateOptions = [
|
|
2
|
+
{
|
|
3
|
+
label: 'Choose state',
|
|
4
|
+
value: '',
|
|
5
|
+
},
|
|
6
|
+
{
|
|
7
|
+
label: 'Alabama',
|
|
8
|
+
value: 'AL',
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
label: 'Alaska',
|
|
12
|
+
value: 'AK',
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
label: 'American Samoa',
|
|
16
|
+
value: 'AS',
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
label: 'Arizona',
|
|
20
|
+
value: 'AZ',
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
label: 'Arkansas',
|
|
24
|
+
value: 'AR',
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
label: 'California',
|
|
28
|
+
value: 'CA',
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
label: 'Colorado',
|
|
32
|
+
value: 'CO',
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
label: 'Connecticut',
|
|
36
|
+
value: 'CT',
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
label: 'Delaware',
|
|
40
|
+
value: 'DE',
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
label: 'District Of Columbia',
|
|
44
|
+
value: 'DC',
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
label: 'Federated States Of Micronesia',
|
|
48
|
+
value: 'FM',
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
label: 'Florida',
|
|
52
|
+
value: 'FL',
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
label: 'Georgia',
|
|
56
|
+
value: 'GA',
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
label: 'Guam',
|
|
60
|
+
value: 'GU',
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
label: 'Hawaii',
|
|
64
|
+
value: 'HI',
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
label: 'Idaho',
|
|
68
|
+
value: 'ID',
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
label: 'Illinois',
|
|
72
|
+
value: 'IL',
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
label: 'Indiana',
|
|
76
|
+
value: 'IN',
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
label: 'Iowa',
|
|
80
|
+
value: 'IA',
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
label: 'Kansas',
|
|
84
|
+
value: 'KS',
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
label: 'Kentucky',
|
|
88
|
+
value: 'KY',
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
label: 'Louisiana',
|
|
92
|
+
value: 'LA',
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
label: 'Maine',
|
|
96
|
+
value: 'ME',
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
label: 'Marshall Islands',
|
|
100
|
+
value: 'MH',
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
label: 'Maryland',
|
|
104
|
+
value: 'MD',
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
label: 'Massachusetts',
|
|
108
|
+
value: 'MA',
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
label: 'Michigan',
|
|
112
|
+
value: 'MI',
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
label: 'Minnesota',
|
|
116
|
+
value: 'MN',
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
label: 'Mississippi',
|
|
120
|
+
value: 'MS',
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
label: 'Missouri',
|
|
124
|
+
value: 'MO',
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
label: 'Montana',
|
|
128
|
+
value: 'MT',
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
label: 'Nebraska',
|
|
132
|
+
value: 'NE',
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
label: 'Nevada',
|
|
136
|
+
value: 'NV',
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
label: 'New Hampshire',
|
|
140
|
+
value: 'NH',
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
label: 'New Jersey',
|
|
144
|
+
value: 'NJ',
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
label: 'New Mexico',
|
|
148
|
+
value: 'NM',
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
label: 'New York',
|
|
152
|
+
value: 'NY',
|
|
153
|
+
},
|
|
154
|
+
{
|
|
155
|
+
label: 'North Carolina',
|
|
156
|
+
value: 'NC',
|
|
157
|
+
},
|
|
158
|
+
{
|
|
159
|
+
label: 'North Dakota',
|
|
160
|
+
value: 'ND',
|
|
161
|
+
},
|
|
162
|
+
{
|
|
163
|
+
label: 'Northern Mariana Islands',
|
|
164
|
+
value: 'MP',
|
|
165
|
+
},
|
|
166
|
+
{
|
|
167
|
+
label: 'Ohio',
|
|
168
|
+
value: 'OH',
|
|
169
|
+
},
|
|
170
|
+
{
|
|
171
|
+
label: 'Oklahoma',
|
|
172
|
+
value: 'OK',
|
|
173
|
+
},
|
|
174
|
+
{
|
|
175
|
+
label: 'Oregon',
|
|
176
|
+
value: 'OR',
|
|
177
|
+
},
|
|
178
|
+
{
|
|
179
|
+
label: 'Palau',
|
|
180
|
+
value: 'PW',
|
|
181
|
+
},
|
|
182
|
+
{
|
|
183
|
+
label: 'Pennsylvania',
|
|
184
|
+
value: 'PA',
|
|
185
|
+
},
|
|
186
|
+
{
|
|
187
|
+
label: 'Puerto Rico',
|
|
188
|
+
value: 'PR',
|
|
189
|
+
},
|
|
190
|
+
{
|
|
191
|
+
label: 'Rhode Island',
|
|
192
|
+
value: 'RI',
|
|
193
|
+
},
|
|
194
|
+
{
|
|
195
|
+
label: 'South Carolina',
|
|
196
|
+
value: 'SC',
|
|
197
|
+
},
|
|
198
|
+
{
|
|
199
|
+
label: 'South Dakota',
|
|
200
|
+
value: 'SD',
|
|
201
|
+
},
|
|
202
|
+
{
|
|
203
|
+
label: 'Tennessee',
|
|
204
|
+
value: 'TN',
|
|
205
|
+
},
|
|
206
|
+
{
|
|
207
|
+
label: 'Texas',
|
|
208
|
+
value: 'TX',
|
|
209
|
+
},
|
|
210
|
+
{
|
|
211
|
+
label: 'Utah',
|
|
212
|
+
value: 'UT',
|
|
213
|
+
},
|
|
214
|
+
{
|
|
215
|
+
label: 'Vermont',
|
|
216
|
+
value: 'VT',
|
|
217
|
+
},
|
|
218
|
+
{
|
|
219
|
+
label: 'Virgin Islands',
|
|
220
|
+
value: 'VI',
|
|
221
|
+
},
|
|
222
|
+
{
|
|
223
|
+
label: 'Virginia',
|
|
224
|
+
value: 'VA',
|
|
225
|
+
},
|
|
226
|
+
{
|
|
227
|
+
label: 'Washington',
|
|
228
|
+
value: 'WA',
|
|
229
|
+
},
|
|
230
|
+
{
|
|
231
|
+
label: 'West Virginia',
|
|
232
|
+
value: 'WV',
|
|
233
|
+
},
|
|
234
|
+
{
|
|
235
|
+
label: 'Wisconsin',
|
|
236
|
+
value: 'WI',
|
|
237
|
+
},
|
|
238
|
+
{
|
|
239
|
+
label: 'Wyoming',
|
|
240
|
+
value: 'WY',
|
|
241
|
+
},
|
|
242
|
+
];
|
|
243
|
+
|
|
244
|
+
export { StateOptions as S };
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { r as registerInstance, c as createEvent, h } from './p-fad19d75.js';
|
|
2
|
+
import { J as JustifiAnalytics } from './p-9282eab8.js';
|
|
3
|
+
import './p-492588bf.js';
|
|
4
|
+
import './p-29c0b182.js';
|
|
5
|
+
|
|
6
|
+
const CardForm = class {
|
|
7
|
+
constructor(hostRef) {
|
|
8
|
+
registerInstance(this, hostRef);
|
|
9
|
+
this.cardFormReady = createEvent(this, "cardFormReady", 7);
|
|
10
|
+
this.ready = createEvent(this, "ready", 7);
|
|
11
|
+
this.cardFormTokenized = createEvent(this, "cardFormTokenize", 7);
|
|
12
|
+
this.cardFormValidated = createEvent(this, "cardFormValidate", 7);
|
|
13
|
+
this.validationMode = undefined;
|
|
14
|
+
this.iframeOrigin = undefined;
|
|
15
|
+
this.singleLine = false;
|
|
16
|
+
this.internalStyleOverrides = undefined;
|
|
17
|
+
}
|
|
18
|
+
readyHandler(event) {
|
|
19
|
+
console.warn(`The 'cardFormReady' event is deprecated in the next major release and will be renamed to 'ready'`);
|
|
20
|
+
this.cardFormReady.emit(event);
|
|
21
|
+
this.ready.emit(event);
|
|
22
|
+
}
|
|
23
|
+
tokenizeHandler(event) {
|
|
24
|
+
console.warn(`The 'cardFormTokenize' 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.`);
|
|
25
|
+
this.cardFormTokenized.emit(event);
|
|
26
|
+
}
|
|
27
|
+
validateHandler(event) {
|
|
28
|
+
console.warn(`The 'cardFormValidate' 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.`);
|
|
29
|
+
this.cardFormValidated.emit(event);
|
|
30
|
+
}
|
|
31
|
+
componentWillLoad() {
|
|
32
|
+
this.analytics = new JustifiAnalytics(this);
|
|
33
|
+
}
|
|
34
|
+
disconnectedCallback() {
|
|
35
|
+
this.analytics.cleanup();
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Makes a tokenization request to the iframe
|
|
39
|
+
*/
|
|
40
|
+
async tokenize(...args) {
|
|
41
|
+
if (!this.childRef) {
|
|
42
|
+
throw new Error('Cannot call tokenize');
|
|
43
|
+
}
|
|
44
|
+
return this.childRef.tokenize(...args);
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Runs a validation on the form and shows errors if any
|
|
48
|
+
*/
|
|
49
|
+
async validate() {
|
|
50
|
+
if (!this.childRef) {
|
|
51
|
+
throw new Error('Cannot call validate');
|
|
52
|
+
}
|
|
53
|
+
return this.childRef.validate();
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Manually resizes the iframe to fit the contents of the iframe
|
|
57
|
+
* @deprecated This method will be removed in future releases.
|
|
58
|
+
*/
|
|
59
|
+
async resize() {
|
|
60
|
+
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.`);
|
|
61
|
+
if (!this.childRef) {
|
|
62
|
+
throw new Error('Cannot call validate');
|
|
63
|
+
}
|
|
64
|
+
return this.childRef.resize();
|
|
65
|
+
}
|
|
66
|
+
render() {
|
|
67
|
+
return (h("justifi-payment-method-form", { key: 'cc0ad5d8a262ff5c8422d247caed469a8dea3488', ref: el => {
|
|
68
|
+
if (el) {
|
|
69
|
+
this.childRef = el;
|
|
70
|
+
}
|
|
71
|
+
}, "iframe-origin": this.iframeOrigin, "payment-method-form-type": "card", "single-line": this.singleLine, "payment-method-form-ready": this.cardFormReady, "payment-method-form-validate": this.cardFormValidated, "payment-method-form-tokenize": this.cardFormTokenized, "payment-method-form-validation-mode": this.validationMode || 'onSubmit' }));
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
export { CardForm as justifi_card_form };
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { r as registerInstance, c as createEvent, h } from './p-fad19d75.js';
|
|
2
|
+
import { P as PaymentService } from './p-cb26f708.js';
|
|
3
|
+
import './p-56f6ce4c.js';
|
|
4
|
+
import { P as Payment } from './p-df21aaad.js';
|
|
5
|
+
import './p-e3fab0e2.js';
|
|
6
|
+
import { C as ComponentErrorSeverity, a as ComponentErrorCodes } from './p-14c91ffd.js';
|
|
7
|
+
import { g as getErrorMessage, a as getErrorCode } from './p-8115b2f4.js';
|
|
8
|
+
import { E as ErrorState } from './p-dce846bf.js';
|
|
9
|
+
import { J as JustifiAnalytics } from './p-9282eab8.js';
|
|
10
|
+
import './p-29c0b182.js';
|
|
11
|
+
import './p-492588bf.js';
|
|
12
|
+
|
|
13
|
+
const makeGetPaymentDetails = ({ id, authToken, service }) => async ({ onSuccess, onError }) => {
|
|
14
|
+
var _a;
|
|
15
|
+
try {
|
|
16
|
+
const response = await service.fetchPayment(id, authToken);
|
|
17
|
+
if (!response.error) {
|
|
18
|
+
onSuccess({ payment: new Payment(response.data) });
|
|
19
|
+
}
|
|
20
|
+
else {
|
|
21
|
+
const responseError = getErrorMessage(response.error);
|
|
22
|
+
const code = getErrorCode((_a = response.error) === null || _a === void 0 ? void 0 : _a.code);
|
|
23
|
+
onError({
|
|
24
|
+
error: responseError,
|
|
25
|
+
code,
|
|
26
|
+
severity: ComponentErrorSeverity.ERROR,
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
catch (error) {
|
|
31
|
+
const code = getErrorCode(error === null || error === void 0 ? void 0 : error.code);
|
|
32
|
+
onError({
|
|
33
|
+
error: getErrorMessage(error),
|
|
34
|
+
code,
|
|
35
|
+
severity: ComponentErrorSeverity.ERROR,
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
const PaymentDetails = class {
|
|
41
|
+
constructor(hostRef) {
|
|
42
|
+
registerInstance(this, hostRef);
|
|
43
|
+
this.errorEvent = createEvent(this, "error-event", 7);
|
|
44
|
+
this.paymentService = new PaymentService();
|
|
45
|
+
this.handleErrorEvent = event => {
|
|
46
|
+
this.errorMessage = event.detail.message;
|
|
47
|
+
this.errorEvent.emit(event.detail);
|
|
48
|
+
};
|
|
49
|
+
this.paymentId = undefined;
|
|
50
|
+
this.authToken = undefined;
|
|
51
|
+
this.getPaymentDetails = undefined;
|
|
52
|
+
this.errorMessage = null;
|
|
53
|
+
}
|
|
54
|
+
componentWillLoad() {
|
|
55
|
+
this.analytics = new JustifiAnalytics(this);
|
|
56
|
+
this.initializeGetPaymentDetails();
|
|
57
|
+
}
|
|
58
|
+
disconnectedCallback() {
|
|
59
|
+
this.analytics.cleanup();
|
|
60
|
+
}
|
|
61
|
+
;
|
|
62
|
+
propChanged() {
|
|
63
|
+
this.initializeGetPaymentDetails();
|
|
64
|
+
}
|
|
65
|
+
initializeGetPaymentDetails() {
|
|
66
|
+
if (this.paymentId && this.authToken) {
|
|
67
|
+
this.getPaymentDetails = makeGetPaymentDetails({
|
|
68
|
+
id: this.paymentId,
|
|
69
|
+
authToken: this.authToken,
|
|
70
|
+
service: new PaymentService(),
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
else {
|
|
74
|
+
this.errorMessage = 'Payment ID and Auth Token are required';
|
|
75
|
+
this.errorEvent.emit({
|
|
76
|
+
message: this.errorMessage,
|
|
77
|
+
errorCode: ComponentErrorCodes.MISSING_PROPS,
|
|
78
|
+
severity: ComponentErrorSeverity.ERROR,
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
render() {
|
|
83
|
+
if (this.errorMessage) {
|
|
84
|
+
return ErrorState(this.errorMessage);
|
|
85
|
+
}
|
|
86
|
+
return (h("payment-details-core", { getPaymentDetails: this.getPaymentDetails, "onError-event": this.handleErrorEvent }));
|
|
87
|
+
}
|
|
88
|
+
static get watchers() { return {
|
|
89
|
+
"paymentId": ["propChanged"],
|
|
90
|
+
"authToken": ["propChanged"]
|
|
91
|
+
}; }
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
export { PaymentDetails as justifi_payment_details };
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { r as registerInstance, h, c as createEvent } from './p-fad19d75.js';
|
|
2
|
+
import { c as create$3, F as FormController } from './p-2eab3c90.js';
|
|
3
|
+
import { i as identityNameValidation, l as lineOneValidation, a as lineTwoValidation, c as cityValidation, s as stateValidation, p as postalValidation } from './p-89887332.js';
|
|
4
|
+
import { S as StateOptions } from './p-6078a370.js';
|
|
5
|
+
import { n as numberOnlyHandler } from './p-8df7bde8.js';
|
|
6
|
+
import { S as StyledHost } from './p-ba4bae6f.js';
|
|
7
|
+
import './p-ba5fae28.js';
|
|
8
|
+
import './p-af244664.js';
|
|
9
|
+
import './p-1ff8810b.js';
|
|
10
|
+
|
|
11
|
+
const BillingFormSchema = create$3({
|
|
12
|
+
name: identityNameValidation.required('Enter full name'),
|
|
13
|
+
address_line1: lineOneValidation.required('Enter street address'),
|
|
14
|
+
address_line2: lineTwoValidation.nullable(),
|
|
15
|
+
address_city: cityValidation.required('Enter city'),
|
|
16
|
+
address_state: stateValidation.required('Select state'),
|
|
17
|
+
address_postal_code: postalValidation.required('Enter postal code'),
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
const billingFormCss = ":host{display:block}justifi-billing-form{margin-left:calc(var(--jfi-layout-padding) * -1);margin-right:calc(var(--jfi-layout-padding) * -1)}*::part(label){color:var(--jfi-form-label-color);font-family:var(--jfi-form-label-font-family);font-weight:var(--jfi-form-label-font-weight);font-size:var(--jfi-form-label-font-size);margin:var(--jfi-form-label-margin)}*::part(input){background-color:var(--jfi-form-control-background-color);border-color:var(--jfi-form-control-border-color);border-width:var(--jfi-form-control-border-width);border-bottom-width:var(--jfi-form-control-border-bottom-width);border-left-width:var(--jfi-form-control-border-left-width);border-right-width:var(--jfi-form-control-border-right-width);border-top-width:var(--jfi-form-control-border-top-width);border-radius:var(--jfi-form-control-border-radius);border-style:var(--jfi-form-control-border-style);box-shadow:var(--jfi-form-control-box-shadow);color:var(--jfi-form-control-color);font-size:var(--jfi-form-control-font-size);font-weight:var(--jfi-form-control-font-weight);line-height:var(--jfi-form-control-line-height);margin:var(--jfi-form-control-margin);padding:var(--jfi-form-control-padding)}*::part(input):focus{color:var(--jfi-form-control-color-focus);border-color:var(--jfi-form-control-border-color-focus);box-shadow:var(--jfi-form-control-box-shadow-focus)}*::part(input-invalid){border-color:var(--jfi-form-control-border-color-error);box-shadow:var(--jfi-form-control-box-shadow-error)}*::part(input-invalid):focus{border-color:var(--jfi-form-control-border-color-error);box-shadow:var(--jfi-form-control-box-shadow-error-focus)}";
|
|
21
|
+
const JustifiBillingFormStyle0 = billingFormCss;
|
|
22
|
+
|
|
23
|
+
const BillingForm = class {
|
|
24
|
+
constructor(hostRef) {
|
|
25
|
+
registerInstance(this, hostRef);
|
|
26
|
+
this.inputHandler = (name, value) => {
|
|
27
|
+
this.formController.setValues(Object.assign(Object.assign({}, this.formController.values.getValue()), { [name]: value }));
|
|
28
|
+
};
|
|
29
|
+
this.legend = undefined;
|
|
30
|
+
this.formController = undefined;
|
|
31
|
+
this.billingInfo = undefined;
|
|
32
|
+
this.errors = {};
|
|
33
|
+
}
|
|
34
|
+
componentWillLoad() {
|
|
35
|
+
this.formController = new FormController(BillingFormSchema);
|
|
36
|
+
}
|
|
37
|
+
componentDidLoad() {
|
|
38
|
+
this.formController.values.subscribe(values => this.billingInfo = Object.assign({}, values));
|
|
39
|
+
this.formController.errors.subscribe(errors => {
|
|
40
|
+
this.errors = Object.assign({}, errors);
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
async getValues() {
|
|
44
|
+
return this.formController.values.getValue();
|
|
45
|
+
}
|
|
46
|
+
async fill(fields) {
|
|
47
|
+
this.formController.setInitialValues(fields);
|
|
48
|
+
}
|
|
49
|
+
async validate() {
|
|
50
|
+
let isValid = await this.formController.validate();
|
|
51
|
+
return { isValid: isValid };
|
|
52
|
+
}
|
|
53
|
+
render() {
|
|
54
|
+
const billingFormDefaultValue = this.formController.getInitialValues();
|
|
55
|
+
return (h(StyledHost, { key: 'b08094d3c44d35cdb3c21b4bc360dbbee19d7d15', exportparts: "label,input,input-invalid" }, h("form", { key: '392538a781ffa2ac299cbc4203bab5efd10e77cc' }, h("fieldset", { key: 'f4b5a5ec9a91e9f50a3847c5eb16635c4f9d569a' }, this.legend && h("legend", { key: 'eb75e22f9df33c13e3851ece784d237b8973e2c5' }, this.legend), h("div", { key: 'd7ffdc1cfeda5568ad003a4d3bbe94765de04605', class: "row gy-3" }, h("div", { key: 'c22f9e7b2f33b5c298bb5f0a5c7bcaa709c231a0', class: "col-12" }, h("form-control-text", { key: 'd6eb4d2f4d1a2a709e0f29bf18b5d9700bd91a13', name: 'name', label: 'Full Name', defaultValue: billingFormDefaultValue.name, errorText: this.errors.name, inputHandler: this.inputHandler })), h("div", { key: '8494ee3c14f8923d18d8708077e030c2f141a251', class: "col-12" }, h("form-control-text", { key: '63266eb0e2b2b006a3c914a68703ee1cdf848f83', name: 'address_line1', label: 'Street Address', defaultValue: billingFormDefaultValue.address_line1, errorText: this.errors.address_line1, inputHandler: this.inputHandler })), h("div", { key: '0a19fcf5c172d2539f23e147f39461d84dfd9d37', class: "col-12" }, h("form-control-text", { key: '0e5fae5d65d5ea195de0227d1e4f79cee7c7a0fb', name: 'address_line2', label: "Apartment, Suite, etc. (optional)", defaultValue: billingFormDefaultValue.address_line2, errorText: this.errors.address_line2, inputHandler: this.inputHandler })), h("div", { key: '13104554e8247cb0534c3dc9e6a16b2f44397795', class: "col-12" }, h("form-control-text", { key: '430e59713ec66ff7a6f735ca24640c27b05cbeee', name: 'address_city', label: "City", defaultValue: billingFormDefaultValue.address_city, errorText: this.errors.address_city, inputHandler: this.inputHandler })), h("div", { key: '5b81499717f67d5f499f4ebfc585056ef5bd3d56', class: "col-12" }, h("form-control-select", { key: '726c724eda5f25a92bad7e549ff7845ece7b41e1', name: 'address_state', label: 'State', options: StateOptions, defaultValue: billingFormDefaultValue.address_state, errorText: this.errors.address_state, inputHandler: this.inputHandler })), h("div", { key: '5d5a6e0949c5ad93da5bc1837dadf88c2128212d', class: "col-12" }, h("form-control-text", { key: 'ebb4e77126d86011d9a1ed5d118461198b399092', name: 'address_postal_code', label: "ZIP", defaultValue: billingFormDefaultValue.address_postal_code, errorText: this.errors.address_postal_code, inputHandler: this.inputHandler, maxLength: 5, keyDownHandler: numberOnlyHandler })))))));
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
BillingForm.style = JustifiBillingFormStyle0;
|
|
59
|
+
|
|
60
|
+
const SaveNewPaymentMethod = class {
|
|
61
|
+
constructor(hostRef) {
|
|
62
|
+
registerInstance(this, hostRef);
|
|
63
|
+
this.checkboxChanged = createEvent(this, "checkboxChanged", 7);
|
|
64
|
+
this.isChecked = false;
|
|
65
|
+
}
|
|
66
|
+
handleCheckboxChange(event) {
|
|
67
|
+
const target = event.target;
|
|
68
|
+
this.isChecked = target.checked;
|
|
69
|
+
this.checkboxChanged.emit(this.isChecked);
|
|
70
|
+
}
|
|
71
|
+
render() {
|
|
72
|
+
return (h("div", { key: 'f22a132a518a98786c8486e08c9a65050f3c5ea0', class: "mt-4 form-check" }, h("input", { key: '6f1392f9dd29a9761f5942b0a40e05a899858ada', type: "checkbox", checked: this.isChecked, onChange: (event) => this.handleCheckboxChange(event), class: "form-check-input" }), h("label", { key: 'e6e5908ba70ece8ea19370a04104d88d17237fc7', class: "form-check-label" }, "Save new payment method")));
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
export { BillingForm as justifi_billing_form, SaveNewPaymentMethod as justifi_save_new_payment_method };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { r as registerInstance, h } from './p-fad19d75.js';
|
|
2
|
+
import { E as ErrorState } from './p-dce846bf.js';
|
|
3
|
+
import { S as StyledHost } from './p-ba4bae6f.js';
|
|
4
|
+
|
|
5
|
+
const Details = class {
|
|
6
|
+
constructor(hostRef) {
|
|
7
|
+
registerInstance(this, hostRef);
|
|
8
|
+
this.errorMessage = undefined;
|
|
9
|
+
}
|
|
10
|
+
render() {
|
|
11
|
+
return (h(StyledHost, { key: '00b10fc4e459688ae06147ef1535f03609ec35e4', exportParts: 'detail-empty-state, detail-metadata-title, detail-metadata, detail-section, detail-section-title, \n detail-section-item-title, detail-section-item-data, detail-head, detail-title, detail-head-info' }, this.errorMessage ?
|
|
12
|
+
ErrorState(this.errorMessage)
|
|
13
|
+
:
|
|
14
|
+
h("main", { class: "p-2" }, h("slot", { name: "head-info" }), h("slot", { name: 'detail-sections' }))));
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export { Details as justifi_details };
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { r as registerInstance, c as createEvent, h, H as Host } from './p-fad19d75.js';
|
|
2
|
+
import { I as IMask } from './p-1ad5995e.js';
|
|
3
|
+
import { C as CURRENCY_MASK } from './p-525db3e8.js';
|
|
4
|
+
|
|
5
|
+
const MonetaryInput = class {
|
|
6
|
+
constructor(hostRef) {
|
|
7
|
+
registerInstance(this, hostRef);
|
|
8
|
+
this.formControlInput = createEvent(this, "formControlInput", 7);
|
|
9
|
+
this.formControlBlur = createEvent(this, "formControlBlur", 7);
|
|
10
|
+
this.imask = null;
|
|
11
|
+
this.initializeIMask = () => {
|
|
12
|
+
if (!this.textInput)
|
|
13
|
+
return;
|
|
14
|
+
this.imask = IMask(this.textInput, this.maskOptions);
|
|
15
|
+
this.imask.on('accept', () => {
|
|
16
|
+
const rawValue = this.imask.unmaskedValue;
|
|
17
|
+
this.inputHandler(this.name, rawValue);
|
|
18
|
+
this.formControlInput.emit({ name: this.name, value: rawValue });
|
|
19
|
+
});
|
|
20
|
+
this.textInput.addEventListener('blur', () => this.formControlBlur.emit());
|
|
21
|
+
};
|
|
22
|
+
this.handleFormControlInput = (event) => {
|
|
23
|
+
const target = event.target;
|
|
24
|
+
const name = target.getAttribute('name');
|
|
25
|
+
const rawValue = this.imask.unmaskedValue;
|
|
26
|
+
this.formControlInput.emit({ name: name, value: rawValue });
|
|
27
|
+
};
|
|
28
|
+
this.updateInput = (newValue) => {
|
|
29
|
+
if (this.imask) {
|
|
30
|
+
this.imask.value = String(newValue);
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
this.label = undefined;
|
|
34
|
+
this.name = undefined;
|
|
35
|
+
this.helpText = undefined;
|
|
36
|
+
this.errorText = undefined;
|
|
37
|
+
this.defaultValue = undefined;
|
|
38
|
+
this.inputHandler = undefined;
|
|
39
|
+
this.maskOptions = CURRENCY_MASK.DECIMAL;
|
|
40
|
+
this.disabled = undefined;
|
|
41
|
+
}
|
|
42
|
+
handleDefaultValueChange(newValue) {
|
|
43
|
+
this.updateInput(newValue);
|
|
44
|
+
}
|
|
45
|
+
componentDidLoad() {
|
|
46
|
+
this.initializeIMask();
|
|
47
|
+
this.updateInput(this.defaultValue);
|
|
48
|
+
}
|
|
49
|
+
disconnectedCallback() {
|
|
50
|
+
var _a;
|
|
51
|
+
(_a = this.imask) === null || _a === void 0 ? void 0 : _a.destroy();
|
|
52
|
+
}
|
|
53
|
+
render() {
|
|
54
|
+
return (h(Host, { key: '8797b3aa5c6a30f472d51e2b9437b6158b0566fc', exportparts: "label,input,input-group-input,input-group-text,input-invalid" }, h("div", { key: '0d3e068cf104aec3f6250f5cd6c00a9342928fe8', class: "form-group d-flex flex-column" }, h("label", { key: '0e86db7c0d981bdae74c51dd75bf5579d07b4793', part: "label", class: "form-label", htmlFor: this.name }, this.label), h("div", { key: '8fc773de3995bb37e6fa00b34d8d9e2deaef4bbd', class: "input-group" }, h("span", { key: '83860eac764be9eeea31302d60525fb56af9dc1d', class: "input-group-text", part: "input-group-text" }, "$"), h("input", { key: 'b8c655c0b8eeb6ec328eeaed651773c293aa3100', ref: el => (this.textInput = el), id: this.name, name: this.name, onBlur: this.formControlBlur.emit, onInput: this.handleFormControlInput, part: `input input-group-input ${this.errorText && 'input-invalid'}`, class: this.errorText ? 'form-control monetary is-invalid' : 'form-control monetary', type: "text", disabled: this.disabled })), h("form-control-help-text", { key: 'b3f142b9c67a792a96b597bdaf91fd3abe1b7ce3', helpText: this.helpText, name: this.name }), h("form-control-error-text", { key: 'daefe97a15bde309c397a506de6cda9a0376323b', errorText: this.errorText, name: this.name }))));
|
|
55
|
+
}
|
|
56
|
+
static get watchers() { return {
|
|
57
|
+
"defaultValue": ["handleDefaultValueChange"]
|
|
58
|
+
}; }
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
export { MonetaryInput as form_control_monetary };
|