@salla.sa/twilight-components 1.0.33 → 1.0.35
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/cjs/index.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/salla-branches.cjs.entry.js +7 -8
- package/dist/cjs/salla-button_7.cjs.entry.js +156 -56
- package/dist/cjs/salla-infinite-scroll.cjs.entry.js +3 -0
- package/dist/cjs/salla-offer.cjs.entry.js +10 -2
- package/dist/cjs/salla-product-availability.cjs.entry.js +6 -0
- package/dist/cjs/salla-rating.cjs.entry.js +12 -2
- package/dist/cjs/{salla-search-62921989.js → salla-search-6738ec5e.js} +11 -10
- package/dist/cjs/twilight-components.cjs.js +1 -1
- package/dist/collection/components/salla-branches/salla-branches.js +8 -10
- package/dist/collection/components/salla-button/salla-button.js +63 -26
- package/dist/collection/components/salla-infinite-scroll/salla-infinite-scroll.js +4 -1
- package/dist/collection/components/salla-localization/salla-localization.js +25 -9
- package/dist/collection/components/salla-login/salla-login.js +32 -17
- package/dist/collection/components/salla-modal/salla-modal.js +84 -47
- package/dist/collection/components/salla-offer/salla-offer.js +29 -9
- package/dist/collection/components/salla-product-availability/salla-product-availability.js +11 -5
- package/dist/collection/components/salla-rating/salla-rating.js +35 -5
- package/dist/collection/components/salla-search/salla-search.js +3 -0
- package/dist/collection/components/salla-tel-input/salla-tel-input.js +30 -14
- package/dist/collection/components/salla-verify/salla-verify.js +43 -50
- package/dist/collection/plugins/tailwind-theme/index.js +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/salla-branches.entry.js +7 -8
- package/dist/esm/salla-button_7.entry.js +156 -56
- package/dist/esm/salla-infinite-scroll.entry.js +3 -0
- package/dist/esm/salla-offer.entry.js +10 -2
- package/dist/esm/salla-product-availability.entry.js +6 -0
- package/dist/esm/salla-rating.entry.js +12 -2
- package/dist/esm/{salla-search-96520d15.js → salla-search-90231876.js} +11 -10
- package/dist/esm/twilight-components.js +1 -1
- package/dist/twilight-components/index.esm.js +1 -1
- package/dist/twilight-components/p-2abf9fc5.js +1 -0
- package/dist/twilight-components/p-5a498763.entry.js +1 -0
- package/dist/twilight-components/p-9b41d0b5.entry.js +1 -0
- package/dist/twilight-components/p-f36fa4c6.entry.js +1 -0
- package/dist/twilight-components/twilight-components.esm.js +1 -1
- package/dist/types/components/salla-branches/salla-branches.d.ts +0 -1
- package/dist/types/components/salla-button/salla-button.d.ts +32 -1
- package/dist/types/components/salla-infinite-scroll/salla-infinite-scroll.d.ts +3 -0
- package/dist/types/components/salla-localization/salla-localization.d.ts +10 -2
- package/dist/types/components/salla-login/salla-login.d.ts +14 -1
- package/dist/types/components/salla-modal/salla-modal.d.ts +37 -2
- package/dist/types/components/salla-offer/salla-offer.d.ts +9 -1
- package/dist/types/components/salla-product-availability/salla-product-availability.d.ts +10 -1
- package/dist/types/components/salla-rating/salla-rating.d.ts +10 -0
- package/dist/types/components/salla-search/salla-search.d.ts +3 -0
- package/dist/types/components/salla-tel-input/salla-tel-input.d.ts +15 -1
- package/dist/types/components/salla-verify/salla-verify.d.ts +26 -4
- package/dist/types/components.d.ts +209 -10
- package/example/.DS_Store +0 -0
- package/example/currencies +23 -0
- package/example/dist/.DS_Store +0 -0
- package/example/dist/twilight.js +1 -1
- package/example/index.html +3 -45
- package/example/languages +17 -0
- package/example/products/search +13 -0
- package/package.json +1 -1
- package/dist/twilight-components/p-352ce785.js +0 -1
- package/dist/twilight-components/p-9cabc8a4.entry.js +0 -1
- package/dist/twilight-components/p-a841c013.entry.js +0 -1
- package/dist/twilight-components/p-fbfd14a6.entry.js +0 -1
|
@@ -16,18 +16,52 @@ export namespace Components {
|
|
|
16
16
|
"show": () => Promise<HTMLElement>;
|
|
17
17
|
}
|
|
18
18
|
interface SallaButton {
|
|
19
|
+
/**
|
|
20
|
+
* Button Style
|
|
21
|
+
*/
|
|
19
22
|
"btnStyle": 'primary' | 'outline' | 'outline-primary' | 'danger';
|
|
23
|
+
/**
|
|
24
|
+
* Add `disabled` attribute
|
|
25
|
+
*/
|
|
20
26
|
"disable": () => Promise<void>;
|
|
27
|
+
/**
|
|
28
|
+
* Is the button currently disabled
|
|
29
|
+
*/
|
|
21
30
|
"disabled": boolean;
|
|
31
|
+
/**
|
|
32
|
+
* Remove `disabled` attribute
|
|
33
|
+
*/
|
|
22
34
|
"enable": () => Promise<void>;
|
|
35
|
+
/**
|
|
36
|
+
* Run loading animation
|
|
37
|
+
*/
|
|
23
38
|
"load": () => Promise<HTMLElement>;
|
|
39
|
+
/**
|
|
40
|
+
* If there is need to change loader position, pass the position
|
|
41
|
+
*/
|
|
24
42
|
"loaderPosition": 'start' | 'end' | 'center' | 'before';
|
|
43
|
+
/**
|
|
44
|
+
* Is the button currently loading
|
|
45
|
+
*/
|
|
25
46
|
"loading": boolean;
|
|
47
|
+
/**
|
|
48
|
+
* Changing the body of the button
|
|
49
|
+
* @param html
|
|
50
|
+
*/
|
|
26
51
|
"setText": (html: string) => Promise<HTMLElement>;
|
|
52
|
+
/**
|
|
53
|
+
* Stop loading animation
|
|
54
|
+
*/
|
|
27
55
|
"stop": () => Promise<HTMLElement>;
|
|
56
|
+
/**
|
|
57
|
+
* Is the button wide
|
|
58
|
+
*/
|
|
28
59
|
"wide": boolean;
|
|
29
60
|
}
|
|
30
61
|
interface SallaInfiniteScroll {
|
|
62
|
+
/**
|
|
63
|
+
* Is there is need to autoload next page when scroll
|
|
64
|
+
*/
|
|
31
65
|
"autoload": boolean;
|
|
32
66
|
/**
|
|
33
67
|
* Class selector to know the container if it's not the host `<salla-infinite-scroll>`
|
|
@@ -43,7 +77,13 @@ export namespace Components {
|
|
|
43
77
|
"nextPage": string;
|
|
44
78
|
}
|
|
45
79
|
interface SallaLocalization {
|
|
80
|
+
/**
|
|
81
|
+
* Hide the component
|
|
82
|
+
*/
|
|
46
83
|
"hide": () => Promise<HTMLElement>;
|
|
84
|
+
/**
|
|
85
|
+
* Show the component
|
|
86
|
+
*/
|
|
47
87
|
"show": () => Promise<HTMLElement>;
|
|
48
88
|
"submit": () => Promise<void>;
|
|
49
89
|
}
|
|
@@ -51,56 +91,150 @@ export namespace Components {
|
|
|
51
91
|
"isEmailAllowed": boolean;
|
|
52
92
|
"isEmailRequired": boolean;
|
|
53
93
|
"isMobileAllowed": boolean;
|
|
94
|
+
/**
|
|
95
|
+
* Show login component
|
|
96
|
+
*/
|
|
54
97
|
"show": () => Promise<HTMLElement>;
|
|
55
98
|
}
|
|
56
99
|
interface SallaModal {
|
|
57
100
|
"error": boolean;
|
|
101
|
+
/**
|
|
102
|
+
* hide the modal
|
|
103
|
+
*/
|
|
58
104
|
"hide": () => Promise<HTMLElement>;
|
|
105
|
+
/**
|
|
106
|
+
* Icon css class, default for types `error` is `sicon-alert-engine`, `success` is `sicon-check-circle2`
|
|
107
|
+
*/
|
|
59
108
|
"icon": string;
|
|
109
|
+
/**
|
|
110
|
+
* url of an image
|
|
111
|
+
*/
|
|
60
112
|
"imageIcon": string;
|
|
61
113
|
"isClosable": boolean;
|
|
114
|
+
/**
|
|
115
|
+
* Show loading in the middle
|
|
116
|
+
*/
|
|
62
117
|
"isLoading": boolean;
|
|
118
|
+
/**
|
|
119
|
+
* Start loading
|
|
120
|
+
*/
|
|
63
121
|
"loading": () => Promise<HTMLElement>;
|
|
64
122
|
"noPadding": boolean;
|
|
65
|
-
|
|
123
|
+
/**
|
|
124
|
+
* The position of the modal
|
|
125
|
+
*/
|
|
126
|
+
"position": 'top' | 'middle' | 'bottom';
|
|
66
127
|
"primary": boolean;
|
|
128
|
+
/**
|
|
129
|
+
* Change the title
|
|
130
|
+
* @param title
|
|
131
|
+
*/
|
|
67
132
|
"setTitle": (title: any) => Promise<HTMLElement>;
|
|
133
|
+
/**
|
|
134
|
+
* Show the modal
|
|
135
|
+
*/
|
|
68
136
|
"show": () => Promise<HTMLElement>;
|
|
137
|
+
/**
|
|
138
|
+
* Stop the loading
|
|
139
|
+
*/
|
|
69
140
|
"stopLoading": () => Promise<HTMLElement>;
|
|
70
141
|
"subTitle": string;
|
|
71
142
|
"subTitleFirst": boolean;
|
|
72
143
|
"success": boolean;
|
|
144
|
+
/**
|
|
145
|
+
* Show the modal on rendering
|
|
146
|
+
*/
|
|
73
147
|
"visible": boolean;
|
|
148
|
+
/**
|
|
149
|
+
* The size of the modal
|
|
150
|
+
*/
|
|
74
151
|
"width": 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'full';
|
|
75
152
|
}
|
|
76
153
|
interface SallaOffer {
|
|
77
|
-
|
|
154
|
+
/**
|
|
155
|
+
* Show the available offers for the product
|
|
156
|
+
* @param product_id
|
|
157
|
+
*/
|
|
158
|
+
"show": (product_id: number) => Promise<any>;
|
|
159
|
+
/**
|
|
160
|
+
* Show offer details
|
|
161
|
+
* @param offer
|
|
162
|
+
*/
|
|
78
163
|
"showOffer": (offer: any) => Promise<HTMLElement>;
|
|
79
164
|
}
|
|
80
165
|
interface SallaProductAvailability {
|
|
81
|
-
|
|
166
|
+
/**
|
|
167
|
+
* Notification channels
|
|
168
|
+
*/
|
|
169
|
+
"channels": 'sms' | 'mobile' | 'sms,mobile';
|
|
170
|
+
/**
|
|
171
|
+
* is current user already subscribed
|
|
172
|
+
*/
|
|
82
173
|
"isSubscribed": boolean;
|
|
174
|
+
/**
|
|
175
|
+
* product id that can visitor subscribe to its availability notification
|
|
176
|
+
*/
|
|
83
177
|
"productId": number;
|
|
84
178
|
}
|
|
85
179
|
interface SallaRating {
|
|
180
|
+
/**
|
|
181
|
+
* Show the rating modal
|
|
182
|
+
*/
|
|
86
183
|
"hide": () => Promise<HTMLElement>;
|
|
184
|
+
/**
|
|
185
|
+
* The order id, to rate on its products & shipping
|
|
186
|
+
*/
|
|
187
|
+
"orderId": number;
|
|
188
|
+
/**
|
|
189
|
+
* Show the rating modal
|
|
190
|
+
*/
|
|
87
191
|
"show": () => Promise<NodeJS.Timeout>;
|
|
88
192
|
}
|
|
89
193
|
interface SallaSearch {
|
|
90
194
|
}
|
|
91
195
|
interface SallaTelInput {
|
|
196
|
+
/**
|
|
197
|
+
* Current country_code
|
|
198
|
+
*/
|
|
92
199
|
"countryCode": string;
|
|
93
200
|
"countryKey": string;
|
|
201
|
+
/**
|
|
202
|
+
* Get current values
|
|
203
|
+
* @return
|
|
204
|
+
*/
|
|
94
205
|
"getValues": () => Promise<{ mobile: string; countryCode: string; countryKey: string; }>;
|
|
206
|
+
/**
|
|
207
|
+
* Is current data valid or not
|
|
208
|
+
* @return
|
|
209
|
+
*/
|
|
95
210
|
"isValid": () => Promise<boolean>;
|
|
211
|
+
/**
|
|
212
|
+
* Current mobile number
|
|
213
|
+
*/
|
|
96
214
|
"mobile": string;
|
|
97
215
|
}
|
|
98
216
|
interface SallaVerify {
|
|
217
|
+
/**
|
|
218
|
+
* should auto reloading the page after success verification
|
|
219
|
+
*/
|
|
99
220
|
"autoReload": boolean;
|
|
100
|
-
|
|
221
|
+
/**
|
|
222
|
+
* Verifying method
|
|
223
|
+
*/
|
|
224
|
+
"by": 'sms' | 'email';
|
|
225
|
+
/**
|
|
226
|
+
* Get current code
|
|
227
|
+
* @return
|
|
228
|
+
*/
|
|
101
229
|
"getCode": () => Promise<string>;
|
|
102
|
-
|
|
230
|
+
/**
|
|
231
|
+
* Show verifying modal
|
|
232
|
+
* @param data
|
|
233
|
+
*/
|
|
103
234
|
"show": (data: any) => Promise<void>;
|
|
235
|
+
/**
|
|
236
|
+
* Submitting url, default will use salla api auth: `salla.api.auth.verify`
|
|
237
|
+
*/
|
|
104
238
|
"url"?: string;
|
|
105
239
|
/**
|
|
106
240
|
* Should render component without modal
|
|
@@ -205,13 +339,31 @@ declare namespace LocalJSX {
|
|
|
205
339
|
"position"?: string;
|
|
206
340
|
}
|
|
207
341
|
interface SallaButton {
|
|
342
|
+
/**
|
|
343
|
+
* Button Style
|
|
344
|
+
*/
|
|
208
345
|
"btnStyle"?: 'primary' | 'outline' | 'outline-primary' | 'danger';
|
|
346
|
+
/**
|
|
347
|
+
* Is the button currently disabled
|
|
348
|
+
*/
|
|
209
349
|
"disabled"?: boolean;
|
|
350
|
+
/**
|
|
351
|
+
* If there is need to change loader position, pass the position
|
|
352
|
+
*/
|
|
210
353
|
"loaderPosition"?: 'start' | 'end' | 'center' | 'before';
|
|
354
|
+
/**
|
|
355
|
+
* Is the button currently loading
|
|
356
|
+
*/
|
|
211
357
|
"loading"?: boolean;
|
|
358
|
+
/**
|
|
359
|
+
* Is the button wide
|
|
360
|
+
*/
|
|
212
361
|
"wide"?: boolean;
|
|
213
362
|
}
|
|
214
363
|
interface SallaInfiniteScroll {
|
|
364
|
+
/**
|
|
365
|
+
* Is there is need to autoload next page when scroll
|
|
366
|
+
*/
|
|
215
367
|
"autoload"?: boolean;
|
|
216
368
|
/**
|
|
217
369
|
* Class selector to know the container if it's not the host `<salla-infinite-scroll>`
|
|
@@ -235,44 +387,91 @@ declare namespace LocalJSX {
|
|
|
235
387
|
}
|
|
236
388
|
interface SallaModal {
|
|
237
389
|
"error"?: boolean;
|
|
390
|
+
/**
|
|
391
|
+
* Icon css class, default for types `error` is `sicon-alert-engine`, `success` is `sicon-check-circle2`
|
|
392
|
+
*/
|
|
238
393
|
"icon"?: string;
|
|
394
|
+
/**
|
|
395
|
+
* url of an image
|
|
396
|
+
*/
|
|
239
397
|
"imageIcon"?: string;
|
|
240
398
|
"isClosable"?: boolean;
|
|
399
|
+
/**
|
|
400
|
+
* Show loading in the middle
|
|
401
|
+
*/
|
|
241
402
|
"isLoading"?: boolean;
|
|
242
403
|
"noPadding"?: boolean;
|
|
243
404
|
"onModalClosed"?: (event: CustomEvent<any>) => void;
|
|
244
405
|
"onModalOpened"?: (event: CustomEvent<any>) => void;
|
|
245
|
-
|
|
406
|
+
/**
|
|
407
|
+
* The position of the modal
|
|
408
|
+
*/
|
|
409
|
+
"position"?: 'top' | 'middle' | 'bottom';
|
|
246
410
|
"primary"?: boolean;
|
|
247
411
|
"subTitle"?: string;
|
|
248
412
|
"subTitleFirst"?: boolean;
|
|
249
413
|
"success"?: boolean;
|
|
414
|
+
/**
|
|
415
|
+
* Show the modal on rendering
|
|
416
|
+
*/
|
|
250
417
|
"visible"?: boolean;
|
|
418
|
+
/**
|
|
419
|
+
* The size of the modal
|
|
420
|
+
*/
|
|
251
421
|
"width"?: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'full';
|
|
252
422
|
}
|
|
253
423
|
interface SallaOffer {
|
|
254
424
|
}
|
|
255
425
|
interface SallaProductAvailability {
|
|
256
|
-
|
|
426
|
+
/**
|
|
427
|
+
* Notification channels
|
|
428
|
+
*/
|
|
429
|
+
"channels"?: 'sms' | 'mobile' | 'sms,mobile';
|
|
430
|
+
/**
|
|
431
|
+
* is current user already subscribed
|
|
432
|
+
*/
|
|
257
433
|
"isSubscribed"?: boolean;
|
|
434
|
+
/**
|
|
435
|
+
* product id that can visitor subscribe to its availability notification
|
|
436
|
+
*/
|
|
258
437
|
"productId"?: number;
|
|
259
438
|
}
|
|
260
439
|
interface SallaRating {
|
|
440
|
+
/**
|
|
441
|
+
* The order id, to rate on its products & shipping
|
|
442
|
+
*/
|
|
443
|
+
"orderId"?: number;
|
|
261
444
|
}
|
|
262
445
|
interface SallaSearch {
|
|
263
446
|
}
|
|
264
447
|
interface SallaTelInput {
|
|
448
|
+
/**
|
|
449
|
+
* Current country_code
|
|
450
|
+
*/
|
|
265
451
|
"countryCode"?: string;
|
|
266
452
|
"countryKey"?: string;
|
|
453
|
+
/**
|
|
454
|
+
* Current mobile number
|
|
455
|
+
*/
|
|
267
456
|
"mobile"?: string;
|
|
268
457
|
"onEnterClicked"?: (event: CustomEvent<any>) => void;
|
|
269
458
|
}
|
|
270
459
|
interface SallaVerify {
|
|
460
|
+
/**
|
|
461
|
+
* should auto reloading the page after success verification
|
|
462
|
+
*/
|
|
271
463
|
"autoReload"?: boolean;
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
464
|
+
/**
|
|
465
|
+
* Verifying method
|
|
466
|
+
*/
|
|
467
|
+
"by"?: 'sms' | 'email';
|
|
468
|
+
/**
|
|
469
|
+
* Event when success verification
|
|
470
|
+
*/
|
|
275
471
|
"onVerified"?: (event: CustomEvent<any>) => void;
|
|
472
|
+
/**
|
|
473
|
+
* Submitting url, default will use salla api auth: `salla.api.auth.verify`
|
|
474
|
+
*/
|
|
276
475
|
"url"?: string;
|
|
277
476
|
/**
|
|
278
477
|
* Should render component without modal
|
package/example/.DS_Store
CHANGED
|
Binary file
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{"data":[
|
|
2
|
+
{
|
|
3
|
+
"code" : "SAR",
|
|
4
|
+
"name" : "ريال سعودي",
|
|
5
|
+
"symbol" : "ر.س",
|
|
6
|
+
"amount" : 1,
|
|
7
|
+
"country_code": "sa"
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
"code" : "EUR",
|
|
11
|
+
"name" : "يورو",
|
|
12
|
+
"symbol" : "€",
|
|
13
|
+
"amount" : 0.22,
|
|
14
|
+
"country_code": "eu"
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"code" : "USD",
|
|
18
|
+
"name" : "دولار أمريكي",
|
|
19
|
+
"symbol" : "$",
|
|
20
|
+
"amount" : 0.27,
|
|
21
|
+
"country_code": "us"
|
|
22
|
+
}
|
|
23
|
+
]}
|
|
Binary file
|