@justifi/webcomponents 0.2.1 → 0.3.2

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 (78) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/dist/cjs/Payment-5781460e.js +71 -0
  3. package/dist/cjs/{index-ca2cd154.js → index-4f2a13d2.js} +13 -389
  4. package/dist/cjs/justifi-bank-account-form.cjs.entry.js +3 -2
  5. package/dist/cjs/{justifi-billing-form.cjs.entry.js → justifi-billing-form_2.cjs.entry.js} +30 -1
  6. package/dist/cjs/justifi-card-form.cjs.entry.js +3 -2
  7. package/dist/cjs/justifi-payment-form.cjs.entry.js +46 -3
  8. package/dist/cjs/justifi-payment-method-form.cjs.entry.js +22 -16
  9. package/dist/cjs/justifi-payments-list.cjs.entry.js +3 -70
  10. package/dist/cjs/loader.cjs.js +2 -2
  11. package/dist/cjs/select-input_2.cjs.entry.js +1 -1
  12. package/dist/cjs/webcomponents.cjs.js +2 -2
  13. package/dist/collection/api/Payment.js +1 -1
  14. package/dist/collection/collection-manifest.json +1 -0
  15. package/dist/collection/components/bank-account-form/bank-account-form.js +19 -1
  16. package/dist/collection/components/billing-form/billing-form.js +49 -0
  17. package/dist/collection/components/card-form/card-form.js +19 -1
  18. package/dist/collection/components/card-form/card-form.stories.js +35 -28
  19. package/dist/collection/components/payment-form/payment-form.js +145 -7
  20. package/dist/collection/components/payment-form/payment-form.stories.js +82 -0
  21. package/dist/collection/components/payment-form/payment-method-selector.js +86 -0
  22. package/dist/collection/components/payment-form/tokenize.js +1 -0
  23. package/dist/collection/components/payment-method-form/payment-method-form.js +21 -1
  24. package/dist/components/Payment.js +69 -0
  25. package/dist/components/billing-form.js +2185 -0
  26. package/dist/components/index.d.ts +1 -0
  27. package/dist/components/index.js +1 -0
  28. package/dist/components/justifi-bank-account-form.js +3 -1
  29. package/dist/components/justifi-billing-form.js +1 -2175
  30. package/dist/components/justifi-card-form.js +3 -1
  31. package/dist/components/justifi-payment-form.js +85 -6
  32. package/dist/components/justifi-payment-method-selector.d.ts +11 -0
  33. package/dist/components/justifi-payment-method-selector.js +6 -0
  34. package/dist/components/justifi-payments-list.js +1 -68
  35. package/dist/components/payment-method-form.js +22 -15
  36. package/dist/components/payment-method-selector.js +42 -0
  37. package/dist/esm/Payment-3f7570a8.js +69 -0
  38. package/dist/esm/{index-05706eb5.js → index-3ce5521c.js} +13 -389
  39. package/dist/esm/justifi-bank-account-form.entry.js +3 -2
  40. package/dist/esm/{justifi-billing-form.entry.js → justifi-billing-form_2.entry.js} +30 -2
  41. package/dist/esm/justifi-card-form.entry.js +3 -2
  42. package/dist/esm/justifi-payment-form.entry.js +46 -3
  43. package/dist/esm/justifi-payment-method-form.entry.js +22 -16
  44. package/dist/esm/justifi-payments-list.entry.js +2 -69
  45. package/dist/esm/loader.js +2 -2
  46. package/dist/esm/select-input_2.entry.js +1 -1
  47. package/dist/esm/webcomponents.js +2 -2
  48. package/dist/types/api/Payment.d.ts +1 -1
  49. package/dist/types/components/bank-account-form/bank-account-form.d.ts +1 -0
  50. package/dist/types/components/billing-form/billing-form-schema.d.ts +7 -0
  51. package/dist/types/components/billing-form/billing-form.d.ts +3 -8
  52. package/dist/types/components/card-form/card-form.d.ts +1 -0
  53. package/dist/types/components/card-form/card-form.stories.d.ts +1 -0
  54. package/dist/types/components/payment-form/payment-form.d.ts +17 -1
  55. package/dist/types/components/payment-form/payment-form.stories.d.ts +44 -0
  56. package/dist/types/components/payment-form/payment-method-selector.d.ts +10 -0
  57. package/dist/types/components/payment-form/tokenize.d.ts +5 -0
  58. package/dist/types/components/payment-method-form/payment-method-form.d.ts +1 -0
  59. package/dist/types/components.d.ts +40 -2
  60. package/dist/webcomponents/p-19a76621.entry.js +1 -0
  61. package/dist/webcomponents/p-21e020a8.js +1 -0
  62. package/dist/webcomponents/p-250118e4.entry.js +1 -0
  63. package/dist/webcomponents/p-3536328b.entry.js +1 -0
  64. package/dist/webcomponents/p-6633de1b.entry.js +1 -0
  65. package/dist/webcomponents/p-68e47ee5.entry.js +1 -0
  66. package/dist/webcomponents/p-6c3a226e.entry.js +1 -0
  67. package/dist/webcomponents/{p-3809130a.entry.js → p-763a2b4f.entry.js} +1 -1
  68. package/dist/webcomponents/p-9f34a2c1.js +2 -0
  69. package/dist/webcomponents/webcomponents.esm.js +1 -1
  70. package/package.json +18 -14
  71. package/readme.md +1 -1
  72. package/dist/webcomponents/p-67be9585.entry.js +0 -1
  73. package/dist/webcomponents/p-787671b9.entry.js +0 -1
  74. package/dist/webcomponents/p-87654bf4.entry.js +0 -1
  75. package/dist/webcomponents/p-8ee06fd1.js +0 -2
  76. package/dist/webcomponents/p-94ef2d0e.entry.js +0 -1
  77. package/dist/webcomponents/p-c07191dc.entry.js +0 -1
  78. package/dist/webcomponents/p-e5b0f047.entry.js +0 -1
@@ -9,11 +9,7 @@ const NAMESPACE = 'webcomponents';
9
9
  * Modified for Stencil's renderer and slot projection
10
10
  */
11
11
  let scopeId;
12
- let contentRef;
13
12
  let hostTagName;
14
- let useNativeShadowDom = false;
15
- let checkSlotFallbackVisibility = false;
16
- let checkSlotRelocate = false;
17
13
  let isSvgMode = false;
18
14
  let queuePending = false;
19
15
  const createTime = (fnName, tagName = '') => {
@@ -58,7 +54,6 @@ const isComplexType = (o) => {
58
54
  // export function h(nodeName: string | d.FunctionalComponent, vnodeData: d.PropsType, ...children: d.ChildType[]): d.VNode;
59
55
  const h = (nodeName, vnodeData, ...children) => {
60
56
  let child = null;
61
- let slotName = null;
62
57
  let simple = false;
63
58
  let lastSimple = false;
64
59
  const vNodeChildren = [];
@@ -86,9 +81,6 @@ const h = (nodeName, vnodeData, ...children) => {
86
81
  };
87
82
  walk(children);
88
83
  if (vnodeData) {
89
- if (vnodeData.name) {
90
- slotName = vnodeData.name;
91
- }
92
84
  {
93
85
  const classData = vnodeData.className || vnodeData.class;
94
86
  if (classData) {
@@ -106,9 +98,6 @@ const h = (nodeName, vnodeData, ...children) => {
106
98
  if (vNodeChildren.length > 0) {
107
99
  vnode.$children$ = vNodeChildren;
108
100
  }
109
- {
110
- vnode.$name$ = slotName;
111
- }
112
101
  return vnode;
113
102
  };
114
103
  const newVNode = (tag, text) => {
@@ -122,9 +111,6 @@ const newVNode = (tag, text) => {
122
111
  {
123
112
  vnode.$attrs$ = null;
124
113
  }
125
- {
126
- vnode.$name$ = null;
127
- }
128
114
  return vnode;
129
115
  };
130
116
  const Host = {};
@@ -155,6 +141,11 @@ const isHost = (node) => node && node.$tag$ === Host;
155
141
  const parsePropertyValue = (propValue, propType) => {
156
142
  // ensure this value is of the correct prop type
157
143
  if (propValue != null && !isComplexType(propValue)) {
144
+ if (propType & 4 /* MEMBER_FLAGS.Boolean */) {
145
+ // per the HTML spec, any string value means it is a boolean true value
146
+ // but we'll cheat here and say that the string "false" is the boolean false
147
+ return propValue === 'false' ? false : propValue === '' || !!propValue;
148
+ }
158
149
  if (propType & 1 /* MEMBER_FLAGS.String */) {
159
150
  // could have been passed as a number or boolean
160
151
  // but we still want it as a string
@@ -429,36 +420,13 @@ const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
429
420
  let i = 0;
430
421
  let elm;
431
422
  let childNode;
432
- let oldVNode;
433
- if (!useNativeShadowDom) {
434
- // remember for later we need to check to relocate nodes
435
- checkSlotRelocate = true;
436
- if (newVNode.$tag$ === 'slot') {
437
- if (scopeId) {
438
- // scoped css needs to add its scoped id to the parent element
439
- parentElm.classList.add(scopeId + '-s');
440
- }
441
- newVNode.$flags$ |= newVNode.$children$
442
- ? // slot element has fallback content
443
- 2 /* VNODE_FLAGS.isSlotFallback */
444
- : // slot element does not have fallback content
445
- 1 /* VNODE_FLAGS.isSlotReference */;
446
- }
447
- }
448
423
  if (newVNode.$text$ !== null) {
449
424
  // create text node
450
425
  elm = newVNode.$elm$ = doc.createTextNode(newVNode.$text$);
451
426
  }
452
- else if (newVNode.$flags$ & 1 /* VNODE_FLAGS.isSlotReference */) {
453
- // create a slot reference node
454
- elm = newVNode.$elm$ =
455
- doc.createTextNode('');
456
- }
457
427
  else {
458
428
  // create element
459
- elm = newVNode.$elm$ = (doc.createElement(newVNode.$flags$ & 2 /* VNODE_FLAGS.isSlotFallback */
460
- ? 'slot-fb'
461
- : newVNode.$tag$));
429
+ elm = newVNode.$elm$ = (doc.createElement(newVNode.$tag$));
462
430
  // add css classes, attrs, props, listeners, etc.
463
431
  {
464
432
  updateElement(null, newVNode, isSvgMode);
@@ -471,7 +439,7 @@ const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
471
439
  if (newVNode.$children$) {
472
440
  for (i = 0; i < newVNode.$children$.length; ++i) {
473
441
  // create the node
474
- childNode = createElm(oldParentVNode, newVNode, i, elm);
442
+ childNode = createElm(oldParentVNode, newVNode, i);
475
443
  // return node could have been null
476
444
  if (childNode) {
477
445
  // append our new node
@@ -480,62 +448,20 @@ const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
480
448
  }
481
449
  }
482
450
  }
483
- {
484
- elm['s-hn'] = hostTagName;
485
- if (newVNode.$flags$ & (2 /* VNODE_FLAGS.isSlotFallback */ | 1 /* VNODE_FLAGS.isSlotReference */)) {
486
- // remember the content reference comment
487
- elm['s-sr'] = true;
488
- // remember the content reference comment
489
- elm['s-cr'] = contentRef;
490
- // remember the slot name, or empty string for default slot
491
- elm['s-sn'] = newVNode.$name$ || '';
492
- // check if we've got an old vnode for this slot
493
- oldVNode = oldParentVNode && oldParentVNode.$children$ && oldParentVNode.$children$[childIndex];
494
- if (oldVNode && oldVNode.$tag$ === newVNode.$tag$ && oldParentVNode.$elm$) {
495
- // we've got an old slot vnode and the wrapper is being replaced
496
- // so let's move the old slot content back to it's original location
497
- putBackInOriginalLocation(oldParentVNode.$elm$, false);
498
- }
499
- }
500
- }
501
451
  return elm;
502
452
  };
503
- const putBackInOriginalLocation = (parentElm, recursive) => {
504
- plt.$flags$ |= 1 /* PLATFORM_FLAGS.isTmpDisconnected */;
505
- const oldSlotChildNodes = parentElm.childNodes;
506
- for (let i = oldSlotChildNodes.length - 1; i >= 0; i--) {
507
- const childNode = oldSlotChildNodes[i];
508
- if (childNode['s-hn'] !== hostTagName && childNode['s-ol']) {
509
- // // this child node in the old element is from another component
510
- // // remove this node from the old slot's parent
511
- // childNode.remove();
512
- // and relocate it back to it's original location
513
- parentReferenceNode(childNode).insertBefore(childNode, referenceNode(childNode));
514
- // remove the old original location comment entirely
515
- // later on the patch function will know what to do
516
- // and move this to the correct spot in need be
517
- childNode['s-ol'].remove();
518
- childNode['s-ol'] = undefined;
519
- checkSlotRelocate = true;
520
- }
521
- if (recursive) {
522
- putBackInOriginalLocation(childNode, recursive);
523
- }
524
- }
525
- plt.$flags$ &= ~1 /* PLATFORM_FLAGS.isTmpDisconnected */;
526
- };
527
453
  const addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) => {
528
- let containerElm = ((parentElm['s-cr'] && parentElm['s-cr'].parentNode) || parentElm);
454
+ let containerElm = (parentElm);
529
455
  let childNode;
530
456
  if (containerElm.shadowRoot && containerElm.tagName === hostTagName) {
531
457
  containerElm = containerElm.shadowRoot;
532
458
  }
533
459
  for (; startIdx <= endIdx; ++startIdx) {
534
460
  if (vnodes[startIdx]) {
535
- childNode = createElm(null, parentVNode, startIdx, parentElm);
461
+ childNode = createElm(null, parentVNode, startIdx);
536
462
  if (childNode) {
537
463
  vnodes[startIdx].$elm$ = childNode;
538
- containerElm.insertBefore(childNode, referenceNode(before) );
464
+ containerElm.insertBefore(childNode, before);
539
465
  }
540
466
  }
541
467
  }
@@ -545,20 +471,6 @@ const removeVnodes = (vnodes, startIdx, endIdx, vnode, elm) => {
545
471
  if ((vnode = vnodes[startIdx])) {
546
472
  elm = vnode.$elm$;
547
473
  callNodeRefs(vnode);
548
- {
549
- // we're removing this element
550
- // so it's possible we need to show slot fallback content now
551
- checkSlotFallbackVisibility = true;
552
- if (elm['s-ol']) {
553
- // remove the original location comment
554
- elm['s-ol'].remove();
555
- }
556
- else {
557
- // it's possible that child nodes of the node
558
- // that's being removed are slot nodes
559
- putBackInOriginalLocation(elm, true);
560
- }
561
- }
562
474
  // remove the vnode's element from the dom
563
475
  elm.remove();
564
476
  }
@@ -674,23 +586,6 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
674
586
  newEndVnode = newCh[--newEndIdx];
675
587
  }
676
588
  else if (isSameVnode(oldStartVnode, newEndVnode)) {
677
- // case: "Vnode moved right"
678
- //
679
- // We've found that the last node in our window on the new children is
680
- // the same VNode as the _first_ node in our window on the old children
681
- // we're dealing with now. Visually, this is the layout of these two
682
- // nodes:
683
- //
684
- // newCh: [..., newStartVnode , ... , newEndVnode , ...]
685
- // ^^^^^^^^^^^
686
- // oldCh: [..., oldStartVnode , ... , oldEndVnode , ...]
687
- // ^^^^^^^^^^^^^
688
- //
689
- // In this situation we need to patch `newEndVnode` onto `oldStartVnode`
690
- // and move the DOM element for `oldStartVnode`.
691
- if ((oldStartVnode.$tag$ === 'slot' || newEndVnode.$tag$ === 'slot')) {
692
- putBackInOriginalLocation(oldStartVnode.$elm$.parentNode, false);
693
- }
694
589
  patch(oldStartVnode, newEndVnode);
695
590
  // We need to move the element for `oldStartVnode` into a position which
696
591
  // will be appropriate for `newEndVnode`. For this we can use
@@ -714,24 +609,6 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
714
609
  newEndVnode = newCh[--newEndIdx];
715
610
  }
716
611
  else if (isSameVnode(oldEndVnode, newStartVnode)) {
717
- // case: "Vnode moved left"
718
- //
719
- // We've found that the first node in our window on the new children is
720
- // the same VNode as the _last_ node in our window on the old children.
721
- // Visually, this is the layout of these two nodes:
722
- //
723
- // newCh: [..., newStartVnode , ... , newEndVnode , ...]
724
- // ^^^^^^^^^^^^^
725
- // oldCh: [..., oldStartVnode , ... , oldEndVnode , ...]
726
- // ^^^^^^^^^^^
727
- //
728
- // In this situation we need to patch `newStartVnode` onto `oldEndVnode`
729
- // (which will handle updating any changed attributes, reconciling their
730
- // children etc) but we also need to move the DOM node to which
731
- // `oldEndVnode` corresponds.
732
- if ((oldStartVnode.$tag$ === 'slot' || newEndVnode.$tag$ === 'slot')) {
733
- putBackInOriginalLocation(oldEndVnode.$elm$.parentNode, false);
734
- }
735
612
  patch(oldEndVnode, newStartVnode);
736
613
  // We've already checked above if `oldStartVnode` and `newStartVnode` are
737
614
  // the same node, so since we're here we know that they are not. Thus we
@@ -748,13 +625,13 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
748
625
  // the key of the first new child OR the build is not using `key`
749
626
  // attributes at all. In either case we need to create a new element
750
627
  // for the new node.
751
- node = createElm(oldCh && oldCh[newStartIdx], newVNode, newStartIdx, parentElm);
628
+ node = createElm(oldCh && oldCh[newStartIdx], newVNode, newStartIdx);
752
629
  newStartVnode = newCh[++newStartIdx];
753
630
  }
754
631
  if (node) {
755
632
  // if we created a new node then handle inserting it to the DOM
756
633
  {
757
- parentReferenceNode(oldStartVnode.$elm$).insertBefore(node, referenceNode(oldStartVnode.$elm$));
634
+ oldStartVnode.$elm$.parentNode.insertBefore(node, oldStartVnode.$elm$);
758
635
  }
759
636
  }
760
637
  }
@@ -791,21 +668,10 @@ const isSameVnode = (leftVNode, rightVNode) => {
791
668
  // compare if two vnode to see if they're "technically" the same
792
669
  // need to have the same element tag, and same key to be the same
793
670
  if (leftVNode.$tag$ === rightVNode.$tag$) {
794
- if (leftVNode.$tag$ === 'slot') {
795
- return leftVNode.$name$ === rightVNode.$name$;
796
- }
797
671
  return true;
798
672
  }
799
673
  return false;
800
674
  };
801
- const referenceNode = (node) => {
802
- // this node was relocated to a new location in the dom
803
- // because of some other component's slot
804
- // but we still have an html comment in place of where
805
- // it's original location was according to it's original vdom
806
- return (node && node['s-ol']) || node;
807
- };
808
- const parentReferenceNode = (node) => (node['s-ol'] ? node['s-ol'] : node).parentNode;
809
675
  /**
810
676
  * Handle reconciling an outdated VNode with a new one which corresponds to
811
677
  * it. This function handles flushing updates to the DOM and reconciling the
@@ -818,14 +684,10 @@ const patch = (oldVNode, newVNode) => {
818
684
  const elm = (newVNode.$elm$ = oldVNode.$elm$);
819
685
  const oldChildren = oldVNode.$children$;
820
686
  const newChildren = newVNode.$children$;
821
- const tag = newVNode.$tag$;
822
687
  const text = newVNode.$text$;
823
- let defaultHolder;
824
688
  if (text === null) {
825
689
  {
826
- if (tag === 'slot')
827
- ;
828
- else {
690
+ {
829
691
  // either this is the first render of an element OR it's an update
830
692
  // AND we already know it's possible it could have changed
831
693
  // this updates the element's css classes, attrs, props, listeners, etc.
@@ -851,147 +713,12 @@ const patch = (oldVNode, newVNode) => {
851
713
  removeVnodes(oldChildren, 0, oldChildren.length - 1);
852
714
  }
853
715
  }
854
- else if ((defaultHolder = elm['s-cr'])) {
855
- // this element has slotted content
856
- defaultHolder.parentNode.textContent = text;
857
- }
858
716
  else if (oldVNode.$text$ !== text) {
859
717
  // update the text content for the text only vnode
860
718
  // and also only if the text is different than before
861
719
  elm.data = text;
862
720
  }
863
721
  };
864
- const updateFallbackSlotVisibility = (elm) => {
865
- // tslint:disable-next-line: prefer-const
866
- const childNodes = elm.childNodes;
867
- let childNode;
868
- let i;
869
- let ilen;
870
- let j;
871
- let slotNameAttr;
872
- let nodeType;
873
- for (i = 0, ilen = childNodes.length; i < ilen; i++) {
874
- childNode = childNodes[i];
875
- if (childNode.nodeType === 1 /* NODE_TYPE.ElementNode */) {
876
- if (childNode['s-sr']) {
877
- // this is a slot fallback node
878
- // get the slot name for this slot reference node
879
- slotNameAttr = childNode['s-sn'];
880
- // by default always show a fallback slot node
881
- // then hide it if there are other slots in the light dom
882
- childNode.hidden = false;
883
- for (j = 0; j < ilen; j++) {
884
- nodeType = childNodes[j].nodeType;
885
- if (childNodes[j]['s-hn'] !== childNode['s-hn'] || slotNameAttr !== '') {
886
- // this sibling node is from a different component OR is a named fallback slot node
887
- if (nodeType === 1 /* NODE_TYPE.ElementNode */ && slotNameAttr === childNodes[j].getAttribute('slot')) {
888
- childNode.hidden = true;
889
- break;
890
- }
891
- }
892
- else {
893
- // this is a default fallback slot node
894
- // any element or text node (with content)
895
- // should hide the default fallback slot node
896
- if (nodeType === 1 /* NODE_TYPE.ElementNode */ ||
897
- (nodeType === 3 /* NODE_TYPE.TextNode */ && childNodes[j].textContent.trim() !== '')) {
898
- childNode.hidden = true;
899
- break;
900
- }
901
- }
902
- }
903
- }
904
- // keep drilling down
905
- updateFallbackSlotVisibility(childNode);
906
- }
907
- }
908
- };
909
- const relocateNodes = [];
910
- const relocateSlotContent = (elm) => {
911
- // tslint:disable-next-line: prefer-const
912
- let childNode;
913
- let node;
914
- let hostContentNodes;
915
- let slotNameAttr;
916
- let relocateNodeData;
917
- let j;
918
- let i = 0;
919
- const childNodes = elm.childNodes;
920
- const ilen = childNodes.length;
921
- for (; i < ilen; i++) {
922
- childNode = childNodes[i];
923
- if (childNode['s-sr'] && (node = childNode['s-cr']) && node.parentNode) {
924
- // first got the content reference comment node
925
- // then we got it's parent, which is where all the host content is in now
926
- hostContentNodes = node.parentNode.childNodes;
927
- slotNameAttr = childNode['s-sn'];
928
- for (j = hostContentNodes.length - 1; j >= 0; j--) {
929
- node = hostContentNodes[j];
930
- if (!node['s-cn'] && !node['s-nr'] && node['s-hn'] !== childNode['s-hn']) {
931
- // let's do some relocating to its new home
932
- // but never relocate a content reference node
933
- // that is suppose to always represent the original content location
934
- if (isNodeLocatedInSlot(node, slotNameAttr)) {
935
- // it's possible we've already decided to relocate this node
936
- relocateNodeData = relocateNodes.find((r) => r.$nodeToRelocate$ === node);
937
- // made some changes to slots
938
- // let's make sure we also double check
939
- // fallbacks are correctly hidden or shown
940
- checkSlotFallbackVisibility = true;
941
- node['s-sn'] = node['s-sn'] || slotNameAttr;
942
- if (relocateNodeData) {
943
- // previously we never found a slot home for this node
944
- // but turns out we did, so let's remember it now
945
- relocateNodeData.$slotRefNode$ = childNode;
946
- }
947
- else {
948
- // add to our list of nodes to relocate
949
- relocateNodes.push({
950
- $slotRefNode$: childNode,
951
- $nodeToRelocate$: node,
952
- });
953
- }
954
- if (node['s-sr']) {
955
- relocateNodes.map((relocateNode) => {
956
- if (isNodeLocatedInSlot(relocateNode.$nodeToRelocate$, node['s-sn'])) {
957
- relocateNodeData = relocateNodes.find((r) => r.$nodeToRelocate$ === node);
958
- if (relocateNodeData && !relocateNode.$slotRefNode$) {
959
- relocateNode.$slotRefNode$ = relocateNodeData.$slotRefNode$;
960
- }
961
- }
962
- });
963
- }
964
- }
965
- else if (!relocateNodes.some((r) => r.$nodeToRelocate$ === node)) {
966
- // so far this element does not have a slot home, not setting slotRefNode on purpose
967
- // if we never find a home for this element then we'll need to hide it
968
- relocateNodes.push({
969
- $nodeToRelocate$: node,
970
- });
971
- }
972
- }
973
- }
974
- }
975
- if (childNode.nodeType === 1 /* NODE_TYPE.ElementNode */) {
976
- relocateSlotContent(childNode);
977
- }
978
- }
979
- };
980
- const isNodeLocatedInSlot = (nodeToRelocate, slotNameAttr) => {
981
- if (nodeToRelocate.nodeType === 1 /* NODE_TYPE.ElementNode */) {
982
- if (nodeToRelocate.getAttribute('slot') === null && slotNameAttr === '') {
983
- return true;
984
- }
985
- if (nodeToRelocate.getAttribute('slot') === slotNameAttr) {
986
- return true;
987
- }
988
- return false;
989
- }
990
- if (nodeToRelocate['s-sn'] === slotNameAttr) {
991
- return true;
992
- }
993
- return slotNameAttr === '';
994
- };
995
722
  const callNodeRefs = (vNode) => {
996
723
  {
997
724
  vNode.$attrs$ && vNode.$attrs$.ref && vNode.$attrs$.ref(null);
@@ -1000,7 +727,6 @@ const callNodeRefs = (vNode) => {
1000
727
  };
1001
728
  const renderVdom = (hostRef, renderFnResults) => {
1002
729
  const hostElm = hostRef.$hostElement$;
1003
- const cmpMeta = hostRef.$cmpMeta$;
1004
730
  const oldVNode = hostRef.$vnode$ || newVNode(null, null);
1005
731
  const rootVnode = isHost(renderFnResults) ? renderFnResults : h(null, null, renderFnResults);
1006
732
  hostTagName = hostElm.tagName;
@@ -1011,90 +737,8 @@ const renderVdom = (hostRef, renderFnResults) => {
1011
737
  {
1012
738
  scopeId = hostElm['s-sc'];
1013
739
  }
1014
- {
1015
- contentRef = hostElm['s-cr'];
1016
- useNativeShadowDom = (cmpMeta.$flags$ & 1 /* CMP_FLAGS.shadowDomEncapsulation */) !== 0;
1017
- // always reset
1018
- checkSlotFallbackVisibility = false;
1019
- }
1020
740
  // synchronous patch
1021
741
  patch(oldVNode, rootVnode);
1022
- {
1023
- // while we're moving nodes around existing nodes, temporarily disable
1024
- // the disconnectCallback from working
1025
- plt.$flags$ |= 1 /* PLATFORM_FLAGS.isTmpDisconnected */;
1026
- if (checkSlotRelocate) {
1027
- relocateSlotContent(rootVnode.$elm$);
1028
- let relocateData;
1029
- let nodeToRelocate;
1030
- let orgLocationNode;
1031
- let parentNodeRef;
1032
- let insertBeforeNode;
1033
- let refNode;
1034
- let i = 0;
1035
- for (; i < relocateNodes.length; i++) {
1036
- relocateData = relocateNodes[i];
1037
- nodeToRelocate = relocateData.$nodeToRelocate$;
1038
- if (!nodeToRelocate['s-ol']) {
1039
- // add a reference node marking this node's original location
1040
- // keep a reference to this node for later lookups
1041
- orgLocationNode =
1042
- doc.createTextNode('');
1043
- orgLocationNode['s-nr'] = nodeToRelocate;
1044
- nodeToRelocate.parentNode.insertBefore((nodeToRelocate['s-ol'] = orgLocationNode), nodeToRelocate);
1045
- }
1046
- }
1047
- for (i = 0; i < relocateNodes.length; i++) {
1048
- relocateData = relocateNodes[i];
1049
- nodeToRelocate = relocateData.$nodeToRelocate$;
1050
- if (relocateData.$slotRefNode$) {
1051
- // by default we're just going to insert it directly
1052
- // after the slot reference node
1053
- parentNodeRef = relocateData.$slotRefNode$.parentNode;
1054
- insertBeforeNode = relocateData.$slotRefNode$.nextSibling;
1055
- orgLocationNode = nodeToRelocate['s-ol'];
1056
- while ((orgLocationNode = orgLocationNode.previousSibling)) {
1057
- refNode = orgLocationNode['s-nr'];
1058
- if (refNode && refNode['s-sn'] === nodeToRelocate['s-sn'] && parentNodeRef === refNode.parentNode) {
1059
- refNode = refNode.nextSibling;
1060
- if (!refNode || !refNode['s-nr']) {
1061
- insertBeforeNode = refNode;
1062
- break;
1063
- }
1064
- }
1065
- }
1066
- if ((!insertBeforeNode && parentNodeRef !== nodeToRelocate.parentNode) ||
1067
- nodeToRelocate.nextSibling !== insertBeforeNode) {
1068
- // we've checked that it's worth while to relocate
1069
- // since that the node to relocate
1070
- // has a different next sibling or parent relocated
1071
- if (nodeToRelocate !== insertBeforeNode) {
1072
- if (!nodeToRelocate['s-hn'] && nodeToRelocate['s-ol']) {
1073
- // probably a component in the index.html that doesn't have it's hostname set
1074
- nodeToRelocate['s-hn'] = nodeToRelocate['s-ol'].parentNode.nodeName;
1075
- }
1076
- // add it back to the dom but in its new home
1077
- parentNodeRef.insertBefore(nodeToRelocate, insertBeforeNode);
1078
- }
1079
- }
1080
- }
1081
- else {
1082
- // this node doesn't have a slot home to go to, so let's hide it
1083
- if (nodeToRelocate.nodeType === 1 /* NODE_TYPE.ElementNode */) {
1084
- nodeToRelocate.hidden = true;
1085
- }
1086
- }
1087
- }
1088
- }
1089
- if (checkSlotFallbackVisibility) {
1090
- updateFallbackSlotVisibility(rootVnode.$elm$);
1091
- }
1092
- // done moving nodes around
1093
- // allow the disconnect callback to work again
1094
- plt.$flags$ &= ~1 /* PLATFORM_FLAGS.isTmpDisconnected */;
1095
- // always reset
1096
- relocateNodes.length = 0;
1097
- }
1098
742
  };
1099
743
  const attachToAncestor = (hostRef, ancestorComponent) => {
1100
744
  if (ancestorComponent && !hostRef.$onRenderResolve$ && ancestorComponent['s-p']) {
@@ -1512,15 +1156,6 @@ const connectedCallback = (elm) => {
1512
1156
  if (!(hostRef.$flags$ & 1 /* HOST_FLAGS.hasConnected */)) {
1513
1157
  // first time this component has connected
1514
1158
  hostRef.$flags$ |= 1 /* HOST_FLAGS.hasConnected */;
1515
- {
1516
- // initUpdate
1517
- // if the slot polyfill is required we'll need to put some nodes
1518
- // in here to act as original content anchors as we move nodes around
1519
- // host element has been connected to the DOM
1520
- if ((cmpMeta.$flags$ & (4 /* CMP_FLAGS.hasSlotRelocation */ | 8 /* CMP_FLAGS.needsShadowDomShim */))) {
1521
- setContentReference(elm);
1522
- }
1523
- }
1524
1159
  {
1525
1160
  // find the first ancestor component (if there is one) and register
1526
1161
  // this component as one of the actively loading child components for its ancestor
@@ -1562,17 +1197,6 @@ const connectedCallback = (elm) => {
1562
1197
  endConnected();
1563
1198
  }
1564
1199
  };
1565
- const setContentReference = (elm) => {
1566
- // only required when we're NOT using native shadow dom (slot)
1567
- // or this browser doesn't support native shadow dom
1568
- // and this host element was NOT created with SSR
1569
- // let's pick out the inner content for slot projection
1570
- // create a node to represent where the original
1571
- // content was first placed, which is useful later on
1572
- const contentRefElm = (elm['s-cr'] = doc.createComment(''));
1573
- contentRefElm['s-cn'] = true;
1574
- elm.insertBefore(contentRefElm, elm.firstChild);
1575
- };
1576
1200
  const disconnectedCallback = (elm) => {
1577
1201
  if ((plt.$flags$ & 1 /* PLATFORM_FLAGS.isTmpDisconnected */) === 0) {
1578
1202
  const hostRef = getHostRef(elm);
@@ -1,4 +1,4 @@
1
- import { r as registerInstance, c as createEvent, h } from './index-05706eb5.js';
1
+ import { r as registerInstance, c as createEvent, h } from './index-3ce5521c.js';
2
2
 
3
3
  const BankAccountForm = class {
4
4
  constructor(hostRef) {
@@ -8,6 +8,7 @@ const BankAccountForm = class {
8
8
  this.bankAccountFormValidate = createEvent(this, "bankAccountFormValidate", 7);
9
9
  this.validationStrategy = undefined;
10
10
  this.styleOverrides = undefined;
11
+ this.iframeOrigin = undefined;
11
12
  this.internalStyleOverrides = undefined;
12
13
  }
13
14
  readyHandler(event) {
@@ -45,7 +46,7 @@ const BankAccountForm = class {
45
46
  if (el) {
46
47
  this.childRef = el;
47
48
  }
48
- }, "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 }));
49
+ }, "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 }));
49
50
  }
50
51
  static get watchers() { return {
51
52
  "styleOverrides": ["parseStyleOverrides"]
@@ -1,4 +1,4 @@
1
- import { r as registerInstance, h, H as Host } from './index-05706eb5.js';
1
+ import { r as registerInstance, h, H as Host, c as createEvent } from './index-3ce5521c.js';
2
2
 
3
3
  /**
4
4
  * Based on Kendo UI Core expression code <https://github.com/telerik/kendo-ui-core#license-information>
@@ -2122,6 +2122,9 @@ const BillingForm = class {
2122
2122
  this.billingFields = billingFieldsClone;
2123
2123
  }
2124
2124
  }
2125
+ async fill(fields) {
2126
+ this.billingFields = Object.assign({}, fields);
2127
+ }
2125
2128
  async validate() {
2126
2129
  const newErrors = {};
2127
2130
  let isValid = true;
@@ -2137,10 +2140,35 @@ const BillingForm = class {
2137
2140
  this.billingFieldsErrors = newErrors;
2138
2141
  return { isValid: isValid };
2139
2142
  }
2143
+ async getValues() {
2144
+ return this.billingFields;
2145
+ }
2140
2146
  render() {
2141
2147
  return (h(Host, null, h("fieldset", null, h("text-input", { name: "address_line1", label: "Street Address", defaultValue: this.billingFields.address_line1, error: this.billingFieldsErrors.address_line1 }), h("text-input", { name: "address_line2", label: "Apartment, Suite, etc. (optional)", defaultValue: this.billingFields.address_line2, error: this.billingFieldsErrors.address_line2 }), h("text-input", { name: "address_city", label: "City", defaultValue: this.billingFields.address_city, error: this.billingFieldsErrors.address_city }), h("select-input", { name: "address_state", label: "State", options: StateOptions, defaultValue: this.billingFields.address_state, error: this.billingFieldsErrors.address_state }), h("text-input", { name: "address_postal_code", label: "ZIP", defaultValue: this.billingFields.address_postal_code, error: this.billingFieldsErrors.address_postal_code }))));
2142
2148
  }
2143
2149
  };
2144
2150
  BillingForm.style = billingFormCss;
2145
2151
 
2146
- export { BillingForm as justifi_billing_form };
2152
+ const PaymentMethodLabels = {
2153
+ bankAccount: 'Bank Account',
2154
+ card: 'Card'
2155
+ };
2156
+ const PaymentMethodSelector = class {
2157
+ constructor(hostRef) {
2158
+ registerInstance(this, hostRef);
2159
+ this.paymentMethodSelected = createEvent(this, "paymentMethodSelected", 7);
2160
+ this.paymentMethodTypes = [];
2161
+ this.selectedPaymentMethodType = undefined;
2162
+ }
2163
+ onChangeHandler(event) {
2164
+ this.paymentMethodSelected.emit(event.target.value);
2165
+ }
2166
+ render() {
2167
+ return (h("div", null, this.paymentMethodTypes.map((paymentMethodType) => {
2168
+ return (h("div", null, h("input", { id: paymentMethodType, type: "radio", name: "paymentMethodType", value: paymentMethodType, onChange: (event) => this.onChangeHandler(event), checked: this.selectedPaymentMethodType === paymentMethodType }), h("label", { htmlFor: paymentMethodType }, PaymentMethodLabels[paymentMethodType])));
2169
+ })));
2170
+ }
2171
+ ;
2172
+ };
2173
+
2174
+ export { BillingForm as justifi_billing_form, PaymentMethodSelector as justifi_payment_method_selector };
@@ -1,4 +1,4 @@
1
- import { r as registerInstance, c as createEvent, h } from './index-05706eb5.js';
1
+ import { r as registerInstance, c as createEvent, h } from './index-3ce5521c.js';
2
2
 
3
3
  const CardForm = class {
4
4
  constructor(hostRef) {
@@ -8,6 +8,7 @@ const CardForm = class {
8
8
  this.cardFormValidate = createEvent(this, "cardFormValidate", 7);
9
9
  this.validationStrategy = undefined;
10
10
  this.styleOverrides = undefined;
11
+ this.iframeOrigin = undefined;
11
12
  this.internalStyleOverrides = undefined;
12
13
  }
13
14
  readyHandler(event) {
@@ -45,7 +46,7 @@ const CardForm = class {
45
46
  if (el) {
46
47
  this.childRef = el;
47
48
  }
48
- }, "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 }));
49
+ }, "iframe-origin": this.iframeOrigin, "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 }));
49
50
  }
50
51
  static get watchers() { return {
51
52
  "styleOverrides": ["parseStyleOverrides"]