@salla.sa/twilight-components 1.6.15-alpha.6 → 1.6.15-alpha.7
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-69a7a6c7.js → index-5caf5b06.js} +1 -1
- package/dist/cjs/index-cac2fd59.js +2 -2
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/{salla-button_27.cjs.entry.js → salla-button_28.cjs.entry.js} +122 -34
- package/dist/cjs/twilight.cjs.js +2 -2
- package/dist/collection/Helpers/Helper.js +16 -0
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/salla-infinite-scroll/salla-infinite-scroll.js +2 -1
- package/dist/collection/components/salla-login-modal/salla-login-modal.js +3 -2
- package/dist/collection/components/salla-modal/salla-modal.js +5 -4
- package/dist/collection/components/salla-product-availability/salla-product-availability.js +2 -1
- package/dist/collection/components/salla-product-size-guide/salla-product-size-guide.js +32 -30
- package/dist/collection/components/salla-rating-modal/salla-rating-modal.js +7 -6
- package/dist/collection/components/salla-rating-stars/salla-rating-stars.js +2 -1
- package/dist/collection/components/salla-search/salla-search.js +3 -2
- package/dist/collection/components/salla-user-settings/salla-user-settings.css +0 -0
- package/dist/collection/components/salla-user-settings/salla-user-settings.js +109 -0
- package/dist/collection/components/salla-verify/salla-verify.js +4 -2
- package/dist/components/Helper.js +33 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.js +2 -1
- package/dist/components/salla-infinite-scroll.js +2 -1
- package/dist/components/salla-login-modal.js +3 -2
- package/dist/components/salla-modal2.js +4 -3
- package/dist/components/salla-product-availability2.js +2 -1
- package/dist/components/salla-product-size-guide.js +13 -4
- package/dist/components/salla-quantity-input.js +2 -14
- package/dist/components/salla-rating-modal.js +7 -6
- package/dist/components/salla-rating-stars2.js +2 -1
- package/dist/components/salla-search.js +3 -2
- package/dist/components/salla-user-settings.d.ts +11 -0
- package/dist/components/salla-user-settings.js +118 -0
- package/dist/components/salla-verify2.js +4 -2
- package/dist/esm/index-0ce70ad2.js +2 -2
- package/dist/esm/{index-c55c8ada.js → index-5fc44750.js} +1 -1
- package/dist/esm/loader.js +2 -2
- package/dist/esm/{salla-button_27.entry.js → salla-button_28.entry.js} +122 -35
- package/dist/esm/twilight.js +2 -2
- package/dist/esm-es5/index-0ce70ad2.js +1 -1
- package/dist/esm-es5/{index-c55c8ada.js → index-5fc44750.js} +2 -2
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/{salla-button_27.entry.js → salla-button_28.entry.js} +4 -4
- package/dist/esm-es5/twilight.js +1 -1
- package/dist/twilight/{p-c2def1b6.system.js → p-19cf37a6.system.js} +1 -1
- package/dist/twilight/{p-d836f54e.entry.js → p-7dacc9f6.entry.js} +1 -1
- package/dist/twilight/p-8fa40950.system.js +4 -0
- package/dist/twilight/{p-72f4e219.js → p-dab2db9f.js} +2 -2
- package/dist/twilight/{p-cd5fd608.system.entry.js → p-f855b108.system.entry.js} +4 -4
- package/dist/twilight/twilight.esm.js +1 -1
- package/dist/twilight/twilight.js +1 -1
- package/dist/types/Helpers/Helper.d.ts +3 -0
- package/dist/types/components/salla-user-settings/salla-user-settings.d.ts +18 -0
- package/dist/types/components.d.ts +15 -0
- package/package.json +4 -4
- package/dist/twilight/p-5ad1bc70.system.js +0 -4
|
@@ -19145,6 +19145,35 @@ const SallaGifting = class {
|
|
|
19145
19145
|
};
|
|
19146
19146
|
SallaGifting.style = sallaGiftingCss;
|
|
19147
19147
|
|
|
19148
|
+
//TODO::check why there are too much listeners for languages::translations.loaded
|
|
19149
|
+
salla.event.setMaxListeners(20);
|
|
19150
|
+
class Helper {
|
|
19151
|
+
toggleElementClassIf(element, classes1, classes2, callback) {
|
|
19152
|
+
classes1 = Array.isArray(classes1) ? classes1 : classes1.split(' ');
|
|
19153
|
+
classes2 = Array.isArray(classes2) ? classes2 : classes2.split(' ');
|
|
19154
|
+
let isClasses1 = callback(element);
|
|
19155
|
+
element === null || element === void 0 ? void 0 : element.classList.remove(...(isClasses1 ? classes2 : classes1));
|
|
19156
|
+
element === null || element === void 0 ? void 0 : element.classList.add(...(isClasses1 ? classes1 : classes2));
|
|
19157
|
+
return this;
|
|
19158
|
+
}
|
|
19159
|
+
toggleClassIf(selector, classes1, classes2, callback) {
|
|
19160
|
+
document.querySelectorAll(selector).forEach(element => this.toggleElementClassIf(element, classes1, classes2, callback));
|
|
19161
|
+
return this;
|
|
19162
|
+
}
|
|
19163
|
+
isValidEmail(email) {
|
|
19164
|
+
const re = /^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
|
|
19165
|
+
return re.test(String(email).toLowerCase());
|
|
19166
|
+
}
|
|
19167
|
+
debounce(fn, ...data) {
|
|
19168
|
+
if (!this.debounce_) {
|
|
19169
|
+
this.debounce_ = Salla.helpers.debounce((callback, ...innerData) => callback(...innerData), 500);
|
|
19170
|
+
}
|
|
19171
|
+
//@ts-ignore
|
|
19172
|
+
return this.debounce_(fn, ...data);
|
|
19173
|
+
}
|
|
19174
|
+
}
|
|
19175
|
+
const Helper$1 = new Helper;
|
|
19176
|
+
|
|
19148
19177
|
const sallaInfiniteScrollCss = "";
|
|
19149
19178
|
|
|
19150
19179
|
const SallaInfiniteScroll = class {
|
|
@@ -19185,7 +19214,7 @@ const SallaInfiniteScroll = class {
|
|
|
19185
19214
|
}
|
|
19186
19215
|
loading(isLoading = true) {
|
|
19187
19216
|
let btnText = this.status.querySelector('.s-button-text');
|
|
19188
|
-
|
|
19217
|
+
Helper$1.toggleElementClassIf(btnText, 's-button-hide', 's-button-show', () => isLoading);
|
|
19189
19218
|
this.btnLoader.style.display = isLoading ? 'inherit' : 'none';
|
|
19190
19219
|
}
|
|
19191
19220
|
render() {
|
|
@@ -19471,7 +19500,7 @@ const SallaLoginModal = class {
|
|
|
19471
19500
|
};
|
|
19472
19501
|
this.loginByEmail = (event = null) => {
|
|
19473
19502
|
event === null || event === void 0 ? void 0 : event.preventDefault();
|
|
19474
|
-
if (!
|
|
19503
|
+
if (!Helper$1.isValidEmail(this.loginEmail.value)) {
|
|
19475
19504
|
this.validateField(this.loginEmail, this.emailErrorMsg);
|
|
19476
19505
|
return;
|
|
19477
19506
|
}
|
|
@@ -19605,7 +19634,7 @@ const SallaLoginModal = class {
|
|
|
19605
19634
|
.finally(() => btn.stop() && btn.enable());
|
|
19606
19635
|
}
|
|
19607
19636
|
async newUserValidation() {
|
|
19608
|
-
const isLogByPhone = this.regType == "phone", isLogByEmail = this.regType == "email", emailValue = this.regEmail.value || (isLogByEmail && this.loginEmail.value), isEmailValid =
|
|
19637
|
+
const isLogByPhone = this.regType == "phone", isLogByEmail = this.regType == "email", emailValue = this.regEmail.value || (isLogByEmail && this.loginEmail.value), isEmailValid = Helper$1.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);
|
|
19609
19638
|
if (emailValidation && isPhoneValid && isFirstNameValid && isLastNameValid)
|
|
19610
19639
|
return;
|
|
19611
19640
|
!isEmailValid && this.validateField(this.regEmail, this.emailErrorMsg);
|
|
@@ -20003,7 +20032,7 @@ const SallaModal = class {
|
|
|
20003
20032
|
}
|
|
20004
20033
|
toggleModal(isOpen) {
|
|
20005
20034
|
const body = this.host.querySelector('.s-modal-body');
|
|
20006
|
-
|
|
20035
|
+
Helper$1.toggleElementClassIf(body, 's-modal-entering', 's-modal-leaving', () => isOpen)
|
|
20007
20036
|
.toggleElementClassIf(this.overlay, 's-modal-entering', 's-modal-overlay-leaving', () => isOpen)
|
|
20008
20037
|
.toggleElementClassIf(document.body, 'modal-is-open', 'modal-is-closed', () => isOpen);
|
|
20009
20038
|
if (!isOpen) {
|
|
@@ -20039,8 +20068,8 @@ const SallaModal = class {
|
|
|
20039
20068
|
: '', this.modalTitle || this.subTitle ?
|
|
20040
20069
|
index$1.h("div", { class: "s-modal-header-inner" }, index$1.h("slot", { name: 'icon' }, !!this.iconStyle ?
|
|
20041
20070
|
index$1.h("div", { class: this.iconBlockClasses(), innerHTML: this.iconStyle == 'error' ? AlertEngineIcon : CheckCircle2 })
|
|
20042
|
-
: ''), index$1.h("div", { class: "s-modal-header-content" }, index$1.h("div", { class: { 's-modal-title': true, 's-modal-title-below': this.subTitleFirst }, innerHTML: this.modalTitle }), index$1.h("p", { class: { 's-modal-sub-title': true }, innerHTML: this.subTitle })))
|
|
20043
|
-
:
|
|
20071
|
+
: ''), index$1.h("div", { class: "s-modal-header-content" }, this.modalTitle ? index$1.h("div", { class: { 's-modal-title': true, 's-modal-title-below': this.subTitleFirst }, innerHTML: this.modalTitle }) : '', this.subTitle ? index$1.h("p", { class: { 's-modal-sub-title': true }, innerHTML: this.subTitle }) : ''))
|
|
20072
|
+
: ''), index$1.h("slot", null), index$1.h("slot", { name: "footer" })))));
|
|
20044
20073
|
}
|
|
20045
20074
|
//move the modal as root dom, because we need the model to be outside the forms
|
|
20046
20075
|
componentDidLoad() {
|
|
@@ -20334,7 +20363,7 @@ const SallaProductAvailability = class {
|
|
|
20334
20363
|
async validateform() {
|
|
20335
20364
|
try {
|
|
20336
20365
|
if (this.channels_.includes('email')) {
|
|
20337
|
-
const isEmailValid =
|
|
20366
|
+
const isEmailValid = Helper$1.isValidEmail(this.email.value);
|
|
20338
20367
|
if (isEmailValid)
|
|
20339
20368
|
return;
|
|
20340
20369
|
!isEmailValid && this.validateField(this.email, salla.lang.get('common.elements.email_is_valid'));
|
|
@@ -20376,6 +20405,13 @@ const SallaProductAvailability = class {
|
|
|
20376
20405
|
};
|
|
20377
20406
|
SallaProductAvailability.style = sallaProductAvailabilityCss;
|
|
20378
20407
|
|
|
20408
|
+
const PencilRuler = `<!-- Generated by IcoMoon.io -->
|
|
20409
|
+
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">
|
|
20410
|
+
<title>pencil-ruler</title>
|
|
20411
|
+
<path d="M3.057 11.609c0.26 0.26 0.601 0.391 0.943 0.391s0.683-0.131 0.943-0.391l6.667-6.667c0.521-0.521 0.521-1.364 0-1.885l-1.285-1.285c-1.143-1.143-2.661-1.772-4.276-1.772-1.616 0-3.135 0.629-4.276 1.772-1.143 1.141-1.772 2.66-1.772 4.276 0 1.615 0.629 3.135 1.772 4.276zM3.657 3.657c1.277-1.277 3.504-1.277 4.781 0l0.343 0.343-4.781 4.781-0.343-0.343c-0.639-0.639-0.991-1.488-0.991-2.391s0.352-1.752 0.991-2.391zM29.317 20.972c-0.2-0.707-0.932-1.119-1.645-0.921-0.709 0.2-1.121 0.937-0.921 1.645l1.987 7.041-7.041-1.987c-0.707-0.195-1.444 0.213-1.645 0.921-0.2 0.708 0.212 1.445 0.921 1.645l9.333 2.633c0.119 0.032 0.24 0.049 0.361 0.049 0.349 0 0.689-0.137 0.943-0.391 0.341-0.341 0.472-0.84 0.34-1.305zM31.609 8.772l-8.381-8.381c-0.5-0.5-1.385-0.5-1.885 0l-8.171 8.171s-0.001 0-0.001 0.001 0 0.001-0.001 0.001l-4.607 4.607s0 0-0.001 0 0 0 0 0.001l-8.171 8.171c-0.251 0.249-0.391 0.588-0.391 0.943 0 0.353 0.14 0.693 0.391 0.943l8.381 8.381c0.249 0.251 0.589 0.391 0.943 0.391s0.693-0.14 0.943-0.391l20.952-20.952c0.521-0.521 0.521-1.365 0-1.885zM9.715 28.781l-6.495-6.496 1.676-1.676 1.851 1.851c0.26 0.26 0.601 0.391 0.943 0.391s0.683-0.131 0.943-0.391c0.521-0.521 0.521-1.364 0-1.885l-1.851-1.851 2.724-2.724 3.008 3.008c0.26 0.26 0.601 0.391 0.943 0.391s0.683-0.131 0.943-0.391c0.521-0.521 0.521-1.364 0-1.885l-3.008-3.008 2.724-2.724 1.851 1.851c0.26 0.26 0.601 0.391 0.943 0.391s0.683-0.131 0.943-0.391c0.521-0.52 0.521-1.364 0-1.885l-1.851-1.851 2.724-2.724 3.008 3.008c0.26 0.26 0.601 0.391 0.943 0.391s0.683-0.131 0.943-0.391c0.521-0.521 0.521-1.365 0-1.885l-3.008-3.008 1.677-1.677 6.496 6.496z"></path>
|
|
20412
|
+
</svg>
|
|
20413
|
+
`;
|
|
20414
|
+
|
|
20379
20415
|
const sallaProductSizeGuideCss = "";
|
|
20380
20416
|
|
|
20381
20417
|
const SallaProductSizeGuide = class {
|
|
@@ -20419,9 +20455,11 @@ const SallaProductSizeGuide = class {
|
|
|
20419
20455
|
return index$1.h("salla-placeholder", { alignment: "center", iconSize: "xl" }, index$1.h("div", { slot: "title" }, this.placeholder_title), index$1.h("div", { slot: "description" }, this.placeholder_description));
|
|
20420
20456
|
}
|
|
20421
20457
|
render() {
|
|
20422
|
-
return (index$1.h(
|
|
20423
|
-
[
|
|
20424
|
-
|
|
20458
|
+
return (index$1.h("salla-modal", { class: "s-product-size-guide-wrapper", id: 'salla-product-size-guide-modal', isLoading: true, "has-skeleton": true, width: "md", ref: modal => this.modal = modal }, index$1.h("span", { slot: 'icon', class: "s-product-size-guide-header-icon", innerHTML: PencilRuler }), index$1.h("div", { slot: "loading" }, index$1.h("div", { class: "s-product-size-guide-skeleton" }, index$1.h("salla-skeleton", { height: '15px', width: '25%' }), index$1.h("div", { class: "s-product-size-guide-skeleton-header" }, index$1.h("salla-skeleton", { height: '40px' }), index$1.h("salla-skeleton", { height: '40px' }), index$1.h("salla-skeleton", { height: '40px' }), index$1.h("salla-skeleton", { height: '40px' })), index$1.h("div", { class: "s-product-size-guide-skeleton-content" }, index$1.h("salla-skeleton", { height: '15px', width: '25%' }), index$1.h("salla-skeleton", { height: '10px', width: '75%' }), index$1.h("salla-skeleton", { height: '10px', width: '50%' }), index$1.h("salla-skeleton", { height: '10px', width: '75%' }), index$1.h("salla-skeleton", { height: '10px', width: '100%' }), index$1.h("salla-skeleton", { height: '10px', width: '25%' }), index$1.h("salla-skeleton", { height: '10px', width: '60%' }), index$1.h("salla-skeleton", { height: '10px', width: '45%' }), index$1.h("salla-skeleton", { height: '10px', width: '30%' })))), index$1.h("slot", { name: "header" }), !this.hasError && !!this.guides ?
|
|
20459
|
+
[
|
|
20460
|
+
index$1.h("salla-tabs", null, this.guides.map((guide) => index$1.h("salla-tab-header", { slot: "header", name: guide.name }, index$1.h("span", null, guide.name))), this.guides.map((guide) => index$1.h("salla-tab-content", { slot: "content", name: guide.name }, index$1.h("div", { innerHTML: guide.description }))))
|
|
20461
|
+
]
|
|
20462
|
+
: this.showPlaceholder(), index$1.h("slot", { name: "footer" })));
|
|
20425
20463
|
}
|
|
20426
20464
|
get host() { return index$1.getElement(this); }
|
|
20427
20465
|
};
|
|
@@ -20441,19 +20479,6 @@ const Minus = `<!-- Generated by IcoMoon.io -->
|
|
|
20441
20479
|
</svg>
|
|
20442
20480
|
`;
|
|
20443
20481
|
|
|
20444
|
-
//TODO::check why there are too much listeners for languages::translations.loaded
|
|
20445
|
-
salla.event.setMaxListeners(20);
|
|
20446
|
-
class Helper {
|
|
20447
|
-
debounce(fn, ...data) {
|
|
20448
|
-
if (!this.debounce_) {
|
|
20449
|
-
this.debounce_ = Salla.helpers.debounce((callback, ...innerData) => callback(...innerData), 500);
|
|
20450
|
-
}
|
|
20451
|
-
//@ts-ignore
|
|
20452
|
-
return this.debounce_(fn, ...data);
|
|
20453
|
-
}
|
|
20454
|
-
}
|
|
20455
|
-
const Helper$1 = new Helper;
|
|
20456
|
-
|
|
20457
20482
|
const sallaQuantityInputCss = "";
|
|
20458
20483
|
|
|
20459
20484
|
const SallaQuantityInput = class {
|
|
@@ -20600,12 +20625,12 @@ const SallaRatingModal = class {
|
|
|
20600
20625
|
showActiveStep(current = null) {
|
|
20601
20626
|
var _a, _b;
|
|
20602
20627
|
this.currentTab = current || this.steps[this.currentIndex];
|
|
20603
|
-
|
|
20628
|
+
Helper$1.toggleClassIf('.s-rating-modal-step-dot', 's-rating-modal-bg-gray', 's-rating-modal-bg-primary', dot => dot != this.dots[this.currentIndex])
|
|
20604
20629
|
.toggleClassIf('.s-rating-modal-step', 's-rating-modal-active', 's-rating-modal-hidden', tab => tab == this.currentTab);
|
|
20605
20630
|
if (this.currentIndex != 0) {
|
|
20606
20631
|
// the animation
|
|
20607
|
-
|
|
20608
|
-
setTimeout(() =>
|
|
20632
|
+
Helper$1.toggleElementClassIf(this.currentTab, 's-rating-modal-unactive', 's-rating-modal-hidden', () => true);
|
|
20633
|
+
setTimeout(() => Helper$1.toggleElementClassIf(this.currentTab, 's-rating-modal-active', 's-rating-modal-unactive', () => true), 300);
|
|
20609
20634
|
}
|
|
20610
20635
|
// Btn text
|
|
20611
20636
|
let nextType = (_a = this.steps[this.currentIndex + 1]) === null || _a === void 0 ? void 0 : _a.dataset.type;
|
|
@@ -20615,7 +20640,7 @@ const SallaRatingModal = class {
|
|
|
20615
20640
|
}
|
|
20616
20641
|
previousTab() {
|
|
20617
20642
|
this.currentIndex > 0 && this.currentIndex--;
|
|
20618
|
-
|
|
20643
|
+
Helper$1.toggleElementClassIf(this.backBtn, 's-rating-modal-unvisiable', 'block', () => this.currentIndex == 0);
|
|
20619
20644
|
this.showActiveStep();
|
|
20620
20645
|
}
|
|
20621
20646
|
submit() {
|
|
@@ -20626,7 +20651,7 @@ const SallaRatingModal = class {
|
|
|
20626
20651
|
.then(() => this.currentTab.querySelectorAll('[name],.s-rating-modal-btn-star').forEach(el => el.setAttribute('disabled', '')))
|
|
20627
20652
|
.then(() => this.currentIndex < this.stepsCount && this.currentIndex++)
|
|
20628
20653
|
.then(() => this.showActiveStep())
|
|
20629
|
-
.then(() =>
|
|
20654
|
+
.then(() => Helper$1.toggleClassIf('#prev-btn', 'block', 's-rating-modal-unvisiable', () => true))
|
|
20630
20655
|
.finally(() => {
|
|
20631
20656
|
this.nextBtn.stop();
|
|
20632
20657
|
salla.config.canLeave = true;
|
|
@@ -20651,7 +20676,7 @@ const SallaRatingModal = class {
|
|
|
20651
20676
|
return;
|
|
20652
20677
|
}
|
|
20653
20678
|
type = type || rating['dataset'].type;
|
|
20654
|
-
|
|
20679
|
+
Helper$1.toggleElementClassIf(comment, 'save', 's-has-error', el => el.value.length > 3);
|
|
20655
20680
|
throw validationMessage.innerHTML = stars
|
|
20656
20681
|
? (salla.lang.get('common.errors.not_less_than_chars', { chars: 4 }) + ' ' + comment.getAttribute('placeholder'))
|
|
20657
20682
|
: salla.lang.get(`pages.rating.rate_${type}_stars`).replace(' (:item)', '');
|
|
@@ -20733,7 +20758,7 @@ const SallaRatingStars = class {
|
|
|
20733
20758
|
this.startsElem.querySelector('.rating_hidden_input').value = selectedIndex;
|
|
20734
20759
|
// Loop through each star, and add or remove the `.selected` class to toggle highlighting
|
|
20735
20760
|
this.startsElem.querySelectorAll('.s-rating-stars-btn-star')
|
|
20736
|
-
.forEach((star, index) =>
|
|
20761
|
+
.forEach((star, index) => Helper$1.toggleElementClassIf(star, 's-rating-stars-selected', 's-rating-stars-unselected', () => index < parseInt(selectedIndex)));
|
|
20737
20762
|
// update aria-pressed attr status
|
|
20738
20763
|
this.startsElem.querySelectorAll('[aria-pressed]').forEach(star => star.removeAttribute('aria-pressed'));
|
|
20739
20764
|
selected.setAttribute('aria-pressed', 'true');
|
|
@@ -20850,7 +20875,7 @@ const SallaSearch = class {
|
|
|
20850
20875
|
}
|
|
20851
20876
|
}
|
|
20852
20877
|
search(val) {
|
|
20853
|
-
|
|
20878
|
+
this.noResults.style.display = 'none';
|
|
20854
20879
|
//run loading spinner or stop it
|
|
20855
20880
|
this.loading = true;
|
|
20856
20881
|
salla.product.search(val)
|
|
@@ -20861,7 +20886,7 @@ const SallaSearch = class {
|
|
|
20861
20886
|
afterSearching(isEmpty = true) {
|
|
20862
20887
|
var _a;
|
|
20863
20888
|
this.noResults.style.display = isEmpty || ((_a = this.results) === null || _a === void 0 ? void 0 : _a.data.length) > 0 ? 'none' : 'block';
|
|
20864
|
-
|
|
20889
|
+
Helper$1.toggleElementClassIf(this.container, 's-search-container-open', 's-search-no-results', () => { var _a; return (_a = this.results) === null || _a === void 0 ? void 0 : _a.data.length; });
|
|
20865
20890
|
this.loading = false;
|
|
20866
20891
|
salla.product.api.previousQuery = ''; //avoid having error 'Query is same as previous one!' after reopen modal;
|
|
20867
20892
|
this.inputValue.length < 3 ? this.container.classList.remove('s-search-no-results') : '';
|
|
@@ -27664,6 +27689,66 @@ const SallaTelInput = class {
|
|
|
27664
27689
|
};
|
|
27665
27690
|
SallaTelInput.style = sallaTelInputCss;
|
|
27666
27691
|
|
|
27692
|
+
const Bullhorn = `<!-- Generated by IcoMoon.io -->
|
|
27693
|
+
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">
|
|
27694
|
+
<title>bullhorn</title>
|
|
27695
|
+
<path d="M30.129 0.264c-0.339-0.252-0.776-0.328-1.179-0.208l-24.951 7.485v-0.216c0-0.736-0.597-1.333-1.333-1.333s-1.333 0.597-1.333 1.333v14.667c0 0.736 0.597 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-0.112l3.448 1.207-0.595 1.704c-0.321 1.019-0.227 2.103 0.267 3.051s1.327 1.647 2.345 1.968l6.359 2.004c0.399 0.127 0.804 0.187 1.201 0.187 1.699 0 3.277-1.091 3.812-2.785l0.423-1.295 7.633 2.672c0.143 0.049 0.292 0.075 0.44 0.075 0.273 0 0.543-0.084 0.772-0.247 0.352-0.249 0.561-0.655 0.561-1.087v-28c0-0.421-0.199-0.819-0.537-1.069zM18.297 28.4c-0.221 0.701-0.973 1.089-1.673 0.871l-6.357-2.004c-0.34-0.108-0.617-0.34-0.781-0.656s-0.196-0.676-0.101-0.977l0.581-1.665 8.777 3.072zM28 27.453l-24-8.4v-8.728l24-7.2z"></path>
|
|
27696
|
+
</svg>
|
|
27697
|
+
`;
|
|
27698
|
+
|
|
27699
|
+
const UserOff = `<!-- Generated by IcoMoon.io -->
|
|
27700
|
+
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">
|
|
27701
|
+
<title>user-off</title>
|
|
27702
|
+
<path d="M10.837 19.309c-4.963 1.284-8.171 4.303-8.171 7.691v3.667c0 0.736 0.597 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-3.667c0-2.101 2.48-4.155 6.172-5.109 0.713-0.184 1.141-0.912 0.957-1.625-0.184-0.711-0.908-1.137-1.625-0.956zM12.859 3.715c0.933-0.685 2.020-1.048 3.141-1.048 2.941 0 5.333 2.392 5.333 5.333 0 1.121-0.363 2.208-1.048 3.141-0.436 0.593-0.308 1.428 0.284 1.864 0.239 0.175 0.515 0.259 0.788 0.259 0.411 0 0.815-0.188 1.076-0.544 1.025-1.393 1.567-3.025 1.567-4.72 0-4.412-3.588-8-8-8-1.695 0-3.327 0.541-4.721 1.567-0.592 0.435-0.72 1.269-0.284 1.864 0.436 0.593 1.269 0.721 1.864 0.284zM31.609 29.724l-29.333-29.333c-0.521-0.521-1.364-0.521-1.885 0s-0.521 1.364 0 1.885l29.333 29.333c0.26 0.26 0.601 0.391 0.943 0.391s0.683-0.131 0.943-0.391c0.521-0.521 0.521-1.364 0-1.885z"></path>
|
|
27703
|
+
</svg>
|
|
27704
|
+
`;
|
|
27705
|
+
|
|
27706
|
+
const sallaUserSettingsCss = "";
|
|
27707
|
+
|
|
27708
|
+
const SallaUserSettings = class {
|
|
27709
|
+
constructor(hostRef) {
|
|
27710
|
+
index$1.registerInstance(this, hostRef);
|
|
27711
|
+
// Texts
|
|
27712
|
+
this.deactivateAccount = salla.lang.get('pages.profile.deactivate_account');
|
|
27713
|
+
this.promotionalMsgs = salla.lang.get('pages.profile.promotional_messages');
|
|
27714
|
+
this.deactivateDesc = salla.lang.get('pages.profile.deactivate_account_description');
|
|
27715
|
+
this.promotionalMsgsDesc = salla.lang.get('pages.profile.promotional_messages_description');
|
|
27716
|
+
this.sorryForLeavingText = salla.lang.get('pages.profile.warning_for_deactivate');
|
|
27717
|
+
this.warningText = salla.lang.get('pages.profile.sorry_for_leaving');
|
|
27718
|
+
this.keepAccount = salla.lang.get('pages.profile.keep_account');
|
|
27719
|
+
this.buttonLoading = false;
|
|
27720
|
+
this.promotionsEnabled = true;
|
|
27721
|
+
salla.lang.onLoaded(() => {
|
|
27722
|
+
this.deactivateAccount = salla.lang.get('pages.profile.deactivate_account');
|
|
27723
|
+
this.promotionalMsgs = salla.lang.get('pages.profile.promotional_messages');
|
|
27724
|
+
this.deactivateDesc = salla.lang.get('pages.profile.deactivate_account_description');
|
|
27725
|
+
this.promotionalMsgsDesc = salla.lang.get('pages.profile.promotional_messages_description');
|
|
27726
|
+
this.warningText = salla.lang.get('pages.profile.warning_for_deactivate');
|
|
27727
|
+
this.sorryForLeavingText = salla.lang.get('pages.profile.sorry_for_leaving');
|
|
27728
|
+
this.keepAccount = salla.lang.get('pages.profile.keep_account');
|
|
27729
|
+
});
|
|
27730
|
+
}
|
|
27731
|
+
toggleNotification(event) {
|
|
27732
|
+
salla.profile.updateSettings({ promotions_enabled: event.target.checked });
|
|
27733
|
+
}
|
|
27734
|
+
capitalizeText(str) {
|
|
27735
|
+
return str.charAt(0).toUpperCase() + str.slice(1);
|
|
27736
|
+
}
|
|
27737
|
+
openDeactivateModal() {
|
|
27738
|
+
this.confirmationModal.setTitle(this.capitalizeText(this.deactivateAccount));
|
|
27739
|
+
this.confirmationModal.open();
|
|
27740
|
+
}
|
|
27741
|
+
async deleteAccount() {
|
|
27742
|
+
await salla.profile.delete()
|
|
27743
|
+
.then(() => window.location.reload())
|
|
27744
|
+
.finally(() => this.confirmationModal.close());
|
|
27745
|
+
}
|
|
27746
|
+
render() {
|
|
27747
|
+
return (index$1.h(index$1.Host, { class: "s-user-settings-wrapper" }, index$1.h("div", { class: "s-user-settings-section" }, index$1.h("salla-list-tile", null, index$1.h("div", { slot: "icon", class: "s-user-settings-section-icon" }, index$1.h("span", { innerHTML: Bullhorn })), index$1.h("div", { slot: "title", class: "s-user-settings-section-title" }, this.capitalizeText(this.promotionalMsgs)), index$1.h("div", { slot: "subtitle", class: "s-user-settings-section-subtitle" }, this.capitalizeText(this.promotionalMsgsDesc)), index$1.h("div", { slot: 'action', class: "s-user-settings-section-action" }, index$1.h("label", { class: "s-toggle" }, index$1.h("input", { class: "s-toggle-input", checked: this.promotionsEnabled, onChange: (e) => this.toggleNotification(e), type: "checkbox" }), index$1.h("div", { class: "s-toggle-switcher" }))))), index$1.h("div", { class: "s-user-settings-section" }, index$1.h("salla-list-tile", null, index$1.h("div", { slot: "icon", class: "s-user-settings-section-icon" }, index$1.h("span", { innerHTML: UserOff })), index$1.h("div", { slot: "title", class: "s-user-settings-section-title" }, this.capitalizeText(this.deactivateAccount)), index$1.h("div", { slot: "subtitle", class: "s-user-settings-section-subtitle" }, this.capitalizeText(this.deactivateDesc)), index$1.h("div", { slot: 'action', class: "s-user-settings-section-action" }, index$1.h("salla-button", { shape: "link", color: "danger", onClick: () => this.openDeactivateModal() }, this.capitalizeText(this.deactivateAccount))))), index$1.h("salla-modal", { width: "sm", subTitle: this.capitalizeText(this.sorryForLeavingText), ref: modal => this.confirmationModal = modal }, index$1.h("span", { slot: 'icon', class: "s-user-settings-confirmation-icon", innerHTML: UserOff }), index$1.h("div", { class: "s-user-settings-confirmation" }, index$1.h("div", { class: "s-user-settings-confirmation-warning" }, this.capitalizeText(this.warningText)), index$1.h("div", { class: "s-user-settings-confirmation-actions" }, index$1.h("salla-button", { width: "wide", onClick: () => this.confirmationModal.close() }, this.capitalizeText(this.keepAccount)), index$1.h("salla-button", { fill: 'outline', loading: this.buttonLoading, width: "wide", onClick: () => this.deleteAccount() }, this.capitalizeText(this.deactivateAccount)))))));
|
|
27748
|
+
}
|
|
27749
|
+
};
|
|
27750
|
+
SallaUserSettings.style = sallaUserSettingsCss;
|
|
27751
|
+
|
|
27667
27752
|
const AndroidPhoneIcon = `<!-- Generated by IcoMoon.io -->
|
|
27668
27753
|
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">
|
|
27669
27754
|
<title>android-phone</title>
|
|
@@ -27786,12 +27871,14 @@ const SallaVerify = class {
|
|
|
27786
27871
|
this.otpInputs[0].focus();
|
|
27787
27872
|
}
|
|
27788
27873
|
resendTimer() {
|
|
27789
|
-
|
|
27874
|
+
this.resendMessage.style.display = 'block';
|
|
27875
|
+
this.resend.style.display = 'none';
|
|
27790
27876
|
this.resendAfter = 30;
|
|
27791
27877
|
let timerId = setInterval(() => {
|
|
27792
27878
|
if (this.resendAfter <= 0) {
|
|
27793
27879
|
clearInterval(timerId);
|
|
27794
|
-
|
|
27880
|
+
this.resend.style.display = 'block';
|
|
27881
|
+
this.resendMessage.style.display = 'none';
|
|
27795
27882
|
}
|
|
27796
27883
|
else {
|
|
27797
27884
|
this.timer.innerHTML = `${this.resendAfter >= 10 ? this.resendAfter : '0' + this.resendAfter} : 00`;
|
|
@@ -27860,4 +27947,5 @@ exports.salla_tab_content = SallaTabContent;
|
|
|
27860
27947
|
exports.salla_tab_header = SallaTabHeader;
|
|
27861
27948
|
exports.salla_tabs = SallaTabs;
|
|
27862
27949
|
exports.salla_tel_input = SallaTelInput;
|
|
27950
|
+
exports.salla_user_settings = SallaUserSettings;
|
|
27863
27951
|
exports.salla_verify = SallaVerify;
|
package/dist/cjs/twilight.cjs.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
'use strict';
|
|
5
5
|
|
|
6
6
|
const index = require('./index-cac2fd59.js');
|
|
7
|
-
require('./index-
|
|
7
|
+
require('./index-5caf5b06.js');
|
|
8
8
|
require('./_commonjsHelpers-691dd63b.js');
|
|
9
9
|
|
|
10
10
|
/*
|
|
@@ -77,5 +77,5 @@ const patchDynamicImport = (base, orgScriptElm) => {
|
|
|
77
77
|
};
|
|
78
78
|
|
|
79
79
|
patchBrowser().then(options => {
|
|
80
|
-
return index.bootstrapLazy(JSON.parse("[[\"salla-button_27.cjs\",[[4,\"salla-gifting\",{\"productId\":[2,\"product-id\"],\"sectionTitle\":[32],\"sectionSubtitle\":[32],\"sectionBtnText\":[32],\"giftDetails\":[32],\"selectImageForYourGift\":[32],\"selectImageOrUpload\":[32],\"selectGiftMessage\":[32],\"giftCustomText\":[32],\"textId\":[32],\"incorrectGiftText\":[32],\"nextStep\":[32],\"senderNameLabel\":[32],\"receiverNameFieldLabel\":[32],\"receiverMobileFieldLabel\":[32],\"receiverEmailFieldLabel\":[32],\"emailPlaceholder\":[32],\"sendLater\":[32],\"selectSendDateAndTime\":[32],\"canNotEditOrderAfterSelectDate\":[32],\"sendGift\":[32],\"donationRequired\":[32],\"step1Elems\":[32],\"step2Elems\":[32],\"stepsWrapper\":[32],\"textArea\":[32],\"imageCover\":[32],\"textSelect\":[32],\"customTextArea\":[32],\"calendarFormGroup\":[32],\"currentStep\":[32],\"showCalendar\":[32],\"showGiftText\":[32],\"currentLang\":[32],\"parentClass\":[32],\"errors\":[32],\"gift\":[32],\"selectedGiftTextOption\":[32],\"showTextArea\":[32],\"selectedImage\":[32],\"uploadedImage\":[32],\"selectedText\":[32],\"senderName\":[32],\"errorMessage\":[32],\"hasError\":[32],\"quantity\":[32],\"deliveryDate\":[32],\"timeZone\":[32],\"receiverName\":[32],\"receiverMobile\":[32],\"receiverCountryCode\":[32],\"receiverEmail\":[32],\"open\":[64],\"close\":[64],\"goToStep2\":[64]}],[4,\"salla-loyalty\",{\"prizePoints\":[8,\"prize-points\"],\"customerPoints\":[2,\"customer-points\"],\"prizeTitle\":[1,\"prize-title\"],\"allowEmail\":[4,\"allow-email\"],\"allowMobile\":[4,\"allow-mobile\"],\"requireEmail\":[4,\"require-email\"],\"guestMessage\":[1,\"guest-message\"],\"loyaltyProgram\":[32],\"buttonLoading\":[32],\"selectedItem\":[32],\"askConfirmation\":[32],\"is_loggedin\":[32],\"hasError\":[32],\"errorMessage\":[32],\"translationLoaded\":[32],\"open\":[64],\"close\":[64],\"resetExchange\":[64],\"exchangeLoyaltyPoint\":[64]}],[4,\"salla-product-size-guide\",{\"guides\":[32],\"productId\":[32],\"placeholder_title\":[32],\"placeholder_description\":[32],\"modal_title\":[32],\"hasError\":[32],\"open\":[64],\"close\":[64]}],[0,\"salla-localization-modal\",{\"language\":[1537],\"currency\":[1537],\"translationLoaded\":[32],\"languages\":[32],\"currencies\":[32],\"hasError\":[32],\"errorMessage\":[32],\"open\":[64],\"close\":[64],\"submit\":[64]}],[4,\"salla-login-modal\",{\"isEmailAllowed\":[1028,\"is-email-allowed\"],\"isMobileAllowed\":[1028,\"is-mobile-allowed\"],\"isEmailRequired\":[1028,\"is-email-required\"],\"supportWebAuth\":[516,\"support-web-auth\"],\"currentTabName\":[32],\"regType\":[32],\"translationLoaded\":[32],\"title\":[32],\"emailErrorMsg\":[32],\"firstNameErrorMsg\":[32],\"lastNameErrorMsg\":[32],\"open\":[64]},[[8,\"verified\",\"onVerified\"]]],[0,\"salla-offer-modal\",{\"offer\":[32],\"offer_name\":[32],\"offer_message\":[32],\"hasError\":[32],\"errorMessage\":[32],\"translationLoaded\":[32],\"open\":[64],\"showOffer\":[64]}],[0,\"salla-rating-modal\",{\"orderId\":[2,\"order-id\"],\"order\":[32],\"hasError\":[32],\"errorMessage\":[32],\"translationLoaded\":[32],\"open\":[64],\"close\":[64]}],[0,\"salla-search\",{\"inline\":[4],\"oval\":[4],\"height\":[2],\"translationLoaded\":[32],\"results\":[32],\"loading\":[32],\"typing\":[32],\"debounce\":[32],\"search_term\":[32]},[[0,\"keydown\",\"handleKeyDown\"]]],[4,\"salla-social-share\",{\"url\":[513],\"urlName\":[513,\"url-name\"],\"platforms\":[16],\"opened\":[32],\"allPlatforms\":[32],\"platformIcons\":[32],\"open\":[64]}],[4,\"salla-infinite-scroll\",{\"nextPage\":[1,\"next-page\"],\"autoload\":[1028],\"container\":[1],\"item\":[1],\"loadMore\":[32],\"noMore\":[32],\"failedToLoad\":[32]}],[4,\"salla-quantity-input\",{\"quantity\":[32],\"decrease\":[64],\"increase\":[64],\"setValue\":[64]}],[0,\"salla-product-availability\",{\"channels\":[1],\"productId\":[2,\"product-id\"],\"isSubscribed\":[1028,\"is-subscribed\"],\"translationLoaded\":[32],\"title_\":[32],\"isVisitorSubscribed\":[32]}],[4,\"salla-verify\",{\"display\":[1],\"type\":[1025],\"autoReload\":[4,\"auto-reload\"],\"supportWebAuth\":[4,\"support-web-auth\"],\"translationLoaded\":[32],\"title\":[32],\"resendAfter\":[32],\"isProfileVerify\":[32],\"getCode\":[64],\"open\":[64]}],[0,\"salla-datetime-picker\",{\"value\":[1025],\"placeholder\":[1],\"allowInput\":[4,\"allow-input\"],\"allowInvalidPreload\":[4,\"allow-invalid-preload\"],\"altFormat\":[1,\"alt-format\"],\"altInput\":[4,\"alt-input\"],\"altInputClass\":[1,\"alt-input-class\"],\"appendTo\":[16],\"ariaDateFormat\":[1,\"aria-date-format\"],\"autoFillDefaultTime\":[4,\"auto-fill-default-time\"],\"clickOpens\":[4,\"click-opens\"],\"closeOnSelect\":[4,\"close-on-select\"],\"conjunction\":[1],\"dateFormat\":[1,\"date-format\"],\"defaultDate\":[8,\"default-date\"],\"defaultHour\":[2,\"default-hour\"],\"defaultMinute\":[2,\"default-minute\"],\"defaultSeconds\":[2,\"default-seconds\"],\"disable\":[16],\"disableMobile\":[4,\"disable-mobile\"],\"enable\":[16],\"enableSeconds\":[4,\"enable-seconds\"],\"enableTime\":[4,\"enable-time\"],\"formatDate\":[16],\"hourIncrement\":[2,\"hour-increment\"],\"inline\":[4],\"locale\":[1],\"maxDate\":[8,\"max-date\"],\"maxTime\":[8,\"max-time\"],\"minDate\":[8,\"min-date\"],\"minTime\":[8,\"min-time\"],\"minuteIncrement\":[2,\"minute-increment\"],\"mode\":[1],\"monthSelectorType\":[1,\"month-selector-type\"],\"nextArrow\":[1,\"next-arrow\"],\"noCalendar\":[4,\"no-calendar\"],\"onChange\":[16],\"onClose\":[16],\"onDayCreate\":[16],\"onDestroy\":[16],\"onKeyDown\":[16],\"onMonthChange\":[16],\"onOpen\":[16],\"onParseConfig\":[16],\"onReady\":[16],\"onValueUpdate\":[16],\"onYearChange\":[16],\"dateParser\":[16],\"position\":[1],\"positionElement\":[16],\"prevArrow\":[1,\"prev-arrow\"],\"shorthandCurrentMonth\":[4,\"shorthand-current-month\"],\"static\":[4],\"showMonths\":[2,\"show-months\"],\"time_24hr\":[4,\"time_-2-4hr\"],\"weekNumbers\":[4,\"week-numbers\"],\"wrap\":[4]}],[0,\"salla-file-upload\",{\"required\":[4],\"disabled\":[4],\"allowDrop\":[4,\"allow-drop\"],\"allowBrowse\":[4,\"allow-browse\"],\"allowPaste\":[4,\"allow-paste\"],\"allowMultiple\":[4,\"allow-multiple\"],\"allowReplace\":[4,\"allow-replace\"],\"allowRevert\":[4,\"allow-revert\"],\"allowRemove\":[4,\"allow-remove\"],\"allowProcess\":[4,\"allow-process\"],\"allowReorder\":[4,\"allow-reorder\"],\"storeAsFile\":[4,\"store-as-file\"],\"forceRevert\":[4,\"force-revert\"],\"maxFilesCount\":[2,\"max-files-count\"],\"maxParallelUploads\":[2,\"max-parallel-uploads\"],\"checkValidity\":[4,\"check-validity\"],\"itemInsertLocation\":[1,\"item-insert-location\"],\"itemInsertInterval\":[2,\"item-insert-interval\"],\"credits\":[4],\"dropOnPage\":[4,\"drop-on-page\"],\"dropOnElement\":[4,\"drop-on-element\"],\"dropValidation\":[4,\"drop-validation\"],\"ignoredFiles\":[16],\"serverConfig\":[1,\"server-config\"],\"instantUpload\":[4,\"instant-upload\"],\"chunkUploads\":[4,\"chunk-uploads\"],\"chunkForce\":[4,\"chunk-force\"],\"chunkSize\":[2,\"chunk-size\"],\"chunkRetryDelays\":[16],\"labelDecimalSeparator\":[1,\"label-decimal-separator\"],\"labelThousandsSeparator\":[1,\"label-thousands-separator\"],\"labelIdle\":[1,\"label-idle\"],\"labelInvalidField\":[1,\"label-invalid-field\"],\"labelFileWaitingForSize\":[1,\"label-file-waiting-for-size\"],\"labelFileSizeNotAvailable\":[1,\"label-file-size-not-available\"],\"labelFileLoading\":[1,\"label-file-loading\"],\"labelFileLoadError\":[1,\"label-file-load-error\"],\"labelFileProcessing\":[1,\"label-file-processing\"],\"labelFileProcessingComplete\":[1,\"label-file-processing-complete\"],\"labelFileProcessingAborted\":[1,\"label-file-processing-aborted\"],\"labelFileProcessingError\":[1,\"label-file-processing-error\"],\"labelFileProcessingRevertError\":[1,\"label-file-processing-revert-error\"],\"labelFileRemoveError\":[1,\"label-file-remove-error\"],\"labelTapToCancel\":[1,\"label-tap-to-cancel\"],\"labelTapToRetry\":[1,\"label-tap-to-retry\"],\"labelTapToUndo\":[1,\"label-tap-to-undo\"],\"labelButtonRemoveItem\":[1,\"label-button-remove-item\"],\"labelButtonAbortItemLoad\":[1,\"label-button-abort-item-load\"],\"labelButtonRetryItemLoad\":[1,\"label-button-retry-item-load\"],\"labelButtonAbortItemProcessing\":[1,\"label-button-abort-item-processing\"],\"labelButtonUndoItemProcessing\":[1,\"label-button-undo-item-processing\"],\"labelButtonRetryItemProcessing\":[1,\"label-button-retry-item-processing\"],\"labelButtonProcessItem\":[1,\"label-button-process-item\"],\"iconRemove\":[1,\"icon-remove\"],\"iconProcess\":[1,\"icon-process\"],\"iconRetry\":[1,\"icon-retry\"],\"iconUndo\":[1,\"icon-undo\"],\"pond\":[32],\"files\":[32],\"appendFile\":[64]}],[0,\"salla-rating-stars\",{\"name\":[1],\"size\":[1],\"value\":[2]}],[4,\"salla-swiper\",{\"loop\":[4],\"speed\":[2],\"itemPerView\":[8,\"item-per-view\"],\"spaceBetweenItems\":[2,\"space-between-items\"],\"currentIndex\":[32],\"isLastSlideItem\":[32],\"isFirstSlideItem\":[32]}],[4,\"salla-tab-content\",{\"name\":[1],\"isSelected\":[32],\"getChild\":[64]}],[4,\"salla-tab-header\",{\"name\":[1],\"activeClass\":[1,\"active-class\"],\"height\":[8],\"centered\":[4],\"isSelected\":[32],\"getChild\":[64]}],[4,\"salla-tabs\",{\"backgroundColor\":[1,\"background-color\"],\"vertical\":[4]},[[0,\"tabSelected\",\"onSelectedTab\"]]],[4,\"salla-list-tile\",{\"href\":[1],\"target\":[1]}],[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-placeholder\",{\"icon\":[1],\"alignment\":[1],\"iconSize\":[1,\"icon-size\"],\"translationLoaded\":[32]}],[0,\"salla-skeleton\",{\"type\":[1],\"width\":[1],\"height\":[1]}],[4,\"salla-modal\",{\"isClosable\":[1028,\"is-closable\"],\"width\":[513],\"position\":[513],\"visible\":[516],\"hasSkeleton\":[516,\"has-skeleton\"],\"isLoading\":[1540,\"is-loading\"],\"subTitleFirst\":[4,\"sub-title-first\"],\"noPadding\":[4,\"no-padding\"],\"subTitle\":[1,\"sub-title\"],\"centered\":[4],\"iconStyle\":[1,\"icon-style\"],\"modalTitle\":[32],\"open\":[64],\"close\":[64],\"setTitle\":[64],\"loading\":[64],\"stopLoading\":[64]},[[0,\"keyup\",\"handleKeyUp\"]]],[4,\"salla-button\",{\"shape\":[513],\"color\":[513],\"fill\":[513],\"size\":[513],\"width\":[513],\"loading\":[516],\"disabled\":[516],\"loaderPosition\":[1,\"loader-position\"],\"href\":[1],\"load\":[64],\"stop\":[64],\"setText\":[64],\"disable\":[64],\"enable\":[64]}],[0,\"salla-loading\",{\"size\":[8],\"width\":[8],\"color\":[1],\"bgColor\":[1,\"bg-color\"]}]]],[\"salla-scopes.cjs\",[[4,\"salla-scopes\",{\"selection\":[1],\"searchDisplayLimit\":[2,\"search-display-limit\"],\"translationLoaded\":[32],\"mode\":[32],\"current_scope\":[32],\"scopes\":[32],\"originalScopesList\":[32],\"selected_scope\":[32],\"isOpenedBefore\":[32],\"hasError\":[32],\"close\":[64],\"open\":[64],\"handleSubmit\":[64]}]]],[\"salla-add-product-button.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\"]}]]],[\"salla-conditional-fields.cjs\",[[4,\"salla-conditional-fields\",null,[[0,\"change\",\"changeHandler\"]]]]],[\"salla-installment.cjs\",[[0,\"salla-installment\",{\"price\":[1],\"language\":[1],\"currency\":[1],\"tamaraIsActive\":[32],\"tabbyIsActive\":[32],\"spotiiIsActive\":[32]}]]],[\"salla-loyalty-prize-item.cjs\",[[0,\"salla-loyalty-prize-item\",{\"item\":[16]}]]],[\"salla-select.cjs\",[[0,\"salla-select\",{\"label\":[1],\"items\":[16],\"itemText\":[1,\"item-text\"],\"itemValue\":[1,\"item-value\"],\"itemDisabled\":[1,\"item-disabled\"],\"size\":[1],\"value\":[1032],\"autofocus\":[4],\"clearable\":[4],\"clearIcon\":[1,\"clear-icon\"],\"color\":[1],\"flat\":[4],\"disabled\":[4],\"loading\":[4],\"loadingColor\":[1,\"loading-color\"],\"hint\":[1],\"persistHint\":[4,\"persist-hint\"],\"placeholder\":[1],\"multiple\":[4],\"autocomplete\":[4],\"required\":[4],\"chips\":[4],\"shape\":[1],\"returnObject\":[4,\"return-object\"],\"hideDetail\":[4,\"hide-detail\"]}]]]]"), options);
|
|
80
|
+
return index.bootstrapLazy(JSON.parse("[[\"salla-button_28.cjs\",[[4,\"salla-gifting\",{\"productId\":[2,\"product-id\"],\"sectionTitle\":[32],\"sectionSubtitle\":[32],\"sectionBtnText\":[32],\"giftDetails\":[32],\"selectImageForYourGift\":[32],\"selectImageOrUpload\":[32],\"selectGiftMessage\":[32],\"giftCustomText\":[32],\"textId\":[32],\"incorrectGiftText\":[32],\"nextStep\":[32],\"senderNameLabel\":[32],\"receiverNameFieldLabel\":[32],\"receiverMobileFieldLabel\":[32],\"receiverEmailFieldLabel\":[32],\"emailPlaceholder\":[32],\"sendLater\":[32],\"selectSendDateAndTime\":[32],\"canNotEditOrderAfterSelectDate\":[32],\"sendGift\":[32],\"donationRequired\":[32],\"step1Elems\":[32],\"step2Elems\":[32],\"stepsWrapper\":[32],\"textArea\":[32],\"imageCover\":[32],\"textSelect\":[32],\"customTextArea\":[32],\"calendarFormGroup\":[32],\"currentStep\":[32],\"showCalendar\":[32],\"showGiftText\":[32],\"currentLang\":[32],\"parentClass\":[32],\"errors\":[32],\"gift\":[32],\"selectedGiftTextOption\":[32],\"showTextArea\":[32],\"selectedImage\":[32],\"uploadedImage\":[32],\"selectedText\":[32],\"senderName\":[32],\"errorMessage\":[32],\"hasError\":[32],\"quantity\":[32],\"deliveryDate\":[32],\"timeZone\":[32],\"receiverName\":[32],\"receiverMobile\":[32],\"receiverCountryCode\":[32],\"receiverEmail\":[32],\"open\":[64],\"close\":[64],\"goToStep2\":[64]}],[4,\"salla-loyalty\",{\"prizePoints\":[8,\"prize-points\"],\"customerPoints\":[2,\"customer-points\"],\"prizeTitle\":[1,\"prize-title\"],\"allowEmail\":[4,\"allow-email\"],\"allowMobile\":[4,\"allow-mobile\"],\"requireEmail\":[4,\"require-email\"],\"guestMessage\":[1,\"guest-message\"],\"loyaltyProgram\":[32],\"buttonLoading\":[32],\"selectedItem\":[32],\"askConfirmation\":[32],\"is_loggedin\":[32],\"hasError\":[32],\"errorMessage\":[32],\"translationLoaded\":[32],\"open\":[64],\"close\":[64],\"resetExchange\":[64],\"exchangeLoyaltyPoint\":[64]}],[4,\"salla-product-size-guide\",{\"guides\":[32],\"productId\":[32],\"placeholder_title\":[32],\"placeholder_description\":[32],\"modal_title\":[32],\"hasError\":[32],\"open\":[64],\"close\":[64]}],[0,\"salla-localization-modal\",{\"language\":[1537],\"currency\":[1537],\"translationLoaded\":[32],\"languages\":[32],\"currencies\":[32],\"hasError\":[32],\"errorMessage\":[32],\"open\":[64],\"close\":[64],\"submit\":[64]}],[4,\"salla-login-modal\",{\"isEmailAllowed\":[1028,\"is-email-allowed\"],\"isMobileAllowed\":[1028,\"is-mobile-allowed\"],\"isEmailRequired\":[1028,\"is-email-required\"],\"supportWebAuth\":[516,\"support-web-auth\"],\"currentTabName\":[32],\"regType\":[32],\"translationLoaded\":[32],\"title\":[32],\"emailErrorMsg\":[32],\"firstNameErrorMsg\":[32],\"lastNameErrorMsg\":[32],\"open\":[64]},[[8,\"verified\",\"onVerified\"]]],[0,\"salla-offer-modal\",{\"offer\":[32],\"offer_name\":[32],\"offer_message\":[32],\"hasError\":[32],\"errorMessage\":[32],\"translationLoaded\":[32],\"open\":[64],\"showOffer\":[64]}],[0,\"salla-rating-modal\",{\"orderId\":[2,\"order-id\"],\"order\":[32],\"hasError\":[32],\"errorMessage\":[32],\"translationLoaded\":[32],\"open\":[64],\"close\":[64]}],[0,\"salla-user-settings\",{\"promotionsEnabled\":[516,\"promotions-enabled\"],\"deactivateAccount\":[32],\"promotionalMsgs\":[32],\"deactivateDesc\":[32],\"promotionalMsgsDesc\":[32],\"sorryForLeavingText\":[32],\"warningText\":[32],\"keepAccount\":[32],\"buttonLoading\":[32]}],[0,\"salla-search\",{\"inline\":[4],\"oval\":[4],\"height\":[2],\"translationLoaded\":[32],\"results\":[32],\"loading\":[32],\"typing\":[32],\"debounce\":[32],\"search_term\":[32]},[[0,\"keydown\",\"handleKeyDown\"]]],[4,\"salla-social-share\",{\"url\":[513],\"urlName\":[513,\"url-name\"],\"platforms\":[16],\"opened\":[32],\"allPlatforms\":[32],\"platformIcons\":[32],\"open\":[64]}],[4,\"salla-infinite-scroll\",{\"nextPage\":[1,\"next-page\"],\"autoload\":[1028],\"container\":[1],\"item\":[1],\"loadMore\":[32],\"noMore\":[32],\"failedToLoad\":[32]}],[4,\"salla-quantity-input\",{\"quantity\":[32],\"decrease\":[64],\"increase\":[64],\"setValue\":[64]}],[0,\"salla-product-availability\",{\"channels\":[1],\"productId\":[2,\"product-id\"],\"isSubscribed\":[1028,\"is-subscribed\"],\"translationLoaded\":[32],\"title_\":[32],\"isVisitorSubscribed\":[32]}],[4,\"salla-verify\",{\"display\":[1],\"type\":[1025],\"autoReload\":[4,\"auto-reload\"],\"supportWebAuth\":[4,\"support-web-auth\"],\"translationLoaded\":[32],\"title\":[32],\"resendAfter\":[32],\"isProfileVerify\":[32],\"getCode\":[64],\"open\":[64]}],[0,\"salla-datetime-picker\",{\"value\":[1025],\"placeholder\":[1],\"allowInput\":[4,\"allow-input\"],\"allowInvalidPreload\":[4,\"allow-invalid-preload\"],\"altFormat\":[1,\"alt-format\"],\"altInput\":[4,\"alt-input\"],\"altInputClass\":[1,\"alt-input-class\"],\"appendTo\":[16],\"ariaDateFormat\":[1,\"aria-date-format\"],\"autoFillDefaultTime\":[4,\"auto-fill-default-time\"],\"clickOpens\":[4,\"click-opens\"],\"closeOnSelect\":[4,\"close-on-select\"],\"conjunction\":[1],\"dateFormat\":[1,\"date-format\"],\"defaultDate\":[8,\"default-date\"],\"defaultHour\":[2,\"default-hour\"],\"defaultMinute\":[2,\"default-minute\"],\"defaultSeconds\":[2,\"default-seconds\"],\"disable\":[16],\"disableMobile\":[4,\"disable-mobile\"],\"enable\":[16],\"enableSeconds\":[4,\"enable-seconds\"],\"enableTime\":[4,\"enable-time\"],\"formatDate\":[16],\"hourIncrement\":[2,\"hour-increment\"],\"inline\":[4],\"locale\":[1],\"maxDate\":[8,\"max-date\"],\"maxTime\":[8,\"max-time\"],\"minDate\":[8,\"min-date\"],\"minTime\":[8,\"min-time\"],\"minuteIncrement\":[2,\"minute-increment\"],\"mode\":[1],\"monthSelectorType\":[1,\"month-selector-type\"],\"nextArrow\":[1,\"next-arrow\"],\"noCalendar\":[4,\"no-calendar\"],\"onChange\":[16],\"onClose\":[16],\"onDayCreate\":[16],\"onDestroy\":[16],\"onKeyDown\":[16],\"onMonthChange\":[16],\"onOpen\":[16],\"onParseConfig\":[16],\"onReady\":[16],\"onValueUpdate\":[16],\"onYearChange\":[16],\"dateParser\":[16],\"position\":[1],\"positionElement\":[16],\"prevArrow\":[1,\"prev-arrow\"],\"shorthandCurrentMonth\":[4,\"shorthand-current-month\"],\"static\":[4],\"showMonths\":[2,\"show-months\"],\"time_24hr\":[4,\"time_-2-4hr\"],\"weekNumbers\":[4,\"week-numbers\"],\"wrap\":[4]}],[0,\"salla-file-upload\",{\"required\":[4],\"disabled\":[4],\"allowDrop\":[4,\"allow-drop\"],\"allowBrowse\":[4,\"allow-browse\"],\"allowPaste\":[4,\"allow-paste\"],\"allowMultiple\":[4,\"allow-multiple\"],\"allowReplace\":[4,\"allow-replace\"],\"allowRevert\":[4,\"allow-revert\"],\"allowRemove\":[4,\"allow-remove\"],\"allowProcess\":[4,\"allow-process\"],\"allowReorder\":[4,\"allow-reorder\"],\"storeAsFile\":[4,\"store-as-file\"],\"forceRevert\":[4,\"force-revert\"],\"maxFilesCount\":[2,\"max-files-count\"],\"maxParallelUploads\":[2,\"max-parallel-uploads\"],\"checkValidity\":[4,\"check-validity\"],\"itemInsertLocation\":[1,\"item-insert-location\"],\"itemInsertInterval\":[2,\"item-insert-interval\"],\"credits\":[4],\"dropOnPage\":[4,\"drop-on-page\"],\"dropOnElement\":[4,\"drop-on-element\"],\"dropValidation\":[4,\"drop-validation\"],\"ignoredFiles\":[16],\"serverConfig\":[1,\"server-config\"],\"instantUpload\":[4,\"instant-upload\"],\"chunkUploads\":[4,\"chunk-uploads\"],\"chunkForce\":[4,\"chunk-force\"],\"chunkSize\":[2,\"chunk-size\"],\"chunkRetryDelays\":[16],\"labelDecimalSeparator\":[1,\"label-decimal-separator\"],\"labelThousandsSeparator\":[1,\"label-thousands-separator\"],\"labelIdle\":[1,\"label-idle\"],\"labelInvalidField\":[1,\"label-invalid-field\"],\"labelFileWaitingForSize\":[1,\"label-file-waiting-for-size\"],\"labelFileSizeNotAvailable\":[1,\"label-file-size-not-available\"],\"labelFileLoading\":[1,\"label-file-loading\"],\"labelFileLoadError\":[1,\"label-file-load-error\"],\"labelFileProcessing\":[1,\"label-file-processing\"],\"labelFileProcessingComplete\":[1,\"label-file-processing-complete\"],\"labelFileProcessingAborted\":[1,\"label-file-processing-aborted\"],\"labelFileProcessingError\":[1,\"label-file-processing-error\"],\"labelFileProcessingRevertError\":[1,\"label-file-processing-revert-error\"],\"labelFileRemoveError\":[1,\"label-file-remove-error\"],\"labelTapToCancel\":[1,\"label-tap-to-cancel\"],\"labelTapToRetry\":[1,\"label-tap-to-retry\"],\"labelTapToUndo\":[1,\"label-tap-to-undo\"],\"labelButtonRemoveItem\":[1,\"label-button-remove-item\"],\"labelButtonAbortItemLoad\":[1,\"label-button-abort-item-load\"],\"labelButtonRetryItemLoad\":[1,\"label-button-retry-item-load\"],\"labelButtonAbortItemProcessing\":[1,\"label-button-abort-item-processing\"],\"labelButtonUndoItemProcessing\":[1,\"label-button-undo-item-processing\"],\"labelButtonRetryItemProcessing\":[1,\"label-button-retry-item-processing\"],\"labelButtonProcessItem\":[1,\"label-button-process-item\"],\"iconRemove\":[1,\"icon-remove\"],\"iconProcess\":[1,\"icon-process\"],\"iconRetry\":[1,\"icon-retry\"],\"iconUndo\":[1,\"icon-undo\"],\"pond\":[32],\"files\":[32],\"appendFile\":[64]}],[0,\"salla-rating-stars\",{\"name\":[1],\"size\":[1],\"value\":[2]}],[4,\"salla-swiper\",{\"loop\":[4],\"speed\":[2],\"itemPerView\":[8,\"item-per-view\"],\"spaceBetweenItems\":[2,\"space-between-items\"],\"currentIndex\":[32],\"isLastSlideItem\":[32],\"isFirstSlideItem\":[32]}],[4,\"salla-tab-content\",{\"name\":[1],\"isSelected\":[32],\"getChild\":[64]}],[4,\"salla-tab-header\",{\"name\":[1],\"activeClass\":[1,\"active-class\"],\"height\":[8],\"centered\":[4],\"isSelected\":[32],\"getChild\":[64]}],[4,\"salla-tabs\",{\"backgroundColor\":[1,\"background-color\"],\"vertical\":[4]},[[0,\"tabSelected\",\"onSelectedTab\"]]],[4,\"salla-list-tile\",{\"href\":[1],\"target\":[1]}],[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-placeholder\",{\"icon\":[1],\"alignment\":[1],\"iconSize\":[1,\"icon-size\"],\"translationLoaded\":[32]}],[0,\"salla-skeleton\",{\"type\":[1],\"width\":[1],\"height\":[1]}],[4,\"salla-modal\",{\"isClosable\":[1028,\"is-closable\"],\"width\":[513],\"position\":[513],\"visible\":[516],\"hasSkeleton\":[516,\"has-skeleton\"],\"isLoading\":[1540,\"is-loading\"],\"subTitleFirst\":[4,\"sub-title-first\"],\"noPadding\":[4,\"no-padding\"],\"subTitle\":[1,\"sub-title\"],\"centered\":[4],\"iconStyle\":[1,\"icon-style\"],\"modalTitle\":[32],\"open\":[64],\"close\":[64],\"setTitle\":[64],\"loading\":[64],\"stopLoading\":[64]},[[0,\"keyup\",\"handleKeyUp\"]]],[4,\"salla-button\",{\"shape\":[513],\"color\":[513],\"fill\":[513],\"size\":[513],\"width\":[513],\"loading\":[516],\"disabled\":[516],\"loaderPosition\":[1,\"loader-position\"],\"href\":[1],\"load\":[64],\"stop\":[64],\"setText\":[64],\"disable\":[64],\"enable\":[64]}],[0,\"salla-loading\",{\"size\":[8],\"width\":[8],\"color\":[1],\"bgColor\":[1,\"bg-color\"]}]]],[\"salla-scopes.cjs\",[[4,\"salla-scopes\",{\"selection\":[1],\"searchDisplayLimit\":[2,\"search-display-limit\"],\"translationLoaded\":[32],\"mode\":[32],\"current_scope\":[32],\"scopes\":[32],\"originalScopesList\":[32],\"selected_scope\":[32],\"isOpenedBefore\":[32],\"hasError\":[32],\"close\":[64],\"open\":[64],\"handleSubmit\":[64]}]]],[\"salla-add-product-button.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\"]}]]],[\"salla-conditional-fields.cjs\",[[4,\"salla-conditional-fields\",null,[[0,\"change\",\"changeHandler\"]]]]],[\"salla-installment.cjs\",[[0,\"salla-installment\",{\"price\":[1],\"language\":[1],\"currency\":[1],\"tamaraIsActive\":[32],\"tabbyIsActive\":[32],\"spotiiIsActive\":[32]}]]],[\"salla-loyalty-prize-item.cjs\",[[0,\"salla-loyalty-prize-item\",{\"item\":[16]}]]],[\"salla-select.cjs\",[[0,\"salla-select\",{\"label\":[1],\"items\":[16],\"itemText\":[1,\"item-text\"],\"itemValue\":[1,\"item-value\"],\"itemDisabled\":[1,\"item-disabled\"],\"size\":[1],\"value\":[1032],\"autofocus\":[4],\"clearable\":[4],\"clearIcon\":[1,\"clear-icon\"],\"color\":[1],\"flat\":[4],\"disabled\":[4],\"loading\":[4],\"loadingColor\":[1,\"loading-color\"],\"hint\":[1],\"persistHint\":[4,\"persist-hint\"],\"placeholder\":[1],\"multiple\":[4],\"autocomplete\":[4],\"required\":[4],\"chips\":[4],\"shape\":[1],\"returnObject\":[4,\"return-object\"],\"hideDetail\":[4,\"hide-detail\"]}]]]]"), options);
|
|
81
81
|
});
|
|
@@ -4,6 +4,22 @@
|
|
|
4
4
|
//TODO::check why there are too much listeners for languages::translations.loaded
|
|
5
5
|
salla.event.setMaxListeners(20);
|
|
6
6
|
class Helper {
|
|
7
|
+
toggleElementClassIf(element, classes1, classes2, callback) {
|
|
8
|
+
classes1 = Array.isArray(classes1) ? classes1 : classes1.split(' ');
|
|
9
|
+
classes2 = Array.isArray(classes2) ? classes2 : classes2.split(' ');
|
|
10
|
+
let isClasses1 = callback(element);
|
|
11
|
+
element === null || element === void 0 ? void 0 : element.classList.remove(...(isClasses1 ? classes2 : classes1));
|
|
12
|
+
element === null || element === void 0 ? void 0 : element.classList.add(...(isClasses1 ? classes1 : classes2));
|
|
13
|
+
return this;
|
|
14
|
+
}
|
|
15
|
+
toggleClassIf(selector, classes1, classes2, callback) {
|
|
16
|
+
document.querySelectorAll(selector).forEach(element => this.toggleElementClassIf(element, classes1, classes2, callback));
|
|
17
|
+
return this;
|
|
18
|
+
}
|
|
19
|
+
isValidEmail(email) {
|
|
20
|
+
const re = /^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
|
|
21
|
+
return re.test(String(email).toLowerCase());
|
|
22
|
+
}
|
|
7
23
|
debounce(fn, ...data) {
|
|
8
24
|
if (!this.debounce_) {
|
|
9
25
|
this.debounce_ = Salla.helpers.debounce((callback, ...innerData) => callback(...innerData), 500);
|
|
@@ -32,6 +32,7 @@
|
|
|
32
32
|
"./components/salla-tabs/salla-tab-header.js",
|
|
33
33
|
"./components/salla-tabs/salla-tabs.js",
|
|
34
34
|
"./components/salla-tel-input/salla-tel-input.js",
|
|
35
|
+
"./components/salla-user-settings/salla-user-settings.js",
|
|
35
36
|
"./components/salla-verify/salla-verify.js"
|
|
36
37
|
],
|
|
37
38
|
"compiler": {
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
4
|
import { Component, Element, h, Host, Prop, State } from '@stencil/core';
|
|
5
|
+
import Helper from '../../Helpers/Helper';
|
|
5
6
|
/**
|
|
6
7
|
*/
|
|
7
8
|
export class SallaInfiniteScroll {
|
|
@@ -41,7 +42,7 @@ export class SallaInfiniteScroll {
|
|
|
41
42
|
}
|
|
42
43
|
loading(isLoading = true) {
|
|
43
44
|
let btnText = this.status.querySelector('.s-button-text');
|
|
44
|
-
|
|
45
|
+
Helper.toggleElementClassIf(btnText, 's-button-hide', 's-button-show', () => isLoading);
|
|
45
46
|
this.btnLoader.style.display = isLoading ? 'inherit' : 'none';
|
|
46
47
|
}
|
|
47
48
|
render() {
|
|
@@ -7,6 +7,7 @@ import PhoneIcon from "../../assets/svg/phone.svg";
|
|
|
7
7
|
import EmailIcon from "../../assets/svg/mail.svg";
|
|
8
8
|
import KeyboardArrowRightIcon from "../../assets/svg/keyboard_arrow_right.svg";
|
|
9
9
|
import ArrowRightIcon from "../../assets/svg/arrow-right.svg";
|
|
10
|
+
import Helper from '../../Helpers/Helper';
|
|
10
11
|
/**
|
|
11
12
|
* @slot footer - The footer of modal
|
|
12
13
|
* @slot before-login-type - placeholder position
|
|
@@ -57,7 +58,7 @@ export class SallaLoginModal {
|
|
|
57
58
|
};
|
|
58
59
|
this.loginByEmail = (event = null) => {
|
|
59
60
|
event === null || event === void 0 ? void 0 : event.preventDefault();
|
|
60
|
-
if (!
|
|
61
|
+
if (!Helper.isValidEmail(this.loginEmail.value)) {
|
|
61
62
|
this.validateField(this.loginEmail, this.emailErrorMsg);
|
|
62
63
|
return;
|
|
63
64
|
}
|
|
@@ -191,7 +192,7 @@ export class SallaLoginModal {
|
|
|
191
192
|
.finally(() => btn.stop() && btn.enable());
|
|
192
193
|
}
|
|
193
194
|
async newUserValidation() {
|
|
194
|
-
const isLogByPhone = this.regType == "phone", isLogByEmail = this.regType == "email", emailValue = this.regEmail.value || (isLogByEmail && this.loginEmail.value), isEmailValid =
|
|
195
|
+
const isLogByPhone = this.regType == "phone", isLogByEmail = this.regType == "email", emailValue = this.regEmail.value || (isLogByEmail && this.loginEmail.value), isEmailValid = 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);
|
|
195
196
|
if (emailValidation && isPhoneValid && isFirstNameValid && isLastNameValid)
|
|
196
197
|
return;
|
|
197
198
|
!isEmailValid && this.validateField(this.regEmail, this.emailErrorMsg);
|
|
@@ -5,6 +5,7 @@ import { Component, Element, h, Host, Method, Prop, State, Watch, Event, Listen
|
|
|
5
5
|
import CancelIcon from '../../assets/svg/cancel.svg';
|
|
6
6
|
import AlertEngineIcon from '../../assets/svg/alert-engine.svg';
|
|
7
7
|
import CheckCircleIcon from '../../assets/svg/check-circle2.svg';
|
|
8
|
+
import Helper from '../../Helpers/Helper';
|
|
8
9
|
/**
|
|
9
10
|
* @slot footer - The footer of modal
|
|
10
11
|
*/
|
|
@@ -111,7 +112,7 @@ export class SallaModal {
|
|
|
111
112
|
}
|
|
112
113
|
toggleModal(isOpen) {
|
|
113
114
|
const body = this.host.querySelector('.s-modal-body');
|
|
114
|
-
|
|
115
|
+
Helper.toggleElementClassIf(body, 's-modal-entering', 's-modal-leaving', () => isOpen)
|
|
115
116
|
.toggleElementClassIf(this.overlay, 's-modal-entering', 's-modal-overlay-leaving', () => isOpen)
|
|
116
117
|
.toggleElementClassIf(document.body, 'modal-is-open', 'modal-is-closed', () => isOpen);
|
|
117
118
|
if (!isOpen) {
|
|
@@ -166,9 +167,9 @@ export class SallaModal {
|
|
|
166
167
|
h("div", { class: this.iconBlockClasses(), innerHTML: this.iconStyle == 'error' ? AlertEngineIcon : CheckCircleIcon })
|
|
167
168
|
: ''),
|
|
168
169
|
h("div", { class: "s-modal-header-content" },
|
|
169
|
-
h("div", { class: { 's-modal-title': true, 's-modal-title-below': this.subTitleFirst }, innerHTML: this.modalTitle }),
|
|
170
|
-
h("p", { class: { 's-modal-sub-title': true }, innerHTML: this.subTitle })))
|
|
171
|
-
:
|
|
170
|
+
this.modalTitle ? h("div", { class: { 's-modal-title': true, 's-modal-title-below': this.subTitleFirst }, innerHTML: this.modalTitle }) : '',
|
|
171
|
+
this.subTitle ? h("p", { class: { 's-modal-sub-title': true }, innerHTML: this.subTitle }) : ''))
|
|
172
|
+
: ''),
|
|
172
173
|
h("slot", null),
|
|
173
174
|
h("slot", { name: "footer" })))));
|
|
174
175
|
}
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { Component, Element, Host, Prop, State, Watch, h } from '@stencil/core';
|
|
5
5
|
import BellRingIcon from '../../assets/svg/bell-ring.svg';
|
|
6
|
+
import Helper from '../../Helpers/Helper';
|
|
6
7
|
export class SallaProductAvailability {
|
|
7
8
|
constructor() {
|
|
8
9
|
this.isUser = salla.config.isUser();
|
|
@@ -68,7 +69,7 @@ export class SallaProductAvailability {
|
|
|
68
69
|
async validateform() {
|
|
69
70
|
try {
|
|
70
71
|
if (this.channels_.includes('email')) {
|
|
71
|
-
const isEmailValid =
|
|
72
|
+
const isEmailValid = Helper.isValidEmail(this.email.value);
|
|
72
73
|
if (isEmailValid)
|
|
73
74
|
return;
|
|
74
75
|
!isEmailValid && this.validateField(this.email, salla.lang.get('common.elements.email_is_valid'));
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* Crafted with ❤ by Salla
|
|
3
3
|
*/
|
|
4
|
-
import { Component,
|
|
4
|
+
import { Component, State, Method, Element, h } from '@stencil/core';
|
|
5
|
+
import PencilRuler from "../../assets/svg/pencil-ruler.svg";
|
|
5
6
|
export class SallaProductSizeGuide {
|
|
6
7
|
constructor() {
|
|
7
8
|
this.hasError = false;
|
|
@@ -44,36 +45,37 @@ export class SallaProductSizeGuide {
|
|
|
44
45
|
h("div", { slot: "description" }, this.placeholder_description));
|
|
45
46
|
}
|
|
46
47
|
render() {
|
|
47
|
-
return (h(
|
|
48
|
-
h("
|
|
49
|
-
|
|
50
|
-
|
|
48
|
+
return (h("salla-modal", { class: "s-product-size-guide-wrapper", id: 'salla-product-size-guide-modal', isLoading: true, "has-skeleton": true, width: "md", ref: modal => this.modal = modal },
|
|
49
|
+
h("span", { slot: 'icon', class: "s-product-size-guide-header-icon", innerHTML: PencilRuler }),
|
|
50
|
+
h("div", { slot: "loading" },
|
|
51
|
+
h("div", { class: "s-product-size-guide-skeleton" },
|
|
52
|
+
h("salla-skeleton", { height: '15px', width: '25%' }),
|
|
53
|
+
h("div", { class: "s-product-size-guide-skeleton-header" },
|
|
54
|
+
h("salla-skeleton", { height: '40px' }),
|
|
55
|
+
h("salla-skeleton", { height: '40px' }),
|
|
56
|
+
h("salla-skeleton", { height: '40px' }),
|
|
57
|
+
h("salla-skeleton", { height: '40px' })),
|
|
58
|
+
h("div", { class: "s-product-size-guide-skeleton-content" },
|
|
51
59
|
h("salla-skeleton", { height: '15px', width: '25%' }),
|
|
52
|
-
h("
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
h("
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
h("
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
this.guides.map((guide) => h("salla-tab-header", { slot: "header", name: guide.name },
|
|
72
|
-
h("span", null, guide.name))),
|
|
73
|
-
this.guides.map((guide) => h("salla-tab-content", { slot: "content", name: guide.name },
|
|
74
|
-
h("div", { innerHTML: guide.description })))))]
|
|
75
|
-
: this.showPlaceholder(),
|
|
76
|
-
h("slot", { name: "footer" }))));
|
|
60
|
+
h("salla-skeleton", { height: '10px', width: '75%' }),
|
|
61
|
+
h("salla-skeleton", { height: '10px', width: '50%' }),
|
|
62
|
+
h("salla-skeleton", { height: '10px', width: '75%' }),
|
|
63
|
+
h("salla-skeleton", { height: '10px', width: '100%' }),
|
|
64
|
+
h("salla-skeleton", { height: '10px', width: '25%' }),
|
|
65
|
+
h("salla-skeleton", { height: '10px', width: '60%' }),
|
|
66
|
+
h("salla-skeleton", { height: '10px', width: '45%' }),
|
|
67
|
+
h("salla-skeleton", { height: '10px', width: '30%' })))),
|
|
68
|
+
h("slot", { name: "header" }),
|
|
69
|
+
!this.hasError && !!this.guides ?
|
|
70
|
+
[
|
|
71
|
+
h("salla-tabs", null,
|
|
72
|
+
this.guides.map((guide) => h("salla-tab-header", { slot: "header", name: guide.name },
|
|
73
|
+
h("span", null, guide.name))),
|
|
74
|
+
this.guides.map((guide) => h("salla-tab-content", { slot: "content", name: guide.name },
|
|
75
|
+
h("div", { innerHTML: guide.description }))))
|
|
76
|
+
]
|
|
77
|
+
: this.showPlaceholder(),
|
|
78
|
+
h("slot", { name: "footer" })));
|
|
77
79
|
}
|
|
78
80
|
static get is() { return "salla-product-size-guide"; }
|
|
79
81
|
static get originalStyleUrls() { return {
|