@salla.sa/twilight-components 1.5.6 → 1.5.8

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 (67) hide show
  1. package/dist/cjs/{index-d43334bf.js → index-0d0167d5.js} +0 -0
  2. package/dist/cjs/loader.cjs.js +2 -2
  3. package/dist/cjs/salla-add-product-button.cjs.entry.js +20 -5
  4. package/dist/cjs/salla-button_24.cjs.entry.js +76 -9
  5. package/dist/cjs/salla-conditional-fields.cjs.entry.js +1 -1
  6. package/dist/cjs/salla-installment.cjs.entry.js +1 -1
  7. package/dist/cjs/salla-scopes.cjs.entry.js +19 -4
  8. package/dist/cjs/twilight-components.cjs.js +2 -2
  9. package/dist/collection/components/salla-add-product-button/salla-add-product-button.js +29 -14
  10. package/dist/collection/components/salla-list-tile/salla-list-tile.js +8 -2
  11. package/dist/collection/components/salla-localization-modal/salla-localization-modal.js +12 -3
  12. package/dist/collection/components/salla-loyalty/salla-loyalty.js +2 -2
  13. package/dist/collection/components/salla-modal/salla-modal.js +24 -6
  14. package/dist/collection/components/salla-rating-stars/salla-rating-stars.js +11 -5
  15. package/dist/collection/components/salla-scopes/salla-scopes.js +21 -6
  16. package/dist/collection/components/salla-search/salla-search.js +12 -3
  17. package/dist/collection/components/salla-social-share/salla-social-share.js +4 -1
  18. package/dist/collection/components/salla-swiper/salla-swiper.js +17 -25
  19. package/dist/collection/components/salla-tabs/salla-tab-content.js +5 -2
  20. package/dist/collection/components/salla-tabs/salla-tab-header.js +11 -8
  21. package/dist/collection/components/salla-tabs/salla-tabs.js +1 -1
  22. package/dist/collection/components/salla-tel-input/salla-tel-input.js +1 -1
  23. package/dist/components/salla-add-product-button.js +19 -4
  24. package/dist/components/salla-list-tile2.js +6 -0
  25. package/dist/components/salla-localization-modal.js +9 -0
  26. package/dist/components/salla-loyalty.js +1 -1
  27. package/dist/components/salla-modal2.js +18 -0
  28. package/dist/components/salla-rating-stars2.js +6 -0
  29. package/dist/components/salla-scopes.js +18 -3
  30. package/dist/components/salla-search.js +9 -0
  31. package/dist/components/salla-social-share.js +3 -0
  32. package/dist/components/salla-swiper2.js +13 -4
  33. package/dist/components/salla-tab-content2.js +3 -0
  34. package/dist/components/salla-tab-header2.js +7 -4
  35. package/dist/components/salla-tabs2.js +1 -1
  36. package/dist/esm/{index-c78562f8.js → index-4e30ffd0.js} +0 -0
  37. package/dist/esm/loader.js +2 -2
  38. package/dist/esm/salla-add-product-button.entry.js +20 -5
  39. package/dist/esm/salla-button_24.entry.js +76 -9
  40. package/dist/esm/salla-conditional-fields.entry.js +1 -1
  41. package/dist/esm/salla-installment.entry.js +1 -1
  42. package/dist/esm/salla-scopes.entry.js +19 -4
  43. package/dist/esm/twilight-components.js +2 -2
  44. package/dist/twilight-components/{p-ca871c42.entry.js → p-019bb315.entry.js} +1 -1
  45. package/dist/twilight-components/{p-336eda99.js → p-1503d976.js} +0 -0
  46. package/dist/twilight-components/{p-b5028001.entry.js → p-4cba804f.entry.js} +1 -1
  47. package/dist/twilight-components/p-952f6c78.entry.js +4 -0
  48. package/dist/twilight-components/{p-aa546227.entry.js → p-a023ad04.entry.js} +1 -1
  49. package/dist/twilight-components/p-e7d11878.entry.js +4 -0
  50. package/dist/twilight-components/twilight-components.esm.js +1 -1
  51. package/dist/types/components/salla-add-product-button/salla-add-product-button.d.ts +24 -3
  52. package/dist/types/components/salla-list-tile/salla-list-tile.d.ts +6 -0
  53. package/dist/types/components/salla-localization-modal/salla-localization-modal.d.ts +9 -0
  54. package/dist/types/components/salla-loyalty/salla-loyalty.d.ts +1 -1
  55. package/dist/types/components/salla-modal/salla-modal.d.ts +18 -0
  56. package/dist/types/components/salla-rating-stars/salla-rating-stars.d.ts +10 -1
  57. package/dist/types/components/salla-scopes/salla-scopes.d.ts +9 -0
  58. package/dist/types/components/salla-search/salla-search.d.ts +9 -0
  59. package/dist/types/components/salla-social-share/salla-social-share.d.ts +3 -0
  60. package/dist/types/components/salla-swiper/salla-swiper.d.ts +12 -1
  61. package/dist/types/components/salla-tabs/salla-tab-content.d.ts +7 -0
  62. package/dist/types/components/salla-tabs/salla-tab-header.d.ts +9 -3
  63. package/dist/types/components/salla-tel-input/salla-tel-input.d.ts +3 -0
  64. package/dist/types/components.d.ts +203 -9
  65. package/package.json +4 -5
  66. package/dist/twilight-components/p-5707f352.entry.js +0 -4
  67. package/dist/twilight-components/p-c2947b0f.entry.js +0 -4
@@ -167,7 +167,7 @@ export class SallaLoyalty {
167
167
  .catch(e => console.log(e));
168
168
  }
169
169
  /**
170
- *
170
+ * Exchange loyalty points with the selected prize item
171
171
  * @param {number} loyalty_prize_id
172
172
  *
173
173
  */
@@ -452,7 +452,7 @@ export class SallaLoyalty {
452
452
  "return": "Promise<any>"
453
453
  },
454
454
  "docs": {
455
- "text": "",
455
+ "text": "Exchange loyalty points with the selected prize item",
456
456
  "tags": [{
457
457
  "name": "param",
458
458
  "text": "loyalty_prize_id"
@@ -11,6 +11,9 @@ import CheckCircleIcon from '../../assets/svg/check-circle2.svg';
11
11
  */
12
12
  export class SallaModal {
13
13
  constructor() {
14
+ /**
15
+ * Sets the modal to be closable. Defaults to `true`
16
+ */
14
17
  this.isClosable = true; //todo::rename unclude. Suggestion => persistent
15
18
  /**
16
19
  * The size of the modal
@@ -32,10 +35,25 @@ export class SallaModal {
32
35
  * Show loading in the middle
33
36
  */
34
37
  this.isLoading = false;
38
+ /**
39
+ * Show subtitle before the title or not, defaults to `false` (after the title)
40
+ */
35
41
  this.subTitleFirst = false; //todo:: choose better name
42
+ /**
43
+ * Avoid padding in the modal body or not, defaults to `false`
44
+ */
36
45
  this.noPadding = false; //todo:: choose better name
46
+ /**
47
+ * Set modal sub title.
48
+ */
37
49
  this.subTitle = '';
50
+ /**
51
+ * Align modal content to center, defaults to `false`
52
+ */
38
53
  this.centered = false;
54
+ /**
55
+ * Set the style of the header icon.
56
+ */
39
57
  this.iconStyle = undefined;
40
58
  Helper.setHost(this.host);
41
59
  salla.event.on('modal::open', target => target == this.host.id && this.open());
@@ -177,7 +195,7 @@ export class SallaModal {
177
195
  "optional": false,
178
196
  "docs": {
179
197
  "tags": [],
180
- "text": ""
198
+ "text": "Sets the modal to be closable. Defaults to `true`"
181
199
  },
182
200
  "attribute": "is-closable",
183
201
  "reflect": false,
@@ -285,7 +303,7 @@ export class SallaModal {
285
303
  "optional": false,
286
304
  "docs": {
287
305
  "tags": [],
288
- "text": ""
306
+ "text": "Show subtitle before the title or not, defaults to `false` (after the title)"
289
307
  },
290
308
  "attribute": "sub-title-first",
291
309
  "reflect": false,
@@ -303,7 +321,7 @@ export class SallaModal {
303
321
  "optional": false,
304
322
  "docs": {
305
323
  "tags": [],
306
- "text": ""
324
+ "text": "Avoid padding in the modal body or not, defaults to `false`"
307
325
  },
308
326
  "attribute": "no-padding",
309
327
  "reflect": false,
@@ -321,7 +339,7 @@ export class SallaModal {
321
339
  "optional": false,
322
340
  "docs": {
323
341
  "tags": [],
324
- "text": ""
342
+ "text": "Set modal sub title."
325
343
  },
326
344
  "attribute": "sub-title",
327
345
  "reflect": false,
@@ -339,7 +357,7 @@ export class SallaModal {
339
357
  "optional": false,
340
358
  "docs": {
341
359
  "tags": [],
342
- "text": ""
360
+ "text": "Align modal content to center, defaults to `false`"
343
361
  },
344
362
  "attribute": "centered",
345
363
  "reflect": false,
@@ -357,7 +375,7 @@ export class SallaModal {
357
375
  "optional": false,
358
376
  "docs": {
359
377
  "tags": [],
360
- "text": ""
378
+ "text": "Set the style of the header icon."
361
379
  },
362
380
  "attribute": "icon-style",
363
381
  "reflect": false,
@@ -6,7 +6,13 @@ import Helper from "../../Helpers/Helper";
6
6
  import Star2 from "../../assets/svg/star2.svg";
7
7
  export class SallaRatingStars {
8
8
  constructor() {
9
+ /**
10
+ * Sets input name.
11
+ */
9
12
  this.name = 'rating';
13
+ /**
14
+ * Sets the height and width of the component. Defaults to medium.
15
+ */
10
16
  this.size = 'medium';
11
17
  }
12
18
  initiateRating() {
@@ -88,7 +94,7 @@ export class SallaRatingStars {
88
94
  "optional": false,
89
95
  "docs": {
90
96
  "tags": [],
91
- "text": ""
97
+ "text": "Sets input name."
92
98
  },
93
99
  "attribute": "name",
94
100
  "reflect": false,
@@ -98,15 +104,15 @@ export class SallaRatingStars {
98
104
  "type": "string",
99
105
  "mutable": false,
100
106
  "complexType": {
101
- "original": "string",
102
- "resolved": "string",
107
+ "original": "\"large\" | \"medium\" | \"small\" | \"mini\"",
108
+ "resolved": "\"large\" | \"medium\" | \"mini\" | \"small\"",
103
109
  "references": {}
104
110
  },
105
111
  "required": false,
106
112
  "optional": false,
107
113
  "docs": {
108
114
  "tags": [],
109
- "text": ""
115
+ "text": "Sets the height and width of the component. Defaults to medium."
110
116
  },
111
117
  "attribute": "size",
112
118
  "reflect": false,
@@ -124,7 +130,7 @@ export class SallaRatingStars {
124
130
  "optional": false,
125
131
  "docs": {
126
132
  "tags": [],
127
- "text": ""
133
+ "text": "The rating value."
128
134
  },
129
135
  "attribute": "value",
130
136
  "reflect": false
@@ -40,10 +40,16 @@ export class SallaScopees {
40
40
  this.scopeSearchPlaceholder = salla.lang.get('blocks.scope.searching_for_a_branch');
41
41
  });
42
42
  }
43
+ /**
44
+ * Closes the scope modal.
45
+ */
43
46
  async close() {
44
47
  var _a;
45
48
  return await ((_a = this.modal) === null || _a === void 0 ? void 0 : _a.close());
46
49
  }
50
+ /**
51
+ * Opens the scope modal.
52
+ */
47
53
  async open(mode = ModeType.DEFAULT, product_id = null) {
48
54
  this.setScopeValues([]);
49
55
  if (typeof mode !== 'undefined' && [ModeType.AVAILABILITY, ModeType.DEFAULT].includes(mode)) {
@@ -67,14 +73,23 @@ export class SallaScopees {
67
73
  this.modal.stopLoading();
68
74
  });
69
75
  }
76
+ /**
77
+ * Submit form to change exsiting scope.
78
+ */
70
79
  async handleSubmit() {
71
- let payload = { 'scope_id': this.current_scope.id };
80
+ let payload = { 'id': this.current_scope.id };
72
81
  this.changeBtn.load();
73
82
  return await salla.scope.change(payload)
74
83
  .then(() => {
75
84
  salla.storage.set("branch-choosed-before", true);
76
- salla.storage.set("scope", this.current_scope.id);
77
- window.location.search += "&scope=" + this.current_scope.id;
85
+ salla.storage.set("scope", {
86
+ 'type': this.current_scope.type,
87
+ 'id': this.current_scope.id
88
+ });
89
+ if (window.location.search.includes("?")) {
90
+ window.location.search += "&";
91
+ }
92
+ window.location.search += "scope=" + this.current_scope.id;
78
93
  }).catch(e => console.log(e))
79
94
  .finally(() => {
80
95
  this.changeBtn.stop();
@@ -252,7 +267,7 @@ export class SallaScopees {
252
267
  "return": "Promise<HTMLElement>"
253
268
  },
254
269
  "docs": {
255
- "text": "",
270
+ "text": "Closes the scope modal.",
256
271
  "tags": []
257
272
  }
258
273
  },
@@ -274,7 +289,7 @@ export class SallaScopees {
274
289
  "return": "Promise<any>"
275
290
  },
276
291
  "docs": {
277
- "text": "",
292
+ "text": "Opens the scope modal.",
278
293
  "tags": []
279
294
  }
280
295
  },
@@ -290,7 +305,7 @@ export class SallaScopees {
290
305
  "return": "Promise<any>"
291
306
  },
292
307
  "docs": {
293
- "text": "",
308
+ "text": "Submit form to change exsiting scope.",
294
309
  "tags": []
295
310
  }
296
311
  }
@@ -14,8 +14,17 @@ export class SallaSearch {
14
14
  this.loading = false;
15
15
  this.typing = false;
16
16
  this.debounce = setTimeout(() => '', 1000);
17
+ /**
18
+ * Set the component display without modal window. Defaults to `false`
19
+ */
17
20
  this.inline = false;
21
+ /**
22
+ * Adds a border radius to the input. Half of the height.
23
+ */
18
24
  this.oval = false;
25
+ /**
26
+ * Sets the height of the input
27
+ */
19
28
  this.height = 60;
20
29
  Helper.setHost(this.host);
21
30
  this.productSlot = ((_a = Helper.getElement('[slot="product"]')) === null || _a === void 0 ? void 0 : _a.innerHTML) || this.getDefaultProductSlot();
@@ -124,7 +133,7 @@ export class SallaSearch {
124
133
  "optional": false,
125
134
  "docs": {
126
135
  "tags": [],
127
- "text": ""
136
+ "text": "Set the component display without modal window. Defaults to `false`"
128
137
  },
129
138
  "attribute": "inline",
130
139
  "reflect": false,
@@ -142,7 +151,7 @@ export class SallaSearch {
142
151
  "optional": false,
143
152
  "docs": {
144
153
  "tags": [],
145
- "text": ""
154
+ "text": "Adds a border radius to the input. Half of the height."
146
155
  },
147
156
  "attribute": "oval",
148
157
  "reflect": false,
@@ -160,7 +169,7 @@ export class SallaSearch {
160
169
  "optional": false,
161
170
  "docs": {
162
171
  "tags": [],
163
- "text": ""
172
+ "text": "Sets the height of the input"
164
173
  },
165
174
  "attribute": "height",
166
175
  "reflect": false,
@@ -50,6 +50,9 @@ export class SallaSocialShare {
50
50
  window.a2a_config.locale = salla.lang.locale;
51
51
  });
52
52
  }
53
+ /**
54
+ * Activate or open the share menu.
55
+ */
53
56
  async open() {
54
57
  this.opened = !this.opened;
55
58
  if (this.opened) {
@@ -179,7 +182,7 @@ export class SallaSocialShare {
179
182
  "return": "Promise<void>"
180
183
  },
181
184
  "docs": {
182
- "text": "",
185
+ "text": "Activate or open the share menu.",
183
186
  "tags": []
184
187
  }
185
188
  }
@@ -7,12 +7,22 @@ import ArrowRightIcon from "../../assets/svg/arrow-right.svg";
7
7
  import ArrowLeftIcon from "../../assets/svg/arrow-left.svg";
8
8
  export class SallaSwiper {
9
9
  constructor() {
10
- // slider-options
10
+ /**
11
+ * Set to true to enable continuous loop mode. Defaults to false.
12
+ */
11
13
  this.loop = false;
14
+ /**
15
+ * Duration of transition between slides (in ms). Defaults to 300ms.
16
+ */
12
17
  this.speed = 300;
18
+ /**
19
+ * Number of slides per view (slides visible at the same time on slider's container).
20
+ */
13
21
  this.itemPerView = "auto";
22
+ /**
23
+ * Distance between slide items in px. Defaults to 8px
24
+ */
14
25
  this.spaceBetweenItems = 8;
15
- this.direction = 'ltr';
16
26
  // States
17
27
  this.currentIndex = undefined;
18
28
  this.isLastSlideItem = false;
@@ -37,7 +47,7 @@ export class SallaSwiper {
37
47
  }
38
48
  render() {
39
49
  var _a, _b;
40
- return (h("div", { class: "s-swiper", dir: this.direction },
50
+ return (h("div", { class: "s-swiper" },
41
51
  h("div", { class: "s-swiper-button-prev" },
42
52
  h("salla-button", { disabled: (_a = this.swiper) === null || _a === void 0 ? void 0 : _a.isBeginning, shape: "icon", color: "light", onClick: () => this.swiper.slidePrev() },
43
53
  h("span", { class: "s-swiper-button-icon", innerHTML: ArrowLeftIcon }))),
@@ -69,7 +79,7 @@ export class SallaSwiper {
69
79
  "optional": false,
70
80
  "docs": {
71
81
  "tags": [],
72
- "text": ""
82
+ "text": "Set to true to enable continuous loop mode. Defaults to false."
73
83
  },
74
84
  "attribute": "loop",
75
85
  "reflect": false,
@@ -87,7 +97,7 @@ export class SallaSwiper {
87
97
  "optional": false,
88
98
  "docs": {
89
99
  "tags": [],
90
- "text": ""
100
+ "text": "Duration of transition between slides (in ms). Defaults to 300ms."
91
101
  },
92
102
  "attribute": "speed",
93
103
  "reflect": false,
@@ -105,7 +115,7 @@ export class SallaSwiper {
105
115
  "optional": false,
106
116
  "docs": {
107
117
  "tags": [],
108
- "text": ""
118
+ "text": "Number of slides per view (slides visible at the same time on slider's container)."
109
119
  },
110
120
  "attribute": "item-per-view",
111
121
  "reflect": false,
@@ -123,29 +133,11 @@ export class SallaSwiper {
123
133
  "optional": false,
124
134
  "docs": {
125
135
  "tags": [],
126
- "text": ""
136
+ "text": "Distance between slide items in px. Defaults to 8px"
127
137
  },
128
138
  "attribute": "space-between-items",
129
139
  "reflect": false,
130
140
  "defaultValue": "8"
131
- },
132
- "direction": {
133
- "type": "string",
134
- "mutable": false,
135
- "complexType": {
136
- "original": "string",
137
- "resolved": "string",
138
- "references": {}
139
- },
140
- "required": false,
141
- "optional": false,
142
- "docs": {
143
- "tags": [],
144
- "text": ""
145
- },
146
- "attribute": "direction",
147
- "reflect": false,
148
- "defaultValue": "'ltr'"
149
141
  }
150
142
  }; }
151
143
  static get states() { return {
@@ -6,6 +6,9 @@ export class SallaTabContent {
6
6
  constructor() {
7
7
  this.isSelected = false;
8
8
  }
9
+ /**
10
+ * Expose self for the parent.
11
+ */
9
12
  async getChild() {
10
13
  return {
11
14
  select: this.select.bind(this),
@@ -47,7 +50,7 @@ export class SallaTabContent {
47
50
  "optional": false,
48
51
  "docs": {
49
52
  "tags": [],
50
- "text": ""
53
+ "text": "Set name of the tab content. Mainly used as a key to s\nynchronize the content with it's respective header."
51
54
  },
52
55
  "attribute": "name",
53
56
  "reflect": false
@@ -69,7 +72,7 @@ export class SallaTabContent {
69
72
  "return": "Promise<{ select: any; unselect: any; name: string; }>"
70
73
  },
71
74
  "docs": {
72
- "text": "",
75
+ "text": "Expose self for the parent.",
73
76
  "tags": []
74
77
  }
75
78
  }
@@ -20,9 +20,12 @@ export class SallaTabHeader {
20
20
  this.centered = false;
21
21
  this.isSelected = false;
22
22
  }
23
+ /**
24
+ * Expose self for the parent.
25
+ */
23
26
  async getChild() {
24
27
  return {
25
- select: this.select.bind(this),
28
+ select: this.selected.bind(this),
26
29
  unselect: this.unselect.bind(this),
27
30
  name: this.name,
28
31
  id: this.id
@@ -31,12 +34,12 @@ export class SallaTabHeader {
31
34
  unselect() {
32
35
  this.isSelected = false;
33
36
  }
34
- select() {
37
+ selected() {
35
38
  this.isSelected = true;
36
39
  }
37
40
  onClick() {
38
41
  this.getChild().then(child => {
39
- this.onSelect.emit(child);
42
+ this.tabSelected.emit(child);
40
43
  });
41
44
  }
42
45
  render() {
@@ -70,7 +73,7 @@ export class SallaTabHeader {
70
73
  "optional": false,
71
74
  "docs": {
72
75
  "tags": [],
73
- "text": "Header identifier name to sync with the"
76
+ "text": "Header identifier name to sync with the content."
74
77
  },
75
78
  "attribute": "name",
76
79
  "reflect": false
@@ -134,14 +137,14 @@ export class SallaTabHeader {
134
137
  "isSelected": {}
135
138
  }; }
136
139
  static get events() { return [{
137
- "method": "onSelect",
138
- "name": "onSelect",
140
+ "method": "tabSelected",
141
+ "name": "tabSelected",
139
142
  "bubbles": true,
140
143
  "cancelable": true,
141
144
  "composed": true,
142
145
  "docs": {
143
146
  "tags": [],
144
- "text": ""
147
+ "text": "Emits event object when clicked or selected."
145
148
  },
146
149
  "complexType": {
147
150
  "original": "any",
@@ -162,7 +165,7 @@ export class SallaTabHeader {
162
165
  "return": "Promise<{ select: any; unselect: any; name: string; id: string; }>"
163
166
  },
164
167
  "docs": {
165
- "text": "",
168
+ "text": "Expose self for the parent.",
166
169
  "tags": []
167
170
  }
168
171
  }
@@ -100,7 +100,7 @@ export class SallaTabs {
100
100
  }; }
101
101
  static get elementRef() { return "host"; }
102
102
  static get listeners() { return [{
103
- "name": "onSelect",
103
+ "name": "onTabSelected",
104
104
  "method": "onSelectedTab",
105
105
  "target": undefined,
106
106
  "capture": false,
@@ -177,7 +177,7 @@ export class SallaTelInput {
177
177
  "composed": true,
178
178
  "docs": {
179
179
  "tags": [],
180
- "text": ""
180
+ "text": "Event Emitter"
181
181
  },
182
182
  "complexType": {
183
183
  "original": "any",
@@ -14,14 +14,29 @@ const SallaAddProductButton$1 = /*@__PURE__*/ proxyCustomElement(class extends H
14
14
  constructor() {
15
15
  super();
16
16
  this.__registerHost();
17
- this.success = createEvent(this, "success", 7);
18
- this.failed = createEvent(this, "failed", 7);
17
+ this.onSuccess = createEvent(this, "onSuccess", 7);
18
+ this.onFailed = createEvent(this, "onFailed", 7);
19
19
  this.hostAttributes = {};
20
20
  this.hasLabel = false;
21
+ /**
22
+ * Channels.
23
+ */
21
24
  this.channels = null;
25
+ /**
26
+ * Product Quantity
27
+ */
22
28
  this.quantity = 0;
29
+ /**
30
+ * Donating amount.
31
+ */
23
32
  this.donatingAmount = 0;
33
+ /**
34
+ * Product Status.Defaults to `sale`
35
+ */
24
36
  this.productStatus = 'sale';
37
+ /**
38
+ * Product type. Defaults to `product`
39
+ */
25
40
  this.productType = 'product';
26
41
  }
27
42
  getLabel() {
@@ -52,10 +67,10 @@ const SallaAddProductButton$1 = /*@__PURE__*/ proxyCustomElement(class extends H
52
67
  }).reduce((a, [k, v]) => (v ? (a[k] = v, a) : a), {});
53
68
  return salla.cart.quickAdd(data)
54
69
  .then((response) => {
55
- return this.success.emit(response);
70
+ return this.onSuccess.emit(response);
56
71
  })
57
72
  .catch((error) => {
58
- return this.failed.emit(error);
73
+ return this.onFailed.emit(error);
59
74
  });
60
75
  }
61
76
  getBtnAttributes() {
@@ -9,7 +9,13 @@ const SallaListTile = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
9
9
  constructor() {
10
10
  super();
11
11
  this.__registerHost();
12
+ /**
13
+ * Designates the component as anchor and applies the `href` attribute.
14
+ */
12
15
  this.href = undefined;
16
+ /**
17
+ * Designates the target attribute. This should only be applied when using the `href` prop.
18
+ */
13
19
  this.target = "_self";
14
20
  }
15
21
  generateClass() {
@@ -18,7 +18,13 @@ const SallaLocalizationModal$1 = /*@__PURE__*/ proxyCustomElement(class extends
18
18
  this.languages = [];
19
19
  this.currencies = [];
20
20
  this.isLoading = true;
21
+ /**
22
+ * Current language (existing or newly selected)
23
+ */
21
24
  this.language = salla.config.get('user.language_code');
25
+ /**
26
+ * Current currency (existing or newly selected)
27
+ */
22
28
  this.currency = salla.config.get('user.currency_code');
23
29
  Helper.setHost(this.host);
24
30
  salla.event.on('localization::open', () => this.open());
@@ -69,6 +75,9 @@ const SallaLocalizationModal$1 = /*@__PURE__*/ proxyCustomElement(class extends
69
75
  onChangeLanguage(event) {
70
76
  this.language = event.target.value;
71
77
  }
78
+ /**
79
+ * Change currency and language to the selected ones.
80
+ */
72
81
  async submit() {
73
82
  let url;
74
83
  this.btn.load()
@@ -203,7 +203,7 @@ const SallaLoyalty$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElemen
203
203
  .catch(e => console.log(e));
204
204
  }
205
205
  /**
206
- *
206
+ * Exchange loyalty points with the selected prize item
207
207
  * @param {number} loyalty_prize_id
208
208
  *
209
209
  */
@@ -26,6 +26,9 @@ const SallaModal = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
26
26
  constructor() {
27
27
  super();
28
28
  this.__registerHost();
29
+ /**
30
+ * Sets the modal to be closable. Defaults to `true`
31
+ */
29
32
  this.isClosable = true; //todo::rename unclude. Suggestion => persistent
30
33
  /**
31
34
  * The size of the modal
@@ -47,10 +50,25 @@ const SallaModal = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
47
50
  * Show loading in the middle
48
51
  */
49
52
  this.isLoading = false;
53
+ /**
54
+ * Show subtitle before the title or not, defaults to `false` (after the title)
55
+ */
50
56
  this.subTitleFirst = false; //todo:: choose better name
57
+ /**
58
+ * Avoid padding in the modal body or not, defaults to `false`
59
+ */
51
60
  this.noPadding = false; //todo:: choose better name
61
+ /**
62
+ * Set modal sub title.
63
+ */
52
64
  this.subTitle = '';
65
+ /**
66
+ * Align modal content to center, defaults to `false`
67
+ */
53
68
  this.centered = false;
69
+ /**
70
+ * Set the style of the header icon.
71
+ */
54
72
  this.iconStyle = undefined;
55
73
  Helper.setHost(this.host);
56
74
  salla.event.on('modal::open', target => target == this.host.id && this.open());
@@ -11,7 +11,13 @@ const SallaRatingStars = /*@__PURE__*/ proxyCustomElement(class extends HTMLElem
11
11
  constructor() {
12
12
  super();
13
13
  this.__registerHost();
14
+ /**
15
+ * Sets input name.
16
+ */
14
17
  this.name = 'rating';
18
+ /**
19
+ * Sets the height and width of the component. Defaults to medium.
20
+ */
15
21
  this.size = 'medium';
16
22
  }
17
23
  initiateRating() {