@paynext/sdk 0.0.68 → 0.0.70

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -82,7 +82,7 @@ declare interface CheckoutConfig_2 {
82
82
 
83
83
  declare class CheckoutModule {
84
84
  private readonly config;
85
- private readonly component;
85
+ private component;
86
86
  constructor(config: CheckoutConfig_2);
87
87
  init(): Promise<void>;
88
88
  mount(): Promise<HTMLElement>;
package/dist/index.es.js CHANGED
@@ -51,6 +51,7 @@ class Zu {
51
51
  const i = (yield import("./index-C6qOiJ-j.js")).Core;
52
52
  this.core = new i();
53
53
  }
54
+ e.styles && this.core.state.styles.setState(e.styles);
54
55
  const a = yield this.core.checkout.mount();
55
56
  this.parent.innerHTML = "", this.parent.appendChild(a), this.core.state.checkout.setState(e);
56
57
  });
@@ -5439,8 +5440,13 @@ class Pc {
5439
5440
  this.translate = e;
5440
5441
  const r = e.messages();
5441
5442
  if (this.element = document.createElement("div"), this.element.classList.add(ne.wrapper), this.inputContainer.classList.add(ne.inputContainer), (i = a == null ? void 0 : a.container) != null && i.className && this.inputContainer.classList.add(a.container.className), (n = a == null ? void 0 : a.container) != null && n.styles && Object.assign(this.inputContainer.style, a.container.styles), this.input.setAttribute("id", this.id), this.input.setAttribute("auto-complete", "cc-number"), this.input.setAttribute("placeholder", "1234 1234 1234 1234"), this.input.classList.add(ne.input), (s = a == null ? void 0 : a.field) != null && s.className && this.input.classList.add(a.field.className), (o = a == null ? void 0 : a.field) != null && o.styles && Object.assign(this.input.style, a.field.styles), (l = a == null ? void 0 : a.placeholder) != null && l.styles && Object.keys(a.placeholder.styles).length) {
5442
- const p = (y) => y.replace(/[A-Z]/g, (f) => "-" + f.toLowerCase()), m = Object.entries(a.placeholder.styles).map(([y, f]) => `${p(y)}:${f};`).join("");
5443
- this.placeholderStyle.textContent = `#${this.id}::placeholder{${m}}`, this.element.appendChild(this.placeholderStyle);
5443
+ const p = (f) => f.replace(/[A-Z]/g, (g) => "-" + g.toLowerCase()), m = Object.entries(a.placeholder.styles).map(([f, g]) => `${p(f)}:${g} !important;`).join(""), y = `#${this.id}`;
5444
+ this.placeholderStyle.textContent = `${y}::placeholder{${m}}
5445
+ ${y}::-webkit-input-placeholder{${m}}
5446
+ ${y}::-moz-placeholder{${m}}
5447
+ ${y}:-ms-input-placeholder{${m}}
5448
+ ${y}::-ms-input-placeholder{${m}}
5449
+ `, document.head.appendChild(this.placeholderStyle);
5444
5450
  }
5445
5451
  this.endContent.classList.add(ne.endContent), this.endContent.append(...this.getCardIcons()), this.inputContainer.append(this.input, this.endContent), this.label.setAttribute("for", this.id), this.label.classList.add(ne.label), (d = a == null ? void 0 : a.label) != null && d.className && this.label.classList.add(a.label.className), (c = a == null ? void 0 : a.label) != null && c.styles && Object.assign(this.label.style, a.label.styles), this.labelText.textContent = r.card.number.label, this.labelError.textContent = r.card.number.error.required, this.labelError.classList.add(ne.labelError, ne.hidden), (u = a == null ? void 0 : a.error) != null && u.className && this.labelError.classList.add(a.error.className), (h = a == null ? void 0 : a.error) != null && h.styles && Object.assign(this.labelError.style, a.error.styles), this.label.append(this.labelText, this.labelError), this.error.classList.add(ne.error, ne.hidden), this.element.append(this.label, this.inputContainer, this.error), this.input.addEventListener("input", (p) => {
5446
5452
  p.stopPropagation(), this.handleChange(this.input.value);
@@ -6019,7 +6025,7 @@ class jc {
6019
6025
  class Vc {
6020
6026
  constructor(e) {
6021
6027
  A(this, "component");
6022
- this.config = e, this.component = new jc(e);
6028
+ this.config = e;
6023
6029
  }
6024
6030
  // init
6025
6031
  init() {
@@ -6040,7 +6046,7 @@ class Vc {
6040
6046
  // mount
6041
6047
  mount() {
6042
6048
  return H(this, null, function* () {
6043
- return yield this.init(), yield this.component.init(), this.component.render();
6049
+ return this.component || (this.component = new jc(this.config)), yield this.init(), yield this.component.init(), this.component.render();
6044
6050
  });
6045
6051
  }
6046
6052
  }