@justifi/webcomponents 4.5.0 → 4.5.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/form-control-datepart_2.cjs.entry.js +1 -1
- package/dist/cjs/form-control-monetary.cjs.entry.js +1 -1
- package/dist/cjs/form-control-number_3.cjs.entry.js +1 -1
- package/dist/cjs/form-control-select.cjs.entry.js +1 -1
- package/dist/cjs/{index-4ffc90c0.js → index-3533152c.js} +1 -6
- package/dist/cjs/index-3533152c.js.map +1 -0
- package/dist/cjs/justifi-additional-questions_5.cjs.entry.js +1 -1
- package/dist/cjs/justifi-bank-account-form.cjs.entry.js +3 -1
- package/dist/cjs/justifi-bank-account-form.cjs.entry.js.map +1 -1
- package/dist/cjs/justifi-billing-form_2.cjs.entry.js +1 -1
- package/dist/cjs/justifi-business-form.cjs.entry.js +1 -1
- package/dist/cjs/justifi-business-list.cjs.entry.js +1 -1
- package/dist/cjs/justifi-card-form.cjs.entry.js +3 -1
- package/dist/cjs/justifi-card-form.cjs.entry.js.map +1 -1
- package/dist/cjs/justifi-details.cjs.entry.js +2 -2
- package/dist/cjs/justifi-payment-details.cjs.entry.js +2 -2
- package/dist/cjs/justifi-payment-form.cjs.entry.js +1 -1
- package/dist/cjs/justifi-payment-method-form.cjs.entry.js +1482 -16
- package/dist/cjs/justifi-payment-method-form.cjs.entry.js.map +1 -1
- package/dist/cjs/justifi-payments-list.cjs.entry.js +1 -1
- package/dist/cjs/justifi-payout-details.cjs.entry.js +2 -2
- package/dist/cjs/justifi-payouts-list.cjs.entry.js +1 -1
- package/dist/cjs/justifi-proceeds-list.cjs.entry.js +1 -1
- package/dist/cjs/justifi-table.cjs.entry.js +1 -1
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/select-input_2.cjs.entry.js +1 -1
- package/dist/cjs/{utils-a5b5bfdf.js → utils-d95b09c2.js} +2 -2
- package/dist/cjs/{utils-a5b5bfdf.js.map → utils-d95b09c2.js.map} +1 -1
- package/dist/cjs/webcomponents.cjs.js +2 -2
- package/dist/collection/components/bank-account-form/bank-account-form.js +6 -1
- package/dist/collection/components/bank-account-form/bank-account-form.js.map +1 -1
- package/dist/collection/components/bank-account-form/bank-account-form.stories.js +8 -0
- package/dist/collection/components/bank-account-form/bank-account-form.stories.js.map +1 -1
- package/dist/collection/components/card-form/card-form.js +6 -1
- package/dist/collection/components/card-form/card-form.js.map +1 -1
- package/dist/collection/components/card-form/card-form.stories.js +8 -0
- package/dist/collection/components/card-form/card-form.stories.js.map +1 -1
- package/dist/collection/components/payment-method-form/payment-method-form.css +5 -0
- package/dist/collection/components/payment-method-form/payment-method-form.js +25 -35
- package/dist/collection/components/payment-method-form/payment-method-form.js.map +1 -1
- package/dist/collection/components/payment-method-form/test/payment-method-form.spec.js +7 -7
- package/dist/collection/components/payment-method-form/test/payment-method-form.spec.js.map +1 -1
- package/dist/components/justifi-bank-account-form.js +2 -0
- package/dist/components/justifi-bank-account-form.js.map +1 -1
- package/dist/components/justifi-card-form.js +2 -0
- package/dist/components/justifi-card-form.js.map +1 -1
- package/dist/components/payment-method-form.js +1483 -18
- package/dist/components/payment-method-form.js.map +1 -1
- package/dist/esm/form-control-datepart_2.entry.js +1 -1
- package/dist/esm/form-control-monetary.entry.js +1 -1
- package/dist/esm/form-control-number_3.entry.js +1 -1
- package/dist/esm/form-control-select.entry.js +1 -1
- package/dist/esm/{index-609a2c67.js → index-fe877d03.js} +1 -6
- package/dist/esm/index-fe877d03.js.map +1 -0
- package/dist/esm/justifi-additional-questions_5.entry.js +1 -1
- package/dist/esm/justifi-bank-account-form.entry.js +3 -1
- package/dist/esm/justifi-bank-account-form.entry.js.map +1 -1
- package/dist/esm/justifi-billing-form_2.entry.js +1 -1
- package/dist/esm/justifi-business-form.entry.js +1 -1
- package/dist/esm/justifi-business-list.entry.js +1 -1
- package/dist/esm/justifi-card-form.entry.js +3 -1
- package/dist/esm/justifi-card-form.entry.js.map +1 -1
- package/dist/esm/justifi-details.entry.js +2 -2
- package/dist/esm/justifi-payment-details.entry.js +2 -2
- package/dist/esm/justifi-payment-form.entry.js +1 -1
- package/dist/esm/justifi-payment-method-form.entry.js +1482 -16
- package/dist/esm/justifi-payment-method-form.entry.js.map +1 -1
- package/dist/esm/justifi-payments-list.entry.js +1 -1
- package/dist/esm/justifi-payout-details.entry.js +2 -2
- package/dist/esm/justifi-payouts-list.entry.js +1 -1
- package/dist/esm/justifi-proceeds-list.entry.js +1 -1
- package/dist/esm/justifi-table.entry.js +1 -1
- package/dist/esm/loader.js +3 -3
- package/dist/esm/select-input_2.entry.js +1 -1
- package/dist/esm/{utils-cdf0b984.js → utils-1e7d6279.js} +2 -2
- package/dist/esm/{utils-cdf0b984.js.map → utils-1e7d6279.js.map} +1 -1
- package/dist/esm/webcomponents.js +3 -3
- package/dist/types/components/bank-account-form/bank-account-form.stories.d.ts +6 -0
- package/dist/types/components/card-form/card-form.stories.d.ts +6 -0
- package/dist/types/components/payment-method-form/payment-method-form.d.ts +1 -3
- package/dist/types/components.d.ts +2 -0
- package/dist/webcomponents/{p-b967262f.entry.js → p-1beaaba3.entry.js} +2 -2
- package/dist/webcomponents/{p-0237a6bc.entry.js → p-2b6f5e35.entry.js} +2 -2
- package/dist/webcomponents/{p-86464cab.entry.js → p-2e66512d.entry.js} +2 -2
- package/dist/webcomponents/{p-f8d49acb.entry.js → p-640bfa9f.entry.js} +2 -2
- package/dist/webcomponents/{p-239564c6.entry.js → p-641883b2.entry.js} +2 -2
- package/dist/webcomponents/{p-e26d7eea.entry.js → p-6d549d84.entry.js} +2 -2
- package/dist/webcomponents/{p-27b15fe8.entry.js → p-75292cca.entry.js} +2 -2
- package/dist/webcomponents/{p-c1e4288d.entry.js → p-7d6c309d.entry.js} +2 -2
- package/dist/webcomponents/{p-439fc294.entry.js → p-a2aae7c9.entry.js} +2 -2
- package/dist/webcomponents/{p-e77d8c6e.entry.js → p-a922b908.entry.js} +2 -2
- package/dist/webcomponents/{p-7e3bbe32.entry.js → p-cd0eca25.entry.js} +2 -2
- package/dist/webcomponents/{p-7e3bbe32.entry.js.map → p-cd0eca25.entry.js.map} +1 -1
- package/dist/webcomponents/{p-0d6e9f76.entry.js → p-d92116e6.entry.js} +2 -2
- package/dist/webcomponents/{p-0d6e9f76.entry.js.map → p-d92116e6.entry.js.map} +1 -1
- package/dist/webcomponents/{p-f0acb27e.entry.js → p-da4e6389.entry.js} +2 -2
- package/dist/webcomponents/{p-d1bbf409.entry.js → p-db9945b1.entry.js} +2 -2
- package/dist/webcomponents/{p-c18d876e.entry.js → p-e1f6c8ec.entry.js} +2 -2
- package/dist/webcomponents/{p-126146d4.js → p-e6695628.js} +2 -2
- package/dist/webcomponents/{p-308b6784.js → p-e70b2a21.js} +2 -2
- package/dist/webcomponents/p-e70b2a21.js.map +1 -0
- package/dist/webcomponents/{p-391b8f1d.entry.js → p-ee32a236.entry.js} +2 -2
- package/dist/webcomponents/{p-7abb092c.entry.js → p-f6cc37a6.entry.js} +2 -2
- package/dist/webcomponents/p-f72c3084.entry.js +2 -0
- package/dist/webcomponents/p-f72c3084.entry.js.map +1 -0
- package/dist/webcomponents/{p-bf9c2be2.entry.js → p-f8067330.entry.js} +2 -2
- package/dist/webcomponents/{p-b042bf80.entry.js → p-fe2ec58b.entry.js} +2 -2
- package/dist/webcomponents/webcomponents.esm.js +1 -1
- package/dist/webcomponents/webcomponents.esm.js.map +1 -1
- package/package.json +3 -2
- package/dist/cjs/index-4ffc90c0.js.map +0 -1
- package/dist/esm/index-609a2c67.js.map +0 -1
- package/dist/webcomponents/p-308b6784.js.map +0 -1
- package/dist/webcomponents/p-66f010e5.entry.js +0 -2
- package/dist/webcomponents/p-66f010e5.entry.js.map +0 -1
- /package/dist/webcomponents/{p-b967262f.entry.js.map → p-1beaaba3.entry.js.map} +0 -0
- /package/dist/webcomponents/{p-0237a6bc.entry.js.map → p-2b6f5e35.entry.js.map} +0 -0
- /package/dist/webcomponents/{p-86464cab.entry.js.map → p-2e66512d.entry.js.map} +0 -0
- /package/dist/webcomponents/{p-f8d49acb.entry.js.map → p-640bfa9f.entry.js.map} +0 -0
- /package/dist/webcomponents/{p-239564c6.entry.js.map → p-641883b2.entry.js.map} +0 -0
- /package/dist/webcomponents/{p-e26d7eea.entry.js.map → p-6d549d84.entry.js.map} +0 -0
- /package/dist/webcomponents/{p-27b15fe8.entry.js.map → p-75292cca.entry.js.map} +0 -0
- /package/dist/webcomponents/{p-c1e4288d.entry.js.map → p-7d6c309d.entry.js.map} +0 -0
- /package/dist/webcomponents/{p-439fc294.entry.js.map → p-a2aae7c9.entry.js.map} +0 -0
- /package/dist/webcomponents/{p-e77d8c6e.entry.js.map → p-a922b908.entry.js.map} +0 -0
- /package/dist/webcomponents/{p-f0acb27e.entry.js.map → p-da4e6389.entry.js.map} +0 -0
- /package/dist/webcomponents/{p-d1bbf409.entry.js.map → p-db9945b1.entry.js.map} +0 -0
- /package/dist/webcomponents/{p-c18d876e.entry.js.map → p-e1f6c8ec.entry.js.map} +0 -0
- /package/dist/webcomponents/{p-126146d4.js.map → p-e6695628.js.map} +0 -0
- /package/dist/webcomponents/{p-391b8f1d.entry.js.map → p-ee32a236.entry.js.map} +0 -0
- /package/dist/webcomponents/{p-7abb092c.entry.js.map → p-f6cc37a6.entry.js.map} +0 -0
- /package/dist/webcomponents/{p-bf9c2be2.entry.js.map → p-f8067330.entry.js.map} +0 -0
- /package/dist/webcomponents/{p-b042bf80.entry.js.map → p-fe2ec58b.entry.js.map} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bank-account-form.js","sourceRoot":"","sources":["../../../../src/components/bank-account-form/bank-account-form.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,EAAgB,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAQ/F,MAAM,OAAO,eAAe;;;;;;EAsC1B,YAAY,CAAC,KAAkB;IAC7B,OAAO,CAAC,IAAI,CAAC,yGAAyG,CAAC,CAAC;IACxH,IAAI,CAAC,oBAAoB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACtC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;EACzB,CAAC;EAGD,eAAe,CAAC,KAAoB;IAClC,OAAO,CAAC,IAAI,CACV,+MAA+M,CAChN,CAAC;IACF,IAAI,CAAC,uBAAuB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;EAC3C,CAAC;EAGD,eAAe,CAAC,KAAoB;IAClC,OAAO,CAAC,IAAI,CACV,+MAA+M,CAChN,CAAC;IACF,IAAI,CAAC,uBAAuB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;EAC3C,CAAC;EAID;;KAEG;EAEH,KAAK,CAAC,QAAQ,CAAC,GAAG,IAAiE;IACjF,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE;MAClB,MAAM,IAAI,KAAK,CAAC,sBAAsB,CAAC,CAAC;KACzC;IACD,OAAO,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,GAAG,IAAI,CAAC,CAAC;EACzC,CAAC;EAED;;KAEG;EAEH,KAAK,CAAC,QAAQ;IACZ,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE;MAClB,MAAM,IAAI,KAAK,CAAC,sBAAsB,CAAC,CAAC;KACzC;IACD,OAAO,IAAI,CAAC,QAAQ,CAAC,QAAQ,EAAE,CAAC;EAClC,CAAC;EAED
|
|
1
|
+
{"version":3,"file":"bank-account-form.js","sourceRoot":"","sources":["../../../../src/components/bank-account-form/bank-account-form.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,EAAgB,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAQ/F,MAAM,OAAO,eAAe;;;;;;EAsC1B,YAAY,CAAC,KAAkB;IAC7B,OAAO,CAAC,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AAI,EAAE,EAAE;UACN,IAAI,CAAC,QAAQ,GAAG,EAAE,CAAC;SACpB;MACH,CAAC,mBACc,IAAI,CAAC,YAAY,8BACP,aAAa,+BACX,IAAI,CAAC,oBAAoB,kCACtB,IAAI,CAAC,uBAAuB,yCACrB,IAAI,CAAC,cAAc,IAAI,UAAU,GACtE,CACH,CAAC;EACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Event, Prop, h, EventEmitter, Listen, Method, State } from '@stencil/core';\nimport { CreatePaymentMethodResponse } from '../payment-method-form/payment-method-responses';\nimport { Theme } from '../payment-method-form/theme';\n\n@Component({\n tag: 'justifi-bank-account-form',\n shadow: false,\n})\nexport class BankAccountForm {\n /**\n * When to trigger validation of the form.\n */\n @Prop({ mutable: true }) validationMode: 'onChange' | 'onBlur' | 'onSubmit' | 'onTouched' | 'all';\n\n /**\n * URL for the rendered iFrame. End-users need not use this.\n */\n @Prop({ mutable: true }) iframeOrigin?: string;\n\n @State() internalStyleOverrides: Theme;\n\n /**\n * Triggered when iframe has loaded\n * @event justifi-bank-account-form#bankAccountFormReady\n */\n @Event() bankAccountFormReady: EventEmitter<any>;\n\n /**\n * Triggered when iframe has loaded\n * @event justifi-bank-account-form#ready\n */\n @Event() ready: EventEmitter<any>;\n\n /**\n * Triggered when the tokenize method is called on the component\n * @event justifi-bank-account-form#bankAccountFormTokenize\n */\n @Event() bankAccountFormTokenize: EventEmitter<{ data: any }>;\n\n /**\n * Triggered when the validate method is called on the component\n * @event justifi-bank-account-form#bankAccountFormValidate\n */\n @Event() bankAccountFormValidate: EventEmitter<{ data: { isValid: boolean } }>;\n\n @Listen('paymentMethodFormReady')\n readyHandler(event: CustomEvent) {\n console.warn(`The 'bankAccountFormReady' event is deprecated in the next major release and will be renamed to 'ready'`);\n this.bankAccountFormReady.emit(event);\n this.ready.emit(event);\n }\n\n @Listen('paymentMethodFormTokenize')\n tokenizeHandler(event: { data: any }) {\n console.warn(\n `The 'bankAccountFormTokenize' 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.`,\n );\n this.bankAccountFormTokenize.emit(event);\n }\n\n @Listen('paymentMethodFormValidate')\n validateHandler(event: { data: any }) {\n console.warn(\n `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.`,\n );\n this.bankAccountFormValidate.emit(event);\n }\n\n private childRef?: HTMLJustifiPaymentMethodFormElement;\n\n /**\n * Makes a tokenization request to the iframe\n */\n @Method()\n async tokenize(...args: Parameters<HTMLJustifiPaymentMethodFormElement['tokenize']>): Promise<CreatePaymentMethodResponse> {\n if (!this.childRef) {\n throw new Error('Cannot call tokenize');\n }\n return this.childRef.tokenize(...args);\n }\n\n /**\n * Runs a validation on the form and shows errors if any\n */\n @Method()\n async validate() {\n if (!this.childRef) {\n throw new Error('Cannot call validate');\n }\n return this.childRef.validate();\n }\n\n /**\n * Manually resizes the iframe to fit the contents of the iframe\n * @deprecated This method will be removed in future releases.\n */\n @Method()\n async resize(): Promise<void> {\n console.warn(\n `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.`,\n );\n if (!this.childRef) {\n throw new Error('Cannot call validate');\n }\n return this.childRef.resize();\n }\n\n render() {\n return (\n <justifi-payment-method-form\n ref={el => {\n if (el) {\n this.childRef = el;\n }\n }}\n iframe-origin={this.iframeOrigin}\n payment-method-form-type=\"bankAccount\"\n payment-method-form-ready={this.bankAccountFormReady}\n payment-method-form-tokenize={this.bankAccountFormTokenize}\n payment-method-form-validation-mode={this.validationMode || 'onSubmit'}\n />\n );\n }\n}\n"]}
|
|
@@ -52,9 +52,17 @@ export default {
|
|
|
52
52
|
defaultValue: CSSVars,
|
|
53
53
|
},
|
|
54
54
|
},
|
|
55
|
+
'resize': {
|
|
56
|
+
description: 'Deprecated: This method will be removed in future releases.',
|
|
57
|
+
table: {
|
|
58
|
+
category: 'methods',
|
|
59
|
+
},
|
|
60
|
+
},
|
|
55
61
|
},
|
|
56
62
|
decorators: [
|
|
57
63
|
story => `
|
|
64
|
+
<!-- Deprecated Notice -->
|
|
65
|
+
<p style="color: red; font-family: 'Roboto Mono', monospace;">Note: The 'resize' method is deprecated and will be removed in future releases.</p>
|
|
58
66
|
${story()}
|
|
59
67
|
<script>${addEvents()}</script>
|
|
60
68
|
`,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bank-account-form.stories.js","sourceRoot":"","sources":["../../../../src/components/bank-account-form/bank-account-form.stories.ts"],"names":[],"mappings":"AAAA,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,aAAa,CAAC;AACrD,MAAM,OAAO,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkCf,CAAC;AAEF,eAAe;EACb,KAAK,EAAE,4BAA4B;EACnC,SAAS,EAAE,2BAA2B;EACtC,QAAQ,EAAE;IACR,eAAe,EAAE;MACf,OAAO,EAAE,MAAM;MACf,KAAK,EAAE;QACL,OAAO,EAAE,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI;QAC7B,QAAQ,EAAE,OAAO;OAClB;KACF;IACD,eAAe,EAAE;MACf,OAAO,EAAE,MAAM;MACf,KAAK,EAAE;QACL,QAAQ,EAAE,OAAO;QACjB,YAAY,EAAE,OAAO;OACtB;KACF;GACF;EACD,UAAU,EAAE;IACV,KAAK,CAAC,EAAE,CAAC
|
|
1
|
+
{"version":3,"file":"bank-account-form.stories.js","sourceRoot":"","sources":["../../../../src/components/bank-account-form/bank-account-form.stories.ts"],"names":[],"m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MAG9C,WAAW;GACd,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,KAAK,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AAEvC,MAAM,CAAC,MAAM,MAAM,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AACxC,MAAM,CAAC,IAAI,GAAG;EACZ,eAAe,EAAE,OAAO;CACzB,CAAC","sourcesContent":["const isDev = process.env.NODE_ENV === 'development';\nconst CSSVars = `\n--jfi-load-google-font: 'Roboto Mono:wght@200;400;700;900&family=Agdasima';\n--jfi-layout-font-family: Roboto Mono;\n--jfi-layout-padding: 4px;\n--jfi-layout-form-control-spacing-x: .5rem;\n--jfi-layout-form-control-spacing-y: 1rem;\n--jfi-form-label-font-weight: 700;\n--jfi-form-label-font-family: sans-serif;\n--jfi-form-label-margin: 0 0 .5rem 0;\n--jfi-form-control-background-color: #F4F4F6;\n--jfi-form-control-background-color-hover: #EEEEF5;\n--jfi-form-control-border-color: rgba(0, 0, 0, 0.42);\n--jfi-form-control-border-color-hover: rgba(0, 0, 0, 0.62);\n--jfi-form-control-border-color-focus: #fccc32;\n--jfi-form-control-border-color-error: #C12727;\n--jfi-form-control-border-top-width: 0;\n--jfi-form-control-border-left-width: 0;\n--jfi-form-control-border-bottom-width: 1px;\n--jfi-form-control-border-right-width: 0;\n--jfi-form-control-border-radius: 4px 4px 0 0;\n--jfi-form-control-border-style: solid;\n--jfi-form-control-box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);\n--jfi-form-control-box-shadow-focus: none;\n--jfi-form-control-box-shadow-error-focus: none;\n--jfi-form-control-border-style: solid;\n--jfi-form-control-color: #212529;\n--jfi-form-control-font-size: 1rem;\n--jfi-form-control-font-weight: 400;\n--jfi-form-control-line-height: 2;\n--jfi-form-control-margin: 0;\n--jfi-form-control-padding: .5rem .875rem;\n--jfi-error-message-color: #C12727;\n--jfi-error-message-margin: .25rem 0 0 0;\n--jfi-error-message-font-size: .875rem;\n`;\n\nexport default {\n title: 'Components/BankAccountForm',\n component: 'justifi-bank-account-form',\n argTypes: {\n 'iframe-origin': {\n control: 'text',\n table: {\n disable: isDev ? false : true,\n category: 'props',\n },\n },\n 'css-variables': {\n control: 'text',\n table: {\n category: 'props',\n defaultValue: CSSVars,\n },\n },\n 'resize': {\n description: 'Deprecated: This method will be removed in future releases.',\n table: {\n category: 'methods',\n },\n },\n },\n decorators: [\n story => `\n <!-- Deprecated Notice -->\n <p style=\"color: red; font-family: 'Roboto Mono', monospace;\">Note: The 'resize' method is deprecated and will be removed in future releases.</p>\n ${story()}\n <script>${addEvents()}</script>\n `,\n ],\n};\n\nconst handleValidateClick = async (bankForm: HTMLJustifiBankAccountFormElement) => {\n const valid = await bankForm.validate();\n console.log(valid);\n};\nconst handleTokenizeClick = async (bankForm: HTMLJustifiBankAccountFormElement, paymentMethodData: any) => {\n const tokenizeResponse = await bankForm.tokenize('CLIENT_ID', paymentMethodData);\n console.log(tokenizeResponse);\n};\nconst handleResizeClick = async (bankForm: HTMLJustifiBankAccountFormElement) => {\n await bankForm.resize();\n};\nconst handleReady = () => {\n console.log('bank account form is ready');\n const bankForm = document.querySelector('justifi-bank-account-form') as HTMLJustifiBankAccountFormElement;\n const validateBtn = document.querySelector('#validate-btn');\n const tokenizeBtn = document.querySelector('#tokenize-btn');\n const resizeBtn = document.querySelector('#resize-btn');\n validateBtn?.addEventListener('click', () => {\n handleValidateClick(bankForm);\n });\n tokenizeBtn?.addEventListener('click', () => {\n handleTokenizeClick(bankForm, {});\n });\n resizeBtn?.addEventListener('click', () => {\n handleResizeClick(bankForm);\n });\n};\n\nconst addEvents = () => {\n addEventListener('bankAccountFormReady', handleReady);\n};\n\nconst FormButtons = `\n <style>\n .button-bar {\n display: flex;\n aligin-items: center;\n padding: 10px;\n }\n .button-bar button {\n margin-right: 10px;\n }\n </style>\n <div class=\"button-bar\">\n <button id=\"validate-btn\">Validate</button>\n <button id=\"tokenize-btn\">Tokenize</button>\n <button id=\"resize-btn\">Resize</button>\n </div>\n`;\n\nconst Template = (args: any) => {\n return `\n <div>\n <style>\n :root {\n ${args['css-variables'] || ''}\n }\n </style>\n <justifi-bank-account-form\n data-testid=\"bank-account-form-iframe\"\n validation-mode='${args['validation-mode'] || 'onSubmit'}'\n iframe-origin='${args['iframe-origin'] || ''}'\n />\n </div>\n ${FormButtons}\n `;\n};\n\nexport const Basic = Template.bind({});\n\nexport const Styled = Template.bind({});\nStyled.args = {\n 'css-variables': CSSVars,\n};\n"]}
|
|
@@ -39,8 +39,10 @@ export class CardForm {
|
|
|
39
39
|
}
|
|
40
40
|
/**
|
|
41
41
|
* Manually resizes the iframe to fit the contents of the iframe
|
|
42
|
+
* @deprecated This method will be removed in future releases.
|
|
42
43
|
*/
|
|
43
44
|
async resize() {
|
|
45
|
+
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.`);
|
|
44
46
|
if (!this.childRef) {
|
|
45
47
|
throw new Error('Cannot call validate');
|
|
46
48
|
}
|
|
@@ -256,7 +258,10 @@ export class CardForm {
|
|
|
256
258
|
},
|
|
257
259
|
"docs": {
|
|
258
260
|
"text": "Manually resizes the iframe to fit the contents of the iframe",
|
|
259
|
-
"tags": [
|
|
261
|
+
"tags": [{
|
|
262
|
+
"name": "deprecated",
|
|
263
|
+
"text": "This method will be removed in future releases."
|
|
264
|
+
}]
|
|
260
265
|
}
|
|
261
266
|
}
|
|
262
267
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"card-form.js","sourceRoot":"","sources":["../../../../src/components/card-form/card-form.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,EAAgB,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAQ/F,MAAM,OAAO,QAAQ;;;;sBAcW,KAAK;;;EA+BnC,YAAY,CAAC,KAAkB;IAC7B,OAA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AE;UACN,IAAI,CAAC,QAAQ,GAAG,EAAE,CAAC;SACpB;MACH,CAAC,mBACc,IAAI,CAAC,YAAY,8BACP,MAAM,iBAClB,IAAI,CAAC,UAAU,+BACD,IAAI,CAAC,aAAa,kCACf,IAAI,CAAC,gBAAgB,yCACd,IAAI,CAAC,cAAc,IAAI,UAAU,GACtE,CACH,CAAC;EACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Event, Prop, h, EventEmitter, Method, Listen, State } from '@stencil/core';\nimport { CreatePaymentMethodResponse } from '../payment-method-form/payment-method-responses';\nimport { Theme } from '../payment-method-form/theme';\n\n@Component({\n tag: 'justifi-card-form',\n shadow: false,\n})\nexport class CardForm {\n /**\n * When to trigger validation of the form.\n */\n @Prop({ mutable: true }) validationMode: 'onChange' | 'onBlur' | 'onSubmit' | 'onTouched' | 'all';\n\n /**\n * URL for the rendered iFrame. End-users need not use this.\n */\n @Prop({ mutable: true }) iframeOrigin?: string;\n\n /**\n * Boolean indicating if the Card Form should render in a single line\n */\n @Prop() singleLine: boolean = false;\n\n @State() internalStyleOverrides: Theme;\n\n /**\n * Triggered when iframe has loaded\n * @event justifi-card-form#cardFormReady\n */\n\n @Event() cardFormReady: EventEmitter;\n\n /**\n * Triggered when iframe has loaded\n * @event justifi-card-form#ready\n */\n\n @Event() ready: EventEmitter;\n\n /**\n * Triggered when the tokenize method is called on the component\n * @event justifi-card-form#cardFormTokenize\n */\n @Event() cardFormTokenize: EventEmitter<{ data: any }>;\n\n /**\n * Triggered when the validate method is called on the component\n * @event justifi-card-form#cardFormTokenize\n */\n @Event() cardFormValidate: EventEmitter<{ data: { isValid: boolean } }>;\n\n @Listen('paymentMethodFormReady')\n readyHandler(event: CustomEvent) {\n console.warn(`The 'cardFormReady' event is deprecated in the next major release and will be renamed to 'ready'`);\n this.cardFormReady.emit(event);\n this.ready.emit(event);\n }\n\n @Listen('paymentMethodFormTokenize')\n tokenizeHandler(event: { data: any }) {\n console.warn(\n `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.`,\n );\n this.cardFormTokenize.emit(event);\n }\n\n @Listen('paymentMethodFormValidate')\n validateHandler(event: { data: any }) {\n console.warn(\n `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.`,\n );\n this.cardFormValidate.emit(event);\n }\n\n private childRef?: HTMLJustifiPaymentMethodFormElement;\n\n /**\n * Makes a tokenization request to the iframe\n */\n @Method()\n async tokenize(...args: Parameters<HTMLJustifiPaymentMethodFormElement['tokenize']>): Promise<CreatePaymentMethodResponse> {\n if (!this.childRef) {\n throw new Error('Cannot call tokenize');\n }\n return this.childRef.tokenize(...args);\n }\n\n /**\n * Runs a validation on the form and shows errors if any\n */\n @Method()\n async validate(): Promise<{ isValid: boolean }> {\n if (!this.childRef) {\n throw new Error('Cannot call validate');\n }\n return this.childRef.validate();\n }\n\n /**\n * Manually resizes the iframe to fit the contents of the iframe\n * @deprecated This method will be removed in future releases.\n */\n @Method()\n async resize(): Promise<void> {\n console.warn(\n `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.`,\n );\n if (!this.childRef) {\n throw new Error('Cannot call validate');\n }\n return this.childRef.resize();\n }\n\n render() {\n return (\n <justifi-payment-method-form\n ref={el => {\n if (el) {\n this.childRef = el;\n }\n }}\n iframe-origin={this.iframeOrigin}\n payment-method-form-type=\"card\"\n single-line={this.singleLine}\n payment-method-form-ready={this.cardFormReady}\n payment-method-form-tokenize={this.cardFormTokenize}\n payment-method-form-validation-mode={this.validationMode || 'onSubmit'}\n />\n );\n }\n}\n"]}
|
|
@@ -10,9 +10,17 @@ export default {
|
|
|
10
10
|
category: 'props',
|
|
11
11
|
},
|
|
12
12
|
},
|
|
13
|
+
'resize': {
|
|
14
|
+
description: 'Deprecated: This method will be removed in future releases.',
|
|
15
|
+
table: {
|
|
16
|
+
category: 'methods',
|
|
17
|
+
},
|
|
18
|
+
},
|
|
13
19
|
},
|
|
14
20
|
decorators: [
|
|
15
21
|
story => `
|
|
22
|
+
<!-- Deprecated Notice -->
|
|
23
|
+
<p style="color: red; font-family: 'Roboto Mono', monospace;">Note: The 'resize' method is deprecated and will be removed in future releases.</p>
|
|
16
24
|
${story()}
|
|
17
25
|
<script>${addEvents()}</script>
|
|
18
26
|
`,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"card-form.stories.js","sourceRoot":"","sources":["../../../../src/components/card-form/card-form.stories.ts"],"names":[],"mappings":"AAOA,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,aAAa,CAAC;AAErD,eAAe;EACb,KAAK,EAAE,qBAAqB;EAC5B,SAAS,EAAE,mBAAmB;EAC9B,QAAQ,EAAE;IACR,eAAe,EAAE;MACf,OAAO,EAAE,MAAM;MACf,KAAK,EAAE;QACL,OAAO,EAAE,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI;QAC7B,QAAQ,EAAE,OAAO;OAClB;KACF;GACF;EACD,UAAU,EAAE;IACV,KAAK,CAAC,EAAE,CAAC
|
|
1
|
+
{"version":3,"file":"card-form.stories.js","sourceRoot":"","sources":["../../../../src/components/card-form/card-form.stories.ts"],"names":[],"mappings":"AAOA,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,aAAa,CAAC;AAErD,eAAe;EACb,KAAK,EAAE,qBAAqB;EAC5B,SAAS,EAAE,mBAAmB;EAC9B,QAAQ,EAAE;IACR,eAAe,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G,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AAC5C,UAAU,CAAC,IAAI,GAAG;EAChB,aAAa,EAAE,IAAI;CACpB,CAAC;AAEF,MAAM,eAAe,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkCvB,CAAC;AAEF,MAAM,CAAC,MAAM,MAAM,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AACxC,MAAM,CAAC,IAAI,GAAG;EACZ,aAAa,EAAE,KAAK;EACpB,eAAe,EAAE,eAAe;CACjC,CAAC","sourcesContent":["interface CardFormStoryArgs {\n 'iframe-origin': string;\n 'single-line': boolean;\n 'validation-mode': string;\n 'css-variables': string;\n}\n\nconst isDev = process.env.NODE_ENV === 'development';\n\nexport default {\n title: 'Components/CardForm',\n component: 'justifi-card-form',\n argTypes: {\n 'iframe-origin': {\n control: 'text',\n table: {\n disable: isDev ? false : true,\n category: 'props',\n },\n },\n 'resize': {\n description: 'Deprecated: This method will be removed in future releases.',\n table: {\n category: 'methods',\n },\n },\n },\n decorators: [\n story => `\n <!-- Deprecated Notice -->\n <p style=\"color: red; font-family: 'Roboto Mono', monospace;\">Note: The 'resize' method is deprecated and will be removed in future releases.</p>\n ${story()}\n <script>${addEvents()}</script>\n `,\n ],\n};\n\nconst handleValidateClick = async (cardForm: HTMLJustifiCardFormElement) => {\n const valid = await cardForm.validate();\n console.log(valid);\n};\nconst handleTokenizeClick = async (cardForm: HTMLJustifiCardFormElement, paymentMethodData) => {\n const tokenizeResponse = await cardForm.tokenize('CLIENT_ID', paymentMethodData);\n console.log(tokenizeResponse);\n};\nconst handleResizeClick = async (cardForm: HTMLJustifiCardFormElement) => {\n await cardForm.resize();\n};\nconst handleReady = () => {\n console.log('card form is ready');\n const cardForm = document.querySelector('justifi-card-form') as HTMLJustifiCardFormElement;\n const validateBtn = document.querySelector('#validate-btn');\n const tokenizeBtn = document.querySelector('#tokenize-btn');\n const resizeBtn = document.querySelector('#resize-btn');\n validateBtn?.addEventListener('click', () => {\n handleValidateClick(cardForm);\n });\n tokenizeBtn?.addEventListener('click', () => {\n handleTokenizeClick(cardForm, {});\n });\n resizeBtn?.addEventListener('click', () => {\n handleResizeClick(cardForm);\n });\n};\n\nconst addEvents = () => {\n addEventListener('cardFormReady', handleReady);\n};\n\nconst FormButtons = `\n <style>\n .button-bar {\n display: flex;\n aligin-items: center;\n padding: 10px;\n }\n .button-bar button {\n margin-right: 10px;\n border-radius: 3px;\n border: 1px solid black;\n }\n </style>\n <div class=\"button-bar\">\n <button id=\"validate-btn\">Validate</button>\n <button id=\"tokenize-btn\">Tokenize</button>\n <button id=\"resize-btn\">Resize</button>\n </div>`;\n\nconst Template = (args: CardFormStoryArgs) => {\n const includeButtons = true;\n\n return `\n <div>\n <style>\n :root {\n ${args['css-variables'] || ''}\n }\n </style>\n <justifi-card-form\n data-testid=\"card-form-iframe\"\n validation-mode='${args['validation-mode'] || 'onSubmit'}'\n iframe-origin='${args['iframe-origin'] || ''}'\n single-line='${args['single-line']}'\n />\n </div>\n ${includeButtons ? FormButtons : ''}\n `;\n};\n\nexport const Basic = Template.bind({});\nBasic.args = {\n 'validation-mode': 'onSubmit',\n 'single-line': false,\n};\n\nexport const SingleLine = Template.bind({});\nSingleLine.args = {\n 'single-line': true,\n};\n\nconst styledVariables = `\n --jfi-load-google-font: 'Inter:wght@200;400;700;900&family=Agdasima';\n --jfi-layout-font-family: Agdasima;\n --jfi-layout-padding: 4px;\n --jfi-layout-form-control-spacing-x: .5rem;\n --jfi-layout-form-control-spacing-y: 1rem;\n --jfi-form-label-font-weight: 100;\n --jfi-form-label-font-family: Inter;\n --jfi-form-label-margin: 0 0 .5rem 0;\n --jfi-form-control-background-color: #F4F4F6;\n --jfi-form-control-background-color-hover: #EEEEF5;\n --jfi-form-control-border-color: rgba(0, 0, 0, 0.42);\n --jfi-form-control-border-color-hover: rgba(0, 0, 0, 0.62);\n --jfi-form-control-border-color-focus: #fccc32;\n --jfi-form-control-border-color-error: #C12727;\n --jfi-form-control-border-top-width: 0;\n --jfi-form-control-border-left-width: 0;\n --jfi-form-control-border-bottom-width: 1px;\n --jfi-form-control-border-right-width: 0;\n --jfi-form-control-border-radius: 4px 4px 0 0;\n --jfi-form-control-border-style: solid;\n --jfi-form-control-box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);\n --jfi-form-control-box-shadow-focus: none;\n --jfi-form-control-box-shadow-error-focus: none;\n --jfi-form-control-border-style: solid;\n --jfi-form-control-color: #212529;\n --jfi-form-control-font-size: 1rem;\n --jfi-form-control-font-weight: 400;\n --jfi-form-control-line-height: 2;\n --jfi-form-control-margin: 0;\n --jfi-form-control-padding: .5rem .875rem;\n --jfi-error-message-color: #C12727;\n --jfi-error-message-margin: .25rem 0 0 0;\n --jfi-error-message-font-size: .875rem;\n`;\n\nexport const Styled = Template.bind({});\nStyled.args = {\n 'single-line': false,\n 'css-variables': styledVariables,\n};\n"]}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Host, h } from "@stencil/core";
|
|
2
|
+
import iFrameResize from "iframe-resizer/js/iframeResizer";
|
|
2
3
|
import { MessageEventType } from "./message-event-types";
|
|
3
4
|
import packageJson from "../../../package.json";
|
|
4
5
|
import getComputedTheme from "./get-computed-theme";
|
|
@@ -9,7 +10,6 @@ export class PaymentMethodForm {
|
|
|
9
10
|
this.paymentMethodFormValidationMode = undefined;
|
|
10
11
|
this.iframeOrigin = undefined;
|
|
11
12
|
this.singleLine = undefined;
|
|
12
|
-
this.height = 55;
|
|
13
13
|
}
|
|
14
14
|
connectedCallback() {
|
|
15
15
|
window.addEventListener('message', this.dispatchMessageEvent.bind(this));
|
|
@@ -17,10 +17,6 @@ export class PaymentMethodForm {
|
|
|
17
17
|
disconnectedCallback() {
|
|
18
18
|
window.removeEventListener('message', this.dispatchMessageEvent.bind(this));
|
|
19
19
|
}
|
|
20
|
-
componentShouldUpdate() {
|
|
21
|
-
this.sendStyleOverrides();
|
|
22
|
-
this.resize();
|
|
23
|
-
}
|
|
24
20
|
sendStyleOverrides() {
|
|
25
21
|
if (this.computedTheme) {
|
|
26
22
|
this.postMessage(MessageEventType[this.paymentMethodFormType].styleOverrides, { styleOverrides: this.computedTheme });
|
|
@@ -33,14 +29,14 @@ export class PaymentMethodForm {
|
|
|
33
29
|
if (messageType === MessageEventType[this.paymentMethodFormType].ready) {
|
|
34
30
|
this.paymentMethodFormReady.emit(messageData);
|
|
35
31
|
}
|
|
36
|
-
if (messageType === MessageEventType[this.paymentMethodFormType].resize) {
|
|
37
|
-
this.height = messageData.height;
|
|
38
|
-
}
|
|
39
32
|
}
|
|
40
33
|
postMessage(eventType, payload) {
|
|
41
34
|
var _a, _b;
|
|
42
35
|
(_b = (_a = this.iframeElement) === null || _a === void 0 ? void 0 : _a.contentWindow) === null || _b === void 0 ? void 0 : _b.postMessage(Object.assign({ eventType: eventType }, payload), this.iframeOrigin || process.env.IFRAME_ORIGIN || '*');
|
|
43
36
|
}
|
|
37
|
+
async resize() {
|
|
38
|
+
this.postMessage(MessageEventType[this.paymentMethodFormType].resize);
|
|
39
|
+
}
|
|
44
40
|
async postMessageWithResponseListener(eventType, payload) {
|
|
45
41
|
return new Promise(resolve => {
|
|
46
42
|
const responseListener = (event) => {
|
|
@@ -66,9 +62,6 @@ export class PaymentMethodForm {
|
|
|
66
62
|
async validate() {
|
|
67
63
|
return this.postMessageWithResponseListener(MessageEventType[this.paymentMethodFormType].validate);
|
|
68
64
|
}
|
|
69
|
-
async resize() {
|
|
70
|
-
this.postMessage(MessageEventType[this.paymentMethodFormType].resize);
|
|
71
|
-
}
|
|
72
65
|
composeQueryParams(values) {
|
|
73
66
|
const queryParams = values.map(value => {
|
|
74
67
|
if (value === values[0]) {
|
|
@@ -93,9 +86,11 @@ export class PaymentMethodForm {
|
|
|
93
86
|
return iframeSrc.concat(this.composeQueryParams(paramsList));
|
|
94
87
|
}
|
|
95
88
|
render() {
|
|
96
|
-
return (h(Host, null, h("iframe", { id: `justifi-payment-method-form-${this.paymentMethodFormType}`, src: this.getIframeSrc(), ref: el =>
|
|
89
|
+
return (h(Host, null, h("iframe", { id: `justifi-payment-method-form-${this.paymentMethodFormType}`, src: this.getIframeSrc(), ref: el => {
|
|
90
|
+
this.iframeElement = el;
|
|
91
|
+
}, onLoad: () => {
|
|
92
|
+
iFrameResize({ log: true }, this.iframeElement);
|
|
97
93
|
this.sendStyleOverrides();
|
|
98
|
-
this.resize();
|
|
99
94
|
} })));
|
|
100
95
|
}
|
|
101
96
|
static get is() { return "justifi-payment-method-form"; }
|
|
@@ -181,11 +176,6 @@ export class PaymentMethodForm {
|
|
|
181
176
|
}
|
|
182
177
|
};
|
|
183
178
|
}
|
|
184
|
-
static get states() {
|
|
185
|
-
return {
|
|
186
|
-
"height": {}
|
|
187
|
-
};
|
|
188
|
-
}
|
|
189
179
|
static get events() {
|
|
190
180
|
return [{
|
|
191
181
|
"method": "paymentMethodFormReady",
|
|
@@ -221,6 +211,23 @@ export class PaymentMethodForm {
|
|
|
221
211
|
}
|
|
222
212
|
static get methods() {
|
|
223
213
|
return {
|
|
214
|
+
"resize": {
|
|
215
|
+
"complexType": {
|
|
216
|
+
"signature": "() => Promise<any>",
|
|
217
|
+
"parameters": [],
|
|
218
|
+
"references": {
|
|
219
|
+
"Promise": {
|
|
220
|
+
"location": "global",
|
|
221
|
+
"id": "global::Promise"
|
|
222
|
+
}
|
|
223
|
+
},
|
|
224
|
+
"return": "Promise<any>"
|
|
225
|
+
},
|
|
226
|
+
"docs": {
|
|
227
|
+
"text": "",
|
|
228
|
+
"tags": []
|
|
229
|
+
}
|
|
230
|
+
},
|
|
224
231
|
"tokenize": {
|
|
225
232
|
"complexType": {
|
|
226
233
|
"signature": "(clientId: string, paymentMethodMetadata: any, account?: string) => Promise<CreatePaymentMethodResponse>",
|
|
@@ -268,23 +275,6 @@ export class PaymentMethodForm {
|
|
|
268
275
|
"text": "",
|
|
269
276
|
"tags": []
|
|
270
277
|
}
|
|
271
|
-
},
|
|
272
|
-
"resize": {
|
|
273
|
-
"complexType": {
|
|
274
|
-
"signature": "() => Promise<any>",
|
|
275
|
-
"parameters": [],
|
|
276
|
-
"references": {
|
|
277
|
-
"Promise": {
|
|
278
|
-
"location": "global",
|
|
279
|
-
"id": "global::Promise"
|
|
280
|
-
}
|
|
281
|
-
},
|
|
282
|
-
"return": "Promise<any>"
|
|
283
|
-
},
|
|
284
|
-
"docs": {
|
|
285
|
-
"text": "",
|
|
286
|
-
"tags": []
|
|
287
|
-
}
|
|
288
278
|
}
|
|
289
279
|
};
|
|
290
280
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"payment-method-form.js","sourceRoot":"","sources":["../../../../src/components/payment-method-form/payment-method-form.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,EAAgB,MAAM,EAAE,
|
|
1
|
+
{"version":3,"file":"payment-method-form.js","sourceRoot":"","sources":["../../../../src/components/payment-method-form/payment-method-form.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,EAAgB,MAAM,EAAE,MAAM,eAAe,CAAC;AACtF,OAAO,YAAY,MAAM,iCAAiC,CAAC;AAC3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAEzD,OAAO,WAAW,MAAM,uBAAuB,CAAC;AAChD,OAAO,gBAAgB,MAAM,sBAAsB,CAAC;AAQpD,MAAM,OAAO,iBAAiB;;IAWpB,kBAAa,GAAU,gBAAgB,EAAE,CAAC;;;;;;EAIlD,iBAAiB;IACf,MAAM,CAAC,gBAAgB,CAAC,SAAS,EAAE,IAAI,CAAC,oBAAoB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;EAC3E,CAAC;EAED,oBAAoB;IAClB,MAAM,CAAC,mBAAmB,CAAC,SAAS,EAAE,IAAI,CAAC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AI,OAAO,CAAC,GAAG,CAAC,aAAa,IAAI,0BAA0B,CAAC;IAClG,IAAI,SAAS,GAAG,GAAG,YAAY,IAAI,IAAI,CAAC,qBAAqB,EAAE,CAAC;IAChE,IAAI,UAAU,GAAG,EAAE,CAAC;IACpB,IAAI,IAAI,CAAC,+BAA+B,EAAE;MACxC,UAAU,CAAC,IAAI,CAAC,kBAAkB,IAAI,CAAC,+BAA+B,EAAE,CAAC,CAAC;KAC3E;IACD,IAAI,IAAI,CAAC,UAAU,EAAE;MACnB,UAAU,CAAC,IAAI,CAAC,cAAc,IAAI,CAAC,UAAU,EAAE,CAAC,CAAC;KAClD;IAED,OAAO,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,kBAAkB,CAAC,UAAU,CAAC,CAAC,CAAC;EAC/D,CAAC;EAED,MAAM;IACJ,OAAO,CACL,EAAC,IAAI;MACH,cACE,EAAE,EAAE,+BAA+B,IAAI,CAAC,qBAAqB,EAAE,EAC/D,GAAG,EAAE,IAAI,CAAC,YAAY,EAAE,EACxB,GAAG,EAAE,EAAE,CAAC,EAAE;UACR,IAAI,CAAC,aAAa,GAAG,EAAuB,CAAC;QAC/C,CAAC,EACD,MAAM,EAAE,GAAG,EAAE;UACX,YAAY,CAAC,EAAE,GAAG,EAAE,IAAI,EAAE,EAAE,IAAI,CAAC,aAAa,CAAC,CAAC;UAChD,IAAI,CAAC,kBAAkB,EAAE,CAAC;QAC5B,CAAC,GACO,CACL,CACR,CAAC;EACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Event, Host, Prop, h, EventEmitter, Method } from '@stencil/core';\nimport iFrameResize from 'iframe-resizer/js/iframeResizer';\nimport { MessageEventType } from './message-event-types';\nimport { Theme } from './theme';\nimport packageJson from '../../../package.json';\nimport getComputedTheme from './get-computed-theme';\nimport { CreatePaymentMethodResponse } from './payment-method-responses';\n\n@Component({\n tag: 'justifi-payment-method-form',\n styleUrl: 'payment-method-form.css',\n shadow: false,\n})\nexport class PaymentMethodForm {\n @Prop() paymentMethodFormType: 'card' | 'bankAccount';\n @Prop({\n mutable: true,\n })\n paymentMethodFormValidationMode: 'onChange' | 'onBlur' | 'onSubmit' | 'onTouched' | 'all';\n @Prop() iframeOrigin?: string;\n @Prop() singleLine: boolean;\n @Event({ bubbles: true }) paymentMethodFormReady: EventEmitter;\n @Event({ bubbles: true }) paymentMethodFormTokenize: EventEmitter<{ data: any }>;\n\n private computedTheme: Theme = getComputedTheme();\n\n iframeElement!: HTMLIFrameElement;\n\n connectedCallback() {\n window.addEventListener('message', this.dispatchMessageEvent.bind(this));\n }\n\n disconnectedCallback() {\n window.removeEventListener('message', this.dispatchMessageEvent.bind(this));\n }\n\n sendStyleOverrides() {\n if (this.computedTheme) {\n this.postMessage(MessageEventType[this.paymentMethodFormType].styleOverrides, { styleOverrides: this.computedTheme });\n }\n }\n\n private dispatchMessageEvent(messageEvent: MessageEvent) {\n const messagePayload = messageEvent.data;\n const messageType = messagePayload.eventType;\n const messageData = messagePayload.data;\n\n if (messageType === MessageEventType[this.paymentMethodFormType].ready) {\n this.paymentMethodFormReady.emit(messageData);\n }\n }\n\n private postMessage(eventType: string, payload?: any) {\n this.iframeElement?.contentWindow?.postMessage({ eventType: eventType, ...payload }, this.iframeOrigin || process.env.IFRAME_ORIGIN || '*');\n }\n\n @Method()\n async resize(): Promise<any> {\n this.postMessage(MessageEventType[this.paymentMethodFormType].resize);\n }\n\n private async postMessageWithResponseListener(eventType: string, payload?: any): Promise<any> {\n return new Promise(resolve => {\n const responseListener = (event: MessageEvent) => {\n if (event.data.eventType !== eventType) return;\n window.removeEventListener('message', responseListener);\n resolve(event.data.data);\n };\n window.addEventListener('message', responseListener);\n this.postMessage(eventType, payload);\n });\n }\n\n @Method()\n async tokenize(clientId: string, paymentMethodMetadata: any, account?: string): Promise<CreatePaymentMethodResponse> {\n const eventType = MessageEventType[this.paymentMethodFormType].tokenize;\n const payload = {\n clientId: clientId,\n componentVersion: packageJson.version,\n paymentMethodMetadata: paymentMethodMetadata,\n account: account,\n };\n\n return this.postMessageWithResponseListener(eventType, payload);\n }\n\n @Method()\n async validate(): Promise<any> {\n return this.postMessageWithResponseListener(MessageEventType[this.paymentMethodFormType].validate);\n }\n\n private composeQueryParams(values: string[]) {\n const queryParams = values.map(value => {\n if (value === values[0]) {\n return (value = `?${value}`);\n } else {\n return (value = `&${value}`);\n }\n });\n return queryParams.join('');\n }\n\n private getIframeSrc() {\n const iframeOrigin = this.iframeOrigin || process.env.IFRAME_ORIGIN || 'https://js.justifi.ai/v2';\n let iframeSrc = `${iframeOrigin}/${this.paymentMethodFormType}`;\n let paramsList = [];\n if (this.paymentMethodFormValidationMode) {\n paramsList.push(`validationMode=${this.paymentMethodFormValidationMode}`);\n }\n if (this.singleLine) {\n paramsList.push(`singleLine=${this.singleLine}`);\n }\n\n return iframeSrc.concat(this.composeQueryParams(paramsList));\n }\n\n render() {\n return (\n <Host>\n <iframe\n id={`justifi-payment-method-form-${this.paymentMethodFormType}`}\n src={this.getIframeSrc()}\n ref={el => {\n this.iframeElement = el as HTMLIFrameElement;\n }}\n onLoad={() => {\n iFrameResize({ log: true }, this.iframeElement);\n this.sendStyleOverrides();\n }}\n ></iframe>\n </Host>\n );\n }\n}\n"]}
|
|
@@ -9,7 +9,7 @@ describe('justifi-payment-method-form', () => {
|
|
|
9
9
|
});
|
|
10
10
|
expect(page.root).toEqualHtml(`
|
|
11
11
|
<justifi-payment-method-form>
|
|
12
|
-
<iframe
|
|
12
|
+
<iframe id="justifi-payment-method-form-card" src="https://js.justifi.ai/v2/card"></iframe>
|
|
13
13
|
</justifi-payment-method-form>
|
|
14
14
|
`);
|
|
15
15
|
});
|
|
@@ -20,7 +20,7 @@ describe('justifi-payment-method-form', () => {
|
|
|
20
20
|
});
|
|
21
21
|
expect(page.root).toEqualHtml(`
|
|
22
22
|
<justifi-payment-method-form>
|
|
23
|
-
<iframe
|
|
23
|
+
<iframe id="justifi-payment-method-form-card" src="https://js.justifi.ai/v2/card"></iframe>
|
|
24
24
|
</justifi-payment-method-form>
|
|
25
25
|
`);
|
|
26
26
|
});
|
|
@@ -31,7 +31,7 @@ describe('justifi-payment-method-form', () => {
|
|
|
31
31
|
});
|
|
32
32
|
expect(page.root).toEqualHtml(`
|
|
33
33
|
<justifi-payment-method-form>
|
|
34
|
-
<iframe
|
|
34
|
+
<iframe id="justifi-payment-method-form-bankAccount" src="https://js.justifi.ai/v2/bankAccount"></iframe>
|
|
35
35
|
</justifi-payment-method-form>
|
|
36
36
|
`);
|
|
37
37
|
});
|
|
@@ -42,7 +42,7 @@ describe('justifi-payment-method-form', () => {
|
|
|
42
42
|
});
|
|
43
43
|
expect(page.root).toEqualHtml(`
|
|
44
44
|
<justifi-payment-method-form>
|
|
45
|
-
<iframe
|
|
45
|
+
<iframe id="justifi-payment-method-form-bankAccount" src="https://js.justifi.ai/v2/bankAccount?validationMode=onChange"></iframe>
|
|
46
46
|
</justifi-payment-method-form>
|
|
47
47
|
`);
|
|
48
48
|
});
|
|
@@ -53,7 +53,7 @@ describe('justifi-payment-method-form', () => {
|
|
|
53
53
|
});
|
|
54
54
|
expect(page.root).toEqualHtml(`
|
|
55
55
|
<justifi-payment-method-form>
|
|
56
|
-
<iframe
|
|
56
|
+
<iframe id="justifi-payment-method-form-bankAccount" src="https://js.justifi.ai/v2/bankAccount?validationMode=onBlur"></iframe>
|
|
57
57
|
</justifi-payment-method-form>
|
|
58
58
|
`);
|
|
59
59
|
});
|
|
@@ -64,7 +64,7 @@ describe('justifi-payment-method-form', () => {
|
|
|
64
64
|
});
|
|
65
65
|
expect(page.root).toEqualHtml(`
|
|
66
66
|
<justifi-payment-method-form>
|
|
67
|
-
<iframe
|
|
67
|
+
<iframe id="justifi-payment-method-form-card" src="https://js.justifi.ai/v2/card"></iframe>
|
|
68
68
|
</justifi-payment-method-form>
|
|
69
69
|
`);
|
|
70
70
|
});
|
|
@@ -75,7 +75,7 @@ describe('justifi-payment-method-form', () => {
|
|
|
75
75
|
});
|
|
76
76
|
expect(page.root).toEqualHtml(`
|
|
77
77
|
<justifi-payment-method-form>
|
|
78
|
-
<iframe
|
|
78
|
+
<iframe id="justifi-payment-method-form-card" src="https://js.justifi.ai/v2/card?singleLine=true"></iframe>
|
|
79
79
|
</justifi-payment-method-form>
|
|
80
80
|
`);
|
|
81
81
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"payment-method-form.spec.js","sourceRoot":"","sources":["../../../../../src/components/payment-method-form/test/payment-method-form.spec.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAClC,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAE3D,QAAQ,CAAC,6BAA6B,EAAE,GAAG,EAAE;EAC3C,EAAE,CAAC,mBAAmB,EAAE,KAAK,IAAI,EAAE;IACjC,MAAM,IAAI,GAAG,MAAM,WAAW,CAAC;MAC7B,UAAU,EAAE,CAAC,iBAAiB,CAAC;MAC/B,QAAQ,EAAE,GAAG,EAAE,CAAC,mCAA6B,qBAAqB,EAAC,MAAM,GAA+B;KACzG,CAAC,CAAC;IACH,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,WAAW,CAAC;;;;GAI/B,CAAC,CAAC;EACH,CAAC,CAAC,CAAC;EAEH,EAAE,CAAC,0DAA0D,EAAE,KAAK,IAAI,EAAE;IACxE,MAAM,IAAI,GAAG,MAAM,WAAW,CAAC;MAC7B,UAAU,EAAE,CAAC,iBAAiB,CAAC;MAC/B,QAAQ,EAAE,GAAG,EAAE,CAAC,m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EAAE,KAAK,IAAI,EAAE;IAClH,MAAM,IAAI,GAAG,MAAM,WAAW,CAAC;MAC7B,UAAU,EAAE,CAAC,iBAAiB,CAAC;MAC/B,QAAQ,EAAE,GAAG,EAAE,CAAC,mCAA6B,qBAAqB,EAAC,MAAM,EAAC,YAAY,EAAC,0BAA0B,GAA+B;KACjJ,CAAC,CAAC;IAEH,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,WAAW,CAAC;;;;KAI7B,CAAC,CAAC;EACL,CAAC,CAAC,CAAC;EAEH,EAAE,CAAC,gGAAgG,EAAE,KAAK,IAAI,EAAE;IAC9G,MAAM,IAAI,GAAG,MAAM,WAAW,CAAC;MAC7B,UAAU,EAAE,CAAC,iBAAiB,CAAC;MAC/B,QAAQ,EAAE,GAAG,EAAE,CAAC,mCAA6B,qBAAqB,EAAC,MAAM,EAAC,UAAU,EAAE,IAAI,GAAgC;KAC3H,CAAC,CAAC;IAEH,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,WAAW,CAAC;;;;KAI7B,CAAC,CAAC;EACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { h } from '@stencil/core';\nimport { newSpecPage } from '@stencil/core/testing';\nimport { PaymentMethodForm } from '../payment-method-form';\n\ndescribe('justifi-payment-method-form', () => {\n it('renders an iframe', async () => {\n const page = await newSpecPage({\n components: [PaymentMethodForm],\n template: () => <justifi-payment-method-form paymentMethodFormType=\"card\"></justifi-payment-method-form>,\n });\n expect(page.root).toEqualHtml(`\n <justifi-payment-method-form>\n <iframe
|
|
1
|
+
{"version":3,"file":"payment-method-form.spec.js","sourceRoot":"","sources":["../../../../../src/components/payment-method-form/test/payment-method-form.spec.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAClC,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB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C,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { h } from '@stencil/core';\nimport { newSpecPage } from '@stencil/core/testing';\nimport { PaymentMethodForm } from '../payment-method-form';\n\ndescribe('justifi-payment-method-form', () => {\n it('renders an iframe', async () => {\n const page = await newSpecPage({\n components: [PaymentMethodForm],\n template: () => <justifi-payment-method-form paymentMethodFormType=\"card\"></justifi-payment-method-form>,\n });\n expect(page.root).toEqualHtml(`\n <justifi-payment-method-form>\n <iframe id=\"justifi-payment-method-form-card\" src=\"https://js.justifi.ai/v2/card\"></iframe>\n </justifi-payment-method-form>\n `);\n });\n\n it('renders a card iframe when paymentMethodFormType is card', async () => {\n const page = await newSpecPage({\n components: [PaymentMethodForm],\n template: () => <justifi-payment-method-form paymentMethodFormType=\"card\"></justifi-payment-method-form>,\n });\n expect(page.root).toEqualHtml(`\n <justifi-payment-method-form>\n <iframe id=\"justifi-payment-method-form-card\" src=\"https://js.justifi.ai/v2/card\"></iframe>\n </justifi-payment-method-form>\n `);\n });\n\n it('renders a bank iframe when paymentMethodFormType is bank', async () => {\n const page = await newSpecPage({\n components: [PaymentMethodForm],\n template: () => <justifi-payment-method-form paymentMethodFormType=\"bankAccount\"></justifi-payment-method-form>,\n });\n expect(page.root).toEqualHtml(`\n <justifi-payment-method-form>\n <iframe id=\"justifi-payment-method-form-bankAccount\" src=\"https://js.justifi.ai/v2/bankAccount\"></iframe>\n </justifi-payment-method-form>\n `);\n });\n\n it('renders a card iframe with validationMode when paymentMethodFormType is card and paymentMethodFormValidationMode is set', async () => {\n const page = await newSpecPage({\n components: [PaymentMethodForm],\n template: () => <justifi-payment-method-form paymentMethodFormType=\"bankAccount\" paymentMethodFormValidationMode=\"onChange\"></justifi-payment-method-form>,\n });\n\n expect(page.root).toEqualHtml(`\n <justifi-payment-method-form>\n <iframe id=\"justifi-payment-method-form-bankAccount\" src=\"https://js.justifi.ai/v2/bankAccount?validationMode=onChange\"></iframe>\n </justifi-payment-method-form>\n `);\n });\n\n it('renders a card iframe with validationMode when paymentMethodFormType is card and paymentMethodFormValidationMode is set', async () => {\n const page = await newSpecPage({\n components: [PaymentMethodForm],\n template: () => <justifi-payment-method-form paymentMethodFormType=\"bankAccount\" paymentMethodFormValidationMode=\"onBlur\"></justifi-payment-method-form>,\n });\n\n expect(page.root).toEqualHtml(`\n <justifi-payment-method-form>\n <iframe id=\"justifi-payment-method-form-bankAccount\" src=\"https://js.justifi.ai/v2/bankAccount?validationMode=onBlur\"></iframe>\n </justifi-payment-method-form>\n `);\n });\n\n it('renders a card iframe with iframeOrigin when paymentMethodFormType is card and iframeOrigin is set', async () => {\n const page = await newSpecPage({\n components: [PaymentMethodForm],\n template: () => <justifi-payment-method-form paymentMethodFormType=\"card\" iframeOrigin=\"https://js.justifi.ai/v2\"></justifi-payment-method-form>,\n });\n\n expect(page.root).toEqualHtml(`\n <justifi-payment-method-form>\n <iframe id=\"justifi-payment-method-form-card\" src=\"https://js.justifi.ai/v2/card\"></iframe>\n </justifi-payment-method-form>\n `);\n });\n\n it('renders a card iframe with singleLine when paymentMethodFormType is card and singleLine is set', async () => {\n const page = await newSpecPage({\n components: [PaymentMethodForm],\n template: () => <justifi-payment-method-form paymentMethodFormType=\"card\" singleLine={true}></justifi-payment-method-form>,\n });\n\n expect(page.root).toEqualHtml(`\n <justifi-payment-method-form>\n <iframe id=\"justifi-payment-method-form-card\" src=\"https://js.justifi.ai/v2/card?singleLine=true\"></iframe>\n </justifi-payment-method-form>\n `);\n });\n});\n"]}
|
|
@@ -46,8 +46,10 @@ const BankAccountForm = /*@__PURE__*/ proxyCustomElement(class BankAccountForm e
|
|
|
46
46
|
}
|
|
47
47
|
/**
|
|
48
48
|
* Manually resizes the iframe to fit the contents of the iframe
|
|
49
|
+
* @deprecated This method will be removed in future releases.
|
|
49
50
|
*/
|
|
50
51
|
async resize() {
|
|
52
|
+
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.`);
|
|
51
53
|
if (!this.childRef) {
|
|
52
54
|
throw new Error('Cannot call validate');
|
|
53
55
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"file":"justifi-bank-account-form.js","mappings":";;;MAQa,eAAe;;;;;;;;;;;;EAsC1B,YAAY,CAAC,KAAkB;IAC7B,OAAO,CAAC,IAAI,CAAC,yGAAyG,CAAC,CAAC;IACxH,IAAI,CAAC,oBAAoB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACtC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;GACxB;EAGD,eAAe,CAAC,KAAoB;IAClC,OAAO,CAAC,IAAI,CACV,+MAA+M,CAChN,CAAC;IACF,IAAI,CAAC,uBAAuB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;GAC1C;EAGD,eAAe,CAAC,KAAoB;IAClC,OAAO,CAAC,IAAI,CACV,+MAA+M,CAChN,CAAC;IACF,IAAI,CAAC,uBAAuB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;GAC1C;;;;EAQD,MAAM,QAAQ,CAAC,GAAG,IAAiE;IACjF,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE;MAClB,MAAM,IAAI,KAAK,CAAC,sBAAsB,CAAC,CAAC;KACzC;IACD,OAAO,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,GAAG,IAAI,CAAC,CAAC;GACxC;;;;EAMD,MAAM,QAAQ;IACZ,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE;MAClB,MAAM,IAAI,KAAK,CAAC,sBAAsB,CAAC,CAAC;KACzC;IACD,OAAO,IAAI,CAAC,QAAQ,CAAC,QAAQ,EAAE,CAAC;GACjC
|
|
1
|
+
{"file":"justifi-bank-account-form.js","mappings":";;;MAQa,eAAe;;;;;;;;;;;;EAsC1B,YAAY,CAAC,KAAkB;IAC7B,OAAO,CAAC,IAAI,CAAC,yGAAyG,CAAC,CAAC;IACxH,IAAI,CAAC,oBAAoB,CAAC,IAAI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,IAAI,CAAC,cAAc,IAAI,UAAU,GACtE,EACF;GACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/components/bank-account-form/bank-account-form.tsx"],"sourcesContent":["import { Component, Event, Prop, h, EventEmitter, Listen, Method, State } from '@stencil/core';\nimport { CreatePaymentMethodResponse } from '../payment-method-form/payment-method-responses';\nimport { Theme } from '../payment-method-form/theme';\n\n@Component({\n tag: 'justifi-bank-account-form',\n shadow: false,\n})\nexport class BankAccountForm {\n /**\n * When to trigger validation of the form.\n */\n @Prop({ mutable: true }) validationMode: 'onChange' | 'onBlur' | 'onSubmit' | 'onTouched' | 'all';\n\n /**\n * URL for the rendered iFrame. End-users need not use this.\n */\n @Prop({ mutable: true }) iframeOrigin?: string;\n\n @State() internalStyleOverrides: Theme;\n\n /**\n * Triggered when iframe has loaded\n * @event justifi-bank-account-form#bankAccountFormReady\n */\n @Event() bankAccountFormReady: EventEmitter<any>;\n\n /**\n * Triggered when iframe has loaded\n * @event justifi-bank-account-form#ready\n */\n @Event() ready: EventEmitter<any>;\n\n /**\n * Triggered when the tokenize method is called on the component\n * @event justifi-bank-account-form#bankAccountFormTokenize\n */\n @Event() bankAccountFormTokenize: EventEmitter<{ data: any }>;\n\n /**\n * Triggered when the validate method is called on the component\n * @event justifi-bank-account-form#bankAccountFormValidate\n */\n @Event() bankAccountFormValidate: EventEmitter<{ data: { isValid: boolean } }>;\n\n @Listen('paymentMethodFormReady')\n readyHandler(event: CustomEvent) {\n console.warn(`The 'bankAccountFormReady' event is deprecated in the next major release and will be renamed to 'ready'`);\n this.bankAccountFormReady.emit(event);\n this.ready.emit(event);\n }\n\n @Listen('paymentMethodFormTokenize')\n tokenizeHandler(event: { data: any }) {\n console.warn(\n `The 'bankAccountFormTokenize' 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.`,\n );\n this.bankAccountFormTokenize.emit(event);\n }\n\n @Listen('paymentMethodFormValidate')\n validateHandler(event: { data: any }) {\n console.warn(\n `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.`,\n );\n this.bankAccountFormValidate.emit(event);\n }\n\n private childRef?: HTMLJustifiPaymentMethodFormElement;\n\n /**\n * Makes a tokenization request to the iframe\n */\n @Method()\n async tokenize(...args: Parameters<HTMLJustifiPaymentMethodFormElement['tokenize']>): Promise<CreatePaymentMethodResponse> {\n if (!this.childRef) {\n throw new Error('Cannot call tokenize');\n }\n return this.childRef.tokenize(...args);\n }\n\n /**\n * Runs a validation on the form and shows errors if any\n */\n @Method()\n async validate() {\n if (!this.childRef) {\n throw new Error('Cannot call validate');\n }\n return this.childRef.validate();\n }\n\n /**\n * Manually resizes the iframe to fit the contents of the iframe\n * @deprecated This method will be removed in future releases.\n */\n @Method()\n async resize(): Promise<void> {\n console.warn(\n `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.`,\n );\n if (!this.childRef) {\n throw new Error('Cannot call validate');\n }\n return this.childRef.resize();\n }\n\n render() {\n return (\n <justifi-payment-method-form\n ref={el => {\n if (el) {\n this.childRef = el;\n }\n }}\n iframe-origin={this.iframeOrigin}\n payment-method-form-type=\"bankAccount\"\n payment-method-form-ready={this.bankAccountFormReady}\n payment-method-form-tokenize={this.bankAccountFormTokenize}\n payment-method-form-validation-mode={this.validationMode || 'onSubmit'}\n />\n );\n }\n}\n"],"version":3}
|
|
@@ -47,8 +47,10 @@ const CardForm = /*@__PURE__*/ proxyCustomElement(class CardForm extends HTMLEle
|
|
|
47
47
|
}
|
|
48
48
|
/**
|
|
49
49
|
* Manually resizes the iframe to fit the contents of the iframe
|
|
50
|
+
* @deprecated This method will be removed in future releases.
|
|
50
51
|
*/
|
|
51
52
|
async resize() {
|
|
53
|
+
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.`);
|
|
52
54
|
if (!this.childRef) {
|
|
53
55
|
throw new Error('Cannot call validate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CAAC,cAAc,IAAI,UAAU,GACtE,EACF;GACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":[],"sources":["src/components/card-form/card-form.tsx"],"sourcesContent":["import { Component, Event, Prop, h, EventEmitter, Method, Listen, State } from '@stencil/core';\nimport { CreatePaymentMethodResponse } from '../payment-method-form/payment-method-responses';\nimport { Theme } from '../payment-method-form/theme';\n\n@Component({\n tag: 'justifi-card-form',\n shadow: false,\n})\nexport class CardForm {\n /**\n * When to trigger validation of the form.\n */\n @Prop({ mutable: true }) validationMode: 'onChange' | 'onBlur' | 'onSubmit' | 'onTouched' | 'all';\n\n /**\n * URL for the rendered iFrame. End-users need not use this.\n */\n @Prop({ mutable: true }) iframeOrigin?: string;\n\n /**\n * Boolean indicating if the Card Form should render in a single line\n */\n @Prop() singleLine: boolean = false;\n\n @State() internalStyleOverrides: Theme;\n\n /**\n * Triggered when iframe has loaded\n * @event justifi-card-form#cardFormReady\n */\n\n @Event() cardFormReady: EventEmitter;\n\n /**\n * Triggered when iframe has loaded\n * @event justifi-card-form#ready\n */\n\n @Event() ready: EventEmitter;\n\n /**\n * Triggered when the tokenize method is called on the component\n * @event justifi-card-form#cardFormTokenize\n */\n @Event() cardFormTokenize: EventEmitter<{ data: any }>;\n\n /**\n * Triggered when the validate method is called on the component\n * @event justifi-card-form#cardFormTokenize\n */\n @Event() cardFormValidate: EventEmitter<{ data: { isValid: boolean } }>;\n\n @Listen('paymentMethodFormReady')\n readyHandler(event: CustomEvent) {\n console.warn(`The 'cardFormReady' event is deprecated in the next major release and will be renamed to 'ready'`);\n this.cardFormReady.emit(event);\n this.ready.emit(event);\n }\n\n @Listen('paymentMethodFormTokenize')\n tokenizeHandler(event: { data: any }) {\n console.warn(\n `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.`,\n );\n this.cardFormTokenize.emit(event);\n }\n\n @Listen('paymentMethodFormValidate')\n validateHandler(event: { data: any }) {\n console.warn(\n `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.`,\n );\n this.cardFormValidate.emit(event);\n }\n\n private childRef?: HTMLJustifiPaymentMethodFormElement;\n\n /**\n * Makes a tokenization request to the iframe\n */\n @Method()\n async tokenize(...args: Parameters<HTMLJustifiPaymentMethodFormElement['tokenize']>): Promise<CreatePaymentMethodResponse> {\n if (!this.childRef) {\n throw new Error('Cannot call tokenize');\n }\n return this.childRef.tokenize(...args);\n }\n\n /**\n * Runs a validation on the form and shows errors if any\n */\n @Method()\n async validate(): Promise<{ isValid: boolean }> {\n if (!this.childRef) {\n throw new Error('Cannot call validate');\n }\n return this.childRef.validate();\n }\n\n /**\n * Manually resizes the iframe to fit the contents of the iframe\n * @deprecated This method will be removed in future releases.\n */\n @Method()\n async resize(): Promise<void> {\n console.warn(\n `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.`,\n );\n if (!this.childRef) {\n throw new Error('Cannot call validate');\n }\n return this.childRef.resize();\n }\n\n render() {\n return (\n <justifi-payment-method-form\n ref={el => {\n if (el) {\n this.childRef = el;\n }\n }}\n iframe-origin={this.iframeOrigin}\n payment-method-form-type=\"card\"\n single-line={this.singleLine}\n payment-method-form-ready={this.cardFormReady}\n payment-method-form-tokenize={this.cardFormTokenize}\n payment-method-form-validation-mode={this.validationMode || 'onSubmit'}\n />\n );\n }\n}\n"],"version":3}
|