@justifi/webcomponents 0.6.1 → 2.0.0

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 (62) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/dist/cjs/{index-bcfc2d01.js → index-3aff6bb6.js} +0 -3
  3. package/dist/cjs/justifi-bank-account-form.cjs.entry.js +3 -16
  4. package/dist/cjs/justifi-billing-form_2.cjs.entry.js +3 -3
  5. package/dist/cjs/justifi-card-form.cjs.entry.js +3 -17
  6. package/dist/cjs/justifi-payment-form.cjs.entry.js +2 -2
  7. package/dist/cjs/justifi-payment-method-form.cjs.entry.js +56 -11
  8. package/dist/cjs/justifi-payments-list.cjs.entry.js +1 -1
  9. package/dist/cjs/loader.cjs.js +2 -2
  10. package/dist/cjs/select-input_2.cjs.entry.js +3 -3
  11. package/dist/cjs/webcomponents.cjs.js +2 -2
  12. package/dist/collection/components/bank-account-form/bank-account-form.js +4 -25
  13. package/dist/collection/components/billing-form/billing-form.js +1 -1
  14. package/dist/collection/components/card-form/card-form.js +4 -43
  15. package/dist/collection/components/card-form/card-form.stories.js +75 -42
  16. package/dist/collection/components/payment-form/payment-form.css +47 -0
  17. package/dist/collection/components/payment-form/payment-method-selector.js +1 -1
  18. package/dist/collection/components/payment-method-form/get-computed-theme.js +48 -0
  19. package/dist/collection/components/payment-method-form/payment-method-form.js +9 -34
  20. package/dist/collection/components/select-input/select-input.js +1 -1
  21. package/dist/collection/components/text-input/text-input.js +1 -1
  22. package/dist/components/billing-form.js +1 -1
  23. package/dist/components/justifi-bank-account-form.js +3 -17
  24. package/dist/components/justifi-card-form.js +3 -19
  25. package/dist/components/justifi-payment-form.js +1 -1
  26. package/dist/components/payment-method-form.js +56 -12
  27. package/dist/components/payment-method-selector.js +1 -1
  28. package/dist/components/select-input2.js +1 -1
  29. package/dist/components/text-input2.js +1 -1
  30. package/dist/esm/{index-5676b87a.js → index-550f3d18.js} +0 -3
  31. package/dist/esm/justifi-bank-account-form.entry.js +3 -16
  32. package/dist/esm/justifi-billing-form_2.entry.js +3 -3
  33. package/dist/esm/justifi-card-form.entry.js +3 -17
  34. package/dist/esm/justifi-payment-form.entry.js +2 -2
  35. package/dist/esm/justifi-payment-method-form.entry.js +56 -11
  36. package/dist/esm/justifi-payments-list.entry.js +1 -1
  37. package/dist/esm/loader.js +2 -2
  38. package/dist/esm/select-input_2.entry.js +3 -3
  39. package/dist/esm/webcomponents.js +2 -2
  40. package/dist/types/components/bank-account-form/bank-account-form.d.ts +1 -5
  41. package/dist/types/components/card-form/card-form.d.ts +1 -6
  42. package/dist/types/components/card-form/card-form.stories.d.ts +29 -0
  43. package/dist/types/components/payment-method-form/get-computed-theme.d.ts +3 -0
  44. package/dist/types/components/payment-method-form/payment-method-form.d.ts +2 -3
  45. package/dist/types/components.d.ts +6 -11
  46. package/dist/webcomponents/p-14a858e1.entry.js +1 -0
  47. package/dist/webcomponents/p-3d53bd97.entry.js +1 -0
  48. package/dist/webcomponents/p-48c17d38.js +2 -0
  49. package/dist/webcomponents/{p-81e20318.entry.js → p-4bb94d73.entry.js} +1 -1
  50. package/dist/webcomponents/p-5625b4ea.entry.js +1 -0
  51. package/dist/webcomponents/{p-f25081d7.entry.js → p-57d070c8.entry.js} +1 -1
  52. package/dist/webcomponents/p-884b845d.entry.js +1 -0
  53. package/dist/webcomponents/p-eb9da647.entry.js +1 -0
  54. package/dist/webcomponents/webcomponents.css +1 -0
  55. package/dist/webcomponents/webcomponents.esm.js +1 -1
  56. package/package.json +1 -1
  57. package/dist/webcomponents/p-165b4840.entry.js +0 -1
  58. package/dist/webcomponents/p-1c7556c1.entry.js +0 -1
  59. package/dist/webcomponents/p-5aec1d06.entry.js +0 -1
  60. package/dist/webcomponents/p-8f9a69d2.entry.js +0 -1
  61. package/dist/webcomponents/p-9a8abfcb.js +0 -2
  62. package/dist/webcomponents/p-ad6ad202.entry.js +0 -1
@@ -1,11 +1,9 @@
1
1
  import { h } from '@stencil/core';
2
2
  export class CardForm {
3
3
  constructor() {
4
- this.validationStrategy = undefined;
5
- this.styleOverrides = undefined;
4
+ this.validationMode = undefined;
6
5
  this.iframeOrigin = undefined;
7
6
  this.singleLine = undefined;
8
- this.internalStyleOverrides = undefined;
9
7
  }
10
8
  readyHandler(event) {
11
9
  this.cardFormReady.emit(event);
@@ -16,15 +14,6 @@ export class CardForm {
16
14
  validateHandler(event) {
17
15
  this.cardFormValidate.emit(event);
18
16
  }
19
- componentWillLoad() {
20
- this.parseStyleOverrides();
21
- }
22
- parseStyleOverrides() {
23
- if (this.styleOverrides) {
24
- const parsedStyleOverrides = JSON.parse(this.styleOverrides);
25
- this.internalStyleOverrides = parsedStyleOverrides;
26
- }
27
- }
28
17
  async tokenize(...args) {
29
18
  if (!this.childRef) {
30
19
  throw new Error('Cannot call tokenize');
@@ -42,12 +31,12 @@ export class CardForm {
42
31
  if (el) {
43
32
  this.childRef = el;
44
33
  }
45
- }, "iframe-origin": this.iframeOrigin, "payment-method-form-type": "card", "single-line": this.singleLine, "payment-method-form-ready": this.cardFormReady, "payment-method-form-tokenize": this.cardFormTokenize, "payment-method-form-validation-strategy": this.validationStrategy || 'onSubmit', paymentMethodStyleOverrides: this.internalStyleOverrides }));
34
+ }, "iframe-origin": this.iframeOrigin, "payment-method-form-type": "card", "single-line": this.singleLine, "payment-method-form-ready": this.cardFormReady, "payment-method-form-tokenize": this.cardFormTokenize, "payment-method-form-validation-mode": this.validationMode || 'onSubmit' }));
46
35
  }
47
36
  static get is() { return "justifi-card-form"; }
48
37
  static get properties() {
49
38
  return {
50
- "validationStrategy": {
39
+ "validationMode": {
51
40
  "type": "string",
52
41
  "mutable": true,
53
42
  "complexType": {
@@ -61,24 +50,7 @@ export class CardForm {
61
50
  "tags": [],
62
51
  "text": ""
63
52
  },
64
- "attribute": "validation-strategy",
65
- "reflect": false
66
- },
67
- "styleOverrides": {
68
- "type": "string",
69
- "mutable": true,
70
- "complexType": {
71
- "original": "string",
72
- "resolved": "string",
73
- "references": {}
74
- },
75
- "required": false,
76
- "optional": true,
77
- "docs": {
78
- "tags": [],
79
- "text": ""
80
- },
81
- "attribute": "style-overrides",
53
+ "attribute": "validation-mode",
82
54
  "reflect": false
83
55
  },
84
56
  "iframeOrigin": {
@@ -117,11 +89,6 @@ export class CardForm {
117
89
  }
118
90
  };
119
91
  }
120
- static get states() {
121
- return {
122
- "internalStyleOverrides": {}
123
- };
124
- }
125
92
  static get events() {
126
93
  return [{
127
94
  "method": "cardFormReady",
@@ -215,12 +182,6 @@ export class CardForm {
215
182
  }
216
183
  };
217
184
  }
218
- static get watchers() {
219
- return [{
220
- "propName": "styleOverrides",
221
- "methodName": "parseStyleOverrides"
222
- }];
223
- }
224
185
  static get listeners() {
225
186
  return [{
226
187
  "name": "paymentMethodFormReady",
@@ -2,7 +2,34 @@ import { userEvent, within } from '@storybook/testing-library';
2
2
  import { expect } from '@storybook/jest';
3
3
  export default {
4
4
  title: 'Components/CardForm',
5
- component: 'justifi-card-form',
5
+ component: 'justifi-payment-method-form',
6
+ argTypes: {
7
+ iframeOrigin: {
8
+ control: 'text',
9
+ table: {
10
+ category: 'Props'
11
+ }
12
+ },
13
+ singleLine: {
14
+ control: 'boolean',
15
+ table: {
16
+ category: 'Props'
17
+ }
18
+ },
19
+ styleOverrides: {
20
+ control: 'object',
21
+ table: {
22
+ category: 'Props'
23
+ }
24
+ },
25
+ validationMode: {
26
+ control: { type: 'select' },
27
+ options: ['onSubmit', 'onBlur', 'onChange', 'onTouched', 'all'],
28
+ table: {
29
+ category: 'Props'
30
+ }
31
+ }
32
+ },
6
33
  parameters: {
7
34
  actions: {
8
35
  handles: [
@@ -54,53 +81,28 @@ const FormButtons = `
54
81
  <button id="tokenize-btn">Tokenize</button>
55
82
  </div>
56
83
  `;
57
- const storyStyleOverrides = {
58
- "layout": {
59
- "padding": "100px",
60
- "formControlSpacingHorizontal": ".5rem",
61
- "formControlSpacingVertical": "1rem"
62
- },
63
- "formLabel": {
64
- "fontWeight": "700",
65
- "fontFamily": "sans-serif",
66
- "margin": "0 0 .5rem 0"
67
- },
68
- "formControl": {
69
- "backgroundColor": "#00F4F6",
70
- "backgroundColorHover": "#EEEEF5",
71
- "borderColor": "rgba(0, 0, 0, 0.42)",
72
- "borderColorHover": "rgba(0, 0, 0, 0.62)",
73
- "borderColorFocus": "#fccc32",
74
- "borderColorError": "#C12727",
75
- "borderWidth": "0px",
76
- "borderBottomWidth": "1px",
77
- "borderRadius": "40px 4px 0 0",
78
- "borderStyle": "solid",
79
- "boxShadowErrorFocus": "none",
80
- "boxShadowFocus": "none",
81
- "color": "#212529",
82
- "fontSize": "1rem",
83
- "fontWeight": "400",
84
- "lineHeight": "2",
85
- "margin": "0",
86
- "padding": ".5rem .875rem"
87
- },
88
- "errorMessage": {
89
- "color": "#C12727",
90
- "margin": ".25rem 0 0 0",
91
- "fontSize": ".875rem"
92
- }
93
- };
94
- const Template = ({ includeButtons = true, styleOverrides }) => {
95
- const parsedStyleOverrides = styleOverrides ? JSON.stringify(styleOverrides) : null;
84
+ const Template = (args) => {
85
+ const parsedStyleOverrides = args.styleOverrides ? JSON.stringify(args.styleOverrides) : null;
86
+ const includeButtons = true;
96
87
  return (`
97
88
  <div>
98
- <justifi-card-form data-testid="card-form-iframe" style-overrides='${parsedStyleOverrides || ''}' />
89
+ <justifi-card-form
90
+ data-testid="card-form-iframe"
91
+ validation-mode='${args.validationMode || 'onSubmit'}'
92
+ style-overrides='${parsedStyleOverrides || ''}'
93
+ iframe-origin='${args.iframeOrigin || ''}'
94
+ single-line='${args.singleLine}'
95
+ />
99
96
  </div>
100
97
  ${includeButtons ? FormButtons : ''}
101
98
  `);
102
99
  };
103
100
  export const Basic = Template.bind({});
101
+ Basic.args = {
102
+ iframeOrigin: '',
103
+ singleLine: false,
104
+ validationMode: 'onSubmit'
105
+ };
104
106
  export const Embedded = Template.bind({});
105
107
  Embedded.decorators = [
106
108
  (story) => `
@@ -116,7 +118,38 @@ Embedded.decorators = [
116
118
  ];
117
119
  export const Styled = Template.bind({});
118
120
  Styled.args = {
119
- styleOverrides: storyStyleOverrides
121
+ cssVariables: (`
122
+ --jfi-layout-padding: 0;
123
+ --jfi-layout-form-control-spacing-x: .5rem;
124
+ --jfi-layout-form-control-spacing-y: 1rem;
125
+ --jfi-form-label-font-weight: 700;
126
+ --jfi-form-label-font-family: sans-serif;
127
+ --jfi-form-label-margin: 0 0 .5rem 0;
128
+ --jfi-form-control-background-color: #F4F4F6;
129
+ --jfi-form-control-background-color-hover: #EEEEF5;
130
+ --jfi-form-control-border-color: rgba(0, 0, 0, 0.42);
131
+ --jfi-form-control-border-color-hover: rgba(0, 0, 0, 0.62);
132
+ --jfi-form-control-border-color-focus: #fccc32;
133
+ --jfi-form-control-border-color-error: #C12727;
134
+ --jfi-form-control-border-top-width: 0;
135
+ --jfi-form-control-border-left-width: 0;
136
+ --jfi-form-control-border-bottom-width: 1px;
137
+ --jfi-form-control-border-right-width: 0;
138
+ --jfi-form-control-border-radius: 4px 4px 0 0;
139
+ --jfi-form-control-border-style: solid;
140
+ --jfi-form-control-box-shadow-focus: none;
141
+ --jfi-form-control-box-shadow-error-focus: none;
142
+ --jfi-form-control-border-style: solid;
143
+ --jfi-form-control-color: #212529;
144
+ --jfi-form-control-font-size: 1rem;
145
+ --jfi-form-control-font-weight: 400;
146
+ --jfi-form-control-line-height: 2;
147
+ --jfi-form-control-margin: 0;
148
+ --jfi-form-control-padding: .5rem .875rem;
149
+ --jfi-error-message-color: #C12727;
150
+ --jfi-error-message-margin: .25rem 0 0 0;
151
+ --jfi-error-message-font-size: .875rem;
152
+ `)
120
153
  };
121
154
  export const Completed = Template.bind({});
122
155
  Completed.play = async ({ canvasElement, step }) => {
@@ -1550,4 +1550,51 @@ progress {
1550
1550
  line-height: 1.5;
1551
1551
  color: #212529;
1552
1552
  display: block;
1553
+ }
1554
+
1555
+ justifi-payment-method-form {
1556
+ display: block;
1557
+ margin-left: calc(var(--jfi-layout-padding) * -1);
1558
+ margin-right: calc(var(--jfi-layout-padding) * -1);
1559
+ }
1560
+
1561
+ *::part(label) {
1562
+ color: var(--jfi-form-label-color);
1563
+ font-family: var(--jfi-form-label-font-family);
1564
+ font-weight: var(--jfi-form-label-font-weight);
1565
+ font-size: var(--jfi-form-label-font-size);
1566
+ margin: var(--jfi-form-label-margin);
1567
+ }
1568
+
1569
+ *::part(input) {
1570
+ background-color: var(--jfi-form-control-background-color);
1571
+ border-color: var(--jfi-form-control-border-color);
1572
+ border-width: var(--jfi-form-control-border-width);
1573
+ border-bottom-width: var(--jfi-form-control-border-bottom-width);
1574
+ border-bottom-width: var(--jfi-form-control-border-left-width);
1575
+ border-bottom-width: var(--jfi-form-control-border-right-width);
1576
+ border-top-width: var(--jfi-form-control-border-top-width);
1577
+ border-radius: var(--jfi-form-control-border-radius);
1578
+ border-style: var(--jfi-form-control-border-style);
1579
+ box-shadow: var(--jfi-form-control-box-shadow);
1580
+ color: var(--jfi-form-control-color);
1581
+ font-size: var(--jfi-form-control-font-size);
1582
+ font-weight: var(--jfi-form-control-font-weight);
1583
+ line-height: var(--jfi-form-control-line-height);
1584
+ margin: var(--jfi-form-control-margin);
1585
+ padding: var(--jfi-form-control-padding);
1586
+ }
1587
+ *::part(input):focus {
1588
+ color: var(--jfi-form-control-color-focus);
1589
+ border-color: var(--jfi-form-control-border-color-focus);
1590
+ box-shadow: var(--jfi-form-control-box-shadow-focus);
1591
+ }
1592
+
1593
+ *::part(input-invalid) {
1594
+ border-color: var(--jfi-form-control-border-color-error);
1595
+ box-shadow: var(--jfi-form-control-box-shadow-error);
1596
+ }
1597
+ *::part(input-invalid):focus {
1598
+ border-color: var(--jfi-form-control-border-color-error);
1599
+ box-shadow: var(--jfi-form-control-box-shadow-error-focus);
1553
1600
  }
@@ -13,7 +13,7 @@ export class PaymentMethodSelector {
13
13
  }
14
14
  render() {
15
15
  return (h("div", { class: "form-check" }, this.paymentMethodTypes.map((paymentMethodType) => {
16
- return (h("div", null, h("input", { id: paymentMethodType, type: "radio", name: "paymentMethodType", value: paymentMethodType, onChange: (event) => this.onChangeHandler(event), checked: this.selectedPaymentMethodType === paymentMethodType, class: "form-check-input" }), h("label", { htmlFor: paymentMethodType }, PaymentMethodLabels[paymentMethodType])));
16
+ return (h("div", null, h("input", { id: paymentMethodType, type: "radio", name: "paymentMethodType", value: paymentMethodType, onChange: (event) => this.onChangeHandler(event), checked: this.selectedPaymentMethodType === paymentMethodType, class: "form-check-input" }), h("label", { htmlFor: paymentMethodType, class: "form-check-label" }, PaymentMethodLabels[paymentMethodType])));
17
17
  })));
18
18
  }
19
19
  ;
@@ -0,0 +1,48 @@
1
+ const getComputedTheme = () => {
2
+ const computedStyles = getComputedStyle(document.body);
3
+ const computedTheme = {
4
+ layout: {
5
+ padding: computedStyles.getPropertyValue('--jfi-layout-padding'),
6
+ formControlSpacingHorizontal: computedStyles.getPropertyValue('--jfi-layout-form-control-spacing-x'),
7
+ formControlSpacingVertical: computedStyles.getPropertyValue('--jfi-layout-form-control-spacing-y'),
8
+ },
9
+ formControl: {
10
+ backgroundColor: computedStyles.getPropertyValue('--jfi-form-control-background-color'),
11
+ borderColor: computedStyles.getPropertyValue('--jfi-form-control-border-color'),
12
+ borderColorFocus: computedStyles.getPropertyValue('--jfi-form-control-border-color-focus'),
13
+ borderColorError: computedStyles.getPropertyValue('--jfi-form-control-border-color-error'),
14
+ borderWidth: computedStyles.getPropertyValue('--jfi-form-control-border-width'),
15
+ borderBottomWidth: computedStyles.getPropertyValue('--jfi-form-control-border-bottom-width'),
16
+ borderLeftWidth: computedStyles.getPropertyValue('--jfi-form-control-border-left-width'),
17
+ borderRightWidth: computedStyles.getPropertyValue('--jfi-form-control-border-right-width'),
18
+ borderTopWidth: computedStyles.getPropertyValue('--jfi-form-control-border-top-width'),
19
+ borderRadius: computedStyles.getPropertyValue('--jfi-form-control-border-radius'),
20
+ borderStyle: computedStyles.getPropertyValue('--jfi-form-control-border-style'),
21
+ boxShadow: computedStyles.getPropertyValue('--jfi-form-control-box-shadow'),
22
+ boxShadowError: computedStyles.getPropertyValue('--jfi-form-control-box-shadow-error'),
23
+ boxShadowErrorFocus: computedStyles.getPropertyValue('--jfi-form-control-box-shadow-error-focus'),
24
+ boxShadowFocus: computedStyles.getPropertyValue('--jfi-form-control-box-shadow-focus'),
25
+ color: computedStyles.getPropertyValue('--jfi-form-control-color'),
26
+ colorFocus: computedStyles.getPropertyValue('--jfi-form-control-color-focus'),
27
+ fontSize: computedStyles.getPropertyValue('--jfi-form-control-font-size'),
28
+ fontWeight: computedStyles.getPropertyValue('--jfi-form-control-font-weight'),
29
+ lineHeight: computedStyles.getPropertyValue('--jfi-form-control-line-height'),
30
+ margin: computedStyles.getPropertyValue('--jfi-form-control-margin'),
31
+ padding: computedStyles.getPropertyValue('--jfi-form-control-padding'),
32
+ },
33
+ formLabel: {
34
+ color: computedStyles.getPropertyValue('--jfi-form-label-color'),
35
+ fontFamily: computedStyles.getPropertyValue('--jfi-form-label-font-family'),
36
+ fontSize: computedStyles.getPropertyValue('--jfi-form-label-font-size'),
37
+ fontWeight: computedStyles.getPropertyValue('--jfi-form-label-font-weight'),
38
+ margin: computedStyles.getPropertyValue('--jfi-form-label-margin'),
39
+ },
40
+ errorMessage: {
41
+ color: computedStyles.getPropertyValue('--jfi-error-message-color'),
42
+ margin: computedStyles.getPropertyValue('--jfi-error-message-margin'),
43
+ fontSize: computedStyles.getPropertyValue('--jfi-error-message-font-size'),
44
+ }
45
+ };
46
+ return computedTheme;
47
+ };
48
+ export default getComputedTheme;
@@ -1,11 +1,12 @@
1
1
  import { Host, h } from '@stencil/core';
2
2
  import { MessageEventType } from './message-event-types';
3
3
  import packageJson from '../../../package.json';
4
+ import getComputedTheme from './get-computed-theme';
4
5
  export class PaymentMethodForm {
5
6
  constructor() {
7
+ this.computedTheme = getComputedTheme();
6
8
  this.paymentMethodFormType = undefined;
7
- this.paymentMethodFormValidationStrategy = undefined;
8
- this.paymentMethodStyleOverrides = undefined;
9
+ this.paymentMethodFormValidationMode = undefined;
9
10
  this.iframeOrigin = undefined;
10
11
  this.singleLine = undefined;
11
12
  this.height = 55;
@@ -20,8 +21,8 @@ export class PaymentMethodForm {
20
21
  this.sendStyleOverrides();
21
22
  }
22
23
  sendStyleOverrides() {
23
- if (this.paymentMethodStyleOverrides) {
24
- this.postMessage(MessageEventType[this.paymentMethodFormType].styleOverrides, { styleOverrides: this.paymentMethodStyleOverrides });
24
+ if (this.computedTheme) {
25
+ this.postMessage(MessageEventType[this.paymentMethodFormType].styleOverrides, { styleOverrides: this.computedTheme });
25
26
  }
26
27
  }
27
28
  dispatchMessageEvent(messageEvent) {
@@ -84,8 +85,8 @@ export class PaymentMethodForm {
84
85
  const iframeOrigin = this.iframeOrigin || productionIframeOrigin;
85
86
  let iframeSrc = `${iframeOrigin}/${this.paymentMethodFormType}`;
86
87
  let paramsList = [];
87
- if (this.paymentMethodFormValidationStrategy) {
88
- paramsList.push(`validationMode=${this.paymentMethodFormValidationStrategy}`);
88
+ if (this.paymentMethodFormValidationMode) {
89
+ paramsList.push(`validationMode=${this.paymentMethodFormValidationMode}`);
89
90
  }
90
91
  if (this.singleLine) {
91
92
  paramsList.push(`singleLine=${this.singleLine}`);
@@ -125,7 +126,7 @@ export class PaymentMethodForm {
125
126
  "attribute": "payment-method-form-type",
126
127
  "reflect": false
127
128
  },
128
- "paymentMethodFormValidationStrategy": {
129
+ "paymentMethodFormValidationMode": {
129
130
  "type": "string",
130
131
  "mutable": true,
131
132
  "complexType": {
@@ -139,29 +140,9 @@ export class PaymentMethodForm {
139
140
  "tags": [],
140
141
  "text": ""
141
142
  },
142
- "attribute": "payment-method-form-validation-strategy",
143
+ "attribute": "payment-method-form-validation-mode",
143
144
  "reflect": false
144
145
  },
145
- "paymentMethodStyleOverrides": {
146
- "type": "unknown",
147
- "mutable": false,
148
- "complexType": {
149
- "original": "Theme | undefined",
150
- "resolved": "Theme",
151
- "references": {
152
- "Theme": {
153
- "location": "import",
154
- "path": "./theme"
155
- }
156
- }
157
- },
158
- "required": false,
159
- "optional": false,
160
- "docs": {
161
- "tags": [],
162
- "text": ""
163
- }
164
- },
165
146
  "iframeOrigin": {
166
147
  "type": "string",
167
148
  "mutable": false,
@@ -281,10 +262,4 @@ export class PaymentMethodForm {
281
262
  }
282
263
  };
283
264
  }
284
- static get watchers() {
285
- return [{
286
- "propName": "paymentMethodStyleOverrides",
287
- "methodName": "sendStyleOverrides"
288
- }];
289
- }
290
265
  }
@@ -15,7 +15,7 @@ export class SelectInput {
15
15
  }
16
16
  ;
17
17
  render() {
18
- return (h(Host, null, h("label", { class: "form-label" }, this.label), h("select", { name: this.name, onInput: (event) => this.onInput(event), class: this.error ? 'form-select is-invalid' : 'form-select' }, this.options.map((option) => h("option", { value: option.value }, option.label))), this.error && h("div", { class: "invalid-feedback" }, this.error)));
18
+ return (h(Host, { exportparts: "input,label" }, h("label", { part: "label", class: "form-label" }, this.label), h("select", { name: this.name, onInput: (event) => this.onInput(event), part: "input", class: this.error ? 'form-select is-invalid' : 'form-select' }, this.options.map((option) => h("option", { value: option.value }, option.label))), this.error && h("div", { class: "invalid-feedback" }, this.error)));
19
19
  }
20
20
  static get is() { return "select-input"; }
21
21
  static get encapsulation() { return "shadow"; }
@@ -14,7 +14,7 @@ export class TextInput {
14
14
  }
15
15
  ;
16
16
  render() {
17
- return (h(Host, null, h("label", { class: "form-label" }, this.label), h("input", { name: this.name, type: "text", onInput: (event) => this.onInput(event), value: this.internalValue || this.defaultValue, class: this.error ? 'form-control is-invalid' : 'form-control' }), this.error && h("div", { class: "invalid-feedback" }, this.error)));
17
+ return (h(Host, { exportparts: "input,label" }, h("label", { part: "label", class: "form-label" }, this.label), h("input", { name: this.name, type: "text", onInput: (event) => this.onInput(event), value: this.internalValue || this.defaultValue, part: "input", class: this.error ? 'form-control is-invalid' : 'form-control' }), this.error && h("div", { class: "invalid-feedback" }, this.error)));
18
18
  }
19
19
  static get is() { return "text-input"; }
20
20
  static get encapsulation() { return "shadow"; }
@@ -2150,7 +2150,7 @@ const BillingForm = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
2150
2150
  return this.billingFields;
2151
2151
  }
2152
2152
  render() {
2153
- return (h(Host, null, h("fieldset", null, this.legend && this.legendBlock, h("div", { class: "row gy-3" }, h("div", { class: "col-12" }, h("text-input", { name: "address_line1", label: "Street Address", defaultValue: this.billingFields.address_line1, error: this.billingFieldsErrors.address_line1 })), h("div", { class: "col-12" }, h("text-input", { name: "address_line2", label: "Apartment, Suite, etc. (optional)", defaultValue: this.billingFields.address_line2, error: this.billingFieldsErrors.address_line2 })), h("div", { class: "col-12" }, h("text-input", { name: "address_city", label: "City", defaultValue: this.billingFields.address_city, error: this.billingFieldsErrors.address_city })), h("div", { class: "col-12" }, h("select-input", { name: "address_state", label: "State", options: StateOptions, defaultValue: this.billingFields.address_state, error: this.billingFieldsErrors.address_state })), h("div", { class: "col-12" }, h("text-input", { name: "address_postal_code", label: "ZIP", defaultValue: this.billingFields.address_postal_code, error: this.billingFieldsErrors.address_postal_code }))))));
2153
+ return (h(Host, { exportparts: "input,label" }, h("fieldset", null, this.legend && this.legendBlock, h("div", { class: "row gy-3" }, h("div", { class: "col-12" }, h("text-input", { name: "address_line1", label: "Street Address", defaultValue: this.billingFields.address_line1, error: this.billingFieldsErrors.address_line1 })), h("div", { class: "col-12" }, h("text-input", { name: "address_line2", label: "Apartment, Suite, etc. (optional)", defaultValue: this.billingFields.address_line2, error: this.billingFieldsErrors.address_line2 })), h("div", { class: "col-12" }, h("text-input", { name: "address_city", label: "City", defaultValue: this.billingFields.address_city, error: this.billingFieldsErrors.address_city })), h("div", { class: "col-12" }, h("select-input", { name: "address_state", label: "State", options: StateOptions, defaultValue: this.billingFields.address_state, error: this.billingFieldsErrors.address_state })), h("div", { class: "col-12" }, h("text-input", { name: "address_postal_code", label: "ZIP", defaultValue: this.billingFields.address_postal_code, error: this.billingFieldsErrors.address_postal_code }))))));
2154
2154
  }
2155
2155
  static get style() { return billingFormCss; }
2156
2156
  }, [1, "justifi-billing-form", {
@@ -8,10 +8,9 @@ const BankAccountForm = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
8
8
  this.bankAccountFormReady = createEvent(this, "bankAccountFormReady", 7);
9
9
  this.bankAccountFormTokenize = createEvent(this, "bankAccountFormTokenize", 7);
10
10
  this.bankAccountFormValidate = createEvent(this, "bankAccountFormValidate", 7);
11
- this.validationStrategy = undefined;
11
+ this.validationMode = undefined;
12
12
  this.styleOverrides = undefined;
13
13
  this.iframeOrigin = undefined;
14
- this.internalStyleOverrides = undefined;
15
14
  }
16
15
  readyHandler(event) {
17
16
  this.bankAccountFormReady.emit(event);
@@ -22,15 +21,6 @@ const BankAccountForm = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
22
21
  validateHandler(event) {
23
22
  this.bankAccountFormValidate.emit(event);
24
23
  }
25
- componentWillLoad() {
26
- this.parseStyleOverrides();
27
- }
28
- parseStyleOverrides() {
29
- if (this.styleOverrides) {
30
- const parsedStyleOverrides = JSON.parse(this.styleOverrides);
31
- this.internalStyleOverrides = parsedStyleOverrides;
32
- }
33
- }
34
24
  async tokenize(...args) {
35
25
  if (!this.childRef) {
36
26
  throw new Error('Cannot call tokenize');
@@ -48,16 +38,12 @@ const BankAccountForm = /*@__PURE__*/ proxyCustomElement(class extends HTMLEleme
48
38
  if (el) {
49
39
  this.childRef = el;
50
40
  }
51
- }, "iframe-origin": this.iframeOrigin, "payment-method-form-type": "bankAccount", "payment-method-form-ready": this.bankAccountFormReady, "payment-method-form-tokenize": this.bankAccountFormTokenize, "payment-method-form-validation-strategy": this.validationStrategy || 'onSubmit', paymentMethodStyleOverrides: this.internalStyleOverrides }));
41
+ }, "iframe-origin": this.iframeOrigin, "payment-method-form-type": "bankAccount", "payment-method-form-ready": this.bankAccountFormReady, "payment-method-form-tokenize": this.bankAccountFormTokenize, "payment-method-form-validation-mode": this.validationMode || 'onSubmit' }));
52
42
  }
53
- static get watchers() { return {
54
- "styleOverrides": ["parseStyleOverrides"]
55
- }; }
56
43
  }, [0, "justifi-bank-account-form", {
57
- "validationStrategy": [1025, "validation-strategy"],
44
+ "validationMode": [1025, "validation-mode"],
58
45
  "styleOverrides": [1025, "style-overrides"],
59
46
  "iframeOrigin": [1025, "iframe-origin"],
60
- "internalStyleOverrides": [32],
61
47
  "tokenize": [64],
62
48
  "validate": [64]
63
49
  }, [[0, "paymentMethodFormReady", "readyHandler"], [0, "paymentMethodFormTokenize", "tokenizeHandler"], [0, "paymentMethodFormValidate", "validateHandler"]]]);
@@ -8,11 +8,9 @@ const CardForm = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
8
8
  this.cardFormReady = createEvent(this, "cardFormReady", 7);
9
9
  this.cardFormTokenize = createEvent(this, "cardFormTokenize", 7);
10
10
  this.cardFormValidate = createEvent(this, "cardFormValidate", 7);
11
- this.validationStrategy = undefined;
12
- this.styleOverrides = undefined;
11
+ this.validationMode = undefined;
13
12
  this.iframeOrigin = undefined;
14
13
  this.singleLine = undefined;
15
- this.internalStyleOverrides = undefined;
16
14
  }
17
15
  readyHandler(event) {
18
16
  this.cardFormReady.emit(event);
@@ -23,15 +21,6 @@ const CardForm = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
23
21
  validateHandler(event) {
24
22
  this.cardFormValidate.emit(event);
25
23
  }
26
- componentWillLoad() {
27
- this.parseStyleOverrides();
28
- }
29
- parseStyleOverrides() {
30
- if (this.styleOverrides) {
31
- const parsedStyleOverrides = JSON.parse(this.styleOverrides);
32
- this.internalStyleOverrides = parsedStyleOverrides;
33
- }
34
- }
35
24
  async tokenize(...args) {
36
25
  if (!this.childRef) {
37
26
  throw new Error('Cannot call tokenize');
@@ -49,17 +38,12 @@ const CardForm = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
49
38
  if (el) {
50
39
  this.childRef = el;
51
40
  }
52
- }, "iframe-origin": this.iframeOrigin, "payment-method-form-type": "card", "single-line": this.singleLine, "payment-method-form-ready": this.cardFormReady, "payment-method-form-tokenize": this.cardFormTokenize, "payment-method-form-validation-strategy": this.validationStrategy || 'onSubmit', paymentMethodStyleOverrides: this.internalStyleOverrides }));
41
+ }, "iframe-origin": this.iframeOrigin, "payment-method-form-type": "card", "single-line": this.singleLine, "payment-method-form-ready": this.cardFormReady, "payment-method-form-tokenize": this.cardFormTokenize, "payment-method-form-validation-mode": this.validationMode || 'onSubmit' }));
53
42
  }
54
- static get watchers() { return {
55
- "styleOverrides": ["parseStyleOverrides"]
56
- }; }
57
43
  }, [0, "justifi-card-form", {
58
- "validationStrategy": [1025, "validation-strategy"],
59
- "styleOverrides": [1025, "style-overrides"],
44
+ "validationMode": [1025, "validation-mode"],
60
45
  "iframeOrigin": [1025, "iframe-origin"],
61
46
  "singleLine": [4, "single-line"],
62
- "internalStyleOverrides": [32],
63
47
  "tokenize": [64],
64
48
  "validate": [64]
65
49
  }, [[0, "paymentMethodFormReady", "readyHandler"], [0, "paymentMethodFormTokenize", "tokenizeHandler"], [0, "paymentMethodFormValidate", "validateHandler"]]]);