@salla.sa/twilight-components 1.0.75 → 1.0.76
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/loader.cjs.js +1 -1
- package/dist/cjs/salla-add-product-button_6.cjs.entry.js +25 -19
- package/dist/cjs/salla-branches.cjs.entry.js +2 -2
- package/dist/cjs/salla-infinite-scroll.cjs.entry.js +5 -9
- package/dist/cjs/salla-installment.cjs.entry.js +1 -1
- package/dist/cjs/salla-localization-modal.cjs.entry.js +7 -7
- package/dist/cjs/salla-login-modal.cjs.entry.js +9 -9
- package/dist/cjs/salla-offer-modal.cjs.entry.js +3 -3
- package/dist/cjs/salla-rating-modal.cjs.entry.js +6 -6
- package/dist/cjs/salla-verify-modal.cjs.entry.js +25 -19
- package/dist/cjs/twilight-components.cjs.js +1 -1
- package/dist/collection/components/salla-add-product-button/salla-add-product-button.css +4 -0
- package/dist/collection/components/salla-branches/salla-branches.js +2 -2
- package/dist/collection/components/salla-button/salla-button.js +7 -5
- package/dist/collection/components/salla-infinite-scroll/salla-infinite-scroll.js +9 -13
- package/dist/collection/components/salla-installment/salla-installment.css +9 -1
- package/dist/collection/components/salla-localization-modal/salla-localization-modal.js +10 -10
- package/dist/collection/components/salla-login-modal/salla-login-modal.js +11 -11
- package/dist/collection/components/salla-modal/salla-modal.js +12 -12
- package/dist/collection/components/salla-offer-modal/salla-offer-modal.js +4 -4
- package/dist/collection/components/salla-product-availability/salla-product-availability.js +6 -7
- package/dist/collection/components/salla-rating-modal/salla-rating-modal.js +8 -8
- package/dist/collection/components/salla-search/salla-search.js +1 -1
- package/dist/collection/components/salla-tel-input/salla-tel-input.js +28 -6
- package/dist/collection/components/salla-verify-modal/salla-verify-modal.js +29 -39
- package/dist/components/salla-add-product-button.js +1 -1
- package/dist/components/salla-branches.js +2 -2
- package/dist/components/salla-button2.js +4 -1
- package/dist/components/salla-infinite-scroll.js +6 -10
- package/dist/components/salla-installment.js +1 -1
- package/dist/components/salla-localization-modal.js +9 -9
- package/dist/components/salla-login-modal.js +10 -10
- package/dist/components/salla-modal2.js +9 -9
- package/dist/components/salla-offer-modal.js +4 -4
- package/dist/components/salla-product-availability2.js +6 -7
- package/dist/components/salla-rating-modal.js +8 -8
- package/dist/components/salla-search.js +1 -1
- package/dist/components/salla-tel-input2.js +8 -3
- package/dist/components/salla-verify-modal2.js +27 -21
- package/dist/esm/loader.js +1 -1
- package/dist/esm/salla-add-product-button_6.entry.js +25 -19
- package/dist/esm/salla-branches.entry.js +2 -2
- package/dist/esm/salla-infinite-scroll.entry.js +5 -9
- package/dist/esm/salla-installment.entry.js +1 -1
- package/dist/esm/salla-localization-modal.entry.js +7 -7
- package/dist/esm/salla-login-modal.entry.js +9 -9
- package/dist/esm/salla-offer-modal.entry.js +3 -3
- package/dist/esm/salla-rating-modal.entry.js +6 -6
- package/dist/esm/salla-verify-modal.entry.js +25 -19
- package/dist/esm/twilight-components.js +1 -1
- package/dist/twilight-components/p-05c60bb8.entry.js +4 -0
- package/dist/twilight-components/{p-6c9b9c33.entry.js → p-0ed349dd.entry.js} +1 -1
- package/dist/twilight-components/p-34abe2be.entry.js +4 -0
- package/dist/twilight-components/p-4f37512b.entry.js +4 -0
- package/dist/twilight-components/p-8d60c7c0.entry.js +4 -0
- package/dist/twilight-components/p-ca52e3ed.entry.js +4 -0
- package/dist/twilight-components/p-d0b5970c.entry.js +4 -0
- package/dist/twilight-components/p-d82b45e3.entry.js +4 -0
- package/dist/twilight-components/p-f61388fb.entry.js +4 -0
- package/dist/twilight-components/twilight-components.esm.js +1 -1
- package/dist/types/components/salla-button/salla-button.d.ts +1 -0
- package/dist/types/components/salla-infinite-scroll/salla-infinite-scroll.d.ts +1 -2
- package/dist/types/components/salla-localization-modal/salla-localization-modal.d.ts +3 -3
- package/dist/types/components/salla-login-modal/salla-login-modal.d.ts +2 -2
- package/dist/types/components/salla-modal/salla-modal.d.ts +5 -5
- package/dist/types/components/salla-offer-modal/salla-offer-modal.d.ts +1 -1
- package/dist/types/components/salla-rating-modal/salla-rating-modal.d.ts +2 -2
- package/dist/types/components/salla-tel-input/salla-tel-input.d.ts +6 -2
- package/dist/types/components/salla-verify-modal/salla-verify-modal.d.ts +7 -7
- package/dist/types/components.d.ts +42 -42
- package/example/dist/demo.js +11 -2
- package/example/dist/tailwind.css +83 -38
- package/example/index.html +120 -29
- package/example/infinit-scroll.html +5 -5
- package/package.json +1 -1
- package/dist/twilight-components/p-11826c77.entry.js +0 -4
- package/dist/twilight-components/p-6ded3b36.entry.js +0 -4
- package/dist/twilight-components/p-7112157c.entry.js +0 -4
- package/dist/twilight-components/p-82026b3c.entry.js +0 -4
- package/dist/twilight-components/p-94d96cef.entry.js +0 -4
- package/dist/twilight-components/p-95e868cb.entry.js +0 -4
- package/dist/twilight-components/p-f847ccb4.entry.js +0 -4
- package/dist/twilight-components/p-ff7e5709.entry.js +0 -4
package/dist/cjs/loader.cjs.js
CHANGED
|
@@ -17,7 +17,7 @@ const patchEsm = () => {
|
|
|
17
17
|
const defineCustomElements = (win, options) => {
|
|
18
18
|
if (typeof window === 'undefined') return Promise.resolve();
|
|
19
19
|
return patchEsm().then(() => {
|
|
20
|
-
return index.bootstrapLazy([["salla-add-product-button_6.cjs",[[4,"salla-add-product-button",{"channels":[513],"quantity":[514],"donatingAmount":[514,"donating-amount"],"productId":[520,"product-id"],"productStatus":[513,"product-status"],"productType":[513,"product-type"],"disabled":[516]}],[0,"salla-search",{"inline":[4],"oval":[4],"height":[2],"results":[32],"placeholder":[32],"noResultsText":[32]},[[0,"modalOpened","onModalOpen"],[0,"modalClosed","onModalClose"]]],[0,"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],"isVisitorSubscribed":[32]}],[0,"salla-tel-input",{"
|
|
20
|
+
return index.bootstrapLazy([["salla-add-product-button_6.cjs",[[4,"salla-add-product-button",{"channels":[513],"quantity":[514],"donatingAmount":[514,"donating-amount"],"productId":[520,"product-id"],"productStatus":[513,"product-status"],"productType":[513,"product-type"],"disabled":[516]}],[0,"salla-search",{"inline":[4],"oval":[4],"height":[2],"results":[32],"placeholder":[32],"noResultsText":[32]},[[0,"modalOpened","onModalOpen"],[0,"modalClosed","onModalClose"]]],[0,"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],"isVisitorSubscribed":[32]}],[0,"salla-tel-input",{"phone":[1025],"name":[1],"countryCode":[1025,"country-code"],"mobileRequired":[32],"countryCodeLabel":[32],"mobileLabel":[32],"tooShort":[32],"tooLong":[32],"invalidCountryCode":[32],"invalidNumber":[32],"errorMap":[32],"getValues":[64],"isValid":[64]}],[4,"salla-button",{"shape":[513],"color":[513],"fill":[513],"size":[513],"width":[513],"loading":[516],"disabled":[516],"loaderPosition":[1,"loader-position"],"wide":[4],"href":[1],"load":[64],"stop":[64],"setText":[64],"disable":[64],"enable":[64]}],[4,"salla-modal",{"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],"iconStyle":[1,"icon-style"],"imageIcon":[1,"image-icon"],"modalTitle":[32],"open":[64],"close":[64],"setTitle":[64],"loading":[64],"stopLoading":[64]}]]],["salla-login-modal.cjs",[[4,"salla-login-modal",{"isEmailAllowed":[1028,"is-email-allowed"],"isMobileAllowed":[1028,"is-mobile-allowed"],"isEmailRequired":[1028,"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],"open":[64]},[[0,"verified","onVerified"]]]]],["salla-rating-modal.cjs",[[0,"salla-rating-modal",{"orderId":[2,"order-id"],"order":[32],"open":[64],"close":[64]}]]],["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-localization-modal.cjs",[[0,"salla-localization-modal",{"language":[1537],"currency":[1537],"languages":[32],"currencies":[32],"languagesTitle":[32],"currenciesTitle":[32],"isLoading":[32],"open":[64],"close":[64],"submit":[64]}]]],["salla-offer-modal.cjs",[[0,"salla-offer-modal",{"offer":[32],"offer_name":[32],"offer_message":[32],"offer_expires_in":[32],"remember_my_choice":[32],"add_to_cart":[32],"out_of_stock":[32],"open":[64],"showOffer":[64]}]]],["salla-conditional-fields.cjs",[[4,"salla-conditional-fields",null,[[0,"change","changeHandler"]]]]],["salla-infinite-scroll.cjs",[[4,"salla-infinite-scroll",{"nextPage":[1,"next-page"],"autoload":[1028],"container":[1],"item":[1],"loadMore":[32],"noMore":[32],"failedToLoad":[32]}]]],["salla-installment.cjs",[[0,"salla-installment",{"price":[1],"language":[1],"currency":[1],"tamaraIsActive":[32],"tabbyIsActive":[32],"spotiiIsActive":[32]}]]],["salla-quantity-input.cjs",[[4,"salla-quantity-input",{"quantity":[32],"decrease":[64],"increase":[64],"setValue":[64]}]]],["salla-verify-modal.cjs",[[4,"salla-verify-modal",{"withoutModal":[4,"without-modal"],"type":[1],"autoReload":[4,"auto-reload"],"title":[32],"isProfileVerify":[32],"getCode":[64],"open":[64]}]]],["salla-rating-stars.cjs",[[0,"salla-rating-stars",{"name":[1],"size":[1],"value":[2]}]]]], options);
|
|
21
21
|
});
|
|
22
22
|
};
|
|
23
23
|
|
|
@@ -8,7 +8,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
8
8
|
const index = require('./index-c0f5bb97.js');
|
|
9
9
|
const Helper = require('./Helper-8ae6a805.js');
|
|
10
10
|
|
|
11
|
-
const sallaAddProductButtonCss = ":host{display:block}";
|
|
11
|
+
const sallaAddProductButtonCss = ":host{display:block}salla-add-product-button[width=wide]{width:100%}";
|
|
12
12
|
|
|
13
13
|
const SallaAddProductButton = class {
|
|
14
14
|
constructor(hostRef) {
|
|
@@ -185,8 +185,11 @@ const SallaButton = class {
|
|
|
185
185
|
+ (this.shape == 'icon' ? ' s-button-loader-center' : ' s-button-loader-' + this.loaderPosition);
|
|
186
186
|
return this.hostAttributes;
|
|
187
187
|
}
|
|
188
|
+
button() {
|
|
189
|
+
return (index.h("button", Object.assign({}, this.getBtnAttributes(), { disabled: this.disabled }), index.h("span", { class: "s-button-text", ref: el => this.text = el }, index.h("slot", null)), this.loading ? index.h("span", { class: "s-button-loader" }) : ''));
|
|
190
|
+
}
|
|
188
191
|
render() {
|
|
189
|
-
return (index.h(index.Host, { class: "s-button-wrap" },
|
|
192
|
+
return (index.h(index.Host, { class: "s-button-wrap" }, this.href ? index.h("a", { href: this.href }, this.button()) : this.button()));
|
|
190
193
|
}
|
|
191
194
|
get host() { return index.getElement(this); }
|
|
192
195
|
};
|
|
@@ -209,7 +212,7 @@ const SallaModal = class {
|
|
|
209
212
|
*/
|
|
210
213
|
this.position = 'middle';
|
|
211
214
|
/**
|
|
212
|
-
*
|
|
215
|
+
* open the modal on rendering
|
|
213
216
|
*/
|
|
214
217
|
this.visible = false;
|
|
215
218
|
/**
|
|
@@ -229,8 +232,8 @@ const SallaModal = class {
|
|
|
229
232
|
*/
|
|
230
233
|
this.imageIcon = '';
|
|
231
234
|
Helper.Helper.setHost(this.host);
|
|
232
|
-
salla.event.on('modal::open', btn => btn.dataset.target == this.host.id && this.
|
|
233
|
-
salla.event.on('modal::close', btn => btn.dataset.target == this.host.id && this.
|
|
235
|
+
salla.event.on('modal::open', btn => btn.dataset.target == this.host.id && this.open());
|
|
236
|
+
salla.event.on('modal::close', btn => btn.dataset.target == this.host.id && this.close());
|
|
234
237
|
this.modalTitle = this.host.getAttribute('modal-title');
|
|
235
238
|
}
|
|
236
239
|
handleVisible(newValue) {
|
|
@@ -244,16 +247,16 @@ const SallaModal = class {
|
|
|
244
247
|
this.modalOpened.emit();
|
|
245
248
|
}
|
|
246
249
|
/**
|
|
247
|
-
*
|
|
250
|
+
* Open the modal
|
|
248
251
|
*/
|
|
249
|
-
async
|
|
252
|
+
async open() {
|
|
250
253
|
this.host.setAttribute('visible', '');
|
|
251
254
|
return this.host;
|
|
252
255
|
}
|
|
253
256
|
/**
|
|
254
|
-
*
|
|
257
|
+
* close the modal
|
|
255
258
|
*/
|
|
256
|
-
async
|
|
259
|
+
async close() {
|
|
257
260
|
this.host.removeAttribute('visible');
|
|
258
261
|
return this.host;
|
|
259
262
|
}
|
|
@@ -341,7 +344,6 @@ const SallaProductAvailability = class {
|
|
|
341
344
|
constructor(hostRef) {
|
|
342
345
|
index.registerInstance(this, hostRef);
|
|
343
346
|
this.isUser = Helper.Helper.isUser();
|
|
344
|
-
this.mobileLabel = '555555555';
|
|
345
347
|
this.emailPlaceholder = 'your@email.com';
|
|
346
348
|
/**
|
|
347
349
|
* product id that can visitor subscribe to its availability notification
|
|
@@ -359,9 +361,9 @@ const SallaProductAvailability = class {
|
|
|
359
361
|
}
|
|
360
362
|
let data = { id: this.productId };
|
|
361
363
|
if (this.channels_.includes('sms')) {
|
|
362
|
-
let {
|
|
364
|
+
let { phone, countryCode } = await this.mobileInput.getValues();
|
|
363
365
|
data['country_code'] = countryCode;
|
|
364
|
-
data['mobile'] =
|
|
366
|
+
data['mobile'] = phone; //todo:: change it to `phone`
|
|
365
367
|
}
|
|
366
368
|
if (this.channels_.includes('email')) {
|
|
367
369
|
this.email.value !== '' && (data['email'] = this.email.value);
|
|
@@ -375,7 +377,7 @@ const SallaProductAvailability = class {
|
|
|
375
377
|
salla.storage.set(`product-${this.productId}-subscribed`, true);
|
|
376
378
|
}) //no need to wait until finishing alert animation
|
|
377
379
|
.then(() => this.btn.stop())
|
|
378
|
-
.then(() => this.modal.
|
|
380
|
+
.then(() => this.modal.close())
|
|
379
381
|
.catch(() => this.btn.stop() && this.btn.enable());
|
|
380
382
|
};
|
|
381
383
|
// helpers
|
|
@@ -391,7 +393,7 @@ const SallaProductAvailability = class {
|
|
|
391
393
|
this.subscribedMessage = salla.lang.get('pages.products.notify_availability_success');
|
|
392
394
|
this.title_ = this.host.title || salla.lang.get('pages.products.notify_availability_title');
|
|
393
395
|
this.subTitle = salla.lang.get('pages.products.notify_availability_subtitle');
|
|
394
|
-
this.mobileLabel = salla.lang.get('common.elements.mobile')
|
|
396
|
+
this.mobileLabel = salla.lang.get('common.elements.mobile');
|
|
395
397
|
this.emailLabel = salla.lang.get('common.elements.email');
|
|
396
398
|
this.emailPlaceholder = salla.lang.get('common.elements.email_placeholder') || 'your@email.com';
|
|
397
399
|
this.emailErrorMsg = salla.lang.get('common.elements.email_is_valid');
|
|
@@ -432,7 +434,7 @@ const SallaProductAvailability = class {
|
|
|
432
434
|
return (index.h(index.Host, { class: "s-product-availability-wrap" }, this.isSubscribed || this.isVisitorSubscribed
|
|
433
435
|
? index.h("div", { class: "s-product-availability-subscribed" }, index.h("i", { class: "sicon-bell-ring s-product-availability-subs-icon" }), " ", this.subscribedMessage)
|
|
434
436
|
:
|
|
435
|
-
index.h("salla-button", { width: "wide", onClick: () => this.isUser ? this.submit() : this.modal.
|
|
437
|
+
index.h("salla-button", { width: "wide", onClick: () => this.isUser ? this.submit() : this.modal.open(), ref: btn => this.inlineBtn = btn }, salla.lang.get('pages.products.notify_availability')), this.isUser || this.isSubscribed || this.isVisitorSubscribed ? '' : this.renderModal()));
|
|
436
438
|
}
|
|
437
439
|
renderModal() {
|
|
438
440
|
return (index.h("salla-modal", { ref: modal => this.modal = modal, "modal-title": this.title_, subTitle: this.subTitle, icon: "sicon-bell-ring", width: "sm" }, index.h("div", { class: "s-product-availability-body" }, this.channels_.includes('email') ? [
|
|
@@ -442,7 +444,7 @@ const SallaProductAvailability = class {
|
|
|
442
444
|
] : '', this.channels_.includes('sms') ? [
|
|
443
445
|
index.h("label", { class: "s-product-availability-label" }, this.mobileLabel),
|
|
444
446
|
index.h("salla-tel-input", { ref: el => this.mobileInput = el, onKeyDown: e => this.typing(e, this.submit) })
|
|
445
|
-
] : ''), index.h("div", { slot: "footer", class: "s-product-availability-footer" }, index.h("salla-button", { width: "wide", color: "light", fill: "outline", onClick: () => this.modal.
|
|
447
|
+
] : ''), index.h("div", { slot: "footer", class: "s-product-availability-footer" }, index.h("salla-button", { width: "wide", color: "light", fill: "outline", onClick: () => this.modal.close(), ref: btn => this.cancelBtn = btn }, salla.lang.get('common.elements.cancel')), index.h("salla-button", { "loader-position": 'center', width: "wide", ref: btn => this.btn = btn, onClick: () => this.submit() }, salla.lang.get('common.elements.submit')))));
|
|
446
448
|
}
|
|
447
449
|
get host() { return index.getElement(this); }
|
|
448
450
|
static get watchers() { return {
|
|
@@ -463,7 +465,7 @@ const SallaSearch = class {
|
|
|
463
465
|
this.height = 60;
|
|
464
466
|
Helper.Helper.setHost(this.host);
|
|
465
467
|
this.productSlot = ((_a = Helper.Helper.getElement('[slot="product"]')) === null || _a === void 0 ? void 0 : _a.innerHTML) || this.getDefaultProductSlot();
|
|
466
|
-
salla.event.on('search::
|
|
468
|
+
salla.event.on('search::open', () => this.modal.open());
|
|
467
469
|
salla.lang.onLoaded(() => {
|
|
468
470
|
this.placeholder = salla.lang.get('blocks.header.search_placeholder');
|
|
469
471
|
this.noResultsText = salla.lang.get('common.elements.no_options');
|
|
@@ -1914,6 +1916,10 @@ const SallaTelInput = class {
|
|
|
1914
1916
|
constructor(hostRef) {
|
|
1915
1917
|
index.registerInstance(this, hostRef);
|
|
1916
1918
|
this.enterClicked = index.createEvent(this, "enterClicked", 7);
|
|
1919
|
+
/**
|
|
1920
|
+
* input name
|
|
1921
|
+
*/
|
|
1922
|
+
this.name = 'phone';
|
|
1917
1923
|
/**
|
|
1918
1924
|
* Current country_code
|
|
1919
1925
|
*/
|
|
@@ -1943,7 +1949,7 @@ const SallaTelInput = class {
|
|
|
1943
1949
|
*/
|
|
1944
1950
|
async getValues() {
|
|
1945
1951
|
return {
|
|
1946
|
-
|
|
1952
|
+
[this.name]: this.phone = this.phoneInput.value,
|
|
1947
1953
|
countryCode: this.countryCode = this.countryCodeInput.value
|
|
1948
1954
|
};
|
|
1949
1955
|
}
|
|
@@ -1993,7 +1999,7 @@ const SallaTelInput = class {
|
|
|
1993
1999
|
}
|
|
1994
2000
|
;
|
|
1995
2001
|
render() {
|
|
1996
|
-
return (index.h(index.Host, { id: "s-tel-input" }, index.h("input", { type: "tel", name:
|
|
2002
|
+
return (index.h(index.Host, { id: "s-tel-input" }, index.h("input", { type: "tel", name: this.name, value: this.phone, ref: el => this.phoneInput = el, class: "s-tel-input-control tel-input s-ltr" }), index.h("span", { class: "s-tel-input-error-msg", ref: el => this.errorMsg = el }), index.h("input", { type: "hidden", name: "country_code", value: this.countryCode, ref: el => this.countryCodeInput = el, class: "country_code" })));
|
|
1997
2003
|
}
|
|
1998
2004
|
componentDidLoad() {
|
|
1999
2005
|
this.initTelInput();
|
|
@@ -46,10 +46,10 @@ const SallaBranches = class {
|
|
|
46
46
|
}
|
|
47
47
|
//todo:: add description for all @methods
|
|
48
48
|
async show() {
|
|
49
|
-
return this.modal.
|
|
49
|
+
return this.modal.open();
|
|
50
50
|
}
|
|
51
51
|
async hide() {
|
|
52
|
-
return this.modal.
|
|
52
|
+
return this.modal.close();
|
|
53
53
|
}
|
|
54
54
|
handelChange(event) {
|
|
55
55
|
this.selected = event.target.value;
|
|
@@ -20,15 +20,15 @@ const SallaInfiniteScroll = class {
|
|
|
20
20
|
/**
|
|
21
21
|
* Is there is need to autoload next page when scroll `next-page-autoload|next-page.autoload`
|
|
22
22
|
*/
|
|
23
|
-
this.
|
|
23
|
+
this.autoload = false;
|
|
24
24
|
/**
|
|
25
25
|
* Class selector to know the container if it's not the host `<salla-infinite-scroll>`
|
|
26
26
|
*/
|
|
27
|
-
this.container = '
|
|
27
|
+
this.container = 'salla-infinite-scroll';
|
|
28
28
|
/**
|
|
29
29
|
* Class selector to know list items
|
|
30
30
|
*/
|
|
31
|
-
this.item = '
|
|
31
|
+
this.item = 'salla-infinite-scroll > *';
|
|
32
32
|
Helper.Helper.setHost(this.host);
|
|
33
33
|
this.status = document.createElement('div');
|
|
34
34
|
this.status.className = 's-infinite-scroll-wrapper';
|
|
@@ -52,10 +52,6 @@ const SallaInfiniteScroll = class {
|
|
|
52
52
|
Helper.Helper.toggleElementClassIf(btnText, 's-button-hide', 's-button-show', () => isLoading);
|
|
53
53
|
this.btnLoader.style.display = isLoading ? 'inherit' : 'none';
|
|
54
54
|
}
|
|
55
|
-
componentWillLoad() {
|
|
56
|
-
var _a;
|
|
57
|
-
this.nextPageAutoload = ['', 'true'].includes((_a = this.host.getAttribute('next-page.autoload')) === null || _a === void 0 ? void 0 : _a.toLowerCase());
|
|
58
|
-
}
|
|
59
55
|
render() {
|
|
60
56
|
return this.nextPage.length > 1 ?
|
|
61
57
|
index.h(index.Host, { class: "s-infinite-scroll-container" }, index.h("slot", null)) : '';
|
|
@@ -67,8 +63,8 @@ const SallaInfiniteScroll = class {
|
|
|
67
63
|
this.host.insertAdjacentElement('afterend', this.status);
|
|
68
64
|
let that = this;
|
|
69
65
|
let infScroll = salla.infiniteScroll.initiate(this.container, {
|
|
70
|
-
history: this.
|
|
71
|
-
scrollThreshold: this.
|
|
66
|
+
history: this.autoload ? 'push' : false,
|
|
67
|
+
scrollThreshold: this.autoload ? 400 : false,
|
|
72
68
|
nextPage: this.nextPage,
|
|
73
69
|
checkLastPage: 'salla-infinite-scroll[next-page*=":"],salla-infinite-scroll[next-page*="."]',
|
|
74
70
|
status: '.s-infinite-scroll-status',
|
|
@@ -7,7 +7,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
7
7
|
|
|
8
8
|
const index = require('./index-c0f5bb97.js');
|
|
9
9
|
|
|
10
|
-
const sallaInstallmentCss = "#tabbyPromoWrapper{background:white;border-radius:0.375rem;transition:box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1);margin-bottom:20px}#tabbyPromoWrapper:hover{box-shadow:0 0 #0000, 0 0 #0000, 5px 10px 30px #2B2D340D}#tabbyPromoWrapper #tabbyPromo *{font-family:var(--font-main)}#tabbyPromoWrapper #tabbyPromo>div>div{max-width:none;padding:15px;box-shadow:none;border:none}#tabbyPromoWrapper #tabbyPromo .tabby-promo-snippet{max-width:100%;min-height:100px;padding:18px 20px;border:none}#tabbyPromoWrapper #tabbyPromo .tabby-promo-snippet__text,#tabbyPromoWrapper #tabbyPromo .tabby-promo-snippet__link{font-size:var(--font-sm);color:var(--color-text) !important}#tabbyPromoWrapper #tabbyPromo .tabby-promo-snippet__link{font-weight:bold}.tabby-promo-wrapper #tabby-promo{font-family:var(--font-main) !important}.tabby-promo-wrapper #tabby-promo .tabby-promo__feature-title{font-size:var(--font-md)}.tabby-promo-wrapper #tabby-promo .tabby-promo__feature-desc{font-size:var(--font-sm);line-height:20px}.tamara-product-widget{margin-bottom:20px}.tamara-product-widget,.spotii-wrapper{min-height:100px;position:relative;color:var(--color-text);font-size:var(--font-sm);line-height:1.25;
|
|
10
|
+
const sallaInstallmentCss = "#tabbyPromoWrapper{background:white;border-radius:0.375rem;transition:box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1);margin-bottom:20px}.salla-y #tabbyPromoWrapper{border:1px solid var(--color-grey-dark);border-radius:12px}#tabbyPromoWrapper:hover{box-shadow:0 0 #0000, 0 0 #0000, 5px 10px 30px #2B2D340D}#tabbyPromoWrapper #tabbyPromo *{font-family:var(--font-main)}#tabbyPromoWrapper #tabbyPromo>div>div{max-width:none;padding:15px;box-shadow:none;border:none}#tabbyPromoWrapper #tabbyPromo .tabby-promo-snippet{max-width:100%;min-height:100px;padding:18px 20px;border:none}#tabbyPromoWrapper #tabbyPromo .tabby-promo-snippet__text,#tabbyPromoWrapper #tabbyPromo .tabby-promo-snippet__link{font-size:var(--font-sm);color:var(--color-text) !important}#tabbyPromoWrapper #tabbyPromo .tabby-promo-snippet__link{font-weight:bold}.tabby-promo-wrapper #tabby-promo{font-family:var(--font-main) !important}.tabby-promo-wrapper #tabby-promo .tabby-promo__feature-title{font-size:var(--font-md)}.tabby-promo-wrapper #tabby-promo .tabby-promo__feature-desc{font-size:var(--font-sm);line-height:20px}.tamara-product-widget{margin-bottom:20px}.tamara-product-widget,.spotii-wrapper{min-height:100px;position:relative;color:var(--color-text);font-size:var(--font-sm);line-height:1.25;padding:18px 20px 18px 100px !important;background:white;border-radius:0.375rem;transition:box-shadow 0.5s cubic-bezier(0.4, 0, 0.2, 1)}.salla-y .tamara-product-widget,.salla-y .spotii-wrapper{border-radius:12px;border:1px solid var(--color-grey-dark)}.tamara-product-widget:hover,.spotii-wrapper:hover{box-shadow:0 0 #0000, 0 0 #0000, 5px 10px 30px #2B2D340D}.spotii-wrapper .spotii-promo{font-size:var(--font-md)}.spotii-wrapper .spotii-product-widget{font-size:var(--font-sm);margin-top:10px}.tamara-product-widget .tamara-logo{position:absolute;left:20px;top:18px;margin:0 !important}.ltr .tamara-product-widget .tamara-logo{right:20px;left:auto}.tamara-product-widget span{font-family:var(--font-main);font-size:var(--font-sm);color:var(--color-text)}.tamara-product-widget span:last-child{display:block;position:relative;margin-top:8px}.tamara-popup__wrap{overflow:auto !important}";
|
|
11
11
|
|
|
12
12
|
const SallaInstallment = class {
|
|
13
13
|
constructor(hostRef) {
|
|
@@ -20,7 +20,7 @@ const SallaLocalizationModal = class {
|
|
|
20
20
|
this.language = salla.config.get('user.language_code');
|
|
21
21
|
this.currency = salla.config.get('user.currency_code');
|
|
22
22
|
Helper.Helper.setHost(this.host);
|
|
23
|
-
salla.event.on('localization::
|
|
23
|
+
salla.event.on('localization::open', () => this.open());
|
|
24
24
|
salla.lang.onLoaded(() => {
|
|
25
25
|
var _a;
|
|
26
26
|
this.languagesTitle = salla.lang.get('common.titles.language');
|
|
@@ -40,10 +40,10 @@ const SallaLocalizationModal = class {
|
|
|
40
40
|
this.currencySlot = ((_b = Helper.Helper.getElement('[slot="currency"]')) === null || _b === void 0 ? void 0 : _b.innerHTML) || '<label class="s-localization-modal-label" for="currency-{code}"><span>{name}</span><small class="s-localization-modal-currency">{code}</small></label>';
|
|
41
41
|
}
|
|
42
42
|
/**
|
|
43
|
-
*
|
|
43
|
+
* open the component
|
|
44
44
|
*/
|
|
45
|
-
async
|
|
46
|
-
return this.modal.
|
|
45
|
+
async open() {
|
|
46
|
+
return this.modal.open()
|
|
47
47
|
.then(() => this.getLanguages())
|
|
48
48
|
.then(() => this.getCurrencies())
|
|
49
49
|
.then(() => this.isLoading = false);
|
|
@@ -51,8 +51,8 @@ const SallaLocalizationModal = class {
|
|
|
51
51
|
/**
|
|
52
52
|
* Hide the component
|
|
53
53
|
*/
|
|
54
|
-
async
|
|
55
|
-
return this.modal.
|
|
54
|
+
async close() {
|
|
55
|
+
return this.modal.close();
|
|
56
56
|
}
|
|
57
57
|
async getLanguages() {
|
|
58
58
|
this.language = this.language || salla.config.get('user.language_code');
|
|
@@ -84,7 +84,7 @@ const SallaLocalizationModal = class {
|
|
|
84
84
|
})
|
|
85
85
|
.then(() => this.language === salla.config.get('user.language_code', 'ar') || (url = salla.helpers.addParamToUrl('lang', this.language)))
|
|
86
86
|
.then(() => this.btn.stop())
|
|
87
|
-
.then(() => this.
|
|
87
|
+
.then(() => this.close())
|
|
88
88
|
.then(() => url && (window.location.href = url));
|
|
89
89
|
}
|
|
90
90
|
render() {
|
|
@@ -47,11 +47,11 @@ const SallaLoginModal = class {
|
|
|
47
47
|
e.key == 'Enter' && submitMethod();
|
|
48
48
|
};
|
|
49
49
|
this.loginBySMS = async () => {
|
|
50
|
-
const {
|
|
50
|
+
const { phone, countryCode } = await this.loginTelInput.getValues();
|
|
51
51
|
const isPhoneValid = await this.loginTelInput.isValid();
|
|
52
52
|
if (!isPhoneValid)
|
|
53
53
|
return;
|
|
54
|
-
this.login(this.smsBtn, { type: 'mobile', phone:
|
|
54
|
+
this.login(this.smsBtn, { type: 'mobile', phone: phone, country_code: countryCode });
|
|
55
55
|
};
|
|
56
56
|
this.loginByEmail = () => {
|
|
57
57
|
if (!Helper.Helper.isValidEmail(this.loginEmail.value)) {
|
|
@@ -62,14 +62,14 @@ const SallaLoginModal = class {
|
|
|
62
62
|
};
|
|
63
63
|
this.newUser = async () => {
|
|
64
64
|
var _a;
|
|
65
|
-
const {
|
|
65
|
+
const { phone: regPhone, countryCode } = this.regType == "email" ? await this.regTelInput.getValues() : await this.loginTelInput.getValues(), emailValue = this.regEmail.value || ((_a = this.loginEmail) === null || _a === void 0 ? void 0 : _a.value);
|
|
66
66
|
await this.newUserValidation();
|
|
67
67
|
await this.regBtn.load();
|
|
68
68
|
await this.regBtn.disable();
|
|
69
69
|
let data = {
|
|
70
70
|
first_name: this.firstName.value,
|
|
71
71
|
last_name: this.lastName.value,
|
|
72
|
-
phone: regPhone || this.loginTelInput.
|
|
72
|
+
phone: regPhone || this.loginTelInput.phone,
|
|
73
73
|
country_code: countryCode,
|
|
74
74
|
verified_by: this.regType,
|
|
75
75
|
};
|
|
@@ -104,7 +104,7 @@ const SallaLoginModal = class {
|
|
|
104
104
|
salla.auth.event.onVerificationFailed(() => {
|
|
105
105
|
//
|
|
106
106
|
});
|
|
107
|
-
salla.event.on('login::
|
|
107
|
+
salla.event.on('login::open', () => this.open());
|
|
108
108
|
salla.event.on('twilight::initiated', () => {
|
|
109
109
|
this.isEmailAllowed = salla.config.get('store.settings.auth.email_allowed', !!this.isEmailAllowed);
|
|
110
110
|
this.isMobileAllowed = salla.config.get('store.settings.auth.mobile_allowed', !!this.isMobileAllowed);
|
|
@@ -132,9 +132,9 @@ const SallaLoginModal = class {
|
|
|
132
132
|
window.location.reload();
|
|
133
133
|
}
|
|
134
134
|
/**
|
|
135
|
-
*
|
|
135
|
+
* Open login component
|
|
136
136
|
*/
|
|
137
|
-
async
|
|
137
|
+
async open() {
|
|
138
138
|
if (this.isEmailAllowed && this.isMobileAllowed) {
|
|
139
139
|
this.showTab(this.homeTab);
|
|
140
140
|
}
|
|
@@ -144,7 +144,7 @@ const SallaLoginModal = class {
|
|
|
144
144
|
else if (this.isMobileAllowed) {
|
|
145
145
|
this.showTab(this.mobileTab);
|
|
146
146
|
}
|
|
147
|
-
return this.modal.
|
|
147
|
+
return this.modal.open();
|
|
148
148
|
}
|
|
149
149
|
showTab(tab, evt) {
|
|
150
150
|
var _a, _b;
|
|
@@ -171,7 +171,7 @@ const SallaLoginModal = class {
|
|
|
171
171
|
.then(() => salla.auth.api.login(data))
|
|
172
172
|
.then(() => btn.stop() && btn.enable())
|
|
173
173
|
.then(() => this.showTab(this.verifyTab))
|
|
174
|
-
.then(() => this.verifyTab.
|
|
174
|
+
.then(() => this.verifyTab.open(data));
|
|
175
175
|
}
|
|
176
176
|
async newUserValidation() {
|
|
177
177
|
const isLogByPhone = this.regType == "phone", isLogByEmail = this.regType == "email", emailValue = this.regEmail.value || (isLogByEmail && this.loginEmail.value), isEmailValid = Helper.Helper.isValidEmail(emailValue), isFirstNameValid = this.firstName.value.length > 0, isLastNameValid = this.lastName.value.length > 0, isPhoneValid = await this.regTelInput.isValid() || isLogByPhone && await this.loginTelInput.isValid(), emailValidation = (emailValue && isEmailValid) || (!emailValue && !this.isEmailRequired);
|
|
@@ -33,14 +33,14 @@ const SallaOfferModal = class {
|
|
|
33
33
|
salla.log('User selected to don\'t show this offer again.');
|
|
34
34
|
return;
|
|
35
35
|
}
|
|
36
|
-
this.
|
|
36
|
+
this.open(offer.product_id);
|
|
37
37
|
});
|
|
38
38
|
}
|
|
39
39
|
/**
|
|
40
40
|
* Show the available offers for the product
|
|
41
41
|
* @param product_id
|
|
42
42
|
*/
|
|
43
|
-
async
|
|
43
|
+
async open(product_id) {
|
|
44
44
|
//TODO:: make sure there is only one offer
|
|
45
45
|
return salla.api.offer.details(product_id)
|
|
46
46
|
.then(response => this.showOffer(response.data[0]));
|
|
@@ -54,7 +54,7 @@ const SallaOfferModal = class {
|
|
|
54
54
|
this.offer_name = offer.name;
|
|
55
55
|
this.offer_message = offer.message;
|
|
56
56
|
this.modal.setTitle(this.offer_name);
|
|
57
|
-
return this.modal.
|
|
57
|
+
return this.modal.open();
|
|
58
58
|
}
|
|
59
59
|
rememberMe(event) {
|
|
60
60
|
salla.storage.set('remember-offer-' + this.offer.id, event.target.checked);
|
|
@@ -30,7 +30,7 @@ const SallaRatingModal = class {
|
|
|
30
30
|
this.back = salla.lang.get('common.elements.back');
|
|
31
31
|
this.next = salla.lang.get('common.elements.next');
|
|
32
32
|
Helper.Helper.setHost(this.host);
|
|
33
|
-
salla.event.on('rating::
|
|
33
|
+
salla.event.on('rating::open', () => this.open());
|
|
34
34
|
salla.lang.onLoaded(() => {
|
|
35
35
|
this.rate_the_store = salla.lang.get('pages.rating.rate_the_store');
|
|
36
36
|
this.write_store_rate = salla.lang.get('pages.rating.write_store_rate');
|
|
@@ -46,8 +46,8 @@ const SallaRatingModal = class {
|
|
|
46
46
|
/**
|
|
47
47
|
* Show the rating modal
|
|
48
48
|
*/
|
|
49
|
-
async
|
|
50
|
-
return this.modal.
|
|
49
|
+
async open() {
|
|
50
|
+
return this.modal.open()
|
|
51
51
|
.then(() => this.order || salla.rating.api.order(this.orderId).then(res => this.order = res.data))
|
|
52
52
|
.then(() => this.modal.setTitle(salla.lang.get('pages.rating.rate_order') + ' <span class="unicode">(#' + this.order.id + ')</span>'))
|
|
53
53
|
.then(() => this.modal.stopLoading())
|
|
@@ -57,8 +57,8 @@ const SallaRatingModal = class {
|
|
|
57
57
|
/**
|
|
58
58
|
* Show the rating modal
|
|
59
59
|
*/
|
|
60
|
-
async
|
|
61
|
-
return this.modal.
|
|
60
|
+
async close() {
|
|
61
|
+
return this.modal.close();
|
|
62
62
|
}
|
|
63
63
|
// handle wizard
|
|
64
64
|
handleWizard() {
|
|
@@ -149,7 +149,7 @@ const SallaRatingModal = class {
|
|
|
149
149
|
}
|
|
150
150
|
clearInterval(timeToClose);
|
|
151
151
|
this.thanksTime.remove();
|
|
152
|
-
this.
|
|
152
|
+
this.close().then(() => window.location.reload());
|
|
153
153
|
}, 1000);
|
|
154
154
|
this.host.querySelector('.s-rating-modal-footer').classList.add('s-rating-modal-unvisiable');
|
|
155
155
|
this.showActiveStep(this.thanksTab);
|
|
@@ -14,7 +14,6 @@ const SallaVerifyModal = class {
|
|
|
14
14
|
constructor(hostRef) {
|
|
15
15
|
index.registerInstance(this, hostRef);
|
|
16
16
|
this.verified = index.createEvent(this, "verified", 7);
|
|
17
|
-
// Helper.setHost(this.host);
|
|
18
17
|
this.initiated = false;
|
|
19
18
|
/**
|
|
20
19
|
* Verifying method
|
|
@@ -24,19 +23,27 @@ const SallaVerifyModal = class {
|
|
|
24
23
|
* should auto reloading the page after success verification
|
|
25
24
|
*/
|
|
26
25
|
this.autoReload = true;
|
|
26
|
+
/**
|
|
27
|
+
* to use: `salla.api.auth.verify` or `salla.profile.verify`
|
|
28
|
+
*/
|
|
29
|
+
this.isProfileVerify = false;
|
|
30
|
+
// Helper.setHost(this.host);
|
|
31
|
+
salla.lang.onLoaded(() => {
|
|
32
|
+
var _a, _b;
|
|
33
|
+
this.title = salla.lang.get('pages.profile.verify_title') + salla.lang.get('common.elements.' + this.type);
|
|
34
|
+
(_a = this.modal) === null || _a === void 0 ? void 0 : _a.setTitle(this.title);
|
|
35
|
+
(_b = this.btn) === null || _b === void 0 ? void 0 : _b.setText(salla.lang.get('pages.profile.verify'));
|
|
36
|
+
});
|
|
27
37
|
if (this.withoutModal) {
|
|
28
|
-
this.modal = {
|
|
29
|
-
|
|
30
|
-
else {
|
|
31
|
-
salla.event.on('profile::verify.mobile', data => {
|
|
32
|
-
this.url = 'profile/verify-mobile';
|
|
33
|
-
this.show(data);
|
|
34
|
-
});
|
|
38
|
+
this.modal = { open: () => '', close: () => '' };
|
|
39
|
+
return;
|
|
35
40
|
}
|
|
36
|
-
salla.
|
|
41
|
+
salla.event.on('profile::verification', data => {
|
|
37
42
|
var _a;
|
|
38
|
-
this.
|
|
39
|
-
|
|
43
|
+
this.isProfileVerify = true;
|
|
44
|
+
this.open(data);
|
|
45
|
+
this.title = salla.lang.get('pages.profile.verify_title') + salla.lang.get('common.elements.' + data.type);
|
|
46
|
+
(_a = this.modal) === null || _a === void 0 ? void 0 : _a.setTitle(this.title);
|
|
40
47
|
});
|
|
41
48
|
}
|
|
42
49
|
/**
|
|
@@ -47,13 +54,14 @@ const SallaVerifyModal = class {
|
|
|
47
54
|
return this.code.value;
|
|
48
55
|
}
|
|
49
56
|
/**
|
|
50
|
-
*
|
|
57
|
+
* Open verifying modal
|
|
51
58
|
* @param data
|
|
52
59
|
*/
|
|
53
|
-
async
|
|
60
|
+
async open(data) {
|
|
54
61
|
var _a;
|
|
55
62
|
this.data = data;
|
|
56
63
|
this.data.type = this.data.type || this.type;
|
|
64
|
+
this.type = this.data.type;
|
|
57
65
|
this.resendTimer();
|
|
58
66
|
this.otpInputs = this.host.querySelectorAll('.s-verify-modal-input');
|
|
59
67
|
if (!this.initiated) {
|
|
@@ -77,12 +85,12 @@ const SallaVerifyModal = class {
|
|
|
77
85
|
this.toggleOTPSubmit();
|
|
78
86
|
setTimeout(() => this.otpInputs[3].focus(), 100);
|
|
79
87
|
});
|
|
80
|
-
// return this.modal.
|
|
88
|
+
// return this.modal.open();
|
|
81
89
|
this.initiated = true;
|
|
82
90
|
}
|
|
83
91
|
this.reset();
|
|
84
92
|
!this.withoutModal && ((_a = this.modal) === null || _a === void 0 ? void 0 : _a.setTitle(this.title));
|
|
85
|
-
this.modal.
|
|
93
|
+
this.modal.open();
|
|
86
94
|
}
|
|
87
95
|
toggleOTPSubmit() {
|
|
88
96
|
let otp = [];
|
|
@@ -129,12 +137,10 @@ const SallaVerifyModal = class {
|
|
|
129
137
|
let data = Object.assign({ code: this.code.value }, this.data);
|
|
130
138
|
return this.btn.load()
|
|
131
139
|
.then(() => this.btn.disable())
|
|
132
|
-
.then(() => this.
|
|
133
|
-
? salla.api.auth.request(this.url, data)
|
|
134
|
-
: salla.api.auth.verify(data, true))
|
|
140
|
+
.then(() => this.isProfileVerify ? salla.profile.verify(data) : salla.auth.verify(data, true))
|
|
135
141
|
.then(response => this.verified.emit(response))
|
|
136
142
|
.then(() => this.btn.stop() && this.btn.disable())
|
|
137
|
-
.then(() => this.modal.
|
|
143
|
+
.then(() => this.modal.close())
|
|
138
144
|
.then(() => this.autoReload && window.location.reload())
|
|
139
145
|
.catch(() => this.btn.stop() && this.btn.enable() && this.reset());
|
|
140
146
|
}
|
|
@@ -18,5 +18,5 @@ const patchBrowser = () => {
|
|
|
18
18
|
};
|
|
19
19
|
|
|
20
20
|
patchBrowser().then(options => {
|
|
21
|
-
return index.bootstrapLazy([["salla-add-product-button_6.cjs",[[4,"salla-add-product-button",{"channels":[513],"quantity":[514],"donatingAmount":[514,"donating-amount"],"productId":[520,"product-id"],"productStatus":[513,"product-status"],"productType":[513,"product-type"],"disabled":[516]}],[0,"salla-search",{"inline":[4],"oval":[4],"height":[2],"results":[32],"placeholder":[32],"noResultsText":[32]},[[0,"modalOpened","onModalOpen"],[0,"modalClosed","onModalClose"]]],[0,"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],"isVisitorSubscribed":[32]}],[0,"salla-tel-input",{"
|
|
21
|
+
return index.bootstrapLazy([["salla-add-product-button_6.cjs",[[4,"salla-add-product-button",{"channels":[513],"quantity":[514],"donatingAmount":[514,"donating-amount"],"productId":[520,"product-id"],"productStatus":[513,"product-status"],"productType":[513,"product-type"],"disabled":[516]}],[0,"salla-search",{"inline":[4],"oval":[4],"height":[2],"results":[32],"placeholder":[32],"noResultsText":[32]},[[0,"modalOpened","onModalOpen"],[0,"modalClosed","onModalClose"]]],[0,"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],"isVisitorSubscribed":[32]}],[0,"salla-tel-input",{"phone":[1025],"name":[1],"countryCode":[1025,"country-code"],"mobileRequired":[32],"countryCodeLabel":[32],"mobileLabel":[32],"tooShort":[32],"tooLong":[32],"invalidCountryCode":[32],"invalidNumber":[32],"errorMap":[32],"getValues":[64],"isValid":[64]}],[4,"salla-button",{"shape":[513],"color":[513],"fill":[513],"size":[513],"width":[513],"loading":[516],"disabled":[516],"loaderPosition":[1,"loader-position"],"wide":[4],"href":[1],"load":[64],"stop":[64],"setText":[64],"disable":[64],"enable":[64]}],[4,"salla-modal",{"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],"iconStyle":[1,"icon-style"],"imageIcon":[1,"image-icon"],"modalTitle":[32],"open":[64],"close":[64],"setTitle":[64],"loading":[64],"stopLoading":[64]}]]],["salla-login-modal.cjs",[[4,"salla-login-modal",{"isEmailAllowed":[1028,"is-email-allowed"],"isMobileAllowed":[1028,"is-mobile-allowed"],"isEmailRequired":[1028,"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],"open":[64]},[[0,"verified","onVerified"]]]]],["salla-rating-modal.cjs",[[0,"salla-rating-modal",{"orderId":[2,"order-id"],"order":[32],"open":[64],"close":[64]}]]],["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-localization-modal.cjs",[[0,"salla-localization-modal",{"language":[1537],"currency":[1537],"languages":[32],"currencies":[32],"languagesTitle":[32],"currenciesTitle":[32],"isLoading":[32],"open":[64],"close":[64],"submit":[64]}]]],["salla-offer-modal.cjs",[[0,"salla-offer-modal",{"offer":[32],"offer_name":[32],"offer_message":[32],"offer_expires_in":[32],"remember_my_choice":[32],"add_to_cart":[32],"out_of_stock":[32],"open":[64],"showOffer":[64]}]]],["salla-conditional-fields.cjs",[[4,"salla-conditional-fields",null,[[0,"change","changeHandler"]]]]],["salla-infinite-scroll.cjs",[[4,"salla-infinite-scroll",{"nextPage":[1,"next-page"],"autoload":[1028],"container":[1],"item":[1],"loadMore":[32],"noMore":[32],"failedToLoad":[32]}]]],["salla-installment.cjs",[[0,"salla-installment",{"price":[1],"language":[1],"currency":[1],"tamaraIsActive":[32],"tabbyIsActive":[32],"spotiiIsActive":[32]}]]],["salla-quantity-input.cjs",[[4,"salla-quantity-input",{"quantity":[32],"decrease":[64],"increase":[64],"setValue":[64]}]]],["salla-verify-modal.cjs",[[4,"salla-verify-modal",{"withoutModal":[4,"without-modal"],"type":[1],"autoReload":[4,"auto-reload"],"title":[32],"isProfileVerify":[32],"getCode":[64],"open":[64]}]]],["salla-rating-stars.cjs",[[0,"salla-rating-stars",{"name":[1],"size":[1],"value":[2]}]]]], options);
|
|
22
22
|
});
|
|
@@ -38,10 +38,10 @@ export class SallaBranches {
|
|
|
38
38
|
}
|
|
39
39
|
//todo:: add description for all @methods
|
|
40
40
|
async show() {
|
|
41
|
-
return this.modal.
|
|
41
|
+
return this.modal.open();
|
|
42
42
|
}
|
|
43
43
|
async hide() {
|
|
44
|
-
return this.modal.
|
|
44
|
+
return this.modal.close();
|
|
45
45
|
}
|
|
46
46
|
handelChange(event) {
|
|
47
47
|
this.selected = event.target.value;
|
|
@@ -104,12 +104,14 @@ export class SallaButton {
|
|
|
104
104
|
+ (this.shape == 'icon' ? ' s-button-loader-center' : ' s-button-loader-' + this.loaderPosition);
|
|
105
105
|
return this.hostAttributes;
|
|
106
106
|
}
|
|
107
|
+
button() {
|
|
108
|
+
return (h("button", Object.assign({}, this.getBtnAttributes(), { disabled: this.disabled }),
|
|
109
|
+
h("span", { class: "s-button-text", ref: el => this.text = el },
|
|
110
|
+
h("slot", null)),
|
|
111
|
+
this.loading ? h("span", { class: "s-button-loader" }) : ''));
|
|
112
|
+
}
|
|
107
113
|
render() {
|
|
108
|
-
return (h(Host, { class: "s-button-wrap" },
|
|
109
|
-
h("button", Object.assign({}, this.getBtnAttributes(), { disabled: this.disabled }),
|
|
110
|
-
h("span", { class: "s-button-text", ref: el => this.text = el },
|
|
111
|
-
h("slot", null)),
|
|
112
|
-
this.loading ? h("span", { class: "s-button-loader" }) : '')));
|
|
114
|
+
return (h(Host, { class: "s-button-wrap" }, this.href ? h("a", { href: this.href }, this.button()) : this.button()));
|
|
113
115
|
}
|
|
114
116
|
static get is() { return "salla-button"; }
|
|
115
117
|
static get originalStyleUrls() { return {
|