@salla.sa/twilight-components 1.0.33 → 1.0.34
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 +5 -6
- package/dist/cjs/salla-button_7.cjs.entry.js +143 -52
- 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 +6 -8
- package/dist/collection/components/salla-button/salla-button.js +62 -26
- package/dist/collection/components/salla-infinite-scroll/salla-infinite-scroll.js +4 -1
- package/dist/collection/components/salla-localization/salla-localization.js +11 -5
- 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 +5 -6
- package/dist/esm/salla-button_7.entry.js +143 -52
- 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-dd9469a1.entry.js +1 -0
- package/dist/twilight-components/p-ebc6e474.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 +6 -0
- 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/dist/.DS_Store +0 -0
- package/example/dist/twilight.js +1 -1
- package/example/index.html +2 -2
- 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
package/dist/cjs/index.cjs.js
CHANGED
package/dist/cjs/loader.cjs.js
CHANGED
|
@@ -14,7 +14,7 @@ const patchEsm = () => {
|
|
|
14
14
|
const defineCustomElements = (win, options) => {
|
|
15
15
|
if (typeof window === 'undefined') return Promise.resolve();
|
|
16
16
|
return patchEsm().then(() => {
|
|
17
|
-
return index.bootstrapLazy([["salla-button_7.cjs",[[
|
|
17
|
+
return index.bootstrapLazy([["salla-button_7.cjs",[[4,"salla-login",{"isEmailAllowed":[4,"is-email-allowed"],"isMobileAllowed":[4,"is-mobile-allowed"],"isEmailRequired":[4,"is-email-required"],"title":[32],"loginTypeTitle":[32],"loginText":[32],"smsLabel":[32],"mobileLabel":[32],"emailLabel":[32],"enterText":[32],"bySMSText":[32],"byEmailText":[32],"emailErrorMsg":[32],"firstNameLabel":[32],"lastNameLabel":[32],"firstNameErrorMsg":[32],"lastNameErrorMsg":[32],"show":[64]},[[0,"verified","onVerified"]]],[4,"salla-localization",{"languagesTitle":[32],"currenciesTitle":[32],"show":[64],"hide":[64],"submit":[64]}],[0,"salla-search",{"results":[32],"placeholder":[32],"noResultsText":[32]},[[0,"modalOpened","onModalOpen"],[0,"modalClosed","onModalClose"]]],[4,"salla-verify",{"withoutModal":[4,"without-modal"],"url":[513],"by":[1],"autoReload":[4,"auto-reload"],"title":[32],"getCode":[64],"show":[64]}],[0,"salla-tel-input",{"mobile":[1025],"countryCode":[1025,"country-code"],"countryKey":[1025,"country-key"],"mobileRequired":[32],"countryCodeLabel":[32],"mobileLabel":[32],"tooShort":[32],"tooLong":[32],"invalidCountryCode":[32],"invalidNumber":[32],"errorMap":[32],"getValues":[64],"isValid":[64]}],[4,"salla-button",{"btnStyle":[513,"btn-style"],"loading":[516],"disabled":[516],"loaderPosition":[1,"loader-position"],"wide":[4],"load":[64],"stop":[64],"setText":[64],"disable":[64],"enable":[64]}],[4,"salla-modal",{"error":[4],"success":[4],"primary":[4],"isClosable":[1028,"is-closable"],"width":[513],"position":[513],"visible":[516],"isLoading":[1540,"is-loading"],"subTitleFirst":[4,"sub-title-first"],"noPadding":[4,"no-padding"],"subTitle":[1,"sub-title"],"icon":[1],"imageIcon":[1,"image-icon"],"title":[32],"show":[64],"hide":[64],"setTitle":[64],"loading":[64],"stopLoading":[64]}]]],["salla-product-availability.cjs",[[4,"salla-product-availability",{"channels":[1],"productId":[2,"product-id"],"isSubscribed":[1028,"is-subscribed"],"subTitle":[32],"mobileLabel":[32],"emailLabel":[32],"emailPlaceholder":[32],"subscribedMessage":[32],"title_":[32],"emailErrorMsg":[32]}]]],["salla-branches.cjs",[[4,"salla-branches",{"position":[1],"displayAs":[1,"display-as"],"browseProductsFrom":[1,"browse-products-from"],"branches":[16],"current":[1026],"open":[32],"selected":[32],"isOpenedBefore":[32],"show":[64],"hide":[64]}]]],["salla-offer.cjs",[[0,"salla-offer",{"offer":[32],"show":[64],"showOffer":[64]}]]],["salla-rating.cjs",[[0,"salla-rating",{"orderId":[2,"order-id"],"order":[32],"show":[64],"hide":[64]}]]],["salla-infinite-scroll.cjs",[[4,"salla-infinite-scroll",{"nextPage":[1,"next-page"],"autoload":[4],"container":[1],"item":[1],"loadMore":[32],"noMore":[32],"failedToLoad":[32]}]]]], options);
|
|
18
18
|
});
|
|
19
19
|
};
|
|
20
20
|
|
|
@@ -11,8 +11,8 @@ const SallaBranches = class {
|
|
|
11
11
|
index.registerInstance(this, hostRef);
|
|
12
12
|
this.open = false;
|
|
13
13
|
this.isOpenedBefore = salla.localData.get("branch-choosed-before");
|
|
14
|
-
this.displayAs = 'default';
|
|
15
|
-
this.browseProductsFrom = 'all';
|
|
14
|
+
this.displayAs = 'default'; //todo:: change it to boolean, isPopup default false
|
|
15
|
+
this.browseProductsFrom = 'all'; //todo:: get better name
|
|
16
16
|
this.branches = [
|
|
17
17
|
{ id: 1, name: 'فرع الرياض', open: true, available: true, limited: false, tag: 'متوفر' },
|
|
18
18
|
{ id: 2, name: 'فرع جدة', open: false, available: false, limited: false, tag: 'غير متوفر' },
|
|
@@ -39,10 +39,9 @@ const SallaBranches = class {
|
|
|
39
39
|
: 'التسوق من فرع آخر';
|
|
40
40
|
};
|
|
41
41
|
salla.event.on('branches::show', () => this.show());
|
|
42
|
-
salla.event.on('languages::translations.loaded', () => {
|
|
43
|
-
this.ok = salla.lang.get('common.elements.ok');
|
|
44
|
-
});
|
|
42
|
+
salla.event.on('languages::translations.loaded', () => { var _a; return (_a = this.btn) === null || _a === void 0 ? void 0 : _a.setText(salla.lang.get('common.elements.ok')); });
|
|
45
43
|
}
|
|
44
|
+
//todo:: add description for all @methods
|
|
46
45
|
async show() {
|
|
47
46
|
return this.modal.show();
|
|
48
47
|
}
|
|
@@ -77,7 +76,7 @@ const SallaBranches = class {
|
|
|
77
76
|
index.h("span", { class: this.statusColor(branch) }, branch.tag)))))
|
|
78
77
|
:
|
|
79
78
|
index.h("select", { class: "s-branches-select", onInput: (event) => this.handelChange(event) }, this.branches.map(branch => (index.h("option", { value: branch.id, disabled: !branch.open, selected: this.selected == branch.id }, branch.name, " ", branch.open ? '' : '- مُغلق')))), this.isChoiceable() ?
|
|
80
|
-
index.h("slot", { name: "footer" }, index.h("salla-button", { ref: btn => this.btn = btn, onClick: () => this.handleSubmit(), class: "s-branches-submit", wide: true },
|
|
79
|
+
index.h("slot", { name: "footer" }, index.h("salla-button", { ref: btn => this.btn = btn, onClick: () => this.handleSubmit(), class: "s-branches-submit", wide: true }, salla.lang.get('common.elements.ok')))
|
|
81
80
|
: ''));
|
|
82
81
|
}
|
|
83
82
|
componentDidRender() {
|
|
@@ -4,20 +4,34 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
const index = require('./index-714023c8.js');
|
|
6
6
|
const Helper = require('./Helper-98cc9f18.js');
|
|
7
|
-
const sallaSearch = require('./salla-search-
|
|
7
|
+
const sallaSearch = require('./salla-search-6738ec5e.js');
|
|
8
8
|
|
|
9
9
|
const sallaButtonCss = ":host{display:block}";
|
|
10
10
|
|
|
11
11
|
const SallaButton = class {
|
|
12
12
|
constructor(hostRef) {
|
|
13
13
|
index.registerInstance(this, hostRef);
|
|
14
|
+
/**
|
|
15
|
+
* Button Style
|
|
16
|
+
*/
|
|
14
17
|
this.btnStyle = 'primary';
|
|
18
|
+
/**
|
|
19
|
+
* Is the button currently loading
|
|
20
|
+
*/
|
|
15
21
|
this.loading = false;
|
|
22
|
+
/**
|
|
23
|
+
* Is the button currently disabled
|
|
24
|
+
*/
|
|
16
25
|
this.disabled = false;
|
|
26
|
+
/**
|
|
27
|
+
* If there is need to change loader position, pass the position
|
|
28
|
+
*/
|
|
17
29
|
this.loaderPosition = 'before';
|
|
30
|
+
/**
|
|
31
|
+
* Is the button wide
|
|
32
|
+
*/
|
|
18
33
|
this.wide = false;
|
|
19
34
|
this.hostAttributes = {};
|
|
20
|
-
//============= Initiate Button Attributes =============//
|
|
21
35
|
for (let i = 0; i < this.host.attributes.length; i++) {
|
|
22
36
|
this.hostAttributes[this.host.attributes[i].name] = this.host.attributes[i].value;
|
|
23
37
|
}
|
|
@@ -25,7 +39,7 @@ const SallaButton = class {
|
|
|
25
39
|
this.hostAttributes.class += ' s-button-btn btn--has-loading'
|
|
26
40
|
+ ' s-button-' + this.btnStyle
|
|
27
41
|
+ (this.wide ? ' s-button-wide ' : '')
|
|
28
|
-
+ ' loader-' + this.loaderPosition
|
|
42
|
+
+ ' loader-' + this.loaderPosition //todo:: it looks there is no need for this class🤔
|
|
29
43
|
+ (this.loaderPosition == 'before' ? ' s-button-loader-after' : '');
|
|
30
44
|
delete this.hostAttributes['btn-style'];
|
|
31
45
|
delete this.hostAttributes['id'];
|
|
@@ -33,25 +47,41 @@ const SallaButton = class {
|
|
|
33
47
|
this.host.classList.add('s-button-wide');
|
|
34
48
|
}
|
|
35
49
|
}
|
|
50
|
+
/**
|
|
51
|
+
* Run loading animation
|
|
52
|
+
*/
|
|
36
53
|
async load() {
|
|
37
54
|
if (this.loaderPosition == 'center')
|
|
38
55
|
this.text.classList.add('s-button-hide');
|
|
39
56
|
this.host.setAttribute('loading', '');
|
|
40
57
|
return this.host;
|
|
41
58
|
}
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
}
|
|
59
|
+
/**
|
|
60
|
+
* Stop loading animation
|
|
61
|
+
*/
|
|
46
62
|
async stop() {
|
|
47
63
|
this.host.removeAttribute('loading');
|
|
48
64
|
if (this.loaderPosition == 'center')
|
|
49
65
|
this.text.classList.remove('s-button-hide');
|
|
50
66
|
return this.host;
|
|
51
67
|
}
|
|
68
|
+
/**
|
|
69
|
+
* Changing the body of the button
|
|
70
|
+
* @param html
|
|
71
|
+
*/
|
|
72
|
+
async setText(html) {
|
|
73
|
+
this.text.innerHTML = html;
|
|
74
|
+
return this.host;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Add `disabled` attribute
|
|
78
|
+
*/
|
|
52
79
|
async disable() {
|
|
53
80
|
this.host.setAttribute('disabled', '');
|
|
54
81
|
}
|
|
82
|
+
/**
|
|
83
|
+
* Remove `disabled` attribute
|
|
84
|
+
*/
|
|
55
85
|
async enable() {
|
|
56
86
|
this.host.removeAttribute('disabled');
|
|
57
87
|
}
|
|
@@ -111,9 +141,15 @@ const SallaLocalization = class {
|
|
|
111
141
|
this.languages = Object.values(salla.config.get('languages', {}));
|
|
112
142
|
this.currencies = Object.values(salla.config.get('currencies', {}));
|
|
113
143
|
}
|
|
144
|
+
/**
|
|
145
|
+
* Show the component
|
|
146
|
+
*/
|
|
114
147
|
async show() {
|
|
115
148
|
return this.modal.show();
|
|
116
149
|
}
|
|
150
|
+
/**
|
|
151
|
+
* Hide the component
|
|
152
|
+
*/
|
|
117
153
|
async hide() {
|
|
118
154
|
return this.modal.hide();
|
|
119
155
|
}
|
|
@@ -125,10 +161,10 @@ const SallaLocalization = class {
|
|
|
125
161
|
}
|
|
126
162
|
async submit() {
|
|
127
163
|
let url;
|
|
128
|
-
console.log('this.currency.code::::', this.currency, this.currency.code);
|
|
164
|
+
console.log('this.currency.code::::', this.currency, this.currency.code); //todo:: remove it
|
|
129
165
|
this.btn.load()
|
|
130
|
-
.then(() => this.currency.code === salla.config.get('user.
|
|
131
|
-
.then(() => this.language.code === salla.config.get('user.
|
|
166
|
+
.then(() => this.currency.code === salla.config.get('user.currency_code', 'SAR') || ((url = window.location.href) && salla.currency.api.change(this.currency.code)))
|
|
167
|
+
.then(() => this.language.code === salla.config.get('user.language_code', 'ar') || (url = this.language.url))
|
|
132
168
|
.then(() => this.btn.stop())
|
|
133
169
|
.then(() => this.hide())
|
|
134
170
|
.then(() => url && (window.location.href = url));
|
|
@@ -167,27 +203,43 @@ const SallaModal = class {
|
|
|
167
203
|
index.registerInstance(this, hostRef);
|
|
168
204
|
this.modalOpened = index.createEvent(this, "modalOpened", 7);
|
|
169
205
|
this.modalClosed = index.createEvent(this, "modalClosed", 7);
|
|
170
|
-
var _a;
|
|
171
206
|
//todo:: unite three colors (error, success, primary) in one prop
|
|
172
207
|
this.error = false;
|
|
173
208
|
this.success = false;
|
|
174
209
|
this.primary = false;
|
|
175
|
-
this.isClosable = true;
|
|
210
|
+
this.isClosable = true; //todo::rename unclude
|
|
211
|
+
/**
|
|
212
|
+
* The size of the modal
|
|
213
|
+
*/
|
|
176
214
|
this.width = 'md';
|
|
177
|
-
|
|
215
|
+
/**
|
|
216
|
+
* The position of the modal
|
|
217
|
+
*/
|
|
218
|
+
this.position = 'middle';
|
|
219
|
+
/**
|
|
220
|
+
* Show the modal on rendering
|
|
221
|
+
*/
|
|
178
222
|
this.visible = false;
|
|
223
|
+
/**
|
|
224
|
+
* Show loading in the middle
|
|
225
|
+
*/
|
|
179
226
|
this.isLoading = false;
|
|
180
|
-
this.subTitleFirst = false;
|
|
181
|
-
this.noPadding = false;
|
|
227
|
+
this.subTitleFirst = false; //todo:: choose better name
|
|
228
|
+
this.noPadding = false; //todo:: choose better name
|
|
182
229
|
this.subTitle = '';
|
|
230
|
+
/**
|
|
231
|
+
* Icon css class, default for types `error` is `sicon-alert-engine`, `success` is `sicon-check-circle2`
|
|
232
|
+
*/
|
|
183
233
|
this.icon = '';
|
|
234
|
+
/**
|
|
235
|
+
* url of an image
|
|
236
|
+
*/
|
|
184
237
|
this.imageIcon = '';
|
|
185
238
|
Helper.Helper.setHost(this.host);
|
|
186
239
|
salla.event.on('modal::open', btn => btn.dataset.target == this.host.id && this.show());
|
|
187
240
|
salla.event.on('modal::close', btn => btn.dataset.target == this.host.id && this.hide());
|
|
188
241
|
this.title = this.host.title;
|
|
189
242
|
this.host.removeAttribute('title');
|
|
190
|
-
(_a = Helper.Helper.getElement('[slot=body]')) === null || _a === void 0 ? void 0 : _a.classList.add('s-modal-body', 's-modal-' + this.width);
|
|
191
243
|
}
|
|
192
244
|
handleVisible(newValue) {
|
|
193
245
|
if (!newValue) {
|
|
@@ -199,30 +251,44 @@ const SallaModal = class {
|
|
|
199
251
|
setTimeout(() => this.toggleModal(true)); //small amont of time to running toggle After adding hidden
|
|
200
252
|
this.modalOpened.emit();
|
|
201
253
|
}
|
|
254
|
+
/**
|
|
255
|
+
* Show the modal
|
|
256
|
+
*/
|
|
202
257
|
async show() {
|
|
203
258
|
this.host.setAttribute('visible', '');
|
|
204
259
|
return this.host;
|
|
205
260
|
}
|
|
261
|
+
/**
|
|
262
|
+
* hide the modal
|
|
263
|
+
*/
|
|
206
264
|
async hide() {
|
|
207
265
|
this.host.removeAttribute('visible');
|
|
208
266
|
return this.host;
|
|
209
267
|
}
|
|
268
|
+
/**
|
|
269
|
+
* Change the title
|
|
270
|
+
* @param {string} title
|
|
271
|
+
*/
|
|
210
272
|
async setTitle(title) {
|
|
211
273
|
this.title = title;
|
|
212
274
|
return this.host;
|
|
213
275
|
}
|
|
276
|
+
/**
|
|
277
|
+
* Start loading
|
|
278
|
+
*/
|
|
214
279
|
async loading() {
|
|
215
280
|
this.isLoading = true;
|
|
216
281
|
return this.host;
|
|
217
282
|
}
|
|
283
|
+
/**
|
|
284
|
+
* Stop the loading
|
|
285
|
+
*/
|
|
218
286
|
async stopLoading() {
|
|
219
287
|
this.isLoading = false;
|
|
220
288
|
return this.host;
|
|
221
289
|
}
|
|
222
290
|
toggleModal(isOpen) {
|
|
223
|
-
Helper.Helper
|
|
224
|
-
// .toggleElement(this.host.querySelector('.s-modal-body'), 's-modal-entering', 's-modal-leaving', () => isOpen)
|
|
225
|
-
.toggleElement(this.host.querySelector('[slot=body]') || this.host, 's-modal-entering', 's-modal-leaving', () => isOpen)
|
|
291
|
+
Helper.Helper.toggleElement(this.host, 's-modal-entering', 's-modal-leaving', () => isOpen)
|
|
226
292
|
.toggleElement(this.overlay, 's-modal-entering', 's-modal-overlay-leaving', () => isOpen)
|
|
227
293
|
//todo:: use united class names
|
|
228
294
|
.toggleElement(document.body, 'modal-is-open', 'modal-is-closed', () => isOpen);
|
|
@@ -236,34 +302,36 @@ const SallaModal = class {
|
|
|
236
302
|
}
|
|
237
303
|
this.host.removeAttribute('visible');
|
|
238
304
|
}
|
|
305
|
+
iconBlockClasses() {
|
|
306
|
+
return {
|
|
307
|
+
's-modal-icon': true,
|
|
308
|
+
's-modal-bg-error': this.error,
|
|
309
|
+
's-modal-bg-success': this.success,
|
|
310
|
+
's-modal-bg-normal': !this.error && !this.success,
|
|
311
|
+
's-modal-bg-primary': this.primary
|
|
312
|
+
};
|
|
313
|
+
}
|
|
314
|
+
iconClasses() {
|
|
315
|
+
return {
|
|
316
|
+
[this.icon]: true,
|
|
317
|
+
's-modal-text-error': this.error,
|
|
318
|
+
's-modal-text-success': this.success,
|
|
319
|
+
'sicon-alert-engine': !this.icon && this.error && !this.imageIcon,
|
|
320
|
+
'sicon-check-circle2': !this.icon && this.success && !this.imageIcon,
|
|
321
|
+
};
|
|
322
|
+
}
|
|
239
323
|
//todo:: pref for each modal
|
|
240
324
|
render() {
|
|
241
325
|
this.host.id = this.host.id || 'salla-modal';
|
|
242
|
-
return (
|
|
243
|
-
//todo:: use suitable class name instead of hidden
|
|
244
|
-
index.h(index.Host, { class: 's-modal-container s-hidden', "aria-modal": "true", role: "dialog" }, index.h("div", { class: "s-modal-wrapper" }, index.h("div", { class: "s-modal-overlay", ref: el => this.overlay = el, onClick: () => this.closeModal() }), index.h("span", { class: 's-modal-spacer s-modal-align-' + this.position }, "\u200B"), index.h("div", { class: 's-modal-body s-modal-scroll-y ' + 's-modal-align-' + this.position + ' s-modal-' + this.width + (this.noPadding ? ' s-modal-nopadding' : ' s-modal-padding'), slot: "body" }, this.isLoading
|
|
326
|
+
return (index.h(index.Host, { class: 's-modal-container s-hidden', "aria-modal": "true", role: "dialog" }, index.h("div", { class: "s-modal-wrapper" }, index.h("div", { class: "s-modal-overlay", ref: el => this.overlay = el, onClick: () => this.closeModal() }), index.h("span", { class: 's-modal-spacer s-modal-align-' + this.position }, "\u200B"), index.h("div", { class: 's-modal-body s-modal-scroll-y ' + 's-modal-align-' + this.position + ' s-modal-' + this.width + (this.noPadding ? ' s-modal-nopadding' : ' s-modal-padding') }, this.isLoading
|
|
245
327
|
? index.h("div", { class: "s-modal-loader-wrap" }, index.h("span", { class: "s-modal-loader" }))
|
|
246
328
|
:
|
|
247
329
|
[index.h("div", { class: { 's-modal-header': true, 's-modal-is-center': this.icon != '' || this.imageIcon != '' } }, this.isClosable ?
|
|
248
330
|
index.h("button", { class: "s-modal-close", onClick: () => this.closeModal(), type: "button" }, index.h("span", { class: "sicon-cancel" }))
|
|
249
331
|
: '', this.title || this.subTitle ?
|
|
250
332
|
index.h("div", { class: "s-modal-header-inner" }, this.error || this.success || this.icon
|
|
251
|
-
? index.h("div", { class: {
|
|
252
|
-
|
|
253
|
-
's-modal-bg-error': this.error,
|
|
254
|
-
's-modal-bg-success': this.success,
|
|
255
|
-
's-modal-bg-normal': !this.error && !this.success,
|
|
256
|
-
's-modal-bg-primary': this.primary
|
|
257
|
-
} }, index.h("i", { class: {
|
|
258
|
-
[this.icon]: true,
|
|
259
|
-
's-modal-text-error': this.error,
|
|
260
|
-
's-modal-text-success': this.success,
|
|
261
|
-
'sicon-alert-engine': !this.icon && this.error,
|
|
262
|
-
'sicon-check-circle2': !this.icon && this.success,
|
|
263
|
-
} }))
|
|
264
|
-
: this.imageIcon ?
|
|
265
|
-
index.h("img", { class: "s-modal-header-img", src: this.imageIcon })
|
|
266
|
-
: '', index.h("div", { class: "s-modal-header-content" }, index.h("div", { class: { 's-modal-title': true, 's-modal-title-below': this.subTitleFirst }, innerHTML: this.title }), index.h("p", { class: { 's-modal-sub-title': true }, innerHTML: this.subTitle })))
|
|
333
|
+
? index.h("div", { class: this.iconBlockClasses() }, index.h("i", { class: this.iconClasses() }))
|
|
334
|
+
: this.imageIcon ? index.h("img", { class: "s-modal-header-img", src: this.imageIcon }) : '', index.h("div", { class: "s-modal-header-content" }, index.h("div", { class: { 's-modal-title': true, 's-modal-title-below': this.subTitleFirst }, innerHTML: this.title }), index.h("p", { class: { 's-modal-sub-title': true }, innerHTML: this.subTitle })))
|
|
267
335
|
: ''),
|
|
268
336
|
index.h("slot", null),
|
|
269
337
|
index.h("slot", { name: "footer" })
|
|
@@ -1653,8 +1721,11 @@ const SallaTelInput = class {
|
|
|
1653
1721
|
constructor(hostRef) {
|
|
1654
1722
|
index.registerInstance(this, hostRef);
|
|
1655
1723
|
this.enterClicked = index.createEvent(this, "enterClicked", 7);
|
|
1724
|
+
/**
|
|
1725
|
+
* Current country_code
|
|
1726
|
+
*/
|
|
1656
1727
|
this.countryCode = salla.config.get('user.country_code', 'SA');
|
|
1657
|
-
this.countryKey = "+966"; //TODO:: why we need it
|
|
1728
|
+
this.countryKey = "+966"; //TODO:: why we need it, if it's important find a way to get it automatically for the current user
|
|
1658
1729
|
this.countryCodeLabel = salla.lang.get('common.country_code');
|
|
1659
1730
|
this.mobileLabel = salla.lang.get('common.elements.mobile');
|
|
1660
1731
|
this.tooShort = salla.lang.get('common.errors.too_short', { attribute: this.mobileLabel });
|
|
@@ -1674,12 +1745,21 @@ const SallaTelInput = class {
|
|
|
1674
1745
|
this.errorMap = [this.invalidNumber, this.invalidCountryCode, this.tooShort, this.tooLong, this.invalidNumber];
|
|
1675
1746
|
});
|
|
1676
1747
|
}
|
|
1748
|
+
/**
|
|
1749
|
+
* Get current values
|
|
1750
|
+
* @return {{mobile:number,countryCode:'SA'|string, countryKey:'+966'|string}}
|
|
1751
|
+
*/
|
|
1677
1752
|
async getValues() {
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1753
|
+
return {
|
|
1754
|
+
mobile: this.mobile = this.phoneInput.value,
|
|
1755
|
+
countryCode: this.countryCode = this.countryCodeInput.value,
|
|
1756
|
+
countryKey: this.countryKey = this.countryKeyInput.value
|
|
1757
|
+
};
|
|
1682
1758
|
}
|
|
1759
|
+
/**
|
|
1760
|
+
* Is current data valid or not
|
|
1761
|
+
* @return {boolean}
|
|
1762
|
+
*/
|
|
1683
1763
|
async isValid() {
|
|
1684
1764
|
this.reset();
|
|
1685
1765
|
if (this.iti.isValidNumber())
|
|
@@ -1712,9 +1792,7 @@ const SallaTelInput = class {
|
|
|
1712
1792
|
});
|
|
1713
1793
|
});
|
|
1714
1794
|
// on blur: validate
|
|
1715
|
-
this.phoneInput.addEventListener('blur', () =>
|
|
1716
|
-
this.isValid();
|
|
1717
|
-
});
|
|
1795
|
+
this.phoneInput.addEventListener('blur', () => this.isValid());
|
|
1718
1796
|
// on keyup / change flag: reset
|
|
1719
1797
|
this.phoneInput.addEventListener('input', e => {
|
|
1720
1798
|
salla.helpers.digitsOnly(e.target);
|
|
@@ -1739,10 +1817,15 @@ const SallaVerify = class {
|
|
|
1739
1817
|
constructor(hostRef) {
|
|
1740
1818
|
index.registerInstance(this, hostRef);
|
|
1741
1819
|
this.verified = index.createEvent(this, "verified", 7);
|
|
1742
|
-
this.
|
|
1820
|
+
this.initiated = false;
|
|
1821
|
+
/**
|
|
1822
|
+
* Verifying method
|
|
1823
|
+
*/
|
|
1743
1824
|
this.by = 'sms';
|
|
1825
|
+
/**
|
|
1826
|
+
* should auto reloading the page after success verification
|
|
1827
|
+
*/
|
|
1744
1828
|
this.autoReload = true;
|
|
1745
|
-
this.initiated = false;
|
|
1746
1829
|
Helper.Helper.setHost(this.host);
|
|
1747
1830
|
if (this.withoutModal) {
|
|
1748
1831
|
this.modal = { show: () => '', hide: () => '' };
|
|
@@ -1754,12 +1837,22 @@ const SallaVerify = class {
|
|
|
1754
1837
|
});
|
|
1755
1838
|
}
|
|
1756
1839
|
salla.event.on('languages::translations.loaded', () => {
|
|
1840
|
+
var _a;
|
|
1757
1841
|
this.title = salla.lang.get('pages.profile.verify_title');
|
|
1842
|
+
(_a = this.btn) === null || _a === void 0 ? void 0 : _a.setText(salla.lang.get('pages.profile.verify'));
|
|
1758
1843
|
});
|
|
1759
1844
|
}
|
|
1845
|
+
/**
|
|
1846
|
+
* Get current code
|
|
1847
|
+
* @return {string}
|
|
1848
|
+
*/
|
|
1760
1849
|
async getCode() {
|
|
1761
1850
|
return this.code.value;
|
|
1762
1851
|
}
|
|
1852
|
+
/**
|
|
1853
|
+
* Show verifying modal
|
|
1854
|
+
* @param data
|
|
1855
|
+
*/
|
|
1763
1856
|
async show(data) {
|
|
1764
1857
|
var _a;
|
|
1765
1858
|
this.data = data;
|
|
@@ -1854,12 +1947,10 @@ const SallaVerify = class {
|
|
|
1854
1947
|
myBody() {
|
|
1855
1948
|
return [
|
|
1856
1949
|
index.h("div", { class: "s-verify-message", innerHTML: salla.lang.get('pages.profile.verify_message') }),
|
|
1857
|
-
// <label class="s-verify-label">{salla.lang.get('pages.profile.verify_placeholder')}</label>,
|
|
1858
1950
|
index.h("input", { type: "hidden", name: "code", maxlength: "4", required: true, ref: code => this.code = code }),
|
|
1859
1951
|
index.h("div", { class: "s-verify-codes", dir: "ltr" }, [1, 2, 3, 4].map(() => index.h("input", { type: "text", maxlength: "1", class: "s-verify-input", required: true }))),
|
|
1860
|
-
index.h("div", { slot: "footer", class: "s-verify-footer" }, index.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')), index.h("p", { class: "s-verify-resend-message", ref: el => this.resendMessage = el }, salla.lang.get('blocks.header.resend_after'), index.h("b", { class: "s-verify-timer", ref: el => this.timer = el })), index.h("a", { href: "#", class: "s-verify-resend", onClick: () => this.resendCode(), ref: el => this.resend = el }, salla.lang.get('blocks.comments.submit')),
|
|
1861
|
-
|
|
1862
|
-
: '')
|
|
1952
|
+
index.h("div", { slot: "footer", class: "s-verify-footer" }, index.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')), index.h("p", { class: "s-verify-resend-message", ref: el => this.resendMessage = el }, salla.lang.get('blocks.header.resend_after'), index.h("b", { class: "s-verify-timer", ref: el => this.timer = el })), index.h("a", { href: "#", class: "s-verify-resend", onClick: () => this.resendCode(), ref: el => this.resend = el }, salla.lang.get('blocks.comments.submit'))),
|
|
1953
|
+
index.h("slot", { name: "after-footer" })
|
|
1863
1954
|
];
|
|
1864
1955
|
}
|
|
1865
1956
|
get host() { return index.getElement(this); }
|
|
@@ -12,6 +12,9 @@ const SallaInfiniteScroll = class {
|
|
|
12
12
|
* Next Page element
|
|
13
13
|
*/
|
|
14
14
|
this.nextPage = '';
|
|
15
|
+
/**
|
|
16
|
+
* Is there is need to autoload next page when scroll
|
|
17
|
+
*/
|
|
15
18
|
this.autoload = false;
|
|
16
19
|
/**
|
|
17
20
|
* Class selector to know the container if it's not the host `<salla-infinite-scroll>`
|
|
@@ -23,10 +23,18 @@ const SallaOffer = class {
|
|
|
23
23
|
this.show(data.product_id);
|
|
24
24
|
});
|
|
25
25
|
}
|
|
26
|
-
|
|
26
|
+
/**
|
|
27
|
+
* Show the available offers for the product
|
|
28
|
+
* @param product_id
|
|
29
|
+
*/
|
|
30
|
+
async show(product_id) {
|
|
27
31
|
//TODO:: make sure there is only one offer
|
|
28
|
-
return salla.api.offer.details(
|
|
32
|
+
return salla.api.offer.details(product_id).then(response => this.offer = response.data[0]);
|
|
29
33
|
}
|
|
34
|
+
/**
|
|
35
|
+
* Show offer details
|
|
36
|
+
* @param {Offer} offer
|
|
37
|
+
*/
|
|
30
38
|
async showOffer(offer) {
|
|
31
39
|
this.offer = offer;
|
|
32
40
|
return this.modal.show();
|
|
@@ -9,7 +9,13 @@ const SallaProductAvailability = class {
|
|
|
9
9
|
constructor(hostRef) {
|
|
10
10
|
index.registerInstance(this, hostRef);
|
|
11
11
|
this.isUser = Helper.Helper.isUser();
|
|
12
|
+
/**
|
|
13
|
+
* product id that can visitor subscribe to its availability notification
|
|
14
|
+
*/
|
|
12
15
|
this.productId = salla.config.get('page.id');
|
|
16
|
+
/**
|
|
17
|
+
* is current user already subscribed
|
|
18
|
+
*/
|
|
13
19
|
this.isSubscribed = false;
|
|
14
20
|
// @Method()
|
|
15
21
|
this.submit = async () => {
|
|
@@ -13,6 +13,10 @@ const SallaRating = class {
|
|
|
13
13
|
this.stepsCount = 0;
|
|
14
14
|
this.currentIndex = 0;
|
|
15
15
|
this.submitted = [];
|
|
16
|
+
/**
|
|
17
|
+
* The order id, to rate on its products & shipping
|
|
18
|
+
*/
|
|
19
|
+
this.orderId = salla.config.get('page.id');
|
|
16
20
|
this.rate_the_store = salla.lang.get('pages.rating.rate_the_store');
|
|
17
21
|
this.write_store_rate = salla.lang.get('pages.rating.write_store_rate');
|
|
18
22
|
this.rate_product_stars = salla.lang.get('pages.rating.rate_product_stars');
|
|
@@ -36,14 +40,20 @@ const SallaRating = class {
|
|
|
36
40
|
this.next = salla.lang.get('common.elements.next');
|
|
37
41
|
});
|
|
38
42
|
}
|
|
43
|
+
/**
|
|
44
|
+
* Show the rating modal
|
|
45
|
+
*/
|
|
39
46
|
async show() {
|
|
40
47
|
return this.modal.show()
|
|
41
|
-
.then(() => this.order || salla.feedback.api.order(
|
|
48
|
+
.then(() => this.order || salla.feedback.api.order(this.orderId).then(res => this.order = res.data))
|
|
42
49
|
.then(() => this.modal.setTitle(salla.lang.get('pages.rating.rate_order') + ' <span class="unicode">(#' + this.order.id + ')</span>'))
|
|
43
50
|
.then(() => this.modal.stopLoading())
|
|
44
51
|
.then(() => this.stepsCount = [this.order.testimonials_enabled, this.order.products_enabled, this.order.shipping_enabled].filter(enabled => enabled).length)
|
|
45
52
|
.then(() => setTimeout(() => this.initiateRating(), 100));
|
|
46
53
|
}
|
|
54
|
+
/**
|
|
55
|
+
* Show the rating modal
|
|
56
|
+
*/
|
|
47
57
|
async hide() {
|
|
48
58
|
return this.modal.hide();
|
|
49
59
|
}
|
|
@@ -169,7 +179,7 @@ const SallaRating = class {
|
|
|
169
179
|
if (Object.keys(data).length == 0) {
|
|
170
180
|
return;
|
|
171
181
|
}
|
|
172
|
-
data['order_id'] =
|
|
182
|
+
data['order_id'] = this.orderId;
|
|
173
183
|
data['type'] = this.currentTab.dataset.type;
|
|
174
184
|
this.submitted.push(this.currentIndex);
|
|
175
185
|
return salla.feedback.api[this.currentTab.dataset.type](data);
|
|
@@ -9,6 +9,7 @@ const SallaLogin = class {
|
|
|
9
9
|
constructor(hostRef) {
|
|
10
10
|
index.registerInstance(this, hostRef);
|
|
11
11
|
this.regType = 'phone';
|
|
12
|
+
//TODO:: any salla-button, text should updated by this.btn?.setText(newText)
|
|
12
13
|
this.title = salla.lang.get('blocks.header.login');
|
|
13
14
|
this.loginTypeTitle = salla.lang.get('blocks.header.select_login_way');
|
|
14
15
|
this.loginText = salla.lang.get('blocks.header.login');
|
|
@@ -111,7 +112,7 @@ const SallaLogin = class {
|
|
|
111
112
|
if (event.detail.case === "new_customer") {
|
|
112
113
|
return this.showTab(this.registrationTab);
|
|
113
114
|
}
|
|
114
|
-
//TODO::It looks that is
|
|
115
|
+
//TODO::It looks that this is a workaround for something, so needs to be enhanced🤔
|
|
115
116
|
if (salla.auth.event.getTypeActionOnVerified() !== 'redirect') {
|
|
116
117
|
return;
|
|
117
118
|
}
|
|
@@ -120,10 +121,9 @@ const SallaLogin = class {
|
|
|
120
121
|
}
|
|
121
122
|
window.location.reload();
|
|
122
123
|
}
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
}
|
|
124
|
+
/**
|
|
125
|
+
* Show login component
|
|
126
|
+
*/
|
|
127
127
|
async show() {
|
|
128
128
|
if (this.isEmailAllowed && this.isMobileAllowed) {
|
|
129
129
|
this.showTab(this.homeTab);
|
|
@@ -167,18 +167,19 @@ const SallaLogin = class {
|
|
|
167
167
|
!isLastNameValid && this.validateField(this.lastName, this.lastNameErrorMsg);
|
|
168
168
|
throw ('Please insert required fields');
|
|
169
169
|
}
|
|
170
|
+
// eslint-disable-next-line @stencil/own-methods-must-be-private
|
|
170
171
|
validateField(field, errorMsg) {
|
|
171
172
|
field.classList.add('s-has-error');
|
|
172
173
|
field.nextElementSibling['innerText'] = '* ' + errorMsg;
|
|
173
174
|
}
|
|
174
175
|
render() {
|
|
175
176
|
return (index.h("salla-modal", { id: "salla-login", icon: "sicon-user", title: this.title, ref: modal => this.modal = modal, width: "xs" }, index.h("div", { class: "s-login-wrapper" }, this.isEmailAllowed && this.isMobileAllowed ?
|
|
176
|
-
index.h("div", { class: "s-login-tab", ref: tab => this.homeTab = tab }, index.h("p", { class: "s-login-sub-title" }, this.loginTypeTitle), index.h("a", { href: "#", class: "s-login-main-btn", onClick: (evt) => this.showTab(this.mobileTab, evt) }, index.h("i", { class: "s-login-main-btn-icon sicon-phone" }), index.h("span", { class: "s-login-main-btn-text" }, this.smsLabel), index.h("i", { class: "main-btn-arrow sicon-keyboard_arrow_left" })), index.h("a", { href: "#", class: "s-login-main-btn", onClick: (evt) => this.showTab(this.emailTab, evt) }, index.h("i", { class: "s-login-main-btn-icon sicon-mail" }), index.h("span", { class: "s-login-main-btn-text" }, this.emailLabel), index.h("i", { class: "main-btn-arrow sicon-keyboard_arrow_left" })))
|
|
177
|
+
index.h("div", { class: "s-login-tab", ref: tab => this.homeTab = tab }, index.h("p", { class: "s-login-sub-title" }, this.loginTypeTitle), index.h("slot", { name: "before-login-type" }), index.h("a", { href: "#", class: "s-login-main-btn", onClick: (evt) => this.showTab(this.mobileTab, evt) }, index.h("i", { class: "s-login-main-btn-icon sicon-phone" }), index.h("span", { class: "s-login-main-btn-text" }, this.smsLabel), index.h("i", { class: "main-btn-arrow sicon-keyboard_arrow_left" })), index.h("a", { href: "#", class: "s-login-main-btn", onClick: (evt) => this.showTab(this.emailTab, evt) }, index.h("i", { class: "s-login-main-btn-icon sicon-mail" }), index.h("span", { class: "s-login-main-btn-text" }, this.emailLabel), index.h("i", { class: "main-btn-arrow sicon-keyboard_arrow_left" })), index.h("slot", { name: "after-login-type" }))
|
|
177
178
|
: '', this.isMobileAllowed ?
|
|
178
|
-
index.h("div", { class: "s-login-tab", ref: tab => this.mobileTab = tab }, index.h("label", { class: "s-login-label" }, this.mobileLabel), index.h("salla-tel-input", { ref: el => this.loginTelInput = el, onKeyDown: e => this.typing(e, this.loginBySMS) }), index.h("salla-button", { "loader-position": 'center', wide: true, onClick: () => this.loginBySMS(), ref: b => this.smsBtn = b }, this.enterText), this.isEmailAllowed ?
|
|
179
|
-
index.h("a", { href: "#", onClick: () => this.showTab(this.emailTab), class: "s-login-link" }, this.byEmailText) : '') : '', this.isEmailAllowed ?
|
|
180
|
-
index.h("div", { class: "s-login-tab", ref: tab => this.emailTab = tab }, index.h("label", { class: "s-login-label" }, this.emailLabel), index.h("input", { type: "email", ref: el => this.loginEmail = el, onKeyDown: e => this.typing(e, this.loginByEmail), placeholder: "your@email.com", class: "s-login-input s-ltr" }), index.h("span", { class: "s-login-error-message" }), index.h("salla-button", { "loader-position": 'center', wide: true, onClick: () => this.loginByEmail(), ref: b => this.emailBtn = b }, this.enterText), this.isMobileAllowed ?
|
|
181
|
-
index.h("a", { href: "#", onClick: () => this.showTab(this.mobileTab), class: "s-login-link" }, this.bySMSText) : '') : '', index.h("salla-verify", { "without-modal": true, ref: tab => this.verifyTab = tab, autoReload: false, "
|
|
179
|
+
index.h("div", { class: "s-login-tab", ref: tab => this.mobileTab = tab }, index.h("slot", { name: "before-login-mobile" }), index.h("label", { class: "s-login-label" }, this.mobileLabel), index.h("salla-tel-input", { ref: el => this.loginTelInput = el, onKeyDown: e => this.typing(e, this.loginBySMS) }), index.h("salla-button", { "loader-position": 'center', wide: true, onClick: () => this.loginBySMS(), ref: b => this.smsBtn = b }, this.enterText), this.isEmailAllowed ?
|
|
180
|
+
index.h("a", { href: "#", onClick: () => this.showTab(this.emailTab), class: "s-login-link" }, this.byEmailText) : '', index.h("slot", { name: "after-login-mobile" })) : '', this.isEmailAllowed ?
|
|
181
|
+
index.h("div", { class: "s-login-tab", ref: tab => this.emailTab = tab }, index.h("slot", { name: "before-login-email" }), index.h("label", { class: "s-login-label" }, this.emailLabel), index.h("input", { type: "email", ref: el => this.loginEmail = el, onKeyDown: e => this.typing(e, this.loginByEmail), placeholder: "your@email.com", class: "s-login-input s-ltr" }), index.h("span", { class: "s-login-error-message" }), index.h("salla-button", { "loader-position": 'center', wide: true, onClick: () => this.loginByEmail(), ref: b => this.emailBtn = b }, this.enterText), this.isMobileAllowed ?
|
|
182
|
+
index.h("a", { href: "#", onClick: () => this.showTab(this.mobileTab), class: "s-login-link" }, this.bySMSText) : '', index.h("slot", { name: "after-login-email" })) : '', index.h("salla-verify", { "without-modal": true, ref: tab => this.verifyTab = tab, autoReload: false }, index.h("a", { onClick: () => this.showTab(this.regType == 'phone' ? this.mobileTab : this.emailTab), class: "s-verify-back sicon-arrow-right", slot: "after-footer", href: "#" })), index.h("div", { ref: tab => this.registrationTab = tab }, index.h("slot", { name: "before-registration" }), index.h("label", { class: "s-login-label" }, this.firstNameLabel), index.h("input", { type: "text", class: "s-login-input", ref: el => this.firstName = el, onKeyDown: e => this.typing(e, this.newUser), placeholder: salla.lang.get('pages.profile.first_name') }), index.h("span", { class: "s-login-error-message" }), index.h("label", { class: "s-login-label" }, this.lastNameLabel), index.h("input", { type: "text", class: "s-login-input", ref: el => this.lastName = el, onKeyDown: e => this.typing(e, this.newUser), placeholder: salla.lang.get('pages.profile.last_name') }), index.h("span", { class: "s-login-error-message" }), index.h("div", { ref: el => this.regMobileBlock = el, class: "mb-1.5" }, index.h("label", { class: "s-login-label" }, this.mobileLabel), index.h("salla-tel-input", { ref: el => this.regTelInput = el, onKeyDown: e => this.typing(e, this.newUser) })), index.h("div", { ref: el => this.regEmailBlock = el, class: "mb-1.5" }, index.h("label", { class: "s-login-label" }, this.emailLabel), index.h("input", { type: "email", ref: el => this.regEmail = el, onKeyDown: e => this.typing(e, this.newUser), placeholder: "your@email.com", class: "s-login-input s-ltr" }), index.h("span", { class: "s-login-error-message" })), index.h("salla-button", { "loader-position": 'center', wide: true, onClick: () => this.newUser(), ref: b => this.regBtn = b }, salla.lang.get('blocks.header.register')), index.h("slot", { name: "after-registration" })))));
|
|
182
183
|
}
|
|
183
184
|
get host() { return index.getElement(this); }
|
|
184
185
|
};
|
|
@@ -15,5 +15,5 @@ const patchBrowser = () => {
|
|
|
15
15
|
};
|
|
16
16
|
|
|
17
17
|
patchBrowser().then(options => {
|
|
18
|
-
return index.bootstrapLazy([["salla-button_7.cjs",[[
|
|
18
|
+
return index.bootstrapLazy([["salla-button_7.cjs",[[4,"salla-login",{"isEmailAllowed":[4,"is-email-allowed"],"isMobileAllowed":[4,"is-mobile-allowed"],"isEmailRequired":[4,"is-email-required"],"title":[32],"loginTypeTitle":[32],"loginText":[32],"smsLabel":[32],"mobileLabel":[32],"emailLabel":[32],"enterText":[32],"bySMSText":[32],"byEmailText":[32],"emailErrorMsg":[32],"firstNameLabel":[32],"lastNameLabel":[32],"firstNameErrorMsg":[32],"lastNameErrorMsg":[32],"show":[64]},[[0,"verified","onVerified"]]],[4,"salla-localization",{"languagesTitle":[32],"currenciesTitle":[32],"show":[64],"hide":[64],"submit":[64]}],[0,"salla-search",{"results":[32],"placeholder":[32],"noResultsText":[32]},[[0,"modalOpened","onModalOpen"],[0,"modalClosed","onModalClose"]]],[4,"salla-verify",{"withoutModal":[4,"without-modal"],"url":[513],"by":[1],"autoReload":[4,"auto-reload"],"title":[32],"getCode":[64],"show":[64]}],[0,"salla-tel-input",{"mobile":[1025],"countryCode":[1025,"country-code"],"countryKey":[1025,"country-key"],"mobileRequired":[32],"countryCodeLabel":[32],"mobileLabel":[32],"tooShort":[32],"tooLong":[32],"invalidCountryCode":[32],"invalidNumber":[32],"errorMap":[32],"getValues":[64],"isValid":[64]}],[4,"salla-button",{"btnStyle":[513,"btn-style"],"loading":[516],"disabled":[516],"loaderPosition":[1,"loader-position"],"wide":[4],"load":[64],"stop":[64],"setText":[64],"disable":[64],"enable":[64]}],[4,"salla-modal",{"error":[4],"success":[4],"primary":[4],"isClosable":[1028,"is-closable"],"width":[513],"position":[513],"visible":[516],"isLoading":[1540,"is-loading"],"subTitleFirst":[4,"sub-title-first"],"noPadding":[4,"no-padding"],"subTitle":[1,"sub-title"],"icon":[1],"imageIcon":[1,"image-icon"],"title":[32],"show":[64],"hide":[64],"setTitle":[64],"loading":[64],"stopLoading":[64]}]]],["salla-product-availability.cjs",[[4,"salla-product-availability",{"channels":[1],"productId":[2,"product-id"],"isSubscribed":[1028,"is-subscribed"],"subTitle":[32],"mobileLabel":[32],"emailLabel":[32],"emailPlaceholder":[32],"subscribedMessage":[32],"title_":[32],"emailErrorMsg":[32]}]]],["salla-branches.cjs",[[4,"salla-branches",{"position":[1],"displayAs":[1,"display-as"],"browseProductsFrom":[1,"browse-products-from"],"branches":[16],"current":[1026],"open":[32],"selected":[32],"isOpenedBefore":[32],"show":[64],"hide":[64]}]]],["salla-offer.cjs",[[0,"salla-offer",{"offer":[32],"show":[64],"showOffer":[64]}]]],["salla-rating.cjs",[[0,"salla-rating",{"orderId":[2,"order-id"],"order":[32],"show":[64],"hide":[64]}]]],["salla-infinite-scroll.cjs",[[4,"salla-infinite-scroll",{"nextPage":[1,"next-page"],"autoload":[4],"container":[1],"item":[1],"loadMore":[32],"noMore":[32],"failedToLoad":[32]}]]]], options);
|
|
19
19
|
});
|