@salla.sa/twilight-components 1.5.8 → 1.5.10

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.
@@ -12,8 +12,8 @@ const sallaAddProductButtonCss = ":host{display:block}salla-add-product-button[w
12
12
  const SallaAddProductButton = class {
13
13
  constructor(hostRef) {
14
14
  index.registerInstance(this, hostRef);
15
- this.onSuccess = index.createEvent(this, "onSuccess", 7);
16
- this.onFailed = index.createEvent(this, "onFailed", 7);
15
+ this.success = index.createEvent(this, "success", 7);
16
+ this.failed = index.createEvent(this, "failed", 7);
17
17
  this.hostAttributes = {};
18
18
  this.hasLabel = false;
19
19
  /**
@@ -65,10 +65,10 @@ const SallaAddProductButton = class {
65
65
  }).reduce((a, [k, v]) => (v ? (a[k] = v, a) : a), {});
66
66
  return salla.cart.quickAdd(data)
67
67
  .then((response) => {
68
- return this.onSuccess.emit(response);
68
+ return this.success.emit(response);
69
69
  })
70
70
  .catch((error) => {
71
- return this.onFailed.emit(error);
71
+ return this.failed.emit(error);
72
72
  });
73
73
  }
74
74
  getBtnAttributes() {
@@ -537,7 +537,7 @@ const SallaLoginModal = class {
537
537
  return;
538
538
  }
539
539
  if (event.detail.data.redirect_url) {
540
- return window.location.href = event.data.redirect_url;
540
+ return window.location.href = event.detail.data.redirect_url;
541
541
  }
542
542
  window.location.reload();
543
543
  }
@@ -55,10 +55,10 @@ export class SallaAddProductButton {
55
55
  }).reduce((a, [k, v]) => (v ? (a[k] = v, a) : a), {});
56
56
  return salla.cart.quickAdd(data)
57
57
  .then((response) => {
58
- return this.onSuccess.emit(response);
58
+ return this.success.emit(response);
59
59
  })
60
60
  .catch((error) => {
61
- return this.onFailed.emit(error);
61
+ return this.failed.emit(error);
62
62
  });
63
63
  }
64
64
  getBtnAttributes() {
@@ -200,8 +200,8 @@ export class SallaAddProductButton {
200
200
  }
201
201
  }; }
202
202
  static get events() { return [{
203
- "method": "onSuccess",
204
- "name": "onSuccess",
203
+ "method": "success",
204
+ "name": "success",
205
205
  "bubbles": true,
206
206
  "cancelable": true,
207
207
  "composed": true,
@@ -215,8 +215,8 @@ export class SallaAddProductButton {
215
215
  "references": {}
216
216
  }
217
217
  }, {
218
- "method": "onFailed",
219
- "name": "onFailed",
218
+ "method": "failed",
219
+ "name": "failed",
220
220
  "bubbles": true,
221
221
  "cancelable": true,
222
222
  "composed": true,
@@ -125,7 +125,7 @@ export class SallaLoginModal {
125
125
  return;
126
126
  }
127
127
  if (event.detail.data.redirect_url) {
128
- return window.location.href = event.data.redirect_url;
128
+ return window.location.href = event.detail.data.redirect_url;
129
129
  }
130
130
  window.location.reload();
131
131
  }
@@ -14,8 +14,8 @@ const SallaAddProductButton$1 = /*@__PURE__*/ proxyCustomElement(class extends H
14
14
  constructor() {
15
15
  super();
16
16
  this.__registerHost();
17
- this.onSuccess = createEvent(this, "onSuccess", 7);
18
- this.onFailed = createEvent(this, "onFailed", 7);
17
+ this.success = createEvent(this, "success", 7);
18
+ this.failed = createEvent(this, "failed", 7);
19
19
  this.hostAttributes = {};
20
20
  this.hasLabel = false;
21
21
  /**
@@ -67,10 +67,10 @@ const SallaAddProductButton$1 = /*@__PURE__*/ proxyCustomElement(class extends H
67
67
  }).reduce((a, [k, v]) => (v ? (a[k] = v, a) : a), {});
68
68
  return salla.cart.quickAdd(data)
69
69
  .then((response) => {
70
- return this.onSuccess.emit(response);
70
+ return this.success.emit(response);
71
71
  })
72
72
  .catch((error) => {
73
- return this.onFailed.emit(error);
73
+ return this.failed.emit(error);
74
74
  });
75
75
  }
76
76
  getBtnAttributes() {
@@ -136,7 +136,7 @@ const SallaLoginModal$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLEle
136
136
  return;
137
137
  }
138
138
  if (event.detail.data.redirect_url) {
139
- return window.location.href = event.data.redirect_url;
139
+ return window.location.href = event.detail.data.redirect_url;
140
140
  }
141
141
  window.location.reload();
142
142
  }
@@ -8,8 +8,8 @@ const sallaAddProductButtonCss = ":host{display:block}salla-add-product-button[w
8
8
  const SallaAddProductButton = class {
9
9
  constructor(hostRef) {
10
10
  registerInstance(this, hostRef);
11
- this.onSuccess = createEvent(this, "onSuccess", 7);
12
- this.onFailed = createEvent(this, "onFailed", 7);
11
+ this.success = createEvent(this, "success", 7);
12
+ this.failed = createEvent(this, "failed", 7);
13
13
  this.hostAttributes = {};
14
14
  this.hasLabel = false;
15
15
  /**
@@ -61,10 +61,10 @@ const SallaAddProductButton = class {
61
61
  }).reduce((a, [k, v]) => (v ? (a[k] = v, a) : a), {});
62
62
  return salla.cart.quickAdd(data)
63
63
  .then((response) => {
64
- return this.onSuccess.emit(response);
64
+ return this.success.emit(response);
65
65
  })
66
66
  .catch((error) => {
67
- return this.onFailed.emit(error);
67
+ return this.failed.emit(error);
68
68
  });
69
69
  }
70
70
  getBtnAttributes() {
@@ -533,7 +533,7 @@ const SallaLoginModal = class {
533
533
  return;
534
534
  }
535
535
  if (event.detail.data.redirect_url) {
536
- return window.location.href = event.data.redirect_url;
536
+ return window.location.href = event.detail.data.redirect_url;
537
537
  }
538
538
  window.location.reload();
539
539
  }