@justifi/webcomponents 0.2.0 → 0.2.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.
Files changed (50) hide show
  1. package/CHANGELOG.md +5 -0
  2. package/dist/cjs/{index-3947d225.js → index-ca2cd154.js} +391 -96
  3. package/dist/cjs/justifi-bank-account-form.cjs.entry.js +1 -1
  4. package/dist/cjs/justifi-billing-form.cjs.entry.js +1 -1
  5. package/dist/cjs/justifi-card-form.cjs.entry.js +1 -1
  6. package/dist/cjs/justifi-payment-form.cjs.entry.js +17 -0
  7. package/dist/cjs/justifi-payment-method-form.cjs.entry.js +84 -2
  8. package/dist/cjs/justifi-payments-list.cjs.entry.js +1 -1
  9. package/dist/cjs/loader.cjs.js +3 -4
  10. package/dist/cjs/select-input_2.cjs.entry.js +1 -1
  11. package/dist/cjs/webcomponents.cjs.js +3 -7
  12. package/dist/collection/collection-manifest.json +3 -2
  13. package/dist/collection/components/card-form/card-form.stories.js +132 -0
  14. package/dist/collection/components/payment-form/payment-form.js +31 -0
  15. package/dist/collection/components/payment-method-form/payment-method-form.js +3 -1
  16. package/dist/components/index.d.ts +1 -9
  17. package/dist/components/index.js +2 -1
  18. package/dist/components/justifi-payment-form.d.ts +11 -0
  19. package/dist/components/justifi-payment-form.js +32 -0
  20. package/dist/components/payment-method-form.js +83 -1
  21. package/dist/esm/{index-0bcf33c4.js → index-05706eb5.js} +392 -96
  22. package/dist/esm/justifi-bank-account-form.entry.js +1 -1
  23. package/dist/esm/justifi-billing-form.entry.js +1 -1
  24. package/dist/esm/justifi-card-form.entry.js +1 -1
  25. package/dist/esm/justifi-payment-form.entry.js +13 -0
  26. package/dist/esm/justifi-payment-method-form.entry.js +84 -2
  27. package/dist/esm/justifi-payments-list.entry.js +1 -1
  28. package/dist/esm/loader.js +3 -4
  29. package/dist/esm/polyfills/css-shim.js +1 -1
  30. package/dist/esm/select-input_2.entry.js +1 -1
  31. package/dist/esm/webcomponents.js +3 -4
  32. package/dist/types/api/Api.d.ts +1 -1
  33. package/dist/types/api/Payment.d.ts +1 -1
  34. package/dist/types/components/card-form/card-form.stories.d.ts +14 -0
  35. package/dist/types/components/payment-form/payment-form.d.ts +4 -0
  36. package/dist/types/components.d.ts +15 -0
  37. package/dist/types/stencil-public-runtime.d.ts +3 -59
  38. package/dist/webcomponents/{p-0cddfd4f.entry.js → p-3809130a.entry.js} +1 -1
  39. package/dist/webcomponents/{p-17badb93.entry.js → p-67be9585.entry.js} +1 -1
  40. package/dist/webcomponents/{p-d3dc4e0a.entry.js → p-787671b9.entry.js} +1 -1
  41. package/dist/webcomponents/{p-864e32fd.entry.js → p-87654bf4.entry.js} +1 -1
  42. package/dist/webcomponents/p-8ee06fd1.js +2 -0
  43. package/dist/webcomponents/p-94ef2d0e.entry.js +1 -0
  44. package/dist/webcomponents/p-c07191dc.entry.js +1 -0
  45. package/dist/webcomponents/{p-7fd07095.entry.js → p-e5b0f047.entry.js} +1 -1
  46. package/dist/webcomponents/webcomponents.esm.js +1 -1
  47. package/loader/index.d.ts +0 -9
  48. package/package.json +16 -3
  49. package/dist/webcomponents/p-cecf0fe8.entry.js +0 -1
  50. package/dist/webcomponents/p-e82c9746.js +0 -2
@@ -1,4 +1,4 @@
1
- import { r as registerInstance, c as createEvent, h } from './index-0bcf33c4.js';
1
+ import { r as registerInstance, c as createEvent, h } from './index-05706eb5.js';
2
2
 
3
3
  const BankAccountForm = class {
4
4
  constructor(hostRef) {
@@ -1,4 +1,4 @@
1
- import { r as registerInstance, h, H as Host } from './index-0bcf33c4.js';
1
+ import { r as registerInstance, h, H as Host } from './index-05706eb5.js';
2
2
 
3
3
  /**
4
4
  * Based on Kendo UI Core expression code <https://github.com/telerik/kendo-ui-core#license-information>
@@ -1,4 +1,4 @@
1
- import { r as registerInstance, c as createEvent, h } from './index-0bcf33c4.js';
1
+ import { r as registerInstance, c as createEvent, h } from './index-05706eb5.js';
2
2
 
3
3
  const CardForm = class {
4
4
  constructor(hostRef) {
@@ -0,0 +1,13 @@
1
+ import { r as registerInstance, h, H as Host } from './index-05706eb5.js';
2
+
3
+ const PaymentForm = class {
4
+ constructor(hostRef) {
5
+ registerInstance(this, hostRef);
6
+ this.validationStrategy = undefined;
7
+ }
8
+ render() {
9
+ return (h(Host, null, h("form", null, h("slot", null))));
10
+ }
11
+ };
12
+
13
+ export { PaymentForm as justifi_payment_form };
@@ -1,4 +1,4 @@
1
- import { r as registerInstance, c as createEvent, h, H as Host } from './index-0bcf33c4.js';
1
+ import { r as registerInstance, c as createEvent, h, H as Host } from './index-05706eb5.js';
2
2
 
3
3
  const MessageEventType = {
4
4
  card: {
@@ -17,6 +17,87 @@ const MessageEventType = {
17
17
  }
18
18
  };
19
19
 
20
+ const name = "@justifi/webcomponents";
21
+ const version = "0.2.1";
22
+ const description = "JustiFi Web Components";
23
+ const main = "dist/index.cjs.js";
24
+ const module = "dist/index.js";
25
+ const es2015 = "dist/esm/index.mjs";
26
+ const es2017 = "dist/esm/index.mjs";
27
+ const types = "dist/types/index.d.ts";
28
+ const collection = "dist/collection/collection-manifest.json";
29
+ const unpkg = "dist/stencil-webcomponents/stencil-webcomponents.esm.js";
30
+ const repository = {
31
+ type: "git",
32
+ url: "git+https://github.com/justifi-tech/web-component-library.git"
33
+ };
34
+ const publishConfig = {
35
+ registry: "https://registry.npmjs.org"
36
+ };
37
+ const files = [
38
+ "dist/",
39
+ "loader/"
40
+ ];
41
+ const scripts = {
42
+ "auto-changelog": "auto-changelog",
43
+ release: "release-it --no-npm",
44
+ build: "stencil build --docs",
45
+ start: "concurrently -c \"bgBlue.bold,bgMagenta.bold,bgGreen.bold\" \"yarn run start-stencil\" \"yarn run storybook\"",
46
+ "start-stencil": "stencil build --watch --serve --no-open",
47
+ test: "stencil test --spec --e2e",
48
+ "test:watch": "stencil test --spec --e2e --watchAll",
49
+ generate: "stencil generate",
50
+ storybook: "start-storybook -p 6006",
51
+ "build-storybook": "build-storybook"
52
+ };
53
+ const dependencies = {
54
+ "@stencil/core": "^2.13.0",
55
+ "@stencil/react-output-target": "^0.3.1",
56
+ "date-fns": "^2.29.3",
57
+ "dinero.js": "^1.9.1",
58
+ uuid: "^9.0.0",
59
+ yup: "^1.0.0"
60
+ };
61
+ const devDependencies = {
62
+ "@pxtrn/storybook-addon-docs-stencil": "^6.4.1",
63
+ "@storybook/addon-actions": "^6.5.16",
64
+ "@storybook/addon-essentials": "^6.5.16",
65
+ "@storybook/addon-interactions": "^6.5.16",
66
+ "@storybook/addon-links": "^6.5.16",
67
+ "@storybook/builder-webpack4": "^6.5.16",
68
+ "@storybook/html": "^6.5.16",
69
+ "@storybook/manager-webpack4": "^6.5.16",
70
+ "@storybook/testing-library": "^0.0.13",
71
+ "@types/jest": "^27.0.3",
72
+ "auto-changelog": "^2.4.0",
73
+ concurrently: "^7.6.0",
74
+ jest: "^27.4.5",
75
+ "jest-cli": "^27.4.5",
76
+ puppeteer: "^10.0.0",
77
+ "release-it": "^15.6.0"
78
+ };
79
+ const license = "MIT";
80
+ const packageJson = {
81
+ name: name,
82
+ version: version,
83
+ description: description,
84
+ main: main,
85
+ module: module,
86
+ es2015: es2015,
87
+ es2017: es2017,
88
+ types: types,
89
+ collection: collection,
90
+ "collection:main": "dist/collection/index.js",
91
+ unpkg: unpkg,
92
+ repository: repository,
93
+ publishConfig: publishConfig,
94
+ files: files,
95
+ scripts: scripts,
96
+ dependencies: dependencies,
97
+ devDependencies: devDependencies,
98
+ license: license
99
+ };
100
+
20
101
  const paymentMethodFormCss = ":host{display:block}justifi-payment-method-form iframe{border:none;width:100%}";
21
102
 
22
103
  const PaymentMethodForm = class {
@@ -76,8 +157,9 @@ const PaymentMethodForm = class {
76
157
  const eventType = MessageEventType[this.paymentMethodFormType].tokenize;
77
158
  const payload = {
78
159
  clientId: clientId,
160
+ componentVersion: packageJson.version,
79
161
  paymentMethodMetadata: paymentMethodMetadata,
80
- account: account
162
+ account: account,
81
163
  };
82
164
  return this.postMessageWithResponseListener(eventType, payload);
83
165
  }
@@ -1,4 +1,4 @@
1
- import { r as registerInstance, h, H as Host } from './index-0bcf33c4.js';
1
+ import { r as registerInstance, h, H as Host } from './index-05706eb5.js';
2
2
 
3
3
  // Unique ID creation requires a high quality random # generator. In the browser we therefore
4
4
  // require the crypto API and do not support built-in fallback to lower quality random number
@@ -1,8 +1,7 @@
1
- import { p as promiseResolve, b as bootstrapLazy } from './index-0bcf33c4.js';
2
- export { s as setNonce } from './index-0bcf33c4.js';
1
+ import { p as promiseResolve, b as bootstrapLazy } from './index-05706eb5.js';
3
2
 
4
3
  /*
5
- Stencil Client Patch Esm v2.22.3 | MIT Licensed | https://stenciljs.com
4
+ Stencil Client Patch Esm v2.20.0 | MIT Licensed | https://stenciljs.com
6
5
  */
7
6
  const patchEsm = () => {
8
7
  return promiseResolve();
@@ -11,7 +10,7 @@ const patchEsm = () => {
11
10
  const defineCustomElements = (win, options) => {
12
11
  if (typeof window === 'undefined') return Promise.resolve();
13
12
  return patchEsm().then(() => {
14
- return bootstrapLazy([["justifi-billing-form",[[1,"justifi-billing-form",{"billingFields":[32],"billingFieldsErrors":[32],"validate":[64]},[[0,"fieldReceivedInput","setFormValue"]]]]],["justifi-payment-method-form",[[0,"justifi-payment-method-form",{"paymentMethodFormType":[1,"payment-method-form-type"],"paymentMethodFormValidationStrategy":[1,"payment-method-form-validation-strategy"],"paymentMethodStyleOverrides":[16],"height":[32],"tokenize":[64],"validate":[64]}]]],["justifi-bank-account-form",[[0,"justifi-bank-account-form",{"validationStrategy":[1,"validation-strategy"],"styleOverrides":[1,"style-overrides"],"internalStyleOverrides":[32],"tokenize":[64],"validate":[64]},[[0,"paymentMethodFormReady","readyHandler"],[0,"paymentMethodFormTokenize","tokenizeHandler"],[0,"paymentMethodFormValidate","validateHandler"]]]]],["justifi-card-form",[[0,"justifi-card-form",{"validationStrategy":[1,"validation-strategy"],"styleOverrides":[1,"style-overrides"],"internalStyleOverrides":[32],"tokenize":[64],"validate":[64]},[[0,"paymentMethodFormReady","readyHandler"],[0,"paymentMethodFormTokenize","tokenizeHandler"],[0,"paymentMethodFormValidate","validateHandler"]]]]],["justifi-payments-list",[[1,"justifi-payments-list",{"accountId":[1,"account-id"],"auth":[16],"payments":[32]}]]],["select-input_2",[[1,"select-input",{"name":[1],"label":[1],"defaultValue":[1,"default-value"],"error":[1],"options":[16],"internalValue":[32]}],[1,"text-input",{"name":[1],"label":[1],"defaultValue":[1,"default-value"],"error":[1],"internalValue":[32]}]]]], options);
13
+ return bootstrapLazy([["justifi-billing-form",[[1,"justifi-billing-form",{"billingFields":[32],"billingFieldsErrors":[32],"validate":[64]},[[0,"fieldReceivedInput","setFormValue"]]]]],["justifi-bank-account-form",[[0,"justifi-bank-account-form",{"validationStrategy":[1,"validation-strategy"],"styleOverrides":[1,"style-overrides"],"internalStyleOverrides":[32],"tokenize":[64],"validate":[64]},[[0,"paymentMethodFormReady","readyHandler"],[0,"paymentMethodFormTokenize","tokenizeHandler"],[0,"paymentMethodFormValidate","validateHandler"]]]]],["justifi-card-form",[[0,"justifi-card-form",{"validationStrategy":[1,"validation-strategy"],"styleOverrides":[1,"style-overrides"],"internalStyleOverrides":[32],"tokenize":[64],"validate":[64]},[[0,"paymentMethodFormReady","readyHandler"],[0,"paymentMethodFormTokenize","tokenizeHandler"],[0,"paymentMethodFormValidate","validateHandler"]]]]],["justifi-payment-form",[[4,"justifi-payment-form",{"validationStrategy":[1,"validation-strategy"]}]]],["justifi-payments-list",[[1,"justifi-payments-list",{"accountId":[1,"account-id"],"auth":[16],"payments":[32]}]]],["select-input_2",[[1,"select-input",{"name":[1],"label":[1],"defaultValue":[1,"default-value"],"error":[1],"options":[16],"internalValue":[32]}],[1,"text-input",{"name":[1],"label":[1],"defaultValue":[1,"default-value"],"error":[1],"internalValue":[32]}]]],["justifi-payment-method-form",[[0,"justifi-payment-method-form",{"paymentMethodFormType":[1,"payment-method-form-type"],"paymentMethodFormValidationStrategy":[1,"payment-method-form-validation-strategy"],"paymentMethodStyleOverrides":[16],"height":[32],"tokenize":[64],"validate":[64]}]]]], options);
15
14
  });
16
15
  };
17
16
 
@@ -1 +1 @@
1
- var __assign=this&&this.__assign||function(){return __assign=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var s in t=arguments[r])Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s]);return e},__assign.apply(this,arguments)},StyleNode=function(){this.start=0,this.end=0,this.previous=null,this.parent=null,this.rules=null,this.parsedCssText="",this.cssText="",this.atRule=!1,this.type=0,this.keyframesName="",this.selector="",this.parsedSelector=""};function parse(e){return parseCss(lex(e=clean(e)),e)}function clean(e){return e.replace(RX.comments,"").replace(RX.port,"")}function lex(e){var t=new StyleNode;t.start=0,t.end=e.length;for(var r=t,n=0,s=e.length;n<s;n++)if(e[n]===OPEN_BRACE){r.rules||(r.rules=[]);var o=r,a=o.rules[o.rules.length-1]||null;(r=new StyleNode).start=n+1,r.parent=o,r.previous=a,o.rules.push(r)}else e[n]===CLOSE_BRACE&&(r.end=n+1,r=r.parent||t);return t}function parseCss(e,t){var r=t.substring(e.start,e.end-1);if(e.parsedCssText=e.cssText=r.trim(),e.parent){var n=e.previous?e.previous.end:e.parent.start;r=(r=(r=_expandUnicodeEscapes(r=t.substring(n,e.start-1))).replace(RX.multipleSpaces," ")).substring(r.lastIndexOf(";")+1);var s=e.parsedSelector=e.selector=r.trim();e.atRule=0===s.indexOf(AT_START),e.atRule?0===s.indexOf(MEDIA_START)?e.type=types.MEDIA_RULE:s.match(RX.keyframesRule)&&(e.type=types.KEYFRAMES_RULE,e.keyframesName=e.selector.split(RX.multipleSpaces).pop()):0===s.indexOf(VAR_START)?e.type=types.MIXIN_RULE:e.type=types.STYLE_RULE}var o=e.rules;if(o)for(var a=0,i=o.length,l=void 0;a<i&&(l=o[a]);a++)parseCss(l,t);return e}function _expandUnicodeEscapes(e){return e.replace(/\\([0-9a-f]{1,6})\s/gi,(function(){for(var e=arguments[1],t=6-e.length;t--;)e="0"+e;return"\\"+e}))}var types={STYLE_RULE:1,KEYFRAMES_RULE:7,MEDIA_RULE:4,MIXIN_RULE:1e3},OPEN_BRACE="{",CLOSE_BRACE="}",RX={comments:/\/\*[^*]*\*+([^/*][^*]*\*+)*\//gim,port:/@import[^;]*;/gim,customProp:/(?:^[^;\-\s}]+)?--[^;{}]*?:[^{};]*?(?:[;\n]|$)/gim,mixinProp:/(?:^[^;\-\s}]+)?--[^;{}]*?:[^{};]*?{[^}]*?}(?:[;\n]|$)?/gim,mixinApply:/@apply\s*\(?[^);]*\)?\s*(?:[;\n]|$)?/gim,varApply:/[^;:]*?:[^;]*?var\([^;]*\)(?:[;\n]|$)?/gim,keyframesRule:/^@[^\s]*keyframes/,multipleSpaces:/\s+/g},VAR_START="--",MEDIA_START="@media",AT_START="@",VAR_USAGE_START=/\bvar\(/,VAR_ASSIGN_START=/\B--[\w-]+\s*:/,COMMENTS=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//gim,TRAILING_LINES=/^[\t ]+\n/gm;function findRegex(e,t,r){e.lastIndex=0;var n=t.substring(r).match(e);if(n){var s=r+n.index;return{start:s,end:s+n[0].length}}return null}function resolveVar(e,t,r){return e[t]?e[t]:r?executeTemplate(r,e):""}function findVarEndIndex(e,t){for(var r=0,n=t;n<e.length;n++){var s=e[n];if("("===s)r++;else if(")"===s&&--r<=0)return n+1}return n}function parseVar(e,t){var r=findRegex(VAR_USAGE_START,e,t);if(!r)return null;var n=findVarEndIndex(e,r.start),s=e.substring(r.end,n-1).split(","),o=s[0],a=s.slice(1);return{start:r.start,end:n,propName:o.trim(),fallback:a.length>0?a.join(",").trim():void 0}}function compileVar(e,t,r){var n=parseVar(e,r);if(!n)return t.push(e.substring(r,e.length)),e.length;var s=n.propName,o=null!=n.fallback?compileTemplate(n.fallback):void 0;return t.push(e.substring(r,n.start),(function(e){return resolveVar(e,s,o)})),n.end}function executeTemplate(e,t){for(var r="",n=0;n<e.length;n++){var s=e[n];r+="string"==typeof s?s:s(t)}return r}function findEndValue(e,t){for(var r=!1,n=!1,s=t;s<e.length;s++){var o=e[s];if(r)n&&'"'===o&&(r=!1),n||"'"!==o||(r=!1);else if('"'===o)r=!0,n=!0;else if("'"===o)r=!0,n=!1;else{if(";"===o)return s+1;if("}"===o)return s}}return s}function removeCustomAssigns(e){for(var t="",r=0;;){var n=findRegex(VAR_ASSIGN_START,e,r),s=n?n.start:e.length;if(t+=e.substring(r,s),!n)break;r=findEndValue(e,s)}return t}function compileTemplate(e){var t=0;e=removeCustomAssigns(e=e.replace(COMMENTS,"")).replace(TRAILING_LINES,"");for(var r=[];t<e.length;)t=compileVar(e,r,t);return r}function resolveValues(e){var t={};e.forEach((function(e){e.declarations.forEach((function(e){t[e.prop]=e.value}))}));for(var r={},n=Object.entries(t),s=function(e){var t=!1;if(n.forEach((function(e){var n=e[0],s=executeTemplate(e[1],r);s!==r[n]&&(r[n]=s,t=!0)})),!t)return"break"},o=0;o<10;o++){if("break"===s())break}return r}function getSelectors(e,t){if(void 0===t&&(t=0),!e.rules)return[];var r=[];return e.rules.filter((function(e){return e.type===types.STYLE_RULE})).forEach((function(e){var n=getDeclarations(e.cssText);n.length>0&&e.parsedSelector.split(",").forEach((function(e){e=e.trim(),r.push({selector:e,declarations:n,specificity:computeSpecificity(),nu:t})})),t++})),r}function computeSpecificity(e){return 1}var IMPORTANT="!important",FIND_DECLARATIONS=/(?:^|[;\s{]\s*)(--[\w-]*?)\s*:\s*(?:((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};{])+)|\{([^}]*)\}(?:(?=[;\s}])|$))/gm;function getDeclarations(e){for(var t,r=[];t=FIND_DECLARATIONS.exec(e.trim());){var n=normalizeValue(t[2]),s=n.value,o=n.important;r.push({prop:t[1].trim(),value:compileTemplate(s),important:o})}return r}function normalizeValue(e){var t=(e=e.replace(/\s+/gim," ").trim()).endsWith(IMPORTANT);return t&&(e=e.slice(0,e.length-IMPORTANT.length).trim()),{value:e,important:t}}function getActiveSelectors(e,t,r){var n=[],s=getScopesForElement(t,e);return r.forEach((function(e){return n.push(e)})),s.forEach((function(e){return n.push(e)})),sortSelectors(getSelectorsForScopes(n).filter((function(t){return matches(e,t.selector)})))}function getScopesForElement(e,t){for(var r=[];t;){var n=e.get(t);n&&r.push(n),t=t.parentElement}return r}function getSelectorsForScopes(e){var t=[];return e.forEach((function(e){t.push.apply(t,e.selectors)})),t}function sortSelectors(e){return e.sort((function(e,t){return e.specificity===t.specificity?e.nu-t.nu:e.specificity-t.specificity})),e}function matches(e,t){return":root"===t||"html"===t||e.matches(t)}function parseCSS(e){var t=parse(e),r=compileTemplate(e);return{original:e,template:r,selectors:getSelectors(t),usesCssVars:r.length>1}}function addGlobalStyle(e,t){if(e.some((function(e){return e.styleEl===t})))return!1;var r=parseCSS(t.textContent);return r.styleEl=t,e.push(r),!0}function updateGlobalScopes(e){var t=resolveValues(getSelectorsForScopes(e));e.forEach((function(e){e.usesCssVars&&(e.styleEl.textContent=executeTemplate(e.template,t))}))}function reScope(e,t){var r=e.template.map((function(r){return"string"==typeof r?replaceScope(r,e.scopeId,t):r})),n=e.selectors.map((function(r){return __assign(__assign({},r),{selector:replaceScope(r.selector,e.scopeId,t)})}));return __assign(__assign({},e),{template:r,selectors:n,scopeId:t})}function replaceScope(e,t,r){return e=replaceAll(e,"\\.".concat(t),".".concat(r))}function replaceAll(e,t,r){return e.replace(new RegExp(t,"g"),r)}function loadDocument(e,t){return loadDocumentStyles(e,t),loadDocumentLinks(e,t).then((function(){updateGlobalScopes(t)}))}function startWatcher(e,t){"undefined"!=typeof MutationObserver&&new MutationObserver((function(){loadDocumentStyles(e,t)&&updateGlobalScopes(t)})).observe(document.head,{childList:!0})}function loadDocumentLinks(e,t){for(var r=[],n=e.querySelectorAll('link[rel="stylesheet"][href]:not([data-no-shim])'),s=0;s<n.length;s++)r.push(addGlobalLink(e,t,n[s]));return Promise.all(r)}function loadDocumentStyles(e,t){return Array.from(e.querySelectorAll("style:not([data-styles]):not([data-no-shim])")).map((function(e){return addGlobalStyle(t,e)})).some(Boolean)}function addGlobalLink(e,t,r){var n=r.href;return fetch(n).then((function(e){return e.text()})).then((function(s){if(hasCssVariables(s)&&r.parentNode){hasRelativeUrls(s)&&(s=fixRelativeUrls(s,n));var o=e.createElement("style");o.setAttribute("data-styles",""),o.textContent=s,addGlobalStyle(t,o),r.parentNode.insertBefore(o,r),r.remove()}})).catch((function(e){console.error(e)}))}var CSS_VARIABLE_REGEXP=/[\s;{]--[-a-zA-Z0-9]+\s*:/m;function hasCssVariables(e){return e.indexOf("var(")>-1||CSS_VARIABLE_REGEXP.test(e)}var CSS_URL_REGEXP=/url[\s]*\([\s]*['"]?(?!(?:https?|data)\:|\/)([^\'\"\)]*)[\s]*['"]?\)[\s]*/gim;function hasRelativeUrls(e){return CSS_URL_REGEXP.lastIndex=0,CSS_URL_REGEXP.test(e)}function fixRelativeUrls(e,t){var r=t.replace(/[^/]*$/,"");return e.replace(CSS_URL_REGEXP,(function(e,t){var n=r+t;return e.replace(t,n)}))}var CustomStyle=function(){function e(e,t){this.win=e,this.doc=t,this.count=0,this.hostStyleMap=new WeakMap,this.hostScopeMap=new WeakMap,this.globalScopes=[],this.scopesMap=new Map,this.didInit=!1}return e.prototype.i=function(){var e=this;return this.didInit||!this.win.requestAnimationFrame?Promise.resolve():(this.didInit=!0,new Promise((function(t){e.win.requestAnimationFrame((function(){startWatcher(e.doc,e.globalScopes),loadDocument(e.doc,e.globalScopes).then((function(){return t()}))}))})))},e.prototype.addLink=function(e){var t=this;return addGlobalLink(this.doc,this.globalScopes,e).then((function(){t.updateGlobal()}))},e.prototype.addGlobalStyle=function(e){addGlobalStyle(this.globalScopes,e)&&this.updateGlobal()},e.prototype.createHostStyle=function(e,t,r,n){if(this.hostScopeMap.has(e))throw new Error("host style already created");var s=this.registerHostTemplate(r,t,n),o=this.doc.createElement("style");return o.setAttribute("data-no-shim",""),s.usesCssVars?n?(o["s-sc"]=t="".concat(s.scopeId,"-").concat(this.count),o.textContent="/*needs update*/",this.hostStyleMap.set(e,o),this.hostScopeMap.set(e,reScope(s,t)),this.count++):(s.styleEl=o,s.usesCssVars||(o.textContent=executeTemplate(s.template,{})),this.globalScopes.push(s),this.updateGlobal(),this.hostScopeMap.set(e,s)):o.textContent=r,o},e.prototype.removeHost=function(e){var t=this.hostStyleMap.get(e);t&&t.remove(),this.hostStyleMap.delete(e),this.hostScopeMap.delete(e)},e.prototype.updateHost=function(e){var t=this.hostScopeMap.get(e);if(t&&t.usesCssVars&&t.isScoped){var r=this.hostStyleMap.get(e);if(r){var n=resolveValues(getActiveSelectors(e,this.hostScopeMap,this.globalScopes));r.textContent=executeTemplate(t.template,n)}}},e.prototype.updateGlobal=function(){updateGlobalScopes(this.globalScopes)},e.prototype.registerHostTemplate=function(e,t,r){var n=this.scopesMap.get(t);return n||((n=parseCSS(e)).scopeId=t,n.isScoped=r,this.scopesMap.set(t,n)),n},e}();!function(e){!e||e.__cssshim||e.CSS&&e.CSS.supports&&e.CSS.supports("color","var(--c)")||(e.__cssshim=new CustomStyle(e,e.document))}("undefined"!=typeof window&&window);
1
+ var __assign=this&&this.__assign||function(){return(__assign=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var s in t=arguments[r])Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s]);return e}).apply(this,arguments)},StyleNode=function(){this.start=0,this.end=0,this.previous=null,this.parent=null,this.rules=null,this.parsedCssText="",this.cssText="",this.atRule=!1,this.type=0,this.keyframesName="",this.selector="",this.parsedSelector=""};function parse(e){return parseCss(lex(e=clean(e)),e)}function clean(e){return e.replace(RX.comments,"").replace(RX.port,"")}function lex(e){var t=new StyleNode;t.start=0,t.end=e.length;for(var r=t,n=0,s=e.length;n<s;n++)if(e[n]===OPEN_BRACE){r.rules||(r.rules=[]);var o=r,a=o.rules[o.rules.length-1]||null;(r=new StyleNode).start=n+1,r.parent=o,r.previous=a,o.rules.push(r)}else e[n]===CLOSE_BRACE&&(r.end=n+1,r=r.parent||t);return t}function parseCss(e,t){var r=t.substring(e.start,e.end-1);if(e.parsedCssText=e.cssText=r.trim(),e.parent){var n=e.previous?e.previous.end:e.parent.start;r=(r=(r=_expandUnicodeEscapes(r=t.substring(n,e.start-1))).replace(RX.multipleSpaces," ")).substring(r.lastIndexOf(";")+1);var s=e.parsedSelector=e.selector=r.trim();e.atRule=0===s.indexOf(AT_START),e.atRule?0===s.indexOf(MEDIA_START)?e.type=types.MEDIA_RULE:s.match(RX.keyframesRule)&&(e.type=types.KEYFRAMES_RULE,e.keyframesName=e.selector.split(RX.multipleSpaces).pop()):0===s.indexOf(VAR_START)?e.type=types.MIXIN_RULE:e.type=types.STYLE_RULE}var o=e.rules;if(o)for(var a=0,i=o.length,l=void 0;a<i&&(l=o[a]);a++)parseCss(l,t);return e}function _expandUnicodeEscapes(e){return e.replace(/\\([0-9a-f]{1,6})\s/gi,(function(){for(var e=arguments[1],t=6-e.length;t--;)e="0"+e;return"\\"+e}))}var types={STYLE_RULE:1,KEYFRAMES_RULE:7,MEDIA_RULE:4,MIXIN_RULE:1e3},OPEN_BRACE="{",CLOSE_BRACE="}",RX={comments:/\/\*[^*]*\*+([^/*][^*]*\*+)*\//gim,port:/@import[^;]*;/gim,customProp:/(?:^[^;\-\s}]+)?--[^;{}]*?:[^{};]*?(?:[;\n]|$)/gim,mixinProp:/(?:^[^;\-\s}]+)?--[^;{}]*?:[^{};]*?{[^}]*?}(?:[;\n]|$)?/gim,mixinApply:/@apply\s*\(?[^);]*\)?\s*(?:[;\n]|$)?/gim,varApply:/[^;:]*?:[^;]*?var\([^;]*\)(?:[;\n]|$)?/gim,keyframesRule:/^@[^\s]*keyframes/,multipleSpaces:/\s+/g},VAR_START="--",MEDIA_START="@media",AT_START="@",VAR_USAGE_START=/\bvar\(/,VAR_ASSIGN_START=/\B--[\w-]+\s*:/,COMMENTS=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//gim,TRAILING_LINES=/^[\t ]+\n/gm;function findRegex(e,t,r){e.lastIndex=0;var n=t.substring(r).match(e);if(n){var s=r+n.index;return{start:s,end:s+n[0].length}}return null}function resolveVar(e,t,r){return e[t]?e[t]:r?executeTemplate(r,e):""}function findVarEndIndex(e,t){for(var r=0,n=t;n<e.length;n++){var s=e[n];if("("===s)r++;else if(")"===s&&--r<=0)return n+1}return n}function parseVar(e,t){var r=findRegex(VAR_USAGE_START,e,t);if(!r)return null;var n=findVarEndIndex(e,r.start),s=e.substring(r.end,n-1).split(","),o=s[0],a=s.slice(1);return{start:r.start,end:n,propName:o.trim(),fallback:a.length>0?a.join(",").trim():void 0}}function compileVar(e,t,r){var n=parseVar(e,r);if(!n)return t.push(e.substring(r,e.length)),e.length;var s=n.propName,o=null!=n.fallback?compileTemplate(n.fallback):void 0;return t.push(e.substring(r,n.start),(function(e){return resolveVar(e,s,o)})),n.end}function executeTemplate(e,t){for(var r="",n=0;n<e.length;n++){var s=e[n];r+="string"==typeof s?s:s(t)}return r}function findEndValue(e,t){for(var r=!1,n=!1,s=t;s<e.length;s++){var o=e[s];if(r)n&&'"'===o&&(r=!1),n||"'"!==o||(r=!1);else if('"'===o)r=!0,n=!0;else if("'"===o)r=!0,n=!1;else{if(";"===o)return s+1;if("}"===o)return s}}return s}function removeCustomAssigns(e){for(var t="",r=0;;){var n=findRegex(VAR_ASSIGN_START,e,r),s=n?n.start:e.length;if(t+=e.substring(r,s),!n)break;r=findEndValue(e,s)}return t}function compileTemplate(e){var t=0;e=removeCustomAssigns(e=e.replace(COMMENTS,"")).replace(TRAILING_LINES,"");for(var r=[];t<e.length;)t=compileVar(e,r,t);return r}function resolveValues(e){var t={};e.forEach((function(e){e.declarations.forEach((function(e){t[e.prop]=e.value}))}));for(var r={},n=Object.entries(t),s=function(e){var t=!1;if(n.forEach((function(e){var n=e[0],s=executeTemplate(e[1],r);s!==r[n]&&(r[n]=s,t=!0)})),!t)return"break"},o=0;o<10;o++){if("break"===s())break}return r}function getSelectors(e,t){if(void 0===t&&(t=0),!e.rules)return[];var r=[];return e.rules.filter((function(e){return e.type===types.STYLE_RULE})).forEach((function(e){var n=getDeclarations(e.cssText);n.length>0&&e.parsedSelector.split(",").forEach((function(e){e=e.trim(),r.push({selector:e,declarations:n,specificity:computeSpecificity(),nu:t})})),t++})),r}function computeSpecificity(e){return 1}var IMPORTANT="!important",FIND_DECLARATIONS=/(?:^|[;\s{]\s*)(--[\w-]*?)\s*:\s*(?:((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};{])+)|\{([^}]*)\}(?:(?=[;\s}])|$))/gm;function getDeclarations(e){for(var t,r=[];t=FIND_DECLARATIONS.exec(e.trim());){var n=normalizeValue(t[2]),s=n.value,o=n.important;r.push({prop:t[1].trim(),value:compileTemplate(s),important:o})}return r}function normalizeValue(e){var t=(e=e.replace(/\s+/gim," ").trim()).endsWith(IMPORTANT);return t&&(e=e.slice(0,e.length-IMPORTANT.length).trim()),{value:e,important:t}}function getActiveSelectors(e,t,r){var n=[],s=getScopesForElement(t,e);return r.forEach((function(e){return n.push(e)})),s.forEach((function(e){return n.push(e)})),sortSelectors(getSelectorsForScopes(n).filter((function(t){return matches(e,t.selector)})))}function getScopesForElement(e,t){for(var r=[];t;){var n=e.get(t);n&&r.push(n),t=t.parentElement}return r}function getSelectorsForScopes(e){var t=[];return e.forEach((function(e){t.push.apply(t,e.selectors)})),t}function sortSelectors(e){return e.sort((function(e,t){return e.specificity===t.specificity?e.nu-t.nu:e.specificity-t.specificity})),e}function matches(e,t){return":root"===t||"html"===t||e.matches(t)}function parseCSS(e){var t=parse(e),r=compileTemplate(e);return{original:e,template:r,selectors:getSelectors(t),usesCssVars:r.length>1}}function addGlobalStyle(e,t){if(e.some((function(e){return e.styleEl===t})))return!1;var r=parseCSS(t.textContent);return r.styleEl=t,e.push(r),!0}function updateGlobalScopes(e){var t=resolveValues(getSelectorsForScopes(e));e.forEach((function(e){e.usesCssVars&&(e.styleEl.textContent=executeTemplate(e.template,t))}))}function reScope(e,t){var r=e.template.map((function(r){return"string"==typeof r?replaceScope(r,e.scopeId,t):r})),n=e.selectors.map((function(r){return __assign(__assign({},r),{selector:replaceScope(r.selector,e.scopeId,t)})}));return __assign(__assign({},e),{template:r,selectors:n,scopeId:t})}function replaceScope(e,t,r){return e=replaceAll(e,"\\.".concat(t),".".concat(r))}function replaceAll(e,t,r){return e.replace(new RegExp(t,"g"),r)}function loadDocument(e,t){return loadDocumentStyles(e,t),loadDocumentLinks(e,t).then((function(){updateGlobalScopes(t)}))}function startWatcher(e,t){"undefined"!=typeof MutationObserver&&new MutationObserver((function(){loadDocumentStyles(e,t)&&updateGlobalScopes(t)})).observe(document.head,{childList:!0})}function loadDocumentLinks(e,t){for(var r=[],n=e.querySelectorAll('link[rel="stylesheet"][href]:not([data-no-shim])'),s=0;s<n.length;s++)r.push(addGlobalLink(e,t,n[s]));return Promise.all(r)}function loadDocumentStyles(e,t){return Array.from(e.querySelectorAll("style:not([data-styles]):not([data-no-shim])")).map((function(e){return addGlobalStyle(t,e)})).some(Boolean)}function addGlobalLink(e,t,r){var n=r.href;return fetch(n).then((function(e){return e.text()})).then((function(s){if(hasCssVariables(s)&&r.parentNode){hasRelativeUrls(s)&&(s=fixRelativeUrls(s,n));var o=e.createElement("style");o.setAttribute("data-styles",""),o.textContent=s,addGlobalStyle(t,o),r.parentNode.insertBefore(o,r),r.remove()}})).catch((function(e){console.error(e)}))}var CSS_VARIABLE_REGEXP=/[\s;{]--[-a-zA-Z0-9]+\s*:/m;function hasCssVariables(e){return e.indexOf("var(")>-1||CSS_VARIABLE_REGEXP.test(e)}var CSS_URL_REGEXP=/url[\s]*\([\s]*['"]?(?!(?:https?|data)\:|\/)([^\'\"\)]*)[\s]*['"]?\)[\s]*/gim;function hasRelativeUrls(e){return CSS_URL_REGEXP.lastIndex=0,CSS_URL_REGEXP.test(e)}function fixRelativeUrls(e,t){var r=t.replace(/[^/]*$/,"");return e.replace(CSS_URL_REGEXP,(function(e,t){var n=r+t;return e.replace(t,n)}))}var CustomStyle=function(){function e(e,t){this.win=e,this.doc=t,this.count=0,this.hostStyleMap=new WeakMap,this.hostScopeMap=new WeakMap,this.globalScopes=[],this.scopesMap=new Map,this.didInit=!1}return e.prototype.i=function(){var e=this;return this.didInit||!this.win.requestAnimationFrame?Promise.resolve():(this.didInit=!0,new Promise((function(t){e.win.requestAnimationFrame((function(){startWatcher(e.doc,e.globalScopes),loadDocument(e.doc,e.globalScopes).then((function(){return t()}))}))})))},e.prototype.addLink=function(e){var t=this;return addGlobalLink(this.doc,this.globalScopes,e).then((function(){t.updateGlobal()}))},e.prototype.addGlobalStyle=function(e){addGlobalStyle(this.globalScopes,e)&&this.updateGlobal()},e.prototype.createHostStyle=function(e,t,r,n){if(this.hostScopeMap.has(e))throw new Error("host style already created");var s=this.registerHostTemplate(r,t,n),o=this.doc.createElement("style");return o.setAttribute("data-no-shim",""),s.usesCssVars?n?(o["s-sc"]=t="".concat(s.scopeId,"-").concat(this.count),o.textContent="/*needs update*/",this.hostStyleMap.set(e,o),this.hostScopeMap.set(e,reScope(s,t)),this.count++):(s.styleEl=o,s.usesCssVars||(o.textContent=executeTemplate(s.template,{})),this.globalScopes.push(s),this.updateGlobal(),this.hostScopeMap.set(e,s)):o.textContent=r,o},e.prototype.removeHost=function(e){var t=this.hostStyleMap.get(e);t&&t.remove(),this.hostStyleMap.delete(e),this.hostScopeMap.delete(e)},e.prototype.updateHost=function(e){var t=this.hostScopeMap.get(e);if(t&&t.usesCssVars&&t.isScoped){var r=this.hostStyleMap.get(e);if(r){var n=resolveValues(getActiveSelectors(e,this.hostScopeMap,this.globalScopes));r.textContent=executeTemplate(t.template,n)}}},e.prototype.updateGlobal=function(){updateGlobalScopes(this.globalScopes)},e.prototype.registerHostTemplate=function(e,t,r){var n=this.scopesMap.get(t);return n||((n=parseCSS(e)).scopeId=t,n.isScoped=r,this.scopesMap.set(t,n)),n},e}();!function(e){!e||e.__cssshim||e.CSS&&e.CSS.supports&&e.CSS.supports("color","var(--c)")||(e.__cssshim=new CustomStyle(e,e.document))}("undefined"!=typeof window&&window);
@@ -1,4 +1,4 @@
1
- import { r as registerInstance, c as createEvent, h, H as Host } from './index-0bcf33c4.js';
1
+ import { r as registerInstance, c as createEvent, h, H as Host } from './index-05706eb5.js';
2
2
 
3
3
  const selectInputCss = ":host{display:block}label{display:block}";
4
4
 
@@ -1,8 +1,7 @@
1
- import { p as promiseResolve, b as bootstrapLazy } from './index-0bcf33c4.js';
2
- export { s as setNonce } from './index-0bcf33c4.js';
1
+ import { p as promiseResolve, b as bootstrapLazy } from './index-05706eb5.js';
3
2
 
4
3
  /*
5
- Stencil Client Patch Browser v2.22.3 | MIT Licensed | https://stenciljs.com
4
+ Stencil Client Patch Browser v2.20.0 | MIT Licensed | https://stenciljs.com
6
5
  */
7
6
  const patchBrowser = () => {
8
7
  const importMeta = import.meta.url;
@@ -14,5 +13,5 @@ const patchBrowser = () => {
14
13
  };
15
14
 
16
15
  patchBrowser().then(options => {
17
- return bootstrapLazy([["justifi-billing-form",[[1,"justifi-billing-form",{"billingFields":[32],"billingFieldsErrors":[32],"validate":[64]},[[0,"fieldReceivedInput","setFormValue"]]]]],["justifi-payment-method-form",[[0,"justifi-payment-method-form",{"paymentMethodFormType":[1,"payment-method-form-type"],"paymentMethodFormValidationStrategy":[1,"payment-method-form-validation-strategy"],"paymentMethodStyleOverrides":[16],"height":[32],"tokenize":[64],"validate":[64]}]]],["justifi-bank-account-form",[[0,"justifi-bank-account-form",{"validationStrategy":[1,"validation-strategy"],"styleOverrides":[1,"style-overrides"],"internalStyleOverrides":[32],"tokenize":[64],"validate":[64]},[[0,"paymentMethodFormReady","readyHandler"],[0,"paymentMethodFormTokenize","tokenizeHandler"],[0,"paymentMethodFormValidate","validateHandler"]]]]],["justifi-card-form",[[0,"justifi-card-form",{"validationStrategy":[1,"validation-strategy"],"styleOverrides":[1,"style-overrides"],"internalStyleOverrides":[32],"tokenize":[64],"validate":[64]},[[0,"paymentMethodFormReady","readyHandler"],[0,"paymentMethodFormTokenize","tokenizeHandler"],[0,"paymentMethodFormValidate","validateHandler"]]]]],["justifi-payments-list",[[1,"justifi-payments-list",{"accountId":[1,"account-id"],"auth":[16],"payments":[32]}]]],["select-input_2",[[1,"select-input",{"name":[1],"label":[1],"defaultValue":[1,"default-value"],"error":[1],"options":[16],"internalValue":[32]}],[1,"text-input",{"name":[1],"label":[1],"defaultValue":[1,"default-value"],"error":[1],"internalValue":[32]}]]]], options);
16
+ return bootstrapLazy([["justifi-billing-form",[[1,"justifi-billing-form",{"billingFields":[32],"billingFieldsErrors":[32],"validate":[64]},[[0,"fieldReceivedInput","setFormValue"]]]]],["justifi-bank-account-form",[[0,"justifi-bank-account-form",{"validationStrategy":[1,"validation-strategy"],"styleOverrides":[1,"style-overrides"],"internalStyleOverrides":[32],"tokenize":[64],"validate":[64]},[[0,"paymentMethodFormReady","readyHandler"],[0,"paymentMethodFormTokenize","tokenizeHandler"],[0,"paymentMethodFormValidate","validateHandler"]]]]],["justifi-card-form",[[0,"justifi-card-form",{"validationStrategy":[1,"validation-strategy"],"styleOverrides":[1,"style-overrides"],"internalStyleOverrides":[32],"tokenize":[64],"validate":[64]},[[0,"paymentMethodFormReady","readyHandler"],[0,"paymentMethodFormTokenize","tokenizeHandler"],[0,"paymentMethodFormValidate","validateHandler"]]]]],["justifi-payment-form",[[4,"justifi-payment-form",{"validationStrategy":[1,"validation-strategy"]}]]],["justifi-payments-list",[[1,"justifi-payments-list",{"accountId":[1,"account-id"],"auth":[16],"payments":[32]}]]],["select-input_2",[[1,"select-input",{"name":[1],"label":[1],"defaultValue":[1,"default-value"],"error":[1],"options":[16],"internalValue":[32]}],[1,"text-input",{"name":[1],"label":[1],"defaultValue":[1,"default-value"],"error":[1],"internalValue":[32]}]]],["justifi-payment-method-form",[[0,"justifi-payment-method-form",{"paymentMethodFormType":[1,"payment-method-form-type"],"paymentMethodFormValidationStrategy":[1,"payment-method-form-validation-strategy"],"paymentMethodStyleOverrides":[16],"height":[32],"tokenize":[64],"validate":[64]}]]]], options);
18
17
  });
@@ -7,7 +7,7 @@ export interface IApiResponse<T> {
7
7
  id: number;
8
8
  type: string;
9
9
  }
10
- export type IServerError = string;
10
+ export declare type IServerError = string;
11
11
  export interface IErrorObject {
12
12
  message: string;
13
13
  code: string;
@@ -22,7 +22,7 @@ export declare enum PaymentDisputedStatuses {
22
22
  export interface IPaymentMethod {
23
23
  card?: ICard;
24
24
  }
25
- export type CardBrand = 'american_express' | 'diners_club' | 'discover' | 'jcb' | 'mastercard' | 'china_unionpay' | 'visa' | 'unknown';
25
+ export declare type CardBrand = 'american_express' | 'diners_club' | 'discover' | 'jcb' | 'mastercard' | 'china_unionpay' | 'visa' | 'unknown';
26
26
  export interface ICard {
27
27
  id: string;
28
28
  acct_last_four: string;
@@ -0,0 +1,14 @@
1
+ declare const _default: {
2
+ title: string;
3
+ component: string;
4
+ parameters: {
5
+ actions: {
6
+ handles: string[];
7
+ };
8
+ };
9
+ decorators: ((story: any) => string)[];
10
+ };
11
+ export default _default;
12
+ export declare const Basic: any;
13
+ export declare const Embedded: any;
14
+ export declare const Styled: any;
@@ -0,0 +1,4 @@
1
+ export declare class PaymentForm {
2
+ validationStrategy: 'onChange' | 'onBlur' | 'onSubmit' | 'onTouched' | 'all';
3
+ render(): any;
4
+ }
@@ -23,6 +23,9 @@ export namespace Components {
23
23
  "validate": () => Promise<any>;
24
24
  "validationStrategy": 'onChange' | 'onBlur' | 'onSubmit' | 'onTouched' | 'all';
25
25
  }
26
+ interface JustifiPaymentForm {
27
+ "validationStrategy": 'onChange' | 'onBlur' | 'onSubmit' | 'onTouched' | 'all';
28
+ }
26
29
  interface JustifiPaymentMethodForm {
27
30
  "paymentMethodFormType": 'card' | 'bankAccount';
28
31
  "paymentMethodFormValidationStrategy": 'onChange' | 'onBlur' | 'onSubmit' | 'onTouched' | 'all';
@@ -87,6 +90,12 @@ declare global {
87
90
  prototype: HTMLJustifiCardFormElement;
88
91
  new (): HTMLJustifiCardFormElement;
89
92
  };
93
+ interface HTMLJustifiPaymentFormElement extends Components.JustifiPaymentForm, HTMLStencilElement {
94
+ }
95
+ var HTMLJustifiPaymentFormElement: {
96
+ prototype: HTMLJustifiPaymentFormElement;
97
+ new (): HTMLJustifiPaymentFormElement;
98
+ };
90
99
  interface HTMLJustifiPaymentMethodFormElement extends Components.JustifiPaymentMethodForm, HTMLStencilElement {
91
100
  }
92
101
  var HTMLJustifiPaymentMethodFormElement: {
@@ -115,6 +124,7 @@ declare global {
115
124
  "justifi-bank-account-form": HTMLJustifiBankAccountFormElement;
116
125
  "justifi-billing-form": HTMLJustifiBillingFormElement;
117
126
  "justifi-card-form": HTMLJustifiCardFormElement;
127
+ "justifi-payment-form": HTMLJustifiPaymentFormElement;
118
128
  "justifi-payment-method-form": HTMLJustifiPaymentMethodFormElement;
119
129
  "justifi-payments-list": HTMLJustifiPaymentsListElement;
120
130
  "select-input": HTMLSelectInputElement;
@@ -138,6 +148,9 @@ declare namespace LocalJSX {
138
148
  "styleOverrides"?: string;
139
149
  "validationStrategy"?: 'onChange' | 'onBlur' | 'onSubmit' | 'onTouched' | 'all';
140
150
  }
151
+ interface JustifiPaymentForm {
152
+ "validationStrategy"?: 'onChange' | 'onBlur' | 'onSubmit' | 'onTouched' | 'all';
153
+ }
141
154
  interface JustifiPaymentMethodForm {
142
155
  "onPaymentMethodFormReady"?: (event: JustifiPaymentMethodFormCustomEvent<any>) => void;
143
156
  "onPaymentMethodFormTokenize"?: (event: JustifiPaymentMethodFormCustomEvent<{ data: any }>) => void;
@@ -168,6 +181,7 @@ declare namespace LocalJSX {
168
181
  "justifi-bank-account-form": JustifiBankAccountForm;
169
182
  "justifi-billing-form": JustifiBillingForm;
170
183
  "justifi-card-form": JustifiCardForm;
184
+ "justifi-payment-form": JustifiPaymentForm;
171
185
  "justifi-payment-method-form": JustifiPaymentMethodForm;
172
186
  "justifi-payments-list": JustifiPaymentsList;
173
187
  "select-input": SelectInput;
@@ -181,6 +195,7 @@ declare module "@stencil/core" {
181
195
  "justifi-bank-account-form": LocalJSX.JustifiBankAccountForm & JSXBase.HTMLAttributes<HTMLJustifiBankAccountFormElement>;
182
196
  "justifi-billing-form": LocalJSX.JustifiBillingForm & JSXBase.HTMLAttributes<HTMLJustifiBillingFormElement>;
183
197
  "justifi-card-form": LocalJSX.JustifiCardForm & JSXBase.HTMLAttributes<HTMLJustifiCardFormElement>;
198
+ "justifi-payment-form": LocalJSX.JustifiPaymentForm & JSXBase.HTMLAttributes<HTMLJustifiPaymentFormElement>;
184
199
  "justifi-payment-method-form": LocalJSX.JustifiPaymentMethodForm & JSXBase.HTMLAttributes<HTMLJustifiPaymentMethodFormElement>;
185
200
  "justifi-payments-list": LocalJSX.JustifiPaymentsList & JSXBase.HTMLAttributes<HTMLJustifiPaymentsListElement>;
186
201
  "select-input": LocalJSX.SelectInput & JSXBase.HTMLAttributes<HTMLSelectInputElement>;
@@ -133,7 +133,7 @@ export interface ListenOptions {
133
133
  */
134
134
  passive?: boolean;
135
135
  }
136
- export type ListenTargetOptions = 'body' | 'document' | 'window';
136
+ export declare type ListenTargetOptions = 'body' | 'document' | 'window';
137
137
  export interface StateDecorator {
138
138
  (): PropertyDecorator;
139
139
  }
@@ -214,8 +214,8 @@ export declare const State: StateDecorator;
214
214
  * https://stenciljs.com/docs/reactive-data#watch-decorator
215
215
  */
216
216
  export declare const Watch: WatchDecorator;
217
- export type ResolutionHandler = (elm: HTMLElement) => string | undefined | null;
218
- export type ErrorHandler = (err: any, element?: HTMLElement) => void;
217
+ export declare type ResolutionHandler = (elm: HTMLElement) => string | undefined | null;
218
+ export declare type ErrorHandler = (err: any, element?: HTMLElement) => void;
219
219
  /**
220
220
  * `setMode()` is used for libraries which provide multiple "modes" for styles.
221
221
  */
@@ -257,15 +257,6 @@ export declare function getAssetPath(path: string): string;
257
257
  * @returns the set path
258
258
  */
259
259
  export declare function setAssetPath(path: string): string;
260
- /**
261
- * Used to specify a nonce value that corresponds with an application's
262
- * [Content Security Policy (CSP)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP).
263
- * When set, the nonce will be added to all dynamically created script and style tags at runtime.
264
- * Alternatively, the nonce value can be set on a `meta` tag in the DOM head
265
- * (<meta name="csp-nonce" content="{ nonce value here }" />) and will result in the same behavior.
266
- * @param nonce The value to be used for the nonce attribute.
267
- */
268
- export declare function setNonce(nonce: string): void;
269
260
  /**
270
261
  * Retrieve a Stencil element for a given reference
271
262
  * @param ref the ref to get the Stencil element for
@@ -442,57 +433,13 @@ interface HostAttributes {
442
433
  ref?: (el: HTMLElement | null) => void;
443
434
  [prop: string]: any;
444
435
  }
445
- /**
446
- * Utilities for working with functional Stencil components. An object
447
- * conforming to this interface is passed by the Stencil runtime as the third
448
- * argument to a functional component, allowing component authors to work with
449
- * features like children.
450
- *
451
- * The children of a functional component will be passed as the second
452
- * argument, so a functional component which uses these utils to transform its
453
- * children might look like the following:
454
- *
455
- * ```ts
456
- * export const AddClass: FunctionalComponent = (_, children, utils) => (
457
- * utils.map(children, child => ({
458
- * ...child,
459
- * vattrs: {
460
- * ...child.vattrs,
461
- * class: `${child.vattrs.class} add-class`
462
- * }
463
- * }))
464
- * );
465
- * ```
466
- *
467
- * For more see the Stencil documentation, here:
468
- * https://stenciljs.com/docs/functional-components
469
- */
470
436
  export interface FunctionalUtilities {
471
- /**
472
- * Utility for reading the children of a functional component at runtime.
473
- * Since the Stencil runtime uses a different interface for children it is
474
- * not recommendeded to read the children directly, and is preferable to use
475
- * this utility to, for instance, perform a side effect for each child.
476
- */
477
437
  forEach: (children: VNode[], cb: (vnode: ChildNode, index: number, array: ChildNode[]) => void) => void;
478
- /**
479
- * Utility for transforming the children of a functional component. Given an
480
- * array of children and a callback this will return a list of the results of
481
- * passing each child to the supplied callback.
482
- */
483
438
  map: (children: VNode[], cb: (vnode: ChildNode, index: number, array: ChildNode[]) => ChildNode) => VNode[];
484
439
  }
485
440
  export interface FunctionalComponent<T = {}> {
486
441
  (props: T, children: VNode[], utils: FunctionalUtilities): VNode | VNode[];
487
442
  }
488
- /**
489
- * A Child VDOM node
490
- *
491
- * This has most of the same properties as {@link VNode} but friendlier names
492
- * (i.e. `vtag` instead of `$tag$`, `vchildren` instead of `$children$`) in
493
- * order to provide a friendlier public interface for users of the
494
- * {@link FunctionalUtilities}).
495
- */
496
443
  export interface ChildNode {
497
444
  vtag?: string | number | Function;
498
445
  vkey?: string | number;
@@ -539,9 +486,6 @@ export declare function h(sel: any, children: Array<VNode | undefined | null>):
539
486
  export declare function h(sel: any, data: VNodeData | null, text: string): VNode;
540
487
  export declare function h(sel: any, data: VNodeData | null, children: Array<VNode | undefined | null>): VNode;
541
488
  export declare function h(sel: any, data: VNodeData | null, children: VNode): VNode;
542
- /**
543
- * A virtual DOM node
544
- */
545
489
  export interface VNode {
546
490
  $flags$: number;
547
491
  $tag$: string | number | Function;
@@ -1 +1 @@
1
- import{r as t,c as s,h as i,H as e}from"./p-e82c9746.js";const l=class{constructor(i){t(this,i),this.fieldReceivedInput=s(this,"fieldReceivedInput",7),this.name=void 0,this.label=void 0,this.defaultValue=void 0,this.error=void 0,this.options=void 0,this.internalValue=""}onInput(t){const s=t.target,i=s.getAttribute("name");this.fieldReceivedInput.emit({name:i,value:s.value})}render(){return i(e,null,i("label",null,this.label),i("select",{name:this.name,onInput:t=>this.onInput(t)},this.options.map((t=>i("option",{value:t.value},t.label)))),this.error&&i("div",{style:{color:"red"}},this.error))}};l.style=":host{display:block}label{display:block}";const o=class{constructor(i){t(this,i),this.fieldReceivedInput=s(this,"fieldReceivedInput",7),this.name=void 0,this.label=void 0,this.defaultValue=void 0,this.error=void 0,this.internalValue=""}onInput(t){const s=t.target,i=s.getAttribute("name");this.fieldReceivedInput.emit({name:i,value:s.value})}render(){return i(e,null,i("label",null,this.label),i("input",{name:this.name,type:"text",onInput:t=>this.onInput(t),value:this.internalValue||this.defaultValue}),this.error&&i("div",{style:{color:"red"}},this.error))}};o.style=":host{display:block}label{display:block}";export{l as select_input,o as text_input}
1
+ import{r as t,c as s,h as i,H as e}from"./p-8ee06fd1.js";const l=class{constructor(i){t(this,i),this.fieldReceivedInput=s(this,"fieldReceivedInput",7),this.name=void 0,this.label=void 0,this.defaultValue=void 0,this.error=void 0,this.options=void 0,this.internalValue=""}onInput(t){const s=t.target,i=s.getAttribute("name");this.fieldReceivedInput.emit({name:i,value:s.value})}render(){return i(e,null,i("label",null,this.label),i("select",{name:this.name,onInput:t=>this.onInput(t)},this.options.map((t=>i("option",{value:t.value},t.label)))),this.error&&i("div",{style:{color:"red"}},this.error))}};l.style=":host{display:block}label{display:block}";const o=class{constructor(i){t(this,i),this.fieldReceivedInput=s(this,"fieldReceivedInput",7),this.name=void 0,this.label=void 0,this.defaultValue=void 0,this.error=void 0,this.internalValue=""}onInput(t){const s=t.target,i=s.getAttribute("name");this.fieldReceivedInput.emit({name:i,value:s.value})}render(){return i(e,null,i("label",null,this.label),i("input",{name:this.name,type:"text",onInput:t=>this.onInput(t),value:this.internalValue||this.defaultValue}),this.error&&i("div",{style:{color:"red"}},this.error))}};o.style=":host{display:block}label{display:block}";export{l as select_input,o as text_input}
@@ -1 +1 @@
1
- import{r as t,c as e,h as s,H as i}from"./p-e82c9746.js";const a={card:{ready:"justifi.card.ready",tokenize:"justifi.card.tokenize",validate:"justifi.card.validate",resize:"justifi.card.resize",styleOverrides:"justifi.card.styleOverrides"},bankAccount:{ready:"justifi.bankAccount.ready",tokenize:"justifi.bankAccount.tokenize",validate:"justifi.bankAccount.validate",resize:"justifi.bankAccount.resize",styleOverrides:"justifi.bankAccount.styleOverrides"}},r=class{constructor(s){t(this,s),this.paymentMethodFormReady=e(this,"paymentMethodFormReady",7),this.paymentMethodFormTokenize=e(this,"paymentMethodFormTokenize",7),this.paymentMethodFormType=void 0,this.paymentMethodFormValidationStrategy=void 0,this.paymentMethodStyleOverrides=void 0,this.height=55}connectedCallback(){window.addEventListener("message",this.dispatchMessageEvent.bind(this))}disconnectedCallback(){window.removeEventListener("message",this.dispatchMessageEvent.bind(this))}componentShouldUpdate(){this.sendStyleOverrides()}sendStyleOverrides(){this.paymentMethodStyleOverrides&&this.postMessage(a[this.paymentMethodFormType].styleOverrides,{styleOverrides:this.paymentMethodStyleOverrides})}dispatchMessageEvent(t){const e=t.data,s=e.eventType,i=e.data;s===a[this.paymentMethodFormType].ready&&this.paymentMethodFormReady.emit(i),s===a[this.paymentMethodFormType].resize&&(this.height=i.height)}postMessage(t,e){this.iframeElement&&this.iframeElement.contentWindow.postMessage(Object.assign({eventType:t},e),"*")}async postMessageWithResponseListener(t,e){return new Promise((s=>{const i=e=>{e.data.eventType===t&&(window.removeEventListener("message",i),s(e.data.data))};window.addEventListener("message",i),this.postMessage(t,e)}))}async tokenize(t,e,s){return this.postMessageWithResponseListener(a[this.paymentMethodFormType].tokenize,{clientId:t,paymentMethodMetadata:e,account:s})}async validate(){return this.postMessageWithResponseListener(a[this.paymentMethodFormType].validate)}getIframeSrc(){let t=`https://js.justifi.ai/v2/${this.paymentMethodFormType}`;return this.paymentMethodFormValidationStrategy&&(t+=`?validationStrategy=${this.paymentMethodFormValidationStrategy}`),t}render(){return s(i,null,s("iframe",{id:`justifi-payment-method-form-${this.paymentMethodFormType}`,src:this.getIframeSrc(),ref:t=>this.iframeElement=t,height:this.height}))}static get watchers(){return{paymentMethodStyleOverrides:["sendStyleOverrides"]}}};r.style=":host{display:block}justifi-payment-method-form iframe{border:none;width:100%}";export{r as justifi_payment_method_form}
1
+ import{r as t,c as e,h as s,H as i}from"./p-8ee06fd1.js";const a={card:{ready:"justifi.card.ready",tokenize:"justifi.card.tokenize",validate:"justifi.card.validate",resize:"justifi.card.resize",styleOverrides:"justifi.card.styleOverrides"},bankAccount:{ready:"justifi.bankAccount.ready",tokenize:"justifi.bankAccount.tokenize",validate:"justifi.bankAccount.validate",resize:"justifi.bankAccount.resize",styleOverrides:"justifi.bankAccount.styleOverrides"}},r=class{constructor(s){t(this,s),this.paymentMethodFormReady=e(this,"paymentMethodFormReady",7),this.paymentMethodFormTokenize=e(this,"paymentMethodFormTokenize",7),this.paymentMethodFormType=void 0,this.paymentMethodFormValidationStrategy=void 0,this.paymentMethodStyleOverrides=void 0,this.height=55}connectedCallback(){window.addEventListener("message",this.dispatchMessageEvent.bind(this))}disconnectedCallback(){window.removeEventListener("message",this.dispatchMessageEvent.bind(this))}componentShouldUpdate(){this.sendStyleOverrides()}sendStyleOverrides(){this.paymentMethodStyleOverrides&&this.postMessage(a[this.paymentMethodFormType].styleOverrides,{styleOverrides:this.paymentMethodStyleOverrides})}dispatchMessageEvent(t){const e=t.data,s=e.eventType,i=e.data;s===a[this.paymentMethodFormType].ready&&this.paymentMethodFormReady.emit(i),s===a[this.paymentMethodFormType].resize&&(this.height=i.height)}postMessage(t,e){this.iframeElement&&this.iframeElement.contentWindow.postMessage(Object.assign({eventType:t},e),"*")}async postMessageWithResponseListener(t,e){return new Promise((s=>{const i=e=>{e.data.eventType===t&&(window.removeEventListener("message",i),s(e.data.data))};window.addEventListener("message",i),this.postMessage(t,e)}))}async tokenize(t,e,s){return this.postMessageWithResponseListener(a[this.paymentMethodFormType].tokenize,{clientId:t,componentVersion:"0.2.1",paymentMethodMetadata:e,account:s})}async validate(){return this.postMessageWithResponseListener(a[this.paymentMethodFormType].validate)}getIframeSrc(){let t=`https://js.justifi.ai/v2/${this.paymentMethodFormType}`;return this.paymentMethodFormValidationStrategy&&(t+=`?validationStrategy=${this.paymentMethodFormValidationStrategy}`),t}render(){return s(i,null,s("iframe",{id:`justifi-payment-method-form-${this.paymentMethodFormType}`,src:this.getIframeSrc(),ref:t=>this.iframeElement=t,height:this.height}))}static get watchers(){return{paymentMethodStyleOverrides:["sendStyleOverrides"]}}};r.style=":host{display:block}justifi-payment-method-form iframe{border:none;width:100%}";export{r as justifi_payment_method_form}
@@ -1 +1 @@
1
- import{r as t,c as e,h as r}from"./p-e82c9746.js";const i=class{constructor(r){t(this,r),this.cardFormReady=e(this,"cardFormReady",7),this.cardFormTokenize=e(this,"cardFormTokenize",7),this.cardFormValidate=e(this,"cardFormValidate",7),this.validationStrategy=void 0,this.styleOverrides=void 0,this.internalStyleOverrides=void 0}readyHandler(t){this.cardFormReady.emit(t)}tokenizeHandler(t){this.cardFormTokenize.emit(t)}validateHandler(t){this.cardFormValidate.emit(t)}componentWillLoad(){this.parseStyleOverrides()}parseStyleOverrides(){if(this.styleOverrides){const t=JSON.parse(this.styleOverrides);this.internalStyleOverrides=t}}async tokenize(...t){if(!this.childRef)throw new Error("Cannot call tokenize");return this.childRef.tokenize(...t)}async validate(){if(!this.childRef)throw new Error("Cannot call validate");return this.childRef.validate()}render(){return r("justifi-payment-method-form",{ref:t=>{t&&(this.childRef=t)},"payment-method-form-type":"card","payment-method-form-ready":this.cardFormReady,"payment-method-form-tokenize":this.cardFormTokenize,"payment-method-form-validation-strategy":this.validationStrategy||"onSubmit",paymentMethodStyleOverrides:this.internalStyleOverrides})}static get watchers(){return{styleOverrides:["parseStyleOverrides"]}}};export{i as justifi_card_form}
1
+ import{r as t,c as e,h as r}from"./p-8ee06fd1.js";const i=class{constructor(r){t(this,r),this.cardFormReady=e(this,"cardFormReady",7),this.cardFormTokenize=e(this,"cardFormTokenize",7),this.cardFormValidate=e(this,"cardFormValidate",7),this.validationStrategy=void 0,this.styleOverrides=void 0,this.internalStyleOverrides=void 0}readyHandler(t){this.cardFormReady.emit(t)}tokenizeHandler(t){this.cardFormTokenize.emit(t)}validateHandler(t){this.cardFormValidate.emit(t)}componentWillLoad(){this.parseStyleOverrides()}parseStyleOverrides(){if(this.styleOverrides){const t=JSON.parse(this.styleOverrides);this.internalStyleOverrides=t}}async tokenize(...t){if(!this.childRef)throw new Error("Cannot call tokenize");return this.childRef.tokenize(...t)}async validate(){if(!this.childRef)throw new Error("Cannot call validate");return this.childRef.validate()}render(){return r("justifi-payment-method-form",{ref:t=>{t&&(this.childRef=t)},"payment-method-form-type":"card","payment-method-form-ready":this.cardFormReady,"payment-method-form-tokenize":this.cardFormTokenize,"payment-method-form-validation-strategy":this.validationStrategy||"onSubmit",paymentMethodStyleOverrides:this.internalStyleOverrides})}static get watchers(){return{styleOverrides:["parseStyleOverrides"]}}};export{i as justifi_card_form}