@justifi/webcomponents 0.0.14 → 0.2.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 (66) hide show
  1. package/CHANGELOG.md +40 -0
  2. package/changelog-template.hbs +41 -0
  3. package/dist/cjs/{index-e1b45289.js → index-3947d225.js} +65 -1
  4. package/dist/cjs/justifi-bank-account-form.cjs.entry.js +59 -0
  5. package/dist/cjs/justifi-billing-form.cjs.entry.js +2150 -0
  6. package/dist/cjs/justifi-card-form.cjs.entry.js +59 -0
  7. package/dist/cjs/justifi-payment-method-form.cjs.entry.js +109 -0
  8. package/dist/cjs/{justifi-bank-account-form_4.cjs.entry.js → justifi-payments-list.cjs.entry.js} +1 -206
  9. package/dist/cjs/loader.cjs.js +3 -3
  10. package/dist/cjs/select-input_2.cjs.entry.js +59 -0
  11. package/dist/cjs/webcomponents.cjs.js +3 -3
  12. package/dist/collection/collection-manifest.json +5 -2
  13. package/dist/collection/components/bank-account-form/bank-account-form.js +5 -3
  14. package/dist/collection/components/billing-form/billing-form-schema.js +14 -0
  15. package/dist/collection/components/billing-form/billing-form.css +11 -0
  16. package/dist/collection/components/billing-form/billing-form.js +92 -0
  17. package/dist/collection/components/billing-form/state-options.js +243 -0
  18. package/dist/collection/components/card-form/card-form.js +5 -3
  19. package/dist/collection/components/payment-method-form/payment-method-form.js +4 -4
  20. package/dist/collection/components/select-input/select-input.css +7 -0
  21. package/dist/collection/components/select-input/select-input.js +144 -0
  22. package/dist/collection/components/text-input/text-input.css +7 -0
  23. package/dist/collection/components/text-input/text-input.js +126 -0
  24. package/dist/components/index.d.ts +3 -0
  25. package/dist/components/index.js +3 -0
  26. package/dist/components/justifi-bank-account-form.js +4 -2
  27. package/dist/components/justifi-billing-form.d.ts +11 -0
  28. package/dist/components/justifi-billing-form.js +2180 -0
  29. package/dist/components/justifi-card-form.js +4 -2
  30. package/dist/components/payment-method-form.js +2 -2
  31. package/dist/components/select-input.d.ts +11 -0
  32. package/dist/components/select-input.js +6 -0
  33. package/dist/components/select-input2.js +52 -0
  34. package/dist/components/text-input.d.ts +11 -0
  35. package/dist/components/text-input.js +6 -0
  36. package/dist/components/text-input2.js +48 -0
  37. package/dist/esm/{index-c1f569bd.js → index-0bcf33c4.js} +65 -1
  38. package/dist/esm/justifi-bank-account-form.entry.js +55 -0
  39. package/dist/esm/justifi-billing-form.entry.js +2146 -0
  40. package/dist/esm/justifi-card-form.entry.js +55 -0
  41. package/dist/esm/justifi-payment-method-form.entry.js +105 -0
  42. package/dist/esm/{justifi-bank-account-form_4.entry.js → justifi-payments-list.entry.js} +2 -204
  43. package/dist/esm/loader.js +4 -4
  44. package/dist/esm/select-input_2.entry.js +54 -0
  45. package/dist/esm/webcomponents.js +4 -4
  46. package/dist/types/components/billing-form/billing-form-schema.d.ts +15 -0
  47. package/dist/types/components/billing-form/billing-form.d.ts +17 -0
  48. package/dist/types/components/billing-form/state-options.d.ts +5 -0
  49. package/dist/types/components/payment-method-form/payment-method-form.d.ts +2 -2
  50. package/dist/types/components/payment-method-form/theme.d.ts +3 -1
  51. package/dist/types/components/select-input/select-input.d.ts +18 -0
  52. package/dist/types/components/text-input/text-input.d.ts +14 -0
  53. package/dist/types/components.d.ts +74 -5
  54. package/dist/webcomponents/p-0cddfd4f.entry.js +1 -0
  55. package/dist/webcomponents/p-17badb93.entry.js +1 -0
  56. package/dist/webcomponents/p-7fd07095.entry.js +1 -0
  57. package/dist/webcomponents/p-864e32fd.entry.js +1 -0
  58. package/dist/webcomponents/p-cecf0fe8.entry.js +1 -0
  59. package/dist/webcomponents/p-d3dc4e0a.entry.js +1 -0
  60. package/dist/webcomponents/p-e82c9746.js +2 -0
  61. package/dist/webcomponents/webcomponents.esm.js +1 -1
  62. package/package.json +8 -3
  63. package/readme.md +11 -72
  64. package/LICENSE +0 -21
  65. package/dist/webcomponents/p-1de39730.js +0 -2
  66. package/dist/webcomponents/p-d6caba00.entry.js +0 -1
package/CHANGELOG.md ADDED
@@ -0,0 +1,40 @@
1
+ ### Changelog
2
+
3
+ All notable changes to this project will be documented in this file. Dates are displayed in UTC.
4
+
5
+ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
6
+
7
+ #### 0.2.0
8
+
9
+ > 13 March 2023
10
+
11
+ - Add BillingForm component poc
12
+ - Add TextInput component
13
+ - Add SelectInput component
14
+
15
+ #### 0.1.15
16
+
17
+ > 14 February 2023
18
+
19
+ - FE-48 Add the LICENSE [`#26`](https://github.com/justifi-tech/web-component-library/pull/26)
20
+ - update PR templates main README, and add changelogs [`#23`](https://github.com/justifi-tech/web-component-library/pull/23)
21
+ - Yarn upgrade [`#22`](https://github.com/justifi-tech/web-component-library/pull/22)
22
+ - Add missing properties to theme [`#21`](https://github.com/justifi-tech/web-component-library/pull/21)
23
+ - Bump decode-uri-component from 0.2.0 to 0.2.2 in /react-library [`#6`](https://github.com/justifi-tech/web-component-library/pull/6)
24
+ - Update examples to include payment method metadata and code comments [`#19`](https://github.com/justifi-tech/web-component-library/pull/19)
25
+ - Check for styleOverrides before attempting to parse [`#18`](https://github.com/justifi-tech/web-component-library/pull/18)
26
+ - Update README files [`#17`](https://github.com/justifi-tech/web-component-library/pull/17)
27
+ - Update READMEs and release new react-library version [`#16`](https://github.com/justifi-tech/web-component-library/pull/16)
28
+ - Allow styleOverrides to be passed into cardForm and bankAccountForm [`#15`](https://github.com/justifi-tech/web-component-library/pull/15)
29
+ - FE-18: Iframe content height reporting [`#14`](https://github.com/justifi-tech/web-component-library/pull/14)
30
+ - Update web component props for `v2` payments-js [`#13`](https://github.com/justifi-tech/web-component-library/pull/13)
31
+ - Fix react components [`#11`](https://github.com/justifi-tech/web-component-library/pull/11)
32
+ - Fix card form component events [`#10`](https://github.com/justifi-tech/web-component-library/pull/10)
33
+ - Eng-2080: Add bank account web component [`#7`](https://github.com/justifi-tech/web-component-library/pull/7)
34
+ - ENG-1960 publish libraries to npmjs.org [`#4`](https://github.com/justifi-tech/web-component-library/pull/4)
35
+ - Package & Publish libraries [`#3`](https://github.com/justifi-tech/web-component-library/pull/3)
36
+ - Restructure project and link react and stencil libraries [`#2`](https://github.com/justifi-tech/web-component-library/pull/2)
37
+ - Terraform and GitHub Actions [`#1`](https://github.com/justifi-tech/web-component-library/pull/1)
38
+ - init [`27806f7`](https://github.com/justifi-tech/web-component-library/commit/27806f7bff97247033800c7743570ebeec4080d7)
39
+ - add: release-it package [`e0b3711`](https://github.com/justifi-tech/web-component-library/commit/e0b371184774dd7dead0243cd645640175d6b87f)
40
+ - initial commit [`c147b58`](https://github.com/justifi-tech/web-component-library/commit/c147b580aaf95eb22ffe6ad9b0217954890dd1d4)
@@ -0,0 +1,41 @@
1
+ {{#each releases}}
2
+ # {{title}}
3
+ [{{isoDate}}]
4
+
5
+ {{! lit commits with feature: in message, use feature: or Feature: }}
6
+ {{#commit-list
7
+ commits
8
+ heading='### Features'
9
+ message='(feature: )|(Feature: )'
10
+ exclude='(fix: )|(Fix: )|(break: )|(Break: )'}}
11
+ * {{subject}} ([`{{shorthash}}`]({{href}}))
12
+ {{/commit-list}}
13
+
14
+ {{! use fix: or Fix: }}
15
+ {{#commit-list
16
+ commits
17
+ heading='### Fixes'
18
+ message='(fix: )|(Fix: )'
19
+ exclude='(break: )|(Break: )|(Feature: )|(feature: )'}}
20
+ * {{subject}} ([`{{shorthash}}`]({{href}}))
21
+ {{/commit-list}}
22
+
23
+ {{! use add: or Add: }}
24
+ {{#commit-list
25
+ commits
26
+ heading='### Added'
27
+ message='(add: )|(Add: )'
28
+ exclude='(break: )|(Break: )|(Feature: )|(feature: )'}}
29
+ * {{subject}} ([`{{shorthash}}`]({{href}}))
30
+ {{/commit-list}}
31
+
32
+ {{! user break: or Break: }}
33
+ {{#commit-list
34
+ commits
35
+ heading='### Breaking changes'
36
+ message='(break: )|(Break: )'
37
+ exclude='(fix: )|(Fix: )|(Feature: )|(feature: )'}}
38
+ * {{subject}} ([`{{shorthash}}`]({{href}}))
39
+ {{/commit-list}}
40
+
41
+ {{/each}}
@@ -313,7 +313,7 @@ const getScopeId = (cmp, mode) => 'sc-' + (cmp.$tagName$);
313
313
  const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
314
314
  if (oldValue !== newValue) {
315
315
  let isProp = isMemberInElement(elm, memberName);
316
- memberName.toLowerCase();
316
+ let ln = memberName.toLowerCase();
317
317
  if (memberName === 'class') {
318
318
  const classList = elm.classList;
319
319
  const oldClasses = parseClassList(oldValue);
@@ -321,12 +321,76 @@ const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
321
321
  classList.remove(...oldClasses.filter((c) => c && !newClasses.includes(c)));
322
322
  classList.add(...newClasses.filter((c) => c && !oldClasses.includes(c)));
323
323
  }
324
+ else if (memberName === 'style') {
325
+ // update style attribute, css properties and values
326
+ {
327
+ for (const prop in oldValue) {
328
+ if (!newValue || newValue[prop] == null) {
329
+ if (prop.includes('-')) {
330
+ elm.style.removeProperty(prop);
331
+ }
332
+ else {
333
+ elm.style[prop] = '';
334
+ }
335
+ }
336
+ }
337
+ }
338
+ for (const prop in newValue) {
339
+ if (!oldValue || newValue[prop] !== oldValue[prop]) {
340
+ if (prop.includes('-')) {
341
+ elm.style.setProperty(prop, newValue[prop]);
342
+ }
343
+ else {
344
+ elm.style[prop] = newValue[prop];
345
+ }
346
+ }
347
+ }
348
+ }
324
349
  else if (memberName === 'ref') {
325
350
  // minifier will clean this up
326
351
  if (newValue) {
327
352
  newValue(elm);
328
353
  }
329
354
  }
355
+ else if ((!isProp ) &&
356
+ memberName[0] === 'o' &&
357
+ memberName[1] === 'n') {
358
+ // Event Handlers
359
+ // so if the member name starts with "on" and the 3rd characters is
360
+ // a capital letter, and it's not already a member on the element,
361
+ // then we're assuming it's an event listener
362
+ if (memberName[2] === '-') {
363
+ // on- prefixed events
364
+ // allows to be explicit about the dom event to listen without any magic
365
+ // under the hood:
366
+ // <my-cmp on-click> // listens for "click"
367
+ // <my-cmp on-Click> // listens for "Click"
368
+ // <my-cmp on-ionChange> // listens for "ionChange"
369
+ // <my-cmp on-EVENTS> // listens for "EVENTS"
370
+ memberName = memberName.slice(3);
371
+ }
372
+ else if (isMemberInElement(win, ln)) {
373
+ // standard event
374
+ // the JSX attribute could have been "onMouseOver" and the
375
+ // member name "onmouseover" is on the window's prototype
376
+ // so let's add the listener "mouseover", which is all lowercased
377
+ memberName = ln.slice(2);
378
+ }
379
+ else {
380
+ // custom event
381
+ // the JSX attribute could have been "onMyCustomEvent"
382
+ // so let's trim off the "on" prefix and lowercase the first character
383
+ // and add the listener "myCustomEvent"
384
+ // except for the first character, we keep the event name case
385
+ memberName = ln[2] + memberName.slice(3);
386
+ }
387
+ if (oldValue) {
388
+ plt.rel(elm, memberName, oldValue, false);
389
+ }
390
+ if (newValue) {
391
+ plt.ael(elm, memberName, newValue, false);
392
+ }
393
+ }
330
394
  else {
331
395
  // Set property if it exists and it's not a SVG
332
396
  const isComplex = isComplexType(newValue);
@@ -0,0 +1,59 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ const index = require('./index-3947d225.js');
6
+
7
+ const BankAccountForm = class {
8
+ constructor(hostRef) {
9
+ index.registerInstance(this, hostRef);
10
+ this.bankAccountFormReady = index.createEvent(this, "bankAccountFormReady", 7);
11
+ this.bankAccountFormTokenize = index.createEvent(this, "bankAccountFormTokenize", 7);
12
+ this.bankAccountFormValidate = index.createEvent(this, "bankAccountFormValidate", 7);
13
+ this.validationStrategy = undefined;
14
+ this.styleOverrides = undefined;
15
+ this.internalStyleOverrides = undefined;
16
+ }
17
+ readyHandler(event) {
18
+ this.bankAccountFormReady.emit(event);
19
+ }
20
+ tokenizeHandler(event) {
21
+ this.bankAccountFormTokenize.emit(event);
22
+ }
23
+ validateHandler(event) {
24
+ this.bankAccountFormValidate.emit(event);
25
+ }
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
+ async tokenize(...args) {
36
+ if (!this.childRef) {
37
+ throw new Error('Cannot call tokenize');
38
+ }
39
+ return this.childRef.tokenize(...args);
40
+ }
41
+ async validate() {
42
+ if (!this.childRef) {
43
+ throw new Error('Cannot call validate');
44
+ }
45
+ return this.childRef.validate();
46
+ }
47
+ render() {
48
+ return (index.h("justifi-payment-method-form", { ref: el => {
49
+ if (el) {
50
+ this.childRef = el;
51
+ }
52
+ }, "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 }));
53
+ }
54
+ static get watchers() { return {
55
+ "styleOverrides": ["parseStyleOverrides"]
56
+ }; }
57
+ };
58
+
59
+ exports.justifi_bank_account_form = BankAccountForm;