@salla.sa/twilight-components 1.0.18 → 1.0.19

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 (89) hide show
  1. package/dist/cjs/Helper-fcea994c.js +23 -0
  2. package/dist/cjs/index-4b8b3ffe.js +1696 -0
  3. package/dist/cjs/index.cjs.js +13 -0
  4. package/dist/cjs/loader.cjs.js +21 -0
  5. package/dist/cjs/salla-branches.cjs.entry.js +92 -0
  6. package/dist/cjs/salla-button_5.cjs.entry.js +1686 -0
  7. package/dist/cjs/salla-localization.cjs.entry.js +82 -0
  8. package/dist/cjs/salla-login-008cc893.js +125 -0
  9. package/dist/cjs/salla-offer.cjs.entry.js +50 -0
  10. package/dist/cjs/salla-product-availability.cjs.entry.js +75 -0
  11. package/dist/cjs/salla-rating.cjs.entry.js +300 -0
  12. package/dist/cjs/salla-search-c7aad59a.js +81 -0
  13. package/dist/cjs/salla-search.cjs.entry.js +11 -0
  14. package/dist/cjs/twilight-components.cjs.js +19 -0
  15. package/dist/collection/Helpers/Helper.js +19 -0
  16. package/dist/collection/collection-manifest.json +22 -0
  17. package/dist/collection/components/generate-summary.js +35 -0
  18. package/dist/collection/components/salla-branches/salla-branches.css +12 -0
  19. package/dist/collection/components/salla-branches/salla-branches.js +233 -0
  20. package/dist/collection/components/salla-button/salla-button.css +3 -0
  21. package/dist/collection/components/salla-button/salla-button.js +246 -0
  22. package/dist/collection/components/salla-localization/salla-localization.js +208 -0
  23. package/dist/collection/components/salla-login/salla-login.css +3 -0
  24. package/dist/collection/components/salla-login/salla-login.js +378 -0
  25. package/dist/collection/components/salla-modal/salla-modal.js +459 -0
  26. package/dist/collection/components/salla-offer/salla-offer.js +81 -0
  27. package/dist/collection/components/salla-product-availability/salla-product-availability.js +331 -0
  28. package/dist/collection/components/salla-rating/salla-rating.css +7 -0
  29. package/dist/collection/components/salla-rating/salla-rating.js +483 -0
  30. package/dist/collection/components/salla-search/salla-search.js +132 -0
  31. package/dist/collection/components/salla-tel-input/salla-tel-input.js +14 -0
  32. package/dist/collection/components/salla-verify/salla-verify.js +273 -0
  33. package/dist/collection/index.js +2 -0
  34. package/dist/collection/interfaces/colors.js +1 -0
  35. package/dist/collection/interfaces/index.js +2 -0
  36. package/dist/collection/interfaces/ratio.js +1 -0
  37. package/dist/collection/plugins/tailwind-theme/generator.js +62 -0
  38. package/dist/collection/plugins/tailwind-theme/index.js +26 -0
  39. package/dist/{twilight-components → esm}/Helper-d07ebbc7.js +0 -0
  40. package/dist/esm/index-092659c7.js +1668 -0
  41. package/dist/esm/index.js +4 -0
  42. package/dist/esm/loader.js +17 -0
  43. package/dist/esm/polyfills/core-js.js +11 -0
  44. package/dist/esm/polyfills/css-shim.js +1 -0
  45. package/dist/esm/polyfills/dom.js +79 -0
  46. package/dist/esm/polyfills/es5-html-element.js +1 -0
  47. package/dist/esm/polyfills/index.js +34 -0
  48. package/dist/esm/polyfills/system.js +6 -0
  49. package/dist/{twilight-components → esm}/salla-branches.entry.js +1 -1
  50. package/dist/esm/salla-button_5.entry.js +1678 -0
  51. package/dist/{twilight-components → esm}/salla-localization.entry.js +1 -1
  52. package/dist/{twilight-components/salla-login-b92c73dc.js → esm/salla-login-38586400.js} +2 -6
  53. package/dist/{twilight-components → esm}/salla-offer.entry.js +1 -1
  54. package/dist/{twilight-components → esm}/salla-product-availability.entry.js +1 -1
  55. package/dist/{twilight-components → esm}/salla-rating.entry.js +1 -1
  56. package/dist/{twilight-components/salla-search-69f2d9c1.js → esm/salla-search-ca856aab.js} +1 -1
  57. package/dist/esm/salla-search.entry.js +3 -0
  58. package/dist/esm/twilight-components.js +17 -0
  59. package/dist/index.cjs.js +1 -0
  60. package/dist/index.js +1 -0
  61. package/dist/twilight-components/index.esm.js +1 -4
  62. package/dist/twilight-components/p-03d0ec44.entry.js +1 -0
  63. package/dist/twilight-components/p-13a55257.entry.js +1 -0
  64. package/dist/twilight-components/p-160062c6.js +1 -0
  65. package/dist/twilight-components/p-47f17d3b.js +1 -0
  66. package/dist/twilight-components/p-5307c7b5.entry.js +1 -0
  67. package/dist/twilight-components/p-6a1f43c6.entry.js +1 -0
  68. package/dist/twilight-components/p-7088e517.entry.js +1 -0
  69. package/dist/twilight-components/p-924e3c88.js +1 -0
  70. package/dist/twilight-components/p-e8965b01.js +1 -0
  71. package/dist/twilight-components/p-ecb1b6cc.entry.js +1 -0
  72. package/dist/twilight-components/p-f11b401a.entry.js +1 -0
  73. package/dist/twilight-components/twilight-components.css +1 -3
  74. package/dist/twilight-components/twilight-components.esm.js +1 -125
  75. package/dist/types/components/salla-login/salla-login.d.ts +0 -1
  76. package/dist/types/components/salla-tel-input/salla-tel-input.d.ts +4 -0
  77. package/dist/types/components.d.ts +13 -0
  78. package/package.json +2 -1
  79. package/dist/twilight-components/app-globals-0f993ce5.js +0 -3
  80. package/dist/twilight-components/css-shim-a64b8820.js +0 -4
  81. package/dist/twilight-components/dom-d08ba8aa.js +0 -73
  82. package/dist/twilight-components/index-8966d27f.js +0 -3010
  83. package/dist/twilight-components/salla-button.entry.js +0 -75
  84. package/dist/twilight-components/salla-login-7c25f64b.js +0 -116
  85. package/dist/twilight-components/salla-login.entry.js +0 -3
  86. package/dist/twilight-components/salla-modal.entry.js +0 -113
  87. package/dist/twilight-components/salla-search.entry.js +0 -3
  88. package/dist/twilight-components/salla-verify.entry.js +0 -114
  89. package/dist/twilight-components/shadow-css-bc14d9fd.js +0 -389
@@ -0,0 +1,331 @@
1
+ import { Component, Host, h, Prop, Watch, Element, Method } from '@stencil/core';
2
+ import Helper from "../../Helpers/Helper";
3
+ export class SallaProductAvailability {
4
+ constructor() {
5
+ this.isUser = Helper.isUser();
6
+ this.buttonText = salla.lang.get('pages.products.notify_availability');
7
+ this.countryCode = salla.config.country_code || 'SA';
8
+ this.subscribeText = salla.lang.get('common.elements.submit');
9
+ this.cancelText = salla.lang.get('common.elements.cancel');
10
+ this.subTitle = salla.lang.get('pages.products.notify_availability_subtitle');
11
+ this.mobileLabel = salla.lang.get('common.elements.mobile');
12
+ this.emailLabel = salla.lang.get('common.elements.email');
13
+ this.mobilePlaceholder = salla.lang.get('common.elements.mobile_placeholder');
14
+ this.emailPlaceholder = salla.lang.get('common.elements.email_placeholder');
15
+ this.productId = salla.config.page.id;
16
+ this.subscribedMessage = salla.lang.get('pages.products.notify_availability_success');
17
+ this.isSubscribed = false;
18
+ if (this.isUser) {
19
+ return;
20
+ }
21
+ this.channelsWatcher(this.channels);
22
+ this.title_ = this.host.title || salla.lang.get('pages.products.notify_availability_title');
23
+ this.host.removeAttribute('title');
24
+ }
25
+ channelsWatcher(newValue) {
26
+ this.channels_ = newValue.split(',');
27
+ }
28
+ async submit() {
29
+ if (this.isUser) {
30
+ return salla.api.product.availabilitySubscribe(this.productId)
31
+ .then(() => this.isSubscribed = true);
32
+ }
33
+ let data = { id: this.productId, country_code: this.countryCode };
34
+ if (this.mobile.value !== '') {
35
+ data['mobile'] = this.mobile.value;
36
+ }
37
+ if (this.email.value !== '') {
38
+ data['email'] = this.email.value;
39
+ }
40
+ return this.btn.load()
41
+ .then(() => this.btn.disable())
42
+ .then(() => salla.api.product.availabilitySubscribe(data))
43
+ .then(() => this.isSubscribed = true) //no need to wait until finishing alert animation
44
+ .then(() => this.btn.stop())
45
+ .then(() => this.modal.hide())
46
+ .catch(() => this.btn.stop() && this.btn.enable());
47
+ }
48
+ render() {
49
+ return (h(Host, null,
50
+ this.isSubscribed
51
+ ? h("div", { class: "s-product-availability-subscribed" }, this.subscribedMessage)
52
+ : h("slot", null,
53
+ h("salla-button", { wide: true, onClick: () => this.isUser ? this.submit() : this.modal.show() }, this.buttonText)),
54
+ this.isUser || this.isSubscribed ? '' : this.renderModal()));
55
+ }
56
+ renderModal() {
57
+ return (h("salla-modal", { ref: modal => this.modal = modal, title: this.title_, subTitle: this.subTitle, icon: "sicon-bell-ring", width: "md" },
58
+ h("div", { class: "s-product-availability-body" },
59
+ this.channels_.includes('email') ? [
60
+ h("label", { class: "s-product-availability-label" }, this.emailLabel),
61
+ h("input", { class: "s-product-availability-input", placeholder: this.emailPlaceholder, ref: el => this.email = el, type: "email" })
62
+ ] : '',
63
+ this.channels_.includes('sms') ? [
64
+ h("label", { class: "s-product-availability-label" }, this.mobileLabel),
65
+ h("input", { class: "s-product-availability-input", placeholder: this.mobilePlaceholder, ref: el => this.mobile = el, type: "text" }),
66
+ h("input", { type: "hidden", value: this.countryCode }),
67
+ ] : ''),
68
+ h("div", { slot: "footer", class: "s-product-availability-footer" },
69
+ h("salla-button", { wide: true, ref: btn => this.btn = btn, onClick: () => this.submit() }, this.subscribeText),
70
+ h("salla-button", { wide: true, "btn-style": "outline" }, this.cancelText))));
71
+ }
72
+ static get is() { return "salla-product-availability"; }
73
+ static get properties() { return {
74
+ "channels": {
75
+ "type": "string",
76
+ "mutable": false,
77
+ "complexType": {
78
+ "original": "string",
79
+ "resolved": "string",
80
+ "references": {}
81
+ },
82
+ "required": false,
83
+ "optional": false,
84
+ "docs": {
85
+ "tags": [],
86
+ "text": ""
87
+ },
88
+ "attribute": "channels",
89
+ "reflect": false
90
+ },
91
+ "buttonText": {
92
+ "type": "string",
93
+ "mutable": false,
94
+ "complexType": {
95
+ "original": "string",
96
+ "resolved": "string",
97
+ "references": {}
98
+ },
99
+ "required": false,
100
+ "optional": false,
101
+ "docs": {
102
+ "tags": [],
103
+ "text": ""
104
+ },
105
+ "attribute": "button-text",
106
+ "reflect": false,
107
+ "defaultValue": "salla.lang.get('pages.products.notify_availability')"
108
+ },
109
+ "countryCode": {
110
+ "type": "string",
111
+ "mutable": false,
112
+ "complexType": {
113
+ "original": "string",
114
+ "resolved": "string",
115
+ "references": {}
116
+ },
117
+ "required": false,
118
+ "optional": false,
119
+ "docs": {
120
+ "tags": [],
121
+ "text": ""
122
+ },
123
+ "attribute": "country-code",
124
+ "reflect": false,
125
+ "defaultValue": "salla.config.country_code || 'SA'"
126
+ },
127
+ "subscribeText": {
128
+ "type": "string",
129
+ "mutable": false,
130
+ "complexType": {
131
+ "original": "string",
132
+ "resolved": "string",
133
+ "references": {}
134
+ },
135
+ "required": false,
136
+ "optional": false,
137
+ "docs": {
138
+ "tags": [],
139
+ "text": ""
140
+ },
141
+ "attribute": "subscribe-text",
142
+ "reflect": false,
143
+ "defaultValue": "salla.lang.get('common.elements.submit')"
144
+ },
145
+ "cancelText": {
146
+ "type": "string",
147
+ "mutable": false,
148
+ "complexType": {
149
+ "original": "string",
150
+ "resolved": "string",
151
+ "references": {}
152
+ },
153
+ "required": false,
154
+ "optional": false,
155
+ "docs": {
156
+ "tags": [],
157
+ "text": ""
158
+ },
159
+ "attribute": "cancel-text",
160
+ "reflect": false,
161
+ "defaultValue": "salla.lang.get('common.elements.cancel')"
162
+ },
163
+ "subTitle": {
164
+ "type": "string",
165
+ "mutable": false,
166
+ "complexType": {
167
+ "original": "string",
168
+ "resolved": "string",
169
+ "references": {}
170
+ },
171
+ "required": false,
172
+ "optional": false,
173
+ "docs": {
174
+ "tags": [],
175
+ "text": ""
176
+ },
177
+ "attribute": "sub-title",
178
+ "reflect": false,
179
+ "defaultValue": "salla.lang.get('pages.products.notify_availability_subtitle')"
180
+ },
181
+ "mobileLabel": {
182
+ "type": "string",
183
+ "mutable": false,
184
+ "complexType": {
185
+ "original": "string",
186
+ "resolved": "string",
187
+ "references": {}
188
+ },
189
+ "required": false,
190
+ "optional": false,
191
+ "docs": {
192
+ "tags": [],
193
+ "text": ""
194
+ },
195
+ "attribute": "mobile-label",
196
+ "reflect": false,
197
+ "defaultValue": "salla.lang.get('common.elements.mobile')"
198
+ },
199
+ "emailLabel": {
200
+ "type": "string",
201
+ "mutable": false,
202
+ "complexType": {
203
+ "original": "string",
204
+ "resolved": "string",
205
+ "references": {}
206
+ },
207
+ "required": false,
208
+ "optional": false,
209
+ "docs": {
210
+ "tags": [],
211
+ "text": ""
212
+ },
213
+ "attribute": "email-label",
214
+ "reflect": false,
215
+ "defaultValue": "salla.lang.get('common.elements.email')"
216
+ },
217
+ "mobilePlaceholder": {
218
+ "type": "string",
219
+ "mutable": false,
220
+ "complexType": {
221
+ "original": "string",
222
+ "resolved": "string",
223
+ "references": {}
224
+ },
225
+ "required": false,
226
+ "optional": false,
227
+ "docs": {
228
+ "tags": [],
229
+ "text": ""
230
+ },
231
+ "attribute": "mobile-placeholder",
232
+ "reflect": false,
233
+ "defaultValue": "salla.lang.get('common.elements.mobile_placeholder')"
234
+ },
235
+ "emailPlaceholder": {
236
+ "type": "string",
237
+ "mutable": false,
238
+ "complexType": {
239
+ "original": "string",
240
+ "resolved": "string",
241
+ "references": {}
242
+ },
243
+ "required": false,
244
+ "optional": false,
245
+ "docs": {
246
+ "tags": [],
247
+ "text": ""
248
+ },
249
+ "attribute": "email-placeholder",
250
+ "reflect": false,
251
+ "defaultValue": "salla.lang.get('common.elements.email_placeholder')"
252
+ },
253
+ "productId": {
254
+ "type": "number",
255
+ "mutable": false,
256
+ "complexType": {
257
+ "original": "number",
258
+ "resolved": "number",
259
+ "references": {}
260
+ },
261
+ "required": false,
262
+ "optional": false,
263
+ "docs": {
264
+ "tags": [],
265
+ "text": ""
266
+ },
267
+ "attribute": "product-id",
268
+ "reflect": false,
269
+ "defaultValue": "salla.config.page.id"
270
+ },
271
+ "subscribedMessage": {
272
+ "type": "string",
273
+ "mutable": false,
274
+ "complexType": {
275
+ "original": "string",
276
+ "resolved": "string",
277
+ "references": {}
278
+ },
279
+ "required": false,
280
+ "optional": false,
281
+ "docs": {
282
+ "tags": [],
283
+ "text": ""
284
+ },
285
+ "attribute": "subscribed-message",
286
+ "reflect": false,
287
+ "defaultValue": "salla.lang.get('pages.products.notify_availability_success')"
288
+ },
289
+ "isSubscribed": {
290
+ "type": "boolean",
291
+ "mutable": true,
292
+ "complexType": {
293
+ "original": "boolean",
294
+ "resolved": "boolean",
295
+ "references": {}
296
+ },
297
+ "required": false,
298
+ "optional": false,
299
+ "docs": {
300
+ "tags": [],
301
+ "text": ""
302
+ },
303
+ "attribute": "is-subscribed",
304
+ "reflect": false,
305
+ "defaultValue": "false"
306
+ }
307
+ }; }
308
+ static get methods() { return {
309
+ "submit": {
310
+ "complexType": {
311
+ "signature": "() => Promise<any>",
312
+ "parameters": [],
313
+ "references": {
314
+ "Promise": {
315
+ "location": "global"
316
+ }
317
+ },
318
+ "return": "Promise<any>"
319
+ },
320
+ "docs": {
321
+ "text": "",
322
+ "tags": []
323
+ }
324
+ }
325
+ }; }
326
+ static get elementRef() { return "host"; }
327
+ static get watchers() { return [{
328
+ "propName": "channels",
329
+ "methodName": "channelsWatcher"
330
+ }]; }
331
+ }
@@ -0,0 +1,7 @@
1
+ :host {
2
+ display: block;
3
+ }
4
+
5
+ .unicode{
6
+ unicode-bidi: plaintext;
7
+ }