@justifi/webcomponents 0.0.15 → 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.
- package/CHANGELOG.md +45 -0
- package/changelog-template.hbs +41 -0
- package/dist/cjs/{index-e1b45289.js → index-ca2cd154.js} +456 -97
- package/dist/cjs/justifi-bank-account-form.cjs.entry.js +59 -0
- package/dist/cjs/justifi-billing-form.cjs.entry.js +2150 -0
- package/dist/cjs/justifi-card-form.cjs.entry.js +59 -0
- package/dist/cjs/justifi-payment-form.cjs.entry.js +17 -0
- package/dist/cjs/{justifi-bank-account-form_3.cjs.entry.js → justifi-payment-method-form.cjs.entry.js} +86 -110
- package/dist/cjs/justifi-payments-list.cjs.entry.js +1 -1
- package/dist/cjs/loader.cjs.js +3 -4
- package/dist/cjs/select-input_2.cjs.entry.js +59 -0
- package/dist/cjs/webcomponents.cjs.js +3 -7
- package/dist/collection/collection-manifest.json +7 -3
- package/dist/collection/components/bank-account-form/bank-account-form.js +1 -1
- package/dist/collection/components/billing-form/billing-form-schema.js +14 -0
- package/dist/collection/components/billing-form/billing-form.css +11 -0
- package/dist/collection/components/billing-form/billing-form.js +92 -0
- package/dist/collection/components/billing-form/state-options.js +243 -0
- package/dist/collection/components/card-form/card-form.js +1 -1
- package/dist/collection/components/card-form/card-form.stories.js +132 -0
- package/dist/collection/components/payment-form/payment-form.js +31 -0
- package/dist/collection/components/payment-method-form/payment-method-form.js +6 -4
- package/dist/collection/components/select-input/select-input.css +7 -0
- package/dist/collection/components/select-input/select-input.js +144 -0
- package/dist/collection/components/text-input/text-input.css +7 -0
- package/dist/collection/components/text-input/text-input.js +126 -0
- package/dist/components/index.d.ts +4 -9
- package/dist/components/index.js +5 -1
- package/dist/components/justifi-billing-form.d.ts +11 -0
- package/dist/components/justifi-billing-form.js +2180 -0
- package/dist/components/justifi-payment-form.d.ts +11 -0
- package/dist/components/justifi-payment-form.js +32 -0
- package/dist/components/payment-method-form.js +85 -3
- package/dist/components/select-input.d.ts +11 -0
- package/dist/components/select-input.js +6 -0
- package/dist/components/select-input2.js +52 -0
- package/dist/components/text-input.d.ts +11 -0
- package/dist/components/text-input.js +6 -0
- package/dist/components/text-input2.js +48 -0
- package/dist/esm/{index-c1f569bd.js → index-05706eb5.js} +457 -97
- package/dist/esm/justifi-bank-account-form.entry.js +55 -0
- package/dist/esm/justifi-billing-form.entry.js +2146 -0
- package/dist/esm/justifi-card-form.entry.js +55 -0
- package/dist/esm/justifi-payment-form.entry.js +13 -0
- package/dist/esm/justifi-payment-method-form.entry.js +187 -0
- package/dist/esm/justifi-payments-list.entry.js +1 -1
- package/dist/esm/loader.js +3 -4
- package/dist/esm/polyfills/css-shim.js +1 -1
- package/dist/esm/select-input_2.entry.js +54 -0
- package/dist/esm/webcomponents.js +3 -4
- package/dist/types/api/Api.d.ts +1 -1
- package/dist/types/api/Payment.d.ts +1 -1
- package/dist/types/components/billing-form/billing-form-schema.d.ts +15 -0
- package/dist/types/components/billing-form/billing-form.d.ts +17 -0
- package/dist/types/components/billing-form/state-options.d.ts +5 -0
- package/dist/types/components/card-form/card-form.stories.d.ts +14 -0
- package/dist/types/components/payment-form/payment-form.d.ts +4 -0
- package/dist/types/components/payment-method-form/payment-method-form.d.ts +1 -1
- package/dist/types/components/payment-method-form/theme.d.ts +3 -1
- package/dist/types/components/select-input/select-input.d.ts +18 -0
- package/dist/types/components/text-input/text-input.d.ts +14 -0
- package/dist/types/components.d.ts +87 -3
- package/dist/types/stencil-public-runtime.d.ts +3 -59
- package/dist/webcomponents/p-3809130a.entry.js +1 -0
- package/dist/webcomponents/p-67be9585.entry.js +1 -0
- package/dist/webcomponents/p-787671b9.entry.js +1 -0
- package/dist/webcomponents/p-87654bf4.entry.js +1 -0
- package/dist/webcomponents/p-8ee06fd1.js +2 -0
- package/dist/webcomponents/p-94ef2d0e.entry.js +1 -0
- package/dist/webcomponents/p-c07191dc.entry.js +1 -0
- package/dist/webcomponents/p-e5b0f047.entry.js +1 -0
- package/dist/webcomponents/webcomponents.esm.js +1 -1
- package/loader/index.d.ts +0 -9
- package/package.json +23 -5
- package/LICENSE +0 -21
- package/dist/esm/justifi-bank-account-form_3.entry.js +0 -209
- package/dist/webcomponents/p-1de39730.js +0 -2
- package/dist/webcomponents/p-f0eb5ed0.entry.js +0 -1
- package/dist/webcomponents/p-f91b7b05.entry.js +0 -1
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface JustifiPaymentForm extends Components.JustifiPaymentForm, HTMLElement {}
|
|
4
|
+
export const JustifiPaymentForm: {
|
|
5
|
+
prototype: JustifiPaymentForm;
|
|
6
|
+
new (): JustifiPaymentForm;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
|
|
2
|
+
|
|
3
|
+
const PaymentForm = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
4
|
+
constructor() {
|
|
5
|
+
super();
|
|
6
|
+
this.__registerHost();
|
|
7
|
+
this.validationStrategy = undefined;
|
|
8
|
+
}
|
|
9
|
+
render() {
|
|
10
|
+
return (h(Host, null, h("form", null, h("slot", null))));
|
|
11
|
+
}
|
|
12
|
+
}, [4, "justifi-payment-form", {
|
|
13
|
+
"validationStrategy": [1, "validation-strategy"]
|
|
14
|
+
}]);
|
|
15
|
+
function defineCustomElement$1() {
|
|
16
|
+
if (typeof customElements === "undefined") {
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
const components = ["justifi-payment-form"];
|
|
20
|
+
components.forEach(tagName => { switch (tagName) {
|
|
21
|
+
case "justifi-payment-form":
|
|
22
|
+
if (!customElements.get(tagName)) {
|
|
23
|
+
customElements.define(tagName, PaymentForm);
|
|
24
|
+
}
|
|
25
|
+
break;
|
|
26
|
+
} });
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
const JustifiPaymentForm = PaymentForm;
|
|
30
|
+
const defineCustomElement = defineCustomElement$1;
|
|
31
|
+
|
|
32
|
+
export { JustifiPaymentForm, defineCustomElement };
|
|
@@ -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 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
@@ -73,12 +154,13 @@ const PaymentMethodForm = /*@__PURE__*/ proxyCustomElement(class extends HTMLEle
|
|
|
73
154
|
this.postMessage(eventType, payload);
|
|
74
155
|
});
|
|
75
156
|
}
|
|
76
|
-
async tokenize(
|
|
157
|
+
async tokenize(clientId, paymentMethodMetadata, account) {
|
|
77
158
|
const eventType = MessageEventType[this.paymentMethodFormType].tokenize;
|
|
78
159
|
const payload = {
|
|
79
|
-
|
|
160
|
+
clientId: clientId,
|
|
161
|
+
componentVersion: packageJson.version,
|
|
80
162
|
paymentMethodMetadata: paymentMethodMetadata,
|
|
81
|
-
account: account
|
|
163
|
+
account: account,
|
|
82
164
|
};
|
|
83
165
|
return this.postMessageWithResponseListener(eventType, payload);
|
|
84
166
|
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface SelectInput extends Components.SelectInput, HTMLElement {}
|
|
4
|
+
export const SelectInput: {
|
|
5
|
+
prototype: SelectInput;
|
|
6
|
+
new (): SelectInput;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
|
|
2
|
+
|
|
3
|
+
const selectInputCss = ":host{display:block}label{display:block}";
|
|
4
|
+
|
|
5
|
+
const SelectInput = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
6
|
+
constructor() {
|
|
7
|
+
super();
|
|
8
|
+
this.__registerHost();
|
|
9
|
+
this.__attachShadow();
|
|
10
|
+
this.fieldReceivedInput = createEvent(this, "fieldReceivedInput", 7);
|
|
11
|
+
this.name = undefined;
|
|
12
|
+
this.label = undefined;
|
|
13
|
+
this.defaultValue = undefined;
|
|
14
|
+
this.error = undefined;
|
|
15
|
+
this.options = undefined;
|
|
16
|
+
this.internalValue = '';
|
|
17
|
+
}
|
|
18
|
+
onInput(event) {
|
|
19
|
+
const target = event.target;
|
|
20
|
+
const name = target.getAttribute('name');
|
|
21
|
+
this.fieldReceivedInput.emit({ name: name, value: target.value });
|
|
22
|
+
}
|
|
23
|
+
;
|
|
24
|
+
render() {
|
|
25
|
+
return (h(Host, null, h("label", null, this.label), h("select", { name: this.name, onInput: (event) => this.onInput(event) }, this.options.map((option) => {
|
|
26
|
+
return (h("option", { value: option.value }, option.label));
|
|
27
|
+
})), this.error && h("div", { style: { color: 'red' } }, this.error)));
|
|
28
|
+
}
|
|
29
|
+
static get style() { return selectInputCss; }
|
|
30
|
+
}, [1, "select-input", {
|
|
31
|
+
"name": [1],
|
|
32
|
+
"label": [1],
|
|
33
|
+
"defaultValue": [1, "default-value"],
|
|
34
|
+
"error": [1],
|
|
35
|
+
"options": [16],
|
|
36
|
+
"internalValue": [32]
|
|
37
|
+
}]);
|
|
38
|
+
function defineCustomElement() {
|
|
39
|
+
if (typeof customElements === "undefined") {
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
const components = ["select-input"];
|
|
43
|
+
components.forEach(tagName => { switch (tagName) {
|
|
44
|
+
case "select-input":
|
|
45
|
+
if (!customElements.get(tagName)) {
|
|
46
|
+
customElements.define(tagName, SelectInput);
|
|
47
|
+
}
|
|
48
|
+
break;
|
|
49
|
+
} });
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export { SelectInput as S, defineCustomElement as d };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface TextInput extends Components.TextInput, HTMLElement {}
|
|
4
|
+
export const TextInput: {
|
|
5
|
+
prototype: TextInput;
|
|
6
|
+
new (): TextInput;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
|
|
2
|
+
|
|
3
|
+
const textInputCss = ":host{display:block}label{display:block}";
|
|
4
|
+
|
|
5
|
+
const TextInput = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
6
|
+
constructor() {
|
|
7
|
+
super();
|
|
8
|
+
this.__registerHost();
|
|
9
|
+
this.__attachShadow();
|
|
10
|
+
this.fieldReceivedInput = createEvent(this, "fieldReceivedInput", 7);
|
|
11
|
+
this.name = undefined;
|
|
12
|
+
this.label = undefined;
|
|
13
|
+
this.defaultValue = undefined;
|
|
14
|
+
this.error = undefined;
|
|
15
|
+
this.internalValue = '';
|
|
16
|
+
}
|
|
17
|
+
onInput(event) {
|
|
18
|
+
const target = event.target;
|
|
19
|
+
const name = target.getAttribute('name');
|
|
20
|
+
this.fieldReceivedInput.emit({ name: name, value: target.value });
|
|
21
|
+
}
|
|
22
|
+
;
|
|
23
|
+
render() {
|
|
24
|
+
return (h(Host, null, h("label", null, this.label), h("input", { name: this.name, type: "text", onInput: (event) => this.onInput(event), value: this.internalValue || this.defaultValue }), this.error && h("div", { style: { color: 'red' } }, this.error)));
|
|
25
|
+
}
|
|
26
|
+
static get style() { return textInputCss; }
|
|
27
|
+
}, [1, "text-input", {
|
|
28
|
+
"name": [1],
|
|
29
|
+
"label": [1],
|
|
30
|
+
"defaultValue": [1, "default-value"],
|
|
31
|
+
"error": [1],
|
|
32
|
+
"internalValue": [32]
|
|
33
|
+
}]);
|
|
34
|
+
function defineCustomElement() {
|
|
35
|
+
if (typeof customElements === "undefined") {
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
const components = ["text-input"];
|
|
39
|
+
components.forEach(tagName => { switch (tagName) {
|
|
40
|
+
case "text-input":
|
|
41
|
+
if (!customElements.get(tagName)) {
|
|
42
|
+
customElements.define(tagName, TextInput);
|
|
43
|
+
}
|
|
44
|
+
break;
|
|
45
|
+
} });
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export { TextInput as T, defineCustomElement as d };
|