@odus/checkout 1.1.0 → 1.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.
@@ -1,5 +1,5 @@
1
- import { c as q, a as W, f as L, d as Y, C as P, I as K, b as N, g as G, S as x, e as T, H as J, V as _, h as A, A as Z, P as X, E as Q, l as ee, i as te, j as se, k as ie, m as ae, n as ne, o as re, F as oe, p as R, q as le, r as F, s as E, t as de, u as U, v as H, w as he, x as ce } from "./shared.js";
2
- import { z as Ie, B as Be, D as Te, G as _e, J as Re, K as Ue, L as He, y as Oe, M as ze } from "./shared.js";
1
+ import { k as q, n as W, t as L, p as Y, e as P, I as K, l as N, w as G, S as x, x as T, H as J, i as R, f as A, a as Z, P as Q, E as X, G as ee, C as te, s as se, j as ie, z as ae, A as ne, m as re, F as oe, V as _, B as le, N as F, c as E, b as de, Q as U, d as H, v as he, M as ce } from "./shared.js";
2
+ import { o as Ie, q as Be, r as Te, u as Re, D as _e, K as Ue, L as He, O as Oe, R as ze } from "./shared.js";
3
3
  function I(o) {
4
4
  return {
5
5
  name: "Custom Appearance",
@@ -888,6 +888,8 @@ class ge {
888
888
  vgsHelperText = null;
889
889
  wrapperElement;
890
890
  _vgsFieldsReady = !1;
891
+ _fieldHeight = "38.5px";
892
+ _borderRadius = 0;
891
893
  constructor(e) {
892
894
  const {
893
895
  value: t,
@@ -910,7 +912,9 @@ class ge {
910
912
  );
911
913
  }
912
914
  buildVgsLayout(e, t) {
913
- const s = e.styles.borderRadius, a = document.createElement("div");
915
+ const s = e.styles.borderRadius;
916
+ this._borderRadius = s;
917
+ const a = document.createElement("div");
914
918
  a.style.marginBottom = "4px";
915
919
  const i = document.createElement("label");
916
920
  i.className = "input-label", i.textContent = t("cardholderNameLabel"), i.style.fontFamily = `"${e.styles.fontFamily}", sans-serif`, i.style.fontSize = `${e.styles.fontSize}px`, a.appendChild(i), this.wrapperElement.appendChild(a), this.vgsWrapper = document.createElement("div"), this.vgsWrapper.className = "vgs-wrap", this.vgsWrapper.style.position = "relative", this.vgsWrapper.style.borderRadius = `${s}px`, this.vgsWrapper.style.height = "38.5px", this.vgsWrapper.style.width = "100%", this.vgsWrapper.style.overflow = "hidden";
@@ -945,16 +949,24 @@ class ge {
945
949
  }
946
950
  handleVgsStateChange(e, t) {
947
951
  if (!this.isVgsMode || !this.vgsWrapper) return;
948
- const s = e[_.CARDHOLDER]?.isFocused;
952
+ const s = e[R.CARDHOLDER]?.isFocused;
949
953
  if (this._vgsFieldsReady && (this.vgsWrapper.style.boxShadow = s ? "0 0 0 1px rgba(50, 151, 211, 0.7), 0 1px 1px 0 rgba(0, 0, 0, 0.07), 0 0 0 4px rgba(50, 151, 211, 0.3)" : "0 0 0 1px #e0e0e0, 0 2px 4px 0 rgba(0,0,0,0.07), 0 1px 1.5px 0 rgba(0,0,0,0.05)"), !t || !this.vgsHelperText) return;
950
- const a = t[_.CARDHOLDER];
954
+ const a = t[R.CARDHOLDER];
951
955
  a ? (this.vgsHelperText.setText(a), this.vgsHelperText.toggleVisibility(!0)) : this.vgsHelperText.toggleVisibility(!1);
952
956
  }
957
+ setFieldHeight(e) {
958
+ this._fieldHeight = e, this.vgsWrapper && (this.vgsWrapper.style.height = e);
959
+ }
960
+ setBorderRadius(e) {
961
+ this._borderRadius = e, this.vgsWrapper && (this.vgsWrapper.style.borderRadius = `${e}px`);
962
+ }
953
963
  hideFakePlaceholder() {
954
964
  if (!this.vgsWrapper) return;
955
965
  this._vgsFieldsReady = !0, this.vgsWrapper.style.overflow = "visible", this.vgsWrapper.style.transition = "box-shadow 0.1s ease-in", this.vgsWrapper.style.boxShadow = "0 0 0 1px #e0e0e0, 0 2px 4px 0 rgba(0,0,0,0.07), 0 1px 1.5px 0 rgba(0,0,0,0.05)";
956
966
  const e = this.vgsWrapper.querySelector(".vgs-field-skeleton");
957
- e && e.remove(), this.vgsContainer?.querySelectorAll("iframe").forEach((t) => t.style.height = "38.5px");
967
+ e && e.remove(), this.vgsContainer?.querySelectorAll("iframe").forEach((t) => {
968
+ t.style.height = this._fieldHeight, t.style.borderRadius = `${this._borderRadius}px`;
969
+ });
958
970
  }
959
971
  getValue() {
960
972
  return this.isVgsMode ? "" : this.input?.getValue() ?? "";
@@ -1058,7 +1070,7 @@ class ye extends P {
1058
1070
  switch (y) {
1059
1071
  case "paypal": {
1060
1072
  if (a) {
1061
- const u = new X({
1073
+ const u = new Q({
1062
1074
  checkoutProfile: t,
1063
1075
  formData: s,
1064
1076
  onSubmit: a
@@ -1242,7 +1254,7 @@ class Ce {
1242
1254
  ) || e.layout.shippingFields && Object.values(e.layout.shippingFields).some(
1243
1255
  (n) => n?.enabled
1244
1256
  );
1245
- this.emailField = new Q({
1257
+ this.emailField = new X({
1246
1258
  value: t.email,
1247
1259
  onChange: this.onChange,
1248
1260
  onBlur: this.onBlur,
@@ -1525,6 +1537,12 @@ class Ce {
1525
1537
  e,
1526
1538
  a
1527
1539
  );
1540
+ if (this.cardholderSection && i.cardholderName) {
1541
+ const n = i.cardholderName;
1542
+ typeof n.height == "string" && this.cardholderSection.setFieldHeight(n.height);
1543
+ const r = n["border-radius"];
1544
+ typeof r == "string" && this.cardholderSection.setBorderRadius(parseFloat(r));
1545
+ }
1528
1546
  this.vgsService.mountCardFields(
1529
1547
  {
1530
1548
  cardNumber: t.cardNumber ? `#${t.cardNumber}` : void 0,
@@ -1827,7 +1845,7 @@ class Pe extends P {
1827
1845
  vgsJwt;
1828
1846
  vgsCardResult;
1829
1847
  constructor(e) {
1830
- super("form", ["form-container"]), this.options = e, this.vgsJwt = e.vgsJwt, this.vgsJwt && (this.vgsService = new R()), this.checkoutProfile = ue({
1848
+ super("form", ["form-container"]), this.options = e, this.vgsJwt = e.vgsJwt, this.vgsJwt && (this.vgsService = new _()), this.checkoutProfile = ue({
1831
1849
  appearance: e.appearance
1832
1850
  }), e.locale && this.translation.setLocale(e.locale), this.componentManager = new Ce({
1833
1851
  formElement: this.element,
@@ -2151,7 +2169,7 @@ class Pe extends P {
2151
2169
  ), this.componentManager.cleanup(), this.uiManager.cleanup(), this.getElement().remove();
2152
2170
  }
2153
2171
  associatePayment(e, t, s, a, i) {
2154
- this.options.paymentId = e, this.options.checkoutKey = t, this.options.supportedPaymentMethods = s, this.options.checkoutDetails = a, this.componentManager.setCheckoutDetailsLoaded(!0), i && !this.vgsService && (this.vgsJwt = i, this.vgsService = new R(), this.componentManager.setVgsService(this.vgsService), this.stateCoordinator.setVgsMode(!0), this.vgsService.init(this.options.environment).then((r) => {
2172
+ this.options.paymentId = e, this.options.checkoutKey = t, this.options.supportedPaymentMethods = s, this.options.checkoutDetails = a, this.componentManager.setCheckoutDetailsLoaded(!0), i && !this.vgsService && (this.vgsJwt = i, this.vgsService = new _(), this.componentManager.setVgsService(this.vgsService), this.stateCoordinator.setVgsMode(!0), this.vgsService.init(this.options.environment).then((r) => {
2155
2173
  this.vgsService?.createForm(
2156
2174
  r,
2157
2175
  (d) => this.handleVgsStateChange(d)
@@ -2495,8 +2513,8 @@ export {
2495
2513
  Ie as deLocale,
2496
2514
  Be as enLocale,
2497
2515
  Te as esLocale,
2498
- _e as frLocale,
2499
- Re as itLocale,
2516
+ Re as frLocale,
2517
+ _e as itLocale,
2500
2518
  Ue as plLocale,
2501
2519
  He as ptLocale,
2502
2520
  ce as pushError,
@@ -1,4 +1,4 @@
1
- import { o as a, I as g, S as E, g as z, e as x, A as N, F as V, i as k, a as _, f as P, N as F, p as y, m as w, j as A, E as R, n as C, P as M, l as T, O as I, t as B, w as L, k as j } from "./shared.js";
1
+ import { m as a, I as g, S as E, w as z, x, a as N, F as V, C as k, n as _, t as P, J as F, V as y, z as w, s as A, E as R, A as C, P as M, G as T, T as I, b as B, v as L, j } from "./shared.js";
2
2
  const p = ".form-helper-text{color:#dc2727;font-family:var(--odus-font-family, inherit);font-size:12px;font-weight:500;margin-top:4px;display:block;overflow:hidden;max-height:100px;transition:max-height .3s ease-in-out,opacity .3s ease-in-out,margin .3s ease-in-out}.form-helper-text-hidden{max-height:0;opacity:0;margin-top:0;overflow:hidden}", f = ".input-wrapper{display:flex;flex-direction:column;width:100%;min-width:0;box-sizing:border-box;align-items:stretch}.input-wrapper *{box-sizing:border-box}.form-input{opacity:1;font-size:var(--odus-input-font-size, 16px);font-weight:var(--odus-input-font-weight, 400);letter-spacing:var(--odus-input-letter-spacing, .02em);transition:box-shadow .1s ease-in,border-radius .2s ease-in;box-shadow:0 0 0 1px var(--odus-border-color, #e0e0e0),0 2px 4px #00000012,0 1px 1.5px #0000000d;background:var(--odus-color-background, #fff);padding:var(--odus-input-padding, 8px 12px);border:none;outline:none;line-height:var(--odus-input-line-height, 1.5);z-index:0;box-sizing:border-box;min-height:0;flex:1;width:100%}.form-input[name=cardNumber]{padding-right:100px}.form-input-error{color:#dc2727}.form-input::placeholder{color:var(--odus-input-placeholder-color, #717173);opacity:var(--odus-input-placeholder-opacity, .3)}.form-input:focus{box-shadow:0 0 0 1px #3297d3b3,0 1px 1px #00000012,0 0 0 4px #3297d34d;position:relative;z-index:2}", m = ".input-label{font-family:var(--odus-font-family, inherit);font-size:var(--odus-label-font-size, 14px);font-weight:var(--odus-label-font-weight, 400);color:var(--odus-label-color, var(--odus-color-text, #1a1a1a));letter-spacing:var(--odus-label-letter-spacing, normal);line-height:var(--odus-label-line-height, 1.4);margin-bottom:var(--odus-label-margin-bottom, 6px)}", O = ":host{--odus-font-family: system-ui, sans-serif;--odus-font-size: 16px;--odus-color-error: #dc2727;--odus-color-text: #1a1a1a;--odus-color-background: #ffffff;--odus-border-color: #e0e0e0;--odus-border-radius: 6px;--odus-spacing-sm: 8px;--odus-spacing-md: 16px;--odus-spacing-lg: 24px;--odus-input-height: 44px;--odus-input-padding: 8px 12px;--odus-input-font-size: var(--odus-font-size);--odus-input-font-weight: 400;--odus-input-letter-spacing: .02em;--odus-input-line-height: 1.5;--odus-input-placeholder-color: #717173;--odus-input-placeholder-opacity: .3;--odus-input-focus-shadow: 0 0 0 1px rgba(50, 151, 211, .7), 0 1px 1px 0 rgba(0, 0, 0, .07), 0 0 0 4px rgba(50, 151, 211, .3);--odus-label-font-size: 14px;--odus-label-font-weight: 400;--odus-label-color: var(--odus-color-text);--odus-label-letter-spacing: normal;--odus-label-line-height: 1.4;--odus-label-margin-bottom: 6px;--odus-card-gap: 12px;--odus-button-height: 48px;--odus-button-border-radius: var(--odus-border-radius)}.form-input{opacity:1;font-weight:var(--odus-input-font-weight, 400);letter-spacing:var(--odus-input-letter-spacing, .02em);transition:box-shadow .1s ease-in,border-radius .2s ease-in;box-shadow:0 0 0 1px var(--odus-border-color, #e0e0e0),0 2px 4px #00000012,0 1px 1.5px #0000000d;background:var(--odus-color-background, #fff);padding:var(--odus-input-padding, 8px 12px);border:none;outline:none;line-height:var(--odus-input-line-height, 1.5);z-index:0;box-sizing:border-box;min-height:0;flex:1;width:100%}.form-input::placeholder{color:var(--odus-input-placeholder-color, #717173);opacity:var(--odus-input-placeholder-opacity, .3)}.form-input:focus{box-shadow:var( --odus-input-focus-shadow, 0 0 0 1px rgba(50, 151, 211, .7), 0 1px 1px 0 rgba(0, 0, 0, .07), 0 0 0 4px rgba(50, 151, 211, .3) );position:relative;z-index:2}.input-label{font-family:var(--odus-font-family, inherit)!important;font-size:var(--odus-label-font-size, 14px)!important;font-weight:var(--odus-label-font-weight, 400)!important;color:var(--odus-label-color, var(--odus-color-text, #1a1a1a))!important;letter-spacing:var(--odus-label-letter-spacing, normal)!important;line-height:var(--odus-label-line-height, 1.4)!important;margin-bottom:var(--odus-label-margin-bottom, 6px)!important}.form-helper-text{font-family:var(--odus-font-family, inherit)!important}";
3
3
  class u {
4
4
  shadowRoot = null;
@@ -200,7 +200,7 @@ class D extends u {
200
200
  return this._error;
201
201
  }
202
202
  }
203
- class K extends u {
203
+ class J extends u {
204
204
  _value = "";
205
205
  _error = null;
206
206
  _input = null;
@@ -265,7 +265,7 @@ class K extends u {
265
265
  return this._error;
266
266
  }
267
267
  }
268
- class Z extends u {
268
+ class K extends u {
269
269
  _value = "";
270
270
  _error = null;
271
271
  _input = null;
@@ -331,7 +331,7 @@ class Z extends u {
331
331
  }
332
332
  }
333
333
  const v = /* @__PURE__ */ new Set(["US", "CA"]);
334
- class J extends u {
334
+ class Z extends u {
335
335
  _value = "";
336
336
  _country = "";
337
337
  _input = null;
@@ -1509,16 +1509,16 @@ class fe {
1509
1509
  get: () => (this._addressStreet || (this._addressStreet = new G(), this._trackElement(this._addressStreet)), this._addressStreet),
1510
1510
  enumerable: !0
1511
1511
  }), Object.defineProperty(s, "firstName", {
1512
- get: () => (this._addressFirstName || (this._addressFirstName = new K(), this._trackElement(this._addressFirstName)), this._addressFirstName),
1512
+ get: () => (this._addressFirstName || (this._addressFirstName = new J(), this._trackElement(this._addressFirstName)), this._addressFirstName),
1513
1513
  enumerable: !0
1514
1514
  }), Object.defineProperty(s, "lastName", {
1515
- get: () => (this._addressLastName || (this._addressLastName = new Z(), this._trackElement(this._addressLastName)), this._addressLastName),
1515
+ get: () => (this._addressLastName || (this._addressLastName = new K(), this._trackElement(this._addressLastName)), this._addressLastName),
1516
1516
  enumerable: !0
1517
1517
  }), Object.defineProperty(s, "city", {
1518
1518
  get: () => (this._addressCity || (this._addressCity = new q(), this._trackElement(this._addressCity)), this._addressCity),
1519
1519
  enumerable: !0
1520
1520
  }), Object.defineProperty(s, "state", {
1521
- get: () => (this._addressState || (this._addressState = new J(), this._trackElement(this._addressState)), this._addressState),
1521
+ get: () => (this._addressState || (this._addressState = new Z(), this._trackElement(this._addressState)), this._addressState),
1522
1522
  enumerable: !0
1523
1523
  }), Object.defineProperty(s, "zipCode", {
1524
1524
  get: () => (this._addressZipCode || (this._addressZipCode = new U(), this._trackElement(this._addressZipCode)), this._addressZipCode),
@@ -1734,9 +1734,9 @@ class fe {
1734
1734
  export {
1735
1735
  q as AddressCityElement,
1736
1736
  D as AddressCountryElement,
1737
- K as AddressFirstNameElement,
1738
- Z as AddressLastNameElement,
1739
- J as AddressStateElement,
1737
+ J as AddressFirstNameElement,
1738
+ K as AddressLastNameElement,
1739
+ Z as AddressStateElement,
1740
1740
  G as AddressStreetElement,
1741
1741
  U as AddressZipCodeElement,
1742
1742
  H as ApplePayElement,
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@odus/checkout",
3
- "version": "1.1.0",
3
+ "version": "1.2.1",
4
4
  "displayName": "Odus Checkout SDK",
5
5
  "keywords": [
6
6
  "odus",
@@ -117,12 +117,9 @@
117
117
  "^typecheck"
118
118
  ],
119
119
  "options": {
120
- "command": "tsc --build --emitDeclarationOnly",
120
+ "command": "tsc --build --emitDeclarationOnly --force",
121
121
  "cwd": "libs/checkout"
122
122
  }
123
- },
124
- "vite:typecheck": {
125
- "executor": "nx:noop"
126
123
  }
127
124
  }
128
125
  },
package/dist/phone.js CHANGED
@@ -1,4 +1,4 @@
1
- import { Q as pe, R as Jt, C as P, h as pt, H as ve, T as be, b as Ce } from "./shared.js";
1
+ import { g as pe, y as Jt, e as P, f as pt, H as ve, h as be, l as Ce } from "./shared.js";
2
2
  const Ne = (r, t, e) => {
3
3
  let n = 0, d = e.length;
4
4
  for (let i = 0; i < e.length; i++)
package/dist/shared.js CHANGED
@@ -370,7 +370,7 @@ const ap = (r) => {
370
370
  url: e,
371
371
  app: {
372
372
  name: "odus-checkout",
373
- version: "1.1.0",
373
+ version: "1.2.1",
374
374
  environment: r.environment === "test" ? "sandbox" : "production"
375
375
  },
376
376
  isolate: !0,
@@ -7352,51 +7352,51 @@ class Sp extends B {
7352
7352
  }
7353
7353
  }
7354
7354
  export {
7355
- bp as A,
7356
- Of as B,
7357
- B as C,
7358
- Gf as D,
7355
+ Sp as A,
7356
+ ap as B,
7357
+ gp as C,
7358
+ y0 as D,
7359
7359
  yp as E,
7360
7360
  fp as F,
7361
- n0 as G,
7361
+ lp as G,
7362
7362
  ve as H,
7363
7363
  Bt as I,
7364
- y0 as J,
7364
+ Wu as J,
7365
7365
  H0 as K,
7366
7366
  sv as L,
7367
- _v as M,
7368
- Wu as N,
7369
- Vv as O,
7367
+ sp as M,
7368
+ de as N,
7369
+ op as O,
7370
7370
  Ep as P,
7371
- Qe as Q,
7372
- Zv as R,
7371
+ Ie as Q,
7372
+ _v as R,
7373
7373
  Je as S,
7374
- Oc as T,
7375
- X as V,
7376
- up as a,
7377
- He as b,
7378
- Lh as c,
7379
- It as d,
7380
- pp as e,
7381
- Cc as f,
7382
- vp as g,
7383
- We as h,
7384
- gp as i,
7385
- hp as j,
7386
- dp as k,
7387
- lp as l,
7388
- mp as m,
7389
- Sp as n,
7390
- Nc as o,
7391
- Rt as p,
7392
- ap as q,
7393
- de as r,
7394
- ue as s,
7395
- cp as t,
7396
- Ie as u,
7397
- we as v,
7398
- np as w,
7399
- sp as x,
7400
- op as y,
7401
- mf as z
7374
+ Vv as T,
7375
+ Rt as V,
7376
+ bp as a,
7377
+ cp as b,
7378
+ ue as c,
7379
+ we as d,
7380
+ B as e,
7381
+ We as f,
7382
+ Qe as g,
7383
+ Oc as h,
7384
+ X as i,
7385
+ dp as j,
7386
+ Lh as k,
7387
+ He as l,
7388
+ Nc as m,
7389
+ up as n,
7390
+ mf as o,
7391
+ It as p,
7392
+ Of as q,
7393
+ Gf as r,
7394
+ hp as s,
7395
+ Cc as t,
7396
+ n0 as u,
7397
+ np as v,
7398
+ vp as w,
7399
+ pp as x,
7400
+ Zv as y,
7401
+ mp as z
7402
7402
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@odus/checkout",
3
- "version": "1.1.0",
3
+ "version": "1.2.1",
4
4
  "displayName": "Odus Checkout SDK",
5
5
  "keywords": [
6
6
  "odus",
@@ -117,12 +117,9 @@
117
117
  "^typecheck"
118
118
  ],
119
119
  "options": {
120
- "command": "tsc --build --emitDeclarationOnly",
120
+ "command": "tsc --build --emitDeclarationOnly --force",
121
121
  "cwd": "libs/checkout"
122
122
  }
123
- },
124
- "vite:typecheck": {
125
- "executor": "nx:noop"
126
123
  }
127
124
  }
128
125
  },