@salla.sa/twilight-components 1.6.2 → 1.6.4

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 (152) hide show
  1. package/dist/cjs/loader.cjs.js +1 -1
  2. package/dist/cjs/salla-button_27.cjs.entry.js +27879 -0
  3. package/dist/cjs/salla-loyalty-prize-item.cjs.entry.js +26 -0
  4. package/dist/cjs/salla-scopes.cjs.entry.js +9 -6
  5. package/dist/cjs/salla-select.cjs.entry.js +159 -0
  6. package/dist/cjs/twilight-components.cjs.js +1 -1
  7. package/dist/collection/assets/svg/caret-down.svg +0 -1
  8. package/dist/collection/assets/svg/images.svg +0 -1
  9. package/dist/collection/collection-manifest.json +5 -0
  10. package/dist/collection/components/salla-datetime-picker/interfaces.js +4 -0
  11. package/dist/collection/components/salla-datetime-picker/salla-datetime-picker.css +13 -0
  12. package/dist/collection/components/salla-datetime-picker/salla-datetime-picker.js +1374 -0
  13. package/dist/collection/components/salla-file-upload/interfaces.js +42 -0
  14. package/dist/collection/components/salla-file-upload/salla-file-upload.css +219 -0
  15. package/dist/collection/components/salla-file-upload/salla-file-upload.js +1435 -0
  16. package/dist/collection/components/salla-gifting/gift-schema.js +4 -0
  17. package/dist/collection/components/salla-gifting/intefaces.js +4 -0
  18. package/dist/collection/components/salla-gifting/salla-gifting.css +20 -0
  19. package/dist/collection/components/salla-gifting/salla-gifting.js +564 -0
  20. package/dist/collection/components/salla-localization-modal/salla-localization-modal.js +23 -13
  21. package/dist/collection/components/salla-login-modal/salla-login-modal.js +46 -28
  22. package/dist/collection/components/salla-loyalty/salla-loyalty-prize-item.css +3 -0
  23. package/dist/collection/components/salla-loyalty/salla-loyalty-prize-item.js +69 -0
  24. package/dist/collection/components/salla-loyalty/salla-loyalty.css +0 -4
  25. package/dist/collection/components/salla-loyalty/salla-loyalty.js +29 -16
  26. package/dist/collection/components/salla-modal/salla-modal.css +6 -1
  27. package/dist/collection/components/salla-offer-modal/salla-offer-modal.js +37 -13
  28. package/dist/collection/components/salla-product-size-guide/salla-product-size-guide.js +23 -8
  29. package/dist/collection/components/salla-rating-modal/salla-rating-modal.js +87 -64
  30. package/dist/collection/components/salla-scopes/salla-scopes.js +11 -7
  31. package/dist/collection/components/salla-search/salla-search.js +1 -1
  32. package/dist/collection/components/salla-select/salla-select.css +86 -0
  33. package/dist/collection/components/salla-select/salla-select.js +610 -0
  34. package/dist/collection/components/salla-tel-input/interfaces.js +4 -0
  35. package/dist/collection/components/salla-tel-input/salla-tel-input.css +1 -2
  36. package/dist/collection/components/salla-tel-input/salla-tel-input.js +32 -3
  37. package/dist/collection/components/salla-verify/salla-verify.js +1 -1
  38. package/dist/collection/global/app.js +15 -12
  39. package/dist/components/_commonjsHelpers.js +24 -0
  40. package/dist/{esm/salla-social-share.entry.js → components/anime.es.js} +1 -132
  41. package/dist/components/index.d.ts +5 -0
  42. package/dist/components/index.js +5 -0
  43. package/dist/components/salla-datetime-picker.d.ts +11 -0
  44. package/dist/components/salla-datetime-picker.js +9 -0
  45. package/dist/components/salla-datetime-picker2.js +2876 -0
  46. package/dist/components/salla-file-upload.d.ts +11 -0
  47. package/dist/components/salla-file-upload.js +9 -0
  48. package/dist/components/salla-file-upload2.js +14623 -0
  49. package/dist/components/salla-gifting.d.ts +11 -0
  50. package/dist/components/salla-gifting.js +499 -0
  51. package/dist/components/salla-localization-modal.js +31 -16
  52. package/dist/components/salla-login-modal.js +35 -19
  53. package/dist/components/salla-loyalty-prize-item.d.ts +11 -0
  54. package/dist/components/salla-loyalty-prize-item.js +42 -0
  55. package/dist/components/salla-loyalty.js +28 -17
  56. package/dist/components/salla-modal2.js +1 -1
  57. package/dist/components/salla-offer-modal.js +42 -12
  58. package/dist/components/salla-product-size-guide.js +21 -6
  59. package/dist/components/salla-rating-modal.js +47 -19
  60. package/dist/components/salla-scopes.js +10 -6
  61. package/dist/components/salla-search.js +1 -1
  62. package/dist/components/salla-select.d.ts +11 -0
  63. package/dist/components/salla-select.js +199 -0
  64. package/dist/components/salla-social-share.js +1 -1308
  65. package/dist/components/salla-swiper2.js +9 -9
  66. package/dist/components/salla-tel-input2.js +15 -18
  67. package/dist/components/salla-verify2.js +1 -1
  68. package/dist/esm/loader.js +1 -1
  69. package/dist/esm/salla-button_27.entry.js +27849 -0
  70. package/dist/esm/salla-loyalty-prize-item.entry.js +22 -0
  71. package/dist/esm/salla-scopes.entry.js +9 -6
  72. package/dist/esm/salla-select.entry.js +155 -0
  73. package/dist/esm/twilight-components.js +1 -1
  74. package/dist/twilight-components/p-49125b6a.entry.js +4 -0
  75. package/dist/twilight-components/p-9a25753c.entry.js +4 -0
  76. package/dist/twilight-components/p-b7b9439d.entry.js +22 -0
  77. package/dist/twilight-components/p-df1eb1e5.entry.js +4 -0
  78. package/dist/twilight-components/twilight-components.esm.js +1 -1
  79. package/dist/types/components/salla-datetime-picker/interfaces.d.ts +8 -0
  80. package/dist/types/components/salla-datetime-picker/salla-datetime-picker.d.ts +250 -0
  81. package/dist/types/components/salla-file-upload/interfaces.d.ts +766 -0
  82. package/dist/types/components/salla-file-upload/salla-file-upload.d.ts +267 -0
  83. package/dist/types/components/salla-gifting/gift-schema.d.ts +20 -0
  84. package/dist/types/components/salla-gifting/intefaces.d.ts +18 -0
  85. package/dist/types/components/salla-gifting/salla-gifting.d.ts +98 -0
  86. package/dist/types/components/salla-localization-modal/salla-localization-modal.d.ts +3 -2
  87. package/dist/types/components/salla-login-modal/salla-login-modal.d.ts +13 -3
  88. package/dist/types/components/salla-loyalty/salla-loyalty-prize-item.d.ts +8 -0
  89. package/dist/types/components/salla-loyalty/salla-loyalty.d.ts +2 -0
  90. package/dist/types/components/salla-offer-modal/salla-offer-modal.d.ts +3 -1
  91. package/dist/types/components/salla-product-size-guide/salla-product-size-guide.d.ts +4 -0
  92. package/dist/types/components/salla-rating-modal/salla-rating-modal.d.ts +3 -2
  93. package/dist/types/components/salla-scopes/salla-scopes.d.ts +1 -0
  94. package/dist/types/components/salla-select/salla-select.d.ts +110 -0
  95. package/dist/types/components/salla-tel-input/interfaces.d.ts +4 -0
  96. package/dist/types/components/salla-tel-input/salla-tel-input.d.ts +3 -0
  97. package/dist/types/components.d.ts +1253 -10
  98. package/package.json +9 -3
  99. package/dist/cjs/Helper-8ae6a805.js +0 -28
  100. package/dist/cjs/arrow-right-3d137e4c.js +0 -13
  101. package/dist/cjs/cancel-ae668d91.js +0 -13
  102. package/dist/cjs/check-circle2-1aac98d1.js +0 -13
  103. package/dist/cjs/mail-2db058ee.js +0 -13
  104. package/dist/cjs/salla-button_10.cjs.entry.js +0 -2584
  105. package/dist/cjs/salla-infinite-scroll.cjs.entry.js +0 -93
  106. package/dist/cjs/salla-list-tile_2.cjs.entry.js +0 -80
  107. package/dist/cjs/salla-loyalty.cjs.entry.js +0 -229
  108. package/dist/cjs/salla-product-availability.cjs.entry.js +0 -128
  109. package/dist/cjs/salla-product-size-guide.cjs.entry.js +0 -52
  110. package/dist/cjs/salla-quantity-input.cjs.entry.js +0 -101
  111. package/dist/cjs/salla-rating-modal.cjs.entry.js +0 -169
  112. package/dist/cjs/salla-rating-stars.cjs.entry.js +0 -83
  113. package/dist/cjs/salla-social-share.cjs.entry.js +0 -1447
  114. package/dist/cjs/salla-swiper.cjs.entry.js +0 -5023
  115. package/dist/cjs/salla-tab-content_3.cjs.entry.js +0 -159
  116. package/dist/cjs/star2-8288e6e1.js +0 -13
  117. package/dist/esm/Helper-e1d414a5.js +0 -26
  118. package/dist/esm/arrow-right-1c3e04f2.js +0 -11
  119. package/dist/esm/cancel-41a92070.js +0 -11
  120. package/dist/esm/check-circle2-f6e5f685.js +0 -11
  121. package/dist/esm/mail-9d5204c6.js +0 -11
  122. package/dist/esm/salla-button_10.entry.js +0 -2571
  123. package/dist/esm/salla-infinite-scroll.entry.js +0 -89
  124. package/dist/esm/salla-list-tile_2.entry.js +0 -75
  125. package/dist/esm/salla-loyalty.entry.js +0 -225
  126. package/dist/esm/salla-product-availability.entry.js +0 -124
  127. package/dist/esm/salla-product-size-guide.entry.js +0 -48
  128. package/dist/esm/salla-quantity-input.entry.js +0 -97
  129. package/dist/esm/salla-rating-modal.entry.js +0 -165
  130. package/dist/esm/salla-rating-stars.entry.js +0 -79
  131. package/dist/esm/salla-swiper.entry.js +0 -5019
  132. package/dist/esm/salla-tab-content_3.entry.js +0 -153
  133. package/dist/esm/star2-b134fc74.js +0 -11
  134. package/dist/twilight-components/p-0d498694.entry.js +0 -4
  135. package/dist/twilight-components/p-14f0ff17.entry.js +0 -4
  136. package/dist/twilight-components/p-335abbbb.entry.js +0 -4
  137. package/dist/twilight-components/p-4cafb11b.entry.js +0 -4
  138. package/dist/twilight-components/p-5e63e308.entry.js +0 -4
  139. package/dist/twilight-components/p-5fb32395.entry.js +0 -4
  140. package/dist/twilight-components/p-648e74e5.entry.js +0 -4
  141. package/dist/twilight-components/p-6a3adf55.entry.js +0 -4
  142. package/dist/twilight-components/p-6da4bb74.entry.js +0 -4
  143. package/dist/twilight-components/p-897b2018.js +0 -4
  144. package/dist/twilight-components/p-93708e1e.js +0 -4
  145. package/dist/twilight-components/p-9d236cf4.entry.js +0 -4
  146. package/dist/twilight-components/p-9d2ca9c8.js +0 -4
  147. package/dist/twilight-components/p-af7d5660.js +0 -4
  148. package/dist/twilight-components/p-bdbd2386.entry.js +0 -4
  149. package/dist/twilight-components/p-cac3db69.entry.js +0 -4
  150. package/dist/twilight-components/p-d914a212.js +0 -4
  151. package/dist/twilight-components/p-dace8e6d.js +0 -4
  152. package/dist/twilight-components/p-f9253fda.entry.js +0 -4
@@ -0,0 +1,610 @@
1
+ /*!
2
+ * Crafted with ❤ by Salla
3
+ */
4
+ import { Component, Host, Prop, h } from '@stencil/core';
5
+ export class SallaSelect {
6
+ constructor() {
7
+ /**
8
+ * Sets label
9
+ */
10
+ this.label = undefined;
11
+ /**
12
+ * Can be an array of objects or array of strings.
13
+ * When using objects, will look for a text, value and disabled keys.
14
+ */
15
+ this.items = [];
16
+ /**
17
+ * Set property of items’s text value
18
+ */
19
+ this.itemText = "text";
20
+ /**
21
+ * Set property of items’s value - must be primitive.
22
+ * Dot notation is supported.
23
+ */
24
+ this.itemValue = "value";
25
+ /**
26
+ * Set property of items’s disabled value
27
+ */
28
+ this.itemDisabled = 'disabled';
29
+ /**
30
+ * Sizing options
31
+ */
32
+ this.size = 'normal';
33
+ /**
34
+ * The selected value
35
+ */
36
+ this.value = undefined;
37
+ /**
38
+ * Enable autofocus
39
+ */
40
+ this.autofocus = false;
41
+ /**
42
+ * Add input clear functionality, default icon is `sicon-cancel`
43
+ */
44
+ this.clearable = false;
45
+ /**
46
+ * Applied when using clearable and the input is dirty
47
+ */
48
+ this.clearIcon = 'sicon-cancel';
49
+ /**
50
+ * Applies specified color to the control.
51
+ */
52
+ this.color = 'primary';
53
+ /**
54
+ * Remove elevation or box shadow.
55
+ */
56
+ this.flat = undefined;
57
+ /**
58
+ * Disable the input
59
+ */
60
+ this.disabled = false;
61
+ /**
62
+ * Displays linear progress bar.
63
+ */
64
+ this.loading = false;
65
+ /**
66
+ * Specifies which color is applied to the progress bar.
67
+ */
68
+ this.loadingColor = 'primary';
69
+ /**
70
+ * Hint text
71
+ */
72
+ this.hint = undefined;
73
+ /**
74
+ * Forces hint to always be visible.
75
+ */
76
+ this.persistHint = false;
77
+ /**
78
+ * Sets the input’s placeholder text.
79
+ */
80
+ this.placeholder = undefined;
81
+ /**
82
+ * Enable multiple item selection
83
+ */
84
+ this.multiple = false;
85
+ /**
86
+ * Enable multiple item selection
87
+ */
88
+ this.autocomplete = false;
89
+ /**
90
+ * Enable multiple item selection
91
+ */
92
+ this.required = false;
93
+ /**
94
+ * Changes display of selections to chips
95
+ */
96
+ this.chips = false;
97
+ /**
98
+ * Define appearance of the component
99
+ */
100
+ this.shape = 'outlined';
101
+ /**
102
+ * Changes the selection behavior to return the object directly
103
+ * rather than the value specified with item-value
104
+ */
105
+ this.returnObject = false;
106
+ /**
107
+ * Hides hint if any
108
+ */
109
+ this.hideDetail = false;
110
+ }
111
+ selectClass() {
112
+ return `s-select-field s-select-${this.shape} ${this.color} ${this.size}`;
113
+ }
114
+ onSelectedItemChange(event) {
115
+ let selectedIndex = event.target.selectedIndex;
116
+ if (selectedIndex < 0) {
117
+ this.value = undefined;
118
+ return;
119
+ }
120
+ let selectedItem = this.items[!!this.placeholder ? selectedIndex - 1 : selectedIndex];
121
+ this.value = this.returnObject ? selectedItem : selectedItem[this.itemValue];
122
+ console.log("🚀 ~ file: salla-select.tsx ~ line 153 ~ SallaSelect ~ onSelectedItemChange ~ this.value", this.value);
123
+ }
124
+ generateHint() {
125
+ if (!this.persistHint && !this.value) {
126
+ return "";
127
+ }
128
+ return h("div", { class: "s-select-hint" }, this.hint);
129
+ }
130
+ checkForSelected(item) {
131
+ if (this.returnObject && !!this.value) {
132
+ return item[this.itemValue] = this.value[this.itemValue];
133
+ }
134
+ return item[this.itemValue] == this.value;
135
+ }
136
+ render() {
137
+ return (h(Host, null,
138
+ !!this.label ?
139
+ h("label", { htmlFor: "s-select", class: "s-select-label" }, this.label)
140
+ : "",
141
+ h("select", { multiple: this.multiple, autocomplete: this.autocomplete ? 'on' : 'off', disabled: this.disabled, autoFocus: this.autofocus, id: "s-select", class: this.selectClass(), onChange: this.onSelectedItemChange.bind(this) },
142
+ !!this.placeholder ?
143
+ h("option", { selected: !this.value }, this.placeholder)
144
+ : "",
145
+ this.items.map((item) =>
146
+ // item instanceof Object ?
147
+ h("option", { label: item[this.itemText], value: item[this.itemValue], selected: this.checkForSelected(item), disabled: item[this.itemDisabled] })
148
+ // :
149
+ // <option label={item} value={item} selected={item == this.value} disabled={item == this.itemDisabled}></option>
150
+ )),
151
+ h("div", { class: { "s-hidden": this.hideDetail } }, this.generateHint())));
152
+ }
153
+ static get is() { return "salla-select"; }
154
+ static get originalStyleUrls() { return {
155
+ "$": ["salla-select.scss"]
156
+ }; }
157
+ static get styleUrls() { return {
158
+ "$": ["salla-select.css"]
159
+ }; }
160
+ static get properties() { return {
161
+ "label": {
162
+ "type": "string",
163
+ "mutable": false,
164
+ "complexType": {
165
+ "original": "string",
166
+ "resolved": "string",
167
+ "references": {}
168
+ },
169
+ "required": false,
170
+ "optional": false,
171
+ "docs": {
172
+ "tags": [],
173
+ "text": "Sets label"
174
+ },
175
+ "attribute": "label",
176
+ "reflect": false,
177
+ "defaultValue": "undefined"
178
+ },
179
+ "items": {
180
+ "type": "unknown",
181
+ "mutable": false,
182
+ "complexType": {
183
+ "original": "any[]",
184
+ "resolved": "any[]",
185
+ "references": {}
186
+ },
187
+ "required": false,
188
+ "optional": false,
189
+ "docs": {
190
+ "tags": [],
191
+ "text": "Can be an array of objects or array of strings. \nWhen using objects, will look for a text, value and disabled keys."
192
+ },
193
+ "defaultValue": "[]"
194
+ },
195
+ "itemText": {
196
+ "type": "string",
197
+ "mutable": false,
198
+ "complexType": {
199
+ "original": "string",
200
+ "resolved": "string",
201
+ "references": {}
202
+ },
203
+ "required": false,
204
+ "optional": false,
205
+ "docs": {
206
+ "tags": [],
207
+ "text": "Set property of items\u2019s text value"
208
+ },
209
+ "attribute": "item-text",
210
+ "reflect": false,
211
+ "defaultValue": "\"text\""
212
+ },
213
+ "itemValue": {
214
+ "type": "string",
215
+ "mutable": false,
216
+ "complexType": {
217
+ "original": "string",
218
+ "resolved": "string",
219
+ "references": {}
220
+ },
221
+ "required": false,
222
+ "optional": false,
223
+ "docs": {
224
+ "tags": [],
225
+ "text": "Set property of items\u2019s value - must be primitive. \nDot notation is supported."
226
+ },
227
+ "attribute": "item-value",
228
+ "reflect": false,
229
+ "defaultValue": "\"value\""
230
+ },
231
+ "itemDisabled": {
232
+ "type": "string",
233
+ "mutable": false,
234
+ "complexType": {
235
+ "original": "string",
236
+ "resolved": "string",
237
+ "references": {}
238
+ },
239
+ "required": false,
240
+ "optional": false,
241
+ "docs": {
242
+ "tags": [],
243
+ "text": "Set property of items\u2019s disabled value"
244
+ },
245
+ "attribute": "item-disabled",
246
+ "reflect": false,
247
+ "defaultValue": "'disabled'"
248
+ },
249
+ "size": {
250
+ "type": "string",
251
+ "mutable": false,
252
+ "complexType": {
253
+ "original": "'x-large' | 'large' | 'normal' | 'small' | 'x-small'",
254
+ "resolved": "\"large\" | \"normal\" | \"small\" | \"x-large\" | \"x-small\"",
255
+ "references": {}
256
+ },
257
+ "required": false,
258
+ "optional": false,
259
+ "docs": {
260
+ "tags": [],
261
+ "text": "Sizing options"
262
+ },
263
+ "attribute": "size",
264
+ "reflect": false,
265
+ "defaultValue": "'normal'"
266
+ },
267
+ "value": {
268
+ "type": "any",
269
+ "mutable": true,
270
+ "complexType": {
271
+ "original": "any",
272
+ "resolved": "any",
273
+ "references": {}
274
+ },
275
+ "required": false,
276
+ "optional": false,
277
+ "docs": {
278
+ "tags": [],
279
+ "text": "The selected value"
280
+ },
281
+ "attribute": "value",
282
+ "reflect": false,
283
+ "defaultValue": "undefined"
284
+ },
285
+ "autofocus": {
286
+ "type": "boolean",
287
+ "mutable": false,
288
+ "complexType": {
289
+ "original": "boolean",
290
+ "resolved": "boolean",
291
+ "references": {}
292
+ },
293
+ "required": false,
294
+ "optional": false,
295
+ "docs": {
296
+ "tags": [],
297
+ "text": "Enable autofocus"
298
+ },
299
+ "attribute": "autofocus",
300
+ "reflect": false,
301
+ "defaultValue": "false"
302
+ },
303
+ "clearable": {
304
+ "type": "boolean",
305
+ "mutable": false,
306
+ "complexType": {
307
+ "original": "boolean",
308
+ "resolved": "boolean",
309
+ "references": {}
310
+ },
311
+ "required": false,
312
+ "optional": false,
313
+ "docs": {
314
+ "tags": [],
315
+ "text": "Add input clear functionality, default icon is `sicon-cancel`"
316
+ },
317
+ "attribute": "clearable",
318
+ "reflect": false,
319
+ "defaultValue": "false"
320
+ },
321
+ "clearIcon": {
322
+ "type": "string",
323
+ "mutable": false,
324
+ "complexType": {
325
+ "original": "string",
326
+ "resolved": "string",
327
+ "references": {}
328
+ },
329
+ "required": false,
330
+ "optional": false,
331
+ "docs": {
332
+ "tags": [],
333
+ "text": "Applied when using clearable and the input is dirty"
334
+ },
335
+ "attribute": "clear-icon",
336
+ "reflect": false,
337
+ "defaultValue": "'sicon-cancel'"
338
+ },
339
+ "color": {
340
+ "type": "string",
341
+ "mutable": false,
342
+ "complexType": {
343
+ "original": "'primary' | 'success' | 'warning' | 'danger' | 'light' | 'gray' | 'dark'",
344
+ "resolved": "\"danger\" | \"dark\" | \"gray\" | \"light\" | \"primary\" | \"success\" | \"warning\"",
345
+ "references": {}
346
+ },
347
+ "required": false,
348
+ "optional": false,
349
+ "docs": {
350
+ "tags": [],
351
+ "text": "Applies specified color to the control."
352
+ },
353
+ "attribute": "color",
354
+ "reflect": false,
355
+ "defaultValue": "'primary'"
356
+ },
357
+ "flat": {
358
+ "type": "boolean",
359
+ "mutable": false,
360
+ "complexType": {
361
+ "original": "boolean",
362
+ "resolved": "boolean",
363
+ "references": {}
364
+ },
365
+ "required": false,
366
+ "optional": false,
367
+ "docs": {
368
+ "tags": [],
369
+ "text": "Remove elevation or box shadow."
370
+ },
371
+ "attribute": "flat",
372
+ "reflect": false,
373
+ "defaultValue": "undefined"
374
+ },
375
+ "disabled": {
376
+ "type": "boolean",
377
+ "mutable": false,
378
+ "complexType": {
379
+ "original": "boolean",
380
+ "resolved": "boolean",
381
+ "references": {}
382
+ },
383
+ "required": false,
384
+ "optional": false,
385
+ "docs": {
386
+ "tags": [],
387
+ "text": "Disable the input"
388
+ },
389
+ "attribute": "disabled",
390
+ "reflect": false,
391
+ "defaultValue": "false"
392
+ },
393
+ "loading": {
394
+ "type": "boolean",
395
+ "mutable": false,
396
+ "complexType": {
397
+ "original": "boolean",
398
+ "resolved": "boolean",
399
+ "references": {}
400
+ },
401
+ "required": false,
402
+ "optional": false,
403
+ "docs": {
404
+ "tags": [],
405
+ "text": "Displays linear progress bar."
406
+ },
407
+ "attribute": "loading",
408
+ "reflect": false,
409
+ "defaultValue": "false"
410
+ },
411
+ "loadingColor": {
412
+ "type": "string",
413
+ "mutable": false,
414
+ "complexType": {
415
+ "original": "string",
416
+ "resolved": "string",
417
+ "references": {}
418
+ },
419
+ "required": false,
420
+ "optional": false,
421
+ "docs": {
422
+ "tags": [],
423
+ "text": "Specifies which color is applied to the progress bar."
424
+ },
425
+ "attribute": "loading-color",
426
+ "reflect": false,
427
+ "defaultValue": "'primary'"
428
+ },
429
+ "hint": {
430
+ "type": "string",
431
+ "mutable": false,
432
+ "complexType": {
433
+ "original": "string",
434
+ "resolved": "string",
435
+ "references": {}
436
+ },
437
+ "required": false,
438
+ "optional": false,
439
+ "docs": {
440
+ "tags": [],
441
+ "text": "Hint text"
442
+ },
443
+ "attribute": "hint",
444
+ "reflect": false,
445
+ "defaultValue": "undefined"
446
+ },
447
+ "persistHint": {
448
+ "type": "boolean",
449
+ "mutable": false,
450
+ "complexType": {
451
+ "original": "boolean",
452
+ "resolved": "boolean",
453
+ "references": {}
454
+ },
455
+ "required": false,
456
+ "optional": false,
457
+ "docs": {
458
+ "tags": [],
459
+ "text": "Forces hint to always be visible."
460
+ },
461
+ "attribute": "persist-hint",
462
+ "reflect": false,
463
+ "defaultValue": "false"
464
+ },
465
+ "placeholder": {
466
+ "type": "string",
467
+ "mutable": false,
468
+ "complexType": {
469
+ "original": "string",
470
+ "resolved": "string",
471
+ "references": {}
472
+ },
473
+ "required": false,
474
+ "optional": false,
475
+ "docs": {
476
+ "tags": [],
477
+ "text": "Sets the input\u2019s placeholder text."
478
+ },
479
+ "attribute": "placeholder",
480
+ "reflect": false,
481
+ "defaultValue": "undefined"
482
+ },
483
+ "multiple": {
484
+ "type": "boolean",
485
+ "mutable": false,
486
+ "complexType": {
487
+ "original": "boolean",
488
+ "resolved": "boolean",
489
+ "references": {}
490
+ },
491
+ "required": false,
492
+ "optional": false,
493
+ "docs": {
494
+ "tags": [],
495
+ "text": "Enable multiple item selection"
496
+ },
497
+ "attribute": "multiple",
498
+ "reflect": false,
499
+ "defaultValue": "false"
500
+ },
501
+ "autocomplete": {
502
+ "type": "boolean",
503
+ "mutable": false,
504
+ "complexType": {
505
+ "original": "boolean",
506
+ "resolved": "boolean",
507
+ "references": {}
508
+ },
509
+ "required": false,
510
+ "optional": false,
511
+ "docs": {
512
+ "tags": [],
513
+ "text": "Enable multiple item selection"
514
+ },
515
+ "attribute": "autocomplete",
516
+ "reflect": false,
517
+ "defaultValue": "false"
518
+ },
519
+ "required": {
520
+ "type": "boolean",
521
+ "mutable": false,
522
+ "complexType": {
523
+ "original": "boolean",
524
+ "resolved": "boolean",
525
+ "references": {}
526
+ },
527
+ "required": false,
528
+ "optional": false,
529
+ "docs": {
530
+ "tags": [],
531
+ "text": "Enable multiple item selection"
532
+ },
533
+ "attribute": "required",
534
+ "reflect": false,
535
+ "defaultValue": "false"
536
+ },
537
+ "chips": {
538
+ "type": "boolean",
539
+ "mutable": false,
540
+ "complexType": {
541
+ "original": "boolean",
542
+ "resolved": "boolean",
543
+ "references": {}
544
+ },
545
+ "required": false,
546
+ "optional": false,
547
+ "docs": {
548
+ "tags": [],
549
+ "text": "Changes display of selections to chips"
550
+ },
551
+ "attribute": "chips",
552
+ "reflect": false,
553
+ "defaultValue": "false"
554
+ },
555
+ "shape": {
556
+ "type": "string",
557
+ "mutable": false,
558
+ "complexType": {
559
+ "original": "'underline' | 'outlined'",
560
+ "resolved": "\"outlined\" | \"underline\"",
561
+ "references": {}
562
+ },
563
+ "required": false,
564
+ "optional": false,
565
+ "docs": {
566
+ "tags": [],
567
+ "text": "Define appearance of the component"
568
+ },
569
+ "attribute": "shape",
570
+ "reflect": false,
571
+ "defaultValue": "'outlined'"
572
+ },
573
+ "returnObject": {
574
+ "type": "boolean",
575
+ "mutable": false,
576
+ "complexType": {
577
+ "original": "boolean",
578
+ "resolved": "boolean",
579
+ "references": {}
580
+ },
581
+ "required": false,
582
+ "optional": false,
583
+ "docs": {
584
+ "tags": [],
585
+ "text": "Changes the selection behavior to return the object directly \nrather than the value specified with item-value"
586
+ },
587
+ "attribute": "return-object",
588
+ "reflect": false,
589
+ "defaultValue": "false"
590
+ },
591
+ "hideDetail": {
592
+ "type": "boolean",
593
+ "mutable": false,
594
+ "complexType": {
595
+ "original": "boolean",
596
+ "resolved": "boolean",
597
+ "references": {}
598
+ },
599
+ "required": false,
600
+ "optional": false,
601
+ "docs": {
602
+ "tags": [],
603
+ "text": "Hides hint if any"
604
+ },
605
+ "attribute": "hide-detail",
606
+ "reflect": false,
607
+ "defaultValue": "false"
608
+ }
609
+ }; }
610
+ }
@@ -0,0 +1,4 @@
1
+ /*!
2
+ * Crafted with ❤ by Salla
3
+ */
4
+ export {};
@@ -75,8 +75,7 @@
75
75
  transform: translateY(-50%);
76
76
  }
77
77
  .iti__arrow:after {
78
- content: "\e96d";
79
- font-family: sallaicons;
78
+ content: url("data:image/svg+xml,<svg version='1.1' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'><title>keyboard_arrow_down</title><path d='M9.875 11.104l6.125 6.125 6.125-6.125 1.875 1.875-8 8-8-8z'></path></svg>");
80
79
  font-size: 16px;
81
80
  color: #999;
82
81
  opacity: 0.65;
@@ -74,14 +74,18 @@ export class SallaTelInput {
74
74
  });
75
75
  this.phoneInput.addEventListener("countrychange", () => {
76
76
  let data = this.iti.getSelectedCountryData();
77
- this.countryCodeInput.value = data.iso2.toUpperCase();
77
+ let value = data.iso2.toUpperCase();
78
+ this.countryCodeInput.value = value;
79
+ this.countryCode = value;
80
+ this.phoneEntered.emit({ number: this.phone, country_code: value });
78
81
  });
79
82
  // on blur: validate
80
83
  // this.phoneInput.addEventListener('blur', () => this.isValid());
81
84
  // on keyup / change flag: reset
82
- this.phoneInput.addEventListener('input', e => {
85
+ this.phoneInput.addEventListener('input', (e) => {
83
86
  salla.helpers.inputDigitsOnly(e.target);
84
87
  this.reset();
88
+ this.phoneEntered.emit({ number: e.target.value, country_code: this.countryCode });
85
89
  });
86
90
  }
87
91
  reset() {
@@ -89,9 +93,14 @@ export class SallaTelInput {
89
93
  this.errorMsg.innerHTML = "";
90
94
  }
91
95
  ;
96
+ handleCountryInput(event) {
97
+ if (!!this.phone) {
98
+ this.phoneEntered.emit({ number: event.target.value, country_code: this.countryCode });
99
+ }
100
+ }
92
101
  render() {
93
102
  return (h(Host, { class: "s-tel-input" },
94
- h("input", { type: "tel", name: this.name, value: this.phone, ref: el => this.phoneInput = el, class: "s-tel-input-control tel-input s-ltr" }),
103
+ h("input", { type: "tel", name: this.name, value: this.phone, onChange: (event) => this.handleCountryInput(event), ref: el => this.phoneInput = el, enterkeyhint: "next", autocomplete: "tel", class: "s-tel-input-control tel-input s-ltr" }),
95
104
  h("span", { class: "s-tel-input-error-msg", ref: el => this.errorMsg = el }),
96
105
  h("input", { type: "hidden", name: "country_code", value: this.countryCode, ref: el => this.countryCodeInput = el, class: "country_code" })));
97
106
  }
@@ -185,6 +194,26 @@ export class SallaTelInput {
185
194
  "resolved": "any",
186
195
  "references": {}
187
196
  }
197
+ }, {
198
+ "method": "phoneEntered",
199
+ "name": "phoneEntered",
200
+ "bubbles": true,
201
+ "cancelable": true,
202
+ "composed": true,
203
+ "docs": {
204
+ "tags": [],
205
+ "text": ""
206
+ },
207
+ "complexType": {
208
+ "original": "Phone",
209
+ "resolved": "Phone",
210
+ "references": {
211
+ "Phone": {
212
+ "location": "import",
213
+ "path": "./interfaces"
214
+ }
215
+ }
216
+ }
188
217
  }]; }
189
218
  static get methods() { return {
190
219
  "getValues": {
@@ -164,7 +164,7 @@ export class SallaVerify {
164
164
  return (h("div", { class: "s-verify-body", ref: body => this.body = body },
165
165
  h("div", { class: "s-verify-message", innerHTML: salla.lang.get('pages.profile.verify_message') }),
166
166
  h("input", { type: "hidden", name: "code", maxlength: "4", required: true, ref: code => this.code = code }),
167
- h("div", { class: "s-verify-codes", dir: "ltr" }, [1, 2, 3, 4].map(() => h("input", { type: "number", maxlength: "1", class: "s-verify-input", required: true }))),
167
+ h("div", { class: "s-verify-codes", dir: "ltr" }, [1, 2, 3, 4].map(() => h("input", { type: "tel", autocomplete: "one-time-code", pattern: "[0-9]*", inputmode: "numeric", maxlength: "1", class: "s-verify-input", required: true }))),
168
168
  h("div", { slot: "footer", class: "s-verify-footer" },
169
169
  h("salla-button", { class: "s-verify-submit", "loader-position": 'center', disabled: true, onClick: () => this.submit(), ref: b => this.btn = b }, salla.lang.get('pages.profile.verify')),
170
170
  h("p", { class: "s-verify-resend-message", ref: el => this.resendMessage = el },