@salla.sa/twilight-components 1.0.49 → 1.0.51
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.cjs.js +3 -2
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/salla-button.cjs.entry.js +116 -0
- package/dist/cjs/salla-localization-modal.cjs.entry.js +117 -0
- package/dist/cjs/{salla-search-a7147639.js → salla-login-modal-a2c7fa5d.js} +13 -87
- package/dist/cjs/salla-login-modal.cjs.entry.js +11 -0
- package/dist/cjs/salla-modal_2.cjs.entry.js +155 -0
- package/dist/cjs/{salla-offer.cjs.entry.js → salla-offer-modal.cjs.entry.js} +26 -26
- package/dist/cjs/{salla-rating.cjs.entry.js → salla-rating-modal.cjs.entry.js} +33 -33
- package/dist/cjs/salla-search-99d08b1f.js +79 -0
- package/dist/cjs/{salla-button_7.cjs.entry.js → salla-tel-input.cjs.entry.js} +0 -509
- package/dist/cjs/salla-verify-modal.cjs.entry.js +148 -0
- package/dist/cjs/twilight-components.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +4 -4
- package/dist/collection/components/{salla-localization/salla-localization.css → salla-localization-modal/salla-localization-modal.css} +0 -0
- package/dist/collection/components/{salla-localization/salla-localization.js → salla-localization-modal/salla-localization-modal.js} +19 -19
- package/dist/collection/components/{salla-login/salla-login.css → salla-login-modal/salla-login-modal.css} +0 -0
- package/dist/collection/components/{salla-login/salla-login.js → salla-login-modal/salla-login-modal.js} +34 -34
- package/dist/collection/components/{salla-offer → salla-offer-modal}/offer-schema.js +0 -0
- package/dist/collection/components/{salla-offer/salla-offer.css → salla-offer-modal/salla-offer-modal.css} +4 -4
- package/dist/collection/components/{salla-offer/salla-offer.js → salla-offer-modal/salla-offer-modal.js} +34 -34
- package/dist/collection/components/{salla-rating → salla-rating-modal}/order-feedback-response.js +0 -0
- package/dist/collection/components/{salla-rating/salla-rating.css → salla-rating-modal/salla-rating-modal.css} +1 -1
- package/dist/collection/components/{salla-rating/salla-rating.js → salla-rating-modal/salla-rating-modal.js} +57 -57
- package/dist/collection/index.js +1 -1
- package/dist/esm/index.js +2 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/salla-button.entry.js +112 -0
- package/dist/esm/salla-localization-modal.entry.js +113 -0
- package/dist/esm/{salla-search-813732a1.js → salla-login-modal-187c1f98.js} +13 -86
- package/dist/esm/salla-login-modal.entry.js +3 -0
- package/dist/esm/salla-modal_2.entry.js +150 -0
- package/dist/esm/{salla-offer.entry.js → salla-offer-modal.entry.js} +26 -26
- package/dist/esm/{salla-rating.entry.js → salla-rating-modal.entry.js} +33 -33
- package/dist/esm/salla-search-2e3e60cb.js +77 -0
- package/dist/esm/{salla-button_7.entry.js → salla-tel-input.entry.js} +2 -505
- package/dist/esm/salla-verify-modal.entry.js +144 -0
- package/dist/esm/twilight-components.js +1 -1
- package/dist/twilight-components/index.esm.js +1 -1
- package/dist/twilight-components/p-05dff05e.entry.js +1 -0
- package/dist/twilight-components/p-0b599094.js +1 -0
- package/dist/twilight-components/p-1f873057.entry.js +1 -0
- package/dist/twilight-components/p-2e03db57.entry.js +1 -0
- package/dist/twilight-components/p-5ffd56fb.js +1 -0
- package/dist/twilight-components/p-85427280.entry.js +1 -0
- package/dist/twilight-components/p-88d1bb89.entry.js +1 -0
- package/dist/twilight-components/p-8bfa19fb.entry.js +1 -0
- package/dist/twilight-components/p-ea455ae9.entry.js +1 -0
- package/dist/twilight-components/p-f0f51a3c.entry.js +1 -0
- package/dist/twilight-components/twilight-components.esm.js +1 -1
- package/dist/types/components/{salla-localization/salla-localization.d.ts → salla-localization-modal/salla-localization-modal.d.ts} +1 -1
- package/dist/types/components/{salla-login/salla-login.d.ts → salla-login-modal/salla-login-modal.d.ts} +1 -1
- package/dist/types/components/{salla-offer → salla-offer-modal}/offer-schema.d.ts +0 -0
- package/dist/types/components/{salla-offer/salla-offer.d.ts → salla-offer-modal/salla-offer-modal.d.ts} +1 -1
- package/dist/types/components/{salla-rating → salla-rating-modal}/order-feedback-response.d.ts +0 -0
- package/dist/types/components/{salla-rating/salla-rating.d.ts → salla-rating-modal/salla-rating-modal.d.ts} +1 -1
- package/dist/types/components.d.ts +36 -36
- package/dist/types/index.d.ts +1 -1
- package/package.json +1 -1
- package/dist/twilight-components/p-152b7287.entry.js +0 -1
- package/dist/twilight-components/p-4b774cf9.entry.js +0 -1
- package/dist/twilight-components/p-b584e892.entry.js +0 -1
- package/dist/twilight-components/p-b8ed7363.js +0 -1
|
@@ -15,5 +15,5 @@ const patchBrowser = () => {
|
|
|
15
15
|
};
|
|
16
16
|
|
|
17
17
|
patchBrowser().then(options => {
|
|
18
|
-
return index.bootstrapLazy([["salla-
|
|
18
|
+
return index.bootstrapLazy([["salla-button.cjs",[[4,"salla-button",{"btnStyle":[513,"btn-style"],"loading":[516],"disabled":[516],"loaderPosition":[1,"loader-position"],"wide":[4],"load":[64],"stop":[64],"setText":[64],"disable":[64],"enable":[64]}]]],["salla-modal_2.cjs",[[0,"salla-search",{"results":[32],"placeholder":[32],"noResultsText":[32]},[[0,"modalOpened","onModalOpen"],[0,"modalClosed","onModalClose"]]],[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"],"title":[32],"show":[64],"hide":[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],"show":[64]},[[0,"verified","onVerified"]]]]],["salla-product-availability.cjs",[[4,"salla-product-availability",{"channels":[1],"productId":[2,"product-id"],"isSubscribed":[1028,"is-subscribed"],"subTitle":[32],"mobileLabel":[32],"emailLabel":[32],"emailPlaceholder":[32],"subscribedMessage":[32],"title_":[32],"emailErrorMsg":[32],"isVisitorSubscribed":[32]}]]],["salla-branches.cjs",[[4,"salla-branches",{"position":[1],"displayAs":[1,"display-as"],"browseProductsFrom":[1,"browse-products-from"],"branches":[16],"current":[1026],"open":[32],"selected":[32],"isOpenedBefore":[32],"show":[64],"hide":[64]}]]],["salla-localization-modal.cjs",[[0,"salla-localization-modal",{"language":[1537],"currency":[1537],"languages":[32],"currencies":[32],"languagesTitle":[32],"currenciesTitle":[32],"isLoading":[32],"show":[64],"hide":[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],"show":[64],"showOffer":[64]}]]],["salla-rating-modal.cjs",[[0,"salla-rating-modal",{"orderId":[2,"order-id"],"order":[32],"show":[64],"hide":[64]}]]],["salla-infinite-scroll.cjs",[[4,"salla-infinite-scroll",{"nextPage":[1,"next-page"],"nextPageAutoload":[1028,"next-page-autoload"],"container":[1],"item":[1],"loadMore":[32],"noMore":[32],"failedToLoad":[32]}]]],["salla-verify-modal.cjs",[[4,"salla-verify-modal",{"withoutModal":[4,"without-modal"],"url":[513],"by":[1],"autoReload":[4,"auto-reload"],"title":[32],"getCode":[64],"show":[64]}]]],["salla-tel-input.cjs",[[0,"salla-tel-input",{"mobile":[1025],"countryCode":[1025,"country-code"],"countryKey":[1025,"country-key"],"mobileRequired":[32],"countryCodeLabel":[32],"mobileLabel":[32],"tooShort":[32],"tooLong":[32],"invalidCountryCode":[32],"invalidNumber":[32],"errorMap":[32],"getValues":[64],"isValid":[64]}]]]], options);
|
|
19
19
|
});
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"entries": [
|
|
3
|
-
"./components/salla-login/salla-login.js",
|
|
3
|
+
"./components/salla-login-modal/salla-login-modal.js",
|
|
4
4
|
"./components/salla-search/salla-search.js",
|
|
5
5
|
"./components/salla-branches/salla-branches.js",
|
|
6
6
|
"./components/salla-button/salla-button.js",
|
|
7
7
|
"./components/salla-infinite-scroll/salla-infinite-scroll.js",
|
|
8
|
-
"./components/salla-localization/salla-localization.js",
|
|
8
|
+
"./components/salla-localization-modal/salla-localization-modal.js",
|
|
9
9
|
"./components/salla-modal/salla-modal.js",
|
|
10
|
-
"./components/salla-offer/salla-offer.js",
|
|
10
|
+
"./components/salla-offer-modal/salla-offer-modal.js",
|
|
11
11
|
"./components/salla-product-availability/salla-product-availability.js",
|
|
12
|
-
"./components/salla-rating/salla-rating.js",
|
|
12
|
+
"./components/salla-rating-modal/salla-rating-modal.js",
|
|
13
13
|
"./components/salla-tel-input/salla-tel-input.js",
|
|
14
14
|
"./components/salla-verify-modal/salla-verify-modal.js"
|
|
15
15
|
],
|
|
File without changes
|
|
@@ -6,7 +6,7 @@ import Helper from "../../Helpers/Helper";
|
|
|
6
6
|
* @slot language - Replaces language label, has replaceable props `{name}`, `{code}`, `{country_code}`.
|
|
7
7
|
* @slot currency - Replaces currency label, has replaceable props `{name}`, `{code}`, `{country_code}`.
|
|
8
8
|
*/
|
|
9
|
-
export class
|
|
9
|
+
export class SallaLocalizationModal {
|
|
10
10
|
constructor() {
|
|
11
11
|
var _a, _b;
|
|
12
12
|
this.languages = [];
|
|
@@ -31,8 +31,8 @@ export class SallaLocalization {
|
|
|
31
31
|
* Because scoped templates not supported in stencil );
|
|
32
32
|
* we made a workaround to pass language & currency attributes, then replace names in rendering
|
|
33
33
|
*/
|
|
34
|
-
this.languageSlot = ((_a = Helper.getElement('[slot="language"]')) === null || _a === void 0 ? void 0 : _a.innerHTML) || '<label class="s-localization-label" for="lang-{code}"><span>{name}</span><div class="s-localization-flag flag iti__flag iti__{country_code}"></div></label>';
|
|
35
|
-
this.currencySlot = ((_b = Helper.getElement('[slot="currency"]')) === null || _b === void 0 ? void 0 : _b.innerHTML) || '<label class="s-localization-label" for="currency-{code}"><span>{name}</span><small class="s-localization-currency">{code}</small></label>';
|
|
34
|
+
this.languageSlot = ((_a = Helper.getElement('[slot="language"]')) === null || _a === void 0 ? void 0 : _a.innerHTML) || '<label class="s-localization-modal-label" for="lang-{code}"><span>{name}</span><div class="s-localization-modal-flag flag iti__flag iti__{country_code}"></div></label>';
|
|
35
|
+
this.currencySlot = ((_b = 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>';
|
|
36
36
|
}
|
|
37
37
|
/**
|
|
38
38
|
* Show the component
|
|
@@ -84,30 +84,30 @@ export class SallaLocalization {
|
|
|
84
84
|
}
|
|
85
85
|
render() {
|
|
86
86
|
return (h("salla-modal", { isLoading: this.isLoading, id: "salla-localization", class: "s-hidden", ref: modal => this.modal = modal, width: "xs" }, !this.isLoading ?
|
|
87
|
-
h("div", { class: "s-localization-inner" },
|
|
87
|
+
h("div", { class: "s-localization-modal-inner" },
|
|
88
88
|
this.languages.length > 1 ?
|
|
89
|
-
h("div", { class: "s-localization-section" },
|
|
90
|
-
h("label", { class: "s-localization-title" }, this.languagesTitle),
|
|
91
|
-
h("div", { class: "s-localization-section-inner" }, this.languages.length < 6 ?
|
|
92
|
-
this.languages.map(lang => h("div", { class: "s-localization-item" },
|
|
93
|
-
h("input", { class: "s-localization-input", type: "radio", checked: this.language == lang.iso_code, onChange: () => this.language = lang.iso_code, name: "language", id: 'lang-' + lang.code.toLowerCase(), value: lang.code }),
|
|
89
|
+
h("div", { class: "s-localization-modal-section" },
|
|
90
|
+
h("label", { class: "s-localization-modal-title" }, this.languagesTitle),
|
|
91
|
+
h("div", { class: "s-localization-modal-section-inner" }, this.languages.length < 6 ?
|
|
92
|
+
this.languages.map(lang => h("div", { class: "s-localization-modal-item" },
|
|
93
|
+
h("input", { class: "s-localization-modal-input", type: "radio", checked: this.language == lang.iso_code, onChange: () => this.language = lang.iso_code, name: "language", id: 'lang-' + lang.code.toLowerCase(), value: lang.code }),
|
|
94
94
|
h("div", { id: "language-slot", innerHTML: this.languageSlot
|
|
95
95
|
.replace(/\{name\}/g, lang.name)
|
|
96
96
|
.replace(/\{code\}/g, lang.code)
|
|
97
97
|
.replace(/\{country_code\}/g, lang.country_code) }))) :
|
|
98
|
-
h("select", { class: "s-localization-select", name: "currency", onChange: e => this.onChangeLanguage(e) }, this.languages.map(lang => h("option", { value: lang.code, selected: this.language == lang.code }, lang.name)))))
|
|
98
|
+
h("select", { class: "s-localization-modal-select", name: "currency", onChange: e => this.onChangeLanguage(e) }, this.languages.map(lang => h("option", { value: lang.code, selected: this.language == lang.code }, lang.name)))))
|
|
99
99
|
: '',
|
|
100
100
|
this.currencies.length > 1 ?
|
|
101
|
-
h("div", { class: "s-localization-section" },
|
|
102
|
-
h("label", { class: "s-localization-title" }, this.currenciesTitle),
|
|
103
|
-
h("div", { class: "s-localization-section-inner" }, this.currencies.length < 6 ?
|
|
104
|
-
this.currencies.map(currency => h("div", { class: "s-localization-item" },
|
|
105
|
-
h("input", { class: "s-localization-input", type: "radio", name: "currency", checked: this.currency == currency.code, onChange: () => this.currency = currency.code, id: 'currency-' + currency.code, value: currency.code }),
|
|
101
|
+
h("div", { class: "s-localization-modal-section" },
|
|
102
|
+
h("label", { class: "s-localization-modal-title" }, this.currenciesTitle),
|
|
103
|
+
h("div", { class: "s-localization-modal-section-inner" }, this.currencies.length < 6 ?
|
|
104
|
+
this.currencies.map(currency => h("div", { class: "s-localization-modal-item" },
|
|
105
|
+
h("input", { class: "s-localization-modal-input", type: "radio", name: "currency", checked: this.currency == currency.code, onChange: () => this.currency = currency.code, id: 'currency-' + currency.code, value: currency.code }),
|
|
106
106
|
h("div", { id: "currency-slot", innerHTML: this.currencySlot
|
|
107
107
|
.replace(/\{name\}/g, currency.name)
|
|
108
108
|
.replace(/\{code\}/g, currency.code)
|
|
109
109
|
.replace(/\{country_code\}/g, currency.country_code) }))) :
|
|
110
|
-
h("select", { class: "s-localization-select", name: "currency", onChange: e => this.onChangeCurrency(e) }, this.currencies.map(currency => h("option", { value: currency.code, selected: this.currency == currency.code }, currency.name)))))
|
|
110
|
+
h("select", { class: "s-localization-modal-select", name: "currency", onChange: e => this.onChangeCurrency(e) }, this.currencies.map(currency => h("option", { value: currency.code, selected: this.currency == currency.code }, currency.name)))))
|
|
111
111
|
: '',
|
|
112
112
|
h("salla-button", { wide: true, ref: btn => this.btn = btn, onClick: () => this.submit() }, salla.lang.get('common.elements.ok')))
|
|
113
113
|
: ''));
|
|
@@ -119,12 +119,12 @@ export class SallaLocalization {
|
|
|
119
119
|
this.host.querySelectorAll('#currency-slot').forEach(el => el.replaceWith(el.firstChild));
|
|
120
120
|
this.host.querySelectorAll('#language-slot').forEach(el => el.replaceWith(el.firstChild));
|
|
121
121
|
}
|
|
122
|
-
static get is() { return "salla-localization"; }
|
|
122
|
+
static get is() { return "salla-localization-modal"; }
|
|
123
123
|
static get originalStyleUrls() { return {
|
|
124
|
-
"$": ["salla-localization.scss"]
|
|
124
|
+
"$": ["salla-localization-modal.scss"]
|
|
125
125
|
}; }
|
|
126
126
|
static get styleUrls() { return {
|
|
127
|
-
"$": ["salla-localization.css"]
|
|
127
|
+
"$": ["salla-localization-modal.css"]
|
|
128
128
|
}; }
|
|
129
129
|
static get properties() { return {
|
|
130
130
|
"language": {
|
|
File without changes
|
|
@@ -11,7 +11,7 @@ import Helper from "../../Helpers/Helper";
|
|
|
11
11
|
* @slot before-registration - placeholder position
|
|
12
12
|
* @slot after-registration - placeholder position
|
|
13
13
|
*/
|
|
14
|
-
export class
|
|
14
|
+
export class SallaLoginModal {
|
|
15
15
|
constructor() {
|
|
16
16
|
/**
|
|
17
17
|
* Does the merchant allow to login using email
|
|
@@ -44,7 +44,7 @@ export class SallaLogin {
|
|
|
44
44
|
this.typing = (e, submitMethod) => {
|
|
45
45
|
const error = e.target.nextElementSibling;
|
|
46
46
|
e.target.classList.remove('s-has-error');
|
|
47
|
-
(error === null || error === void 0 ? void 0 : error.classList.contains('s-login-error-message')) && (error.innerText = '');
|
|
47
|
+
(error === null || error === void 0 ? void 0 : error.classList.contains('s-login-modal-error-message')) && (error.innerText = '');
|
|
48
48
|
e.key == 'Enter' && submitMethod();
|
|
49
49
|
};
|
|
50
50
|
this.loginBySMS = async () => {
|
|
@@ -165,8 +165,8 @@ export class SallaLogin {
|
|
|
165
165
|
evt === null || evt === void 0 ? void 0 : evt.preventDefault();
|
|
166
166
|
let tabs = [this.homeTab, this.mobileTab, this.emailTab, this.verifyTab, this.registrationTab];
|
|
167
167
|
tabs.map(el => Helper.toggleElement(el, 'visible', 's-hidden', () => el == tab));
|
|
168
|
-
setTimeout(() => tabs.map(el => Helper.toggleElement(el, 's-login-active', 's-login-unactive', () => el == tab)), 200);
|
|
169
|
-
setTimeout(() => this.host.querySelector('.s-login-wrapper').setAttribute('style', 'height:' + (tab === null || tab === void 0 ? void 0 : tab.scrollHeight) + 'px'));
|
|
168
|
+
setTimeout(() => tabs.map(el => Helper.toggleElement(el, 's-login-modal-active', 's-login-modal-unactive', () => el == tab)), 200);
|
|
169
|
+
setTimeout(() => this.host.querySelector('.s-login-modal-wrapper').setAttribute('style', 'height:' + (tab === null || tab === void 0 ? void 0 : tab.scrollHeight) + 'px'));
|
|
170
170
|
if ([this.mobileTab, this.emailTab].includes(tab)) {
|
|
171
171
|
this.regType = tab === this.mobileTab ? 'phone' : 'email';
|
|
172
172
|
}
|
|
@@ -195,66 +195,66 @@ export class SallaLogin {
|
|
|
195
195
|
}
|
|
196
196
|
render() {
|
|
197
197
|
return (h("salla-modal", { id: "salla-login", icon: "sicon-user", title: this.title, ref: modal => this.modal = modal, width: "xs" },
|
|
198
|
-
h("div", { class: "s-login-wrapper" },
|
|
198
|
+
h("div", { class: "s-login-modal-wrapper" },
|
|
199
199
|
this.isEmailAllowed && this.isMobileAllowed ?
|
|
200
|
-
h("div", { class: "s-login-tab", ref: tab => this.homeTab = tab },
|
|
201
|
-
h("p", { class: "s-login-sub-title" }, this.loginTypeTitle),
|
|
200
|
+
h("div", { class: "s-login-modal-tab", ref: tab => this.homeTab = tab },
|
|
201
|
+
h("p", { class: "s-login-modal-sub-title" }, this.loginTypeTitle),
|
|
202
202
|
h("slot", { name: "before-login-type" }),
|
|
203
|
-
h("a", { href: "#", class: "s-login-main-btn", onClick: (evt) => this.showTab(this.mobileTab, evt) },
|
|
204
|
-
h("i", { class: "s-login-main-btn-icon sicon-phone" }),
|
|
205
|
-
h("span", { class: "s-login-main-btn-text" }, this.smsLabel),
|
|
203
|
+
h("a", { href: "#", class: "s-login-modal-main-btn", onClick: (evt) => this.showTab(this.mobileTab, evt) },
|
|
204
|
+
h("i", { class: "s-login-modal-main-btn-icon sicon-phone" }),
|
|
205
|
+
h("span", { class: "s-login-modal-main-btn-text" }, this.smsLabel),
|
|
206
206
|
h("i", { class: "main-btn-arrow sicon-keyboard_arrow_left" })),
|
|
207
|
-
h("a", { href: "#", class: "s-login-main-btn", onClick: (evt) => this.showTab(this.emailTab, evt) },
|
|
208
|
-
h("i", { class: "s-login-main-btn-icon sicon-mail" }),
|
|
209
|
-
h("span", { class: "s-login-main-btn-text" }, this.emailLabel),
|
|
207
|
+
h("a", { href: "#", class: "s-login-modal-main-btn", onClick: (evt) => this.showTab(this.emailTab, evt) },
|
|
208
|
+
h("i", { class: "s-login-modal-main-btn-icon sicon-mail" }),
|
|
209
|
+
h("span", { class: "s-login-modal-main-btn-text" }, this.emailLabel),
|
|
210
210
|
h("i", { class: "main-btn-arrow sicon-keyboard_arrow_left" })),
|
|
211
211
|
h("slot", { name: "after-login-type" }))
|
|
212
212
|
: '',
|
|
213
213
|
this.isMobileAllowed ?
|
|
214
|
-
h("div", { class: "s-login-tab", ref: tab => this.mobileTab = tab },
|
|
214
|
+
h("div", { class: "s-login-modal-tab", ref: tab => this.mobileTab = tab },
|
|
215
215
|
h("slot", { name: "before-login-mobile" }),
|
|
216
|
-
h("label", { class: "s-login-label" }, this.mobileLabel),
|
|
216
|
+
h("label", { class: "s-login-modal-label" }, this.mobileLabel),
|
|
217
217
|
h("salla-tel-input", { ref: el => this.loginTelInput = el, onKeyDown: e => this.typing(e, this.loginBySMS) }),
|
|
218
218
|
h("salla-button", { "loader-position": 'center', wide: true, onClick: () => this.loginBySMS(), ref: b => this.smsBtn = b }, salla.lang.get('blocks.header.enter')),
|
|
219
219
|
this.isEmailAllowed ?
|
|
220
|
-
h("a", { href: "#", onClick: () => this.showTab(this.emailTab), class: "s-login-link" }, this.byEmailText) : '',
|
|
220
|
+
h("a", { href: "#", onClick: () => this.showTab(this.emailTab), class: "s-login-modal-link" }, this.byEmailText) : '',
|
|
221
221
|
h("slot", { name: "after-login-mobile" })) : '',
|
|
222
222
|
this.isEmailAllowed ?
|
|
223
|
-
h("div", { class: "s-login-tab", ref: tab => this.emailTab = tab },
|
|
223
|
+
h("div", { class: "s-login-modal-tab", ref: tab => this.emailTab = tab },
|
|
224
224
|
h("slot", { name: "before-login-email" }),
|
|
225
|
-
h("label", { class: "s-login-label" }, this.emailLabel),
|
|
226
|
-
h("input", { type: "email", ref: el => this.loginEmail = el, onKeyDown: e => this.typing(e, this.loginByEmail), placeholder: "your@email.com", class: "s-login-input s-ltr" }),
|
|
227
|
-
h("span", { class: "s-login-error-message" }),
|
|
225
|
+
h("label", { class: "s-login-modal-label" }, this.emailLabel),
|
|
226
|
+
h("input", { type: "email", ref: el => this.loginEmail = el, onKeyDown: e => this.typing(e, this.loginByEmail), placeholder: "your@email.com", class: "s-login-modal-input s-ltr" }),
|
|
227
|
+
h("span", { class: "s-login-modal-error-message" }),
|
|
228
228
|
h("salla-button", { "loader-position": 'center', wide: true, onClick: () => this.loginByEmail(), ref: b => this.emailBtn = b }, salla.lang.get('blocks.header.enter')),
|
|
229
229
|
this.isMobileAllowed ?
|
|
230
|
-
h("a", { href: "#", onClick: () => this.showTab(this.mobileTab), class: "s-login-link" }, this.bySMSText) : '',
|
|
230
|
+
h("a", { href: "#", onClick: () => this.showTab(this.mobileTab), class: "s-login-modal-link" }, this.bySMSText) : '',
|
|
231
231
|
h("slot", { name: "after-login-email" })) : '',
|
|
232
232
|
h("salla-verify-modal", { withoutModal: true, ref: tab => this.verifyTab = tab, autoReload: false },
|
|
233
233
|
h("a", { onClick: () => this.showTab(this.regType == 'phone' ? this.mobileTab : this.emailTab), class: "s-verify-modal-back sicon-arrow-right", slot: "after-footer", href: "#" })),
|
|
234
234
|
h("div", { ref: tab => this.registrationTab = tab },
|
|
235
235
|
h("slot", { name: "before-registration" }),
|
|
236
|
-
h("label", { class: "s-login-label" }, this.firstNameLabel),
|
|
237
|
-
h("input", { type: "text", class: "s-login-input", ref: el => this.firstName = el, onKeyDown: e => this.typing(e, this.newUser), placeholder: salla.lang.get('pages.profile.first_name') }),
|
|
238
|
-
h("span", { class: "s-login-error-message" }),
|
|
239
|
-
h("label", { class: "s-login-label" }, this.lastNameLabel),
|
|
240
|
-
h("input", { type: "text", class: "s-login-input", ref: el => this.lastName = el, onKeyDown: e => this.typing(e, this.newUser), placeholder: salla.lang.get('pages.profile.last_name') }),
|
|
241
|
-
h("span", { class: "s-login-error-message" }),
|
|
236
|
+
h("label", { class: "s-login-modal-label" }, this.firstNameLabel),
|
|
237
|
+
h("input", { type: "text", class: "s-login-modal-input", ref: el => this.firstName = el, onKeyDown: e => this.typing(e, this.newUser), placeholder: salla.lang.get('pages.profile.first_name') }),
|
|
238
|
+
h("span", { class: "s-login-modal-error-message" }),
|
|
239
|
+
h("label", { class: "s-login-modal-label" }, this.lastNameLabel),
|
|
240
|
+
h("input", { type: "text", class: "s-login-modal-input", ref: el => this.lastName = el, onKeyDown: e => this.typing(e, this.newUser), placeholder: salla.lang.get('pages.profile.last_name') }),
|
|
241
|
+
h("span", { class: "s-login-modal-error-message" }),
|
|
242
242
|
h("div", { ref: el => this.regMobileBlock = el, class: "mb-1.5" },
|
|
243
|
-
h("label", { class: "s-login-label" }, this.mobileLabel),
|
|
243
|
+
h("label", { class: "s-login-modal-label" }, this.mobileLabel),
|
|
244
244
|
h("salla-tel-input", { ref: el => this.regTelInput = el, onKeyDown: e => this.typing(e, this.newUser) })),
|
|
245
245
|
h("div", { ref: el => this.regEmailBlock = el, class: "mb-1.5" },
|
|
246
|
-
h("label", { class: "s-login-label" }, this.emailLabel),
|
|
247
|
-
h("input", { type: "email", ref: el => this.regEmail = el, onKeyDown: e => this.typing(e, this.newUser), placeholder: "your@email.com", class: "s-login-input s-ltr" }),
|
|
248
|
-
h("span", { class: "s-login-error-message" })),
|
|
246
|
+
h("label", { class: "s-login-modal-label" }, this.emailLabel),
|
|
247
|
+
h("input", { type: "email", ref: el => this.regEmail = el, onKeyDown: e => this.typing(e, this.newUser), placeholder: "your@email.com", class: "s-login-modal-input s-ltr" }),
|
|
248
|
+
h("span", { class: "s-login-modal-error-message" })),
|
|
249
249
|
h("salla-button", { "loader-position": 'center', wide: true, onClick: () => this.newUser(), ref: b => this.regBtn = b }, salla.lang.get('blocks.header.register')),
|
|
250
250
|
h("slot", { name: "after-registration" })))));
|
|
251
251
|
}
|
|
252
|
-
static get is() { return "salla-login"; }
|
|
252
|
+
static get is() { return "salla-login-modal"; }
|
|
253
253
|
static get originalStyleUrls() { return {
|
|
254
|
-
"$": ["salla-login.scss"]
|
|
254
|
+
"$": ["salla-login-modal.scss"]
|
|
255
255
|
}; }
|
|
256
256
|
static get styleUrls() { return {
|
|
257
|
-
"$": ["salla-login.css"]
|
|
257
|
+
"$": ["salla-login-modal.css"]
|
|
258
258
|
}; }
|
|
259
259
|
static get properties() { return {
|
|
260
260
|
"isEmailAllowed": {
|
|
File without changes
|
|
@@ -11,15 +11,15 @@
|
|
|
11
11
|
* Salla Offer Modal Component: popup modal to display the offers
|
|
12
12
|
* You can use these classes to target the elements in the component.
|
|
13
13
|
*/
|
|
14
|
-
#salla-offer-modal .s-offer-body {
|
|
14
|
+
#salla-offer-modal .s-offer-modal-body {
|
|
15
15
|
-webkit-overflow-scrolling: touch;
|
|
16
16
|
}
|
|
17
|
-
#salla-offer-modal .s-offer-body::-webkit-scrollbar {
|
|
17
|
+
#salla-offer-modal .s-offer-modal-body::-webkit-scrollbar {
|
|
18
18
|
display: none;
|
|
19
19
|
}
|
|
20
|
-
#salla-offer-modal .s-offer-next-btn {
|
|
20
|
+
#salla-offer-modal .s-offer-modal-next-btn {
|
|
21
21
|
background: linear-gradient(90deg, #fff 25%, rgba(255, 255, 255, 0.4) 80%, rgba(255, 255, 255, 0) 100%);
|
|
22
22
|
}
|
|
23
|
-
#salla-offer-modal .s-offer-prev-btn {
|
|
23
|
+
#salla-offer-modal .s-offer-modal-prev-btn {
|
|
24
24
|
background: linear-gradient(-90deg, #fff 25%, rgba(255, 255, 255, 0.4) 80%, rgba(255, 255, 255, 0) 100%);
|
|
25
25
|
}
|
|
@@ -5,7 +5,7 @@ import Helper from "../../Helpers/Helper";
|
|
|
5
5
|
* @slot product - Replaces product card, has replaceable props `{name}`, `{url}`, `{image}`, `{price}`.
|
|
6
6
|
* @slot category - Replaces Category badge, has replaceable props `{name}`, `{url}`.
|
|
7
7
|
*/
|
|
8
|
-
export class
|
|
8
|
+
export class SallaOfferModal {
|
|
9
9
|
constructor() {
|
|
10
10
|
var _a, _b;
|
|
11
11
|
this.offer = null;
|
|
@@ -16,7 +16,7 @@ export class SallaOffer {
|
|
|
16
16
|
this.offer_expires_in = salla.lang.get('pages.products.offer_expires_in');
|
|
17
17
|
this.remember_my_choice = salla.lang.get('common.remember_my_choice');
|
|
18
18
|
});
|
|
19
|
-
this.categorySlot = ((_a = Helper.getElement('[slot="category"]')) === null || _a === void 0 ? void 0 : _a.innerHTML) || '<i class="s-offer-badge-icon sicon-tag"></i><span class="s-offer-badge-text">{name}</span>';
|
|
19
|
+
this.categorySlot = ((_a = Helper.getElement('[slot="category"]')) === null || _a === void 0 ? void 0 : _a.innerHTML) || '<i class="s-offer-modal-badge-icon sicon-tag"></i><span class="s-offer-modal-badge-text">{name}</span>';
|
|
20
20
|
this.productSlot = ((_b = Helper.getElement('[slot="product"]')) === null || _b === void 0 ? void 0 : _b.innerHTML) || this.defaultProductSlot();
|
|
21
21
|
salla.offer.event.onExisted(data => {
|
|
22
22
|
//TODO:: use the best, should we hide the offer by product Id or Offer id🤔
|
|
@@ -57,43 +57,43 @@ export class SallaOffer {
|
|
|
57
57
|
.finally(() => this['stop']());
|
|
58
58
|
}
|
|
59
59
|
defaultProductSlot() {
|
|
60
|
-
return '<a href={url} class="s-offer-product-image-wrap"><img class="s-offer-product-image" src="{image}" /></a>' +
|
|
61
|
-
'<div class="s-offer-product-info">' +
|
|
62
|
-
' <a href={url} class="s-offer-product-name">{name}</a>' +
|
|
63
|
-
' <div class="s-offer-product-price">{price}</div>' +
|
|
60
|
+
return '<a href={url} class="s-offer-modal-product-image-wrap"><img class="s-offer-modal-product-image" src="{image}" /></a>' +
|
|
61
|
+
'<div class="s-offer-modal-product-info">' +
|
|
62
|
+
' <a href={url} class="s-offer-modal-product-name">{name}</a>' +
|
|
63
|
+
' <div class="s-offer-modal-product-price">{price}</div>' +
|
|
64
64
|
'</div>';
|
|
65
65
|
}
|
|
66
66
|
render() {
|
|
67
67
|
var _a, _b;
|
|
68
68
|
return h("salla-modal", { id: "salla-offer-modal", "sub-title-first": true, icon: "sicon-special-discount", title: "\u0639\u0631\u0648\u0636 \u0631\u0627\u0626\u0639\u0629 \u0641\u064A \u0627\u0646\u062A\u0638\u0627\u0631\u0643\u060C \u0645\u0627\u0630\u0627 \u0646\u062A\u0646\u0638\u0631!", "sub-title": this.offer_message, ref: modal => this.modal = modal, "is-loading": this.offer === null }, this.offer !== null
|
|
69
|
-
? [h("div", { class: "s-offer-scrolled-slider-wrap" },
|
|
70
|
-
h("div", { class: "s-offer-body s-offer-scrolled-slider" }, ((_a = this.offer.get.categories) === null || _a === void 0 ? void 0 : _a.length) > 0
|
|
71
|
-
? this.offer.get.categories.map(category => h("a", { href: category.urls.customer, class: "s-offer-badge s-offer-slider-item", innerHTML: this.categorySlot
|
|
69
|
+
? [h("div", { class: "s-offer-modal-scrolled-slider-wrap" },
|
|
70
|
+
h("div", { class: "s-offer-modal-body s-offer-modal-scrolled-slider" }, ((_a = this.offer.get.categories) === null || _a === void 0 ? void 0 : _a.length) > 0
|
|
71
|
+
? this.offer.get.categories.map(category => h("a", { href: category.urls.customer, class: "s-offer-modal-badge s-offer-modal-slider-item", innerHTML: this.categorySlot
|
|
72
72
|
.replace(/\{name\}/g, category.name)
|
|
73
73
|
.replace(/\{url\}/g, category.urls.customer) }))
|
|
74
|
-
: (_b = this.offer.get.products) === null || _b === void 0 ? void 0 : _b.map(product => h("div", { class: "s-offer-product s-offer-slider-item", id: 'product_' + product.id, innerHTML: this.productSlot
|
|
74
|
+
: (_b = this.offer.get.products) === null || _b === void 0 ? void 0 : _b.map(product => h("div", { class: "s-offer-modal-product s-offer-modal-slider-item", id: 'product_' + product.id, innerHTML: this.productSlot
|
|
75
75
|
.replace(/\{name\}/g, product.name)
|
|
76
76
|
.replace(/\{url\}/g, product.url)
|
|
77
77
|
.replace(/\{image\}/g, product.thumbnail)
|
|
78
78
|
.replace(/\{price\}/g, product.has_special_price
|
|
79
|
-
? salla.money(product.price) + '<span class="s-offer-product-old-price">' + salla.money(product.regular_price) + '</span>'
|
|
80
|
-
: salla.money(
|
|
81
|
-
h("div", { class: "s-offer-btn-wrap" },
|
|
79
|
+
? salla.money(product.price) + '<span class="s-offer-modal-product-old-price">' + salla.money(product.regular_price) + '</span>'
|
|
80
|
+
: salla.money(product.price)) },
|
|
81
|
+
h("div", { class: "s-offer-modal-btn-wrap" },
|
|
82
82
|
h("salla-button", { wide: true, "btn-style": 'outline-primary', "data-id": product.id, "loader-position": "center", onClick: this.addItem }, salla.lang.get('pages.cart.add_to_cart')))))),
|
|
83
|
-
h("div", { class: "s-offer-slider-nav" },
|
|
84
|
-
h("button", { class: "s-offer-nav-btn s-offer-prev-btn" },
|
|
85
|
-
h("span", { class: "s-offer-nav-btn-icon sicon-keyboard_arrow_right" })),
|
|
86
|
-
h("button", { class: "s-offer-nav-btn s-offer-next-btn" },
|
|
87
|
-
h("span", { class: "s-offer-nav-btn-icon sicon-keyboard_arrow_left" })))),
|
|
88
|
-
h("div", { class: "s-offer-footer", slot: "footer" },
|
|
83
|
+
h("div", { class: "s-offer-modal-slider-nav" },
|
|
84
|
+
h("button", { class: "s-offer-modal-nav-btn s-offer-modal-prev-btn" },
|
|
85
|
+
h("span", { class: "s-offer-modal-nav-btn-icon sicon-keyboard_arrow_right" })),
|
|
86
|
+
h("button", { class: "s-offer-modal-nav-btn s-offer-modal-next-btn" },
|
|
87
|
+
h("span", { class: "s-offer-modal-nav-btn-icon sicon-keyboard_arrow_left" })))),
|
|
88
|
+
h("div", { class: "s-offer-modal-footer", slot: "footer" },
|
|
89
89
|
this.offer.expiry_date ?
|
|
90
|
-
h("p", { class: "s-offer-expiry" },
|
|
90
|
+
h("p", { class: "s-offer-modal-expiry" },
|
|
91
91
|
this.offer_expires_in,
|
|
92
92
|
" ",
|
|
93
93
|
this.offer.expiry_date)
|
|
94
94
|
: '',
|
|
95
|
-
h("label", { class: "s-offer-remember-label" },
|
|
96
|
-
h("input", { type: "checkbox", onChange: e => this.rememberMe(e), class: "s-offer-remember-input" }),
|
|
95
|
+
h("label", { class: "s-offer-modal-remember-label" },
|
|
96
|
+
h("input", { type: "checkbox", onChange: e => this.rememberMe(e), class: "s-offer-modal-remember-input" }),
|
|
97
97
|
"\u00A0 ",
|
|
98
98
|
this.remember_my_choice)),
|
|
99
99
|
] : '');
|
|
@@ -104,11 +104,11 @@ export class SallaOffer {
|
|
|
104
104
|
this.modal.querySelectorAll('[hidden]').forEach(el => el.removeAttribute('hidden'));
|
|
105
105
|
// Sooo mini Slider
|
|
106
106
|
if (this.offer && window.screen.width > 639) {
|
|
107
|
-
let sliderWrap = this.host.querySelector('.s-offer-scrolled-slider-wrap'), slider = this.host.querySelector('.s-offer-scrolled-slider'), navButtons = this.host.querySelectorAll('.s-offer-nav-btn'), nexBtn = this.host.querySelector('.s-offer-next-btn'), prevBtn = this.host.querySelector('.s-offer-prev-btn'), items = this.host.querySelectorAll('.s-offer-slider-item'), sliderNavMargin = 20, // space before displaying the next/prev btns.
|
|
107
|
+
let sliderWrap = this.host.querySelector('.s-offer-modal-scrolled-slider-wrap'), slider = this.host.querySelector('.s-offer-modal-scrolled-slider'), navButtons = this.host.querySelectorAll('.s-offer-modal-nav-btn'), nexBtn = this.host.querySelector('.s-offer-modal-next-btn'), prevBtn = this.host.querySelector('.s-offer-modal-prev-btn'), items = this.host.querySelectorAll('.s-offer-modal-slider-item'), sliderNavMargin = 20, // space before displaying the next/prev btns.
|
|
108
108
|
current = 0, // current slide
|
|
109
109
|
slidesToScroll = 3, itemsLength = items.length, itemSize = items[0].offsetWidth, sliderSize = itemsLength * itemSize, sliderWrapperSize = sliderWrap.offsetWidth, sliderInvisibleSize = sliderSize - sliderWrapperSize, isRTL = document.body.classList.contains('rtl') ? true : false;
|
|
110
110
|
if (sliderInvisibleSize > sliderNavMargin)
|
|
111
|
-
nexBtn.classList.add('s-offer-btn-is-active');
|
|
111
|
+
nexBtn.classList.add('s-offer-modal-btn-is-active');
|
|
112
112
|
window.onresize = function () {
|
|
113
113
|
sliderWrapperSize = sliderWrap.offsetWidth;
|
|
114
114
|
sliderInvisibleSize = sliderSize - sliderWrapperSize;
|
|
@@ -118,23 +118,23 @@ export class SallaOffer {
|
|
|
118
118
|
let sliderEndOffset = sliderInvisibleSize - sliderNavMargin;
|
|
119
119
|
// show & hide the navigation btns depending on scroll position
|
|
120
120
|
if (sliderPosition <= sliderNavMargin) {
|
|
121
|
-
nexBtn.classList.add('s-offer-btn-is-active');
|
|
122
|
-
prevBtn.classList.remove('s-offer-btn-is-active');
|
|
121
|
+
nexBtn.classList.add('s-offer-modal-btn-is-active');
|
|
122
|
+
prevBtn.classList.remove('s-offer-modal-btn-is-active');
|
|
123
123
|
}
|
|
124
124
|
else if (sliderPosition < sliderEndOffset) {
|
|
125
125
|
// show both btns in the middle
|
|
126
|
-
nexBtn.classList.add('s-offer-btn-is-active');
|
|
127
|
-
prevBtn.classList.add('s-offer-btn-is-active');
|
|
126
|
+
nexBtn.classList.add('s-offer-modal-btn-is-active');
|
|
127
|
+
prevBtn.classList.add('s-offer-modal-btn-is-active');
|
|
128
128
|
}
|
|
129
129
|
else if (sliderPosition >= sliderEndOffset) {
|
|
130
|
-
nexBtn.classList.remove('s-offer-btn-is-active');
|
|
131
|
-
prevBtn.classList.add('s-offer-btn-is-active');
|
|
130
|
+
nexBtn.classList.remove('s-offer-modal-btn-is-active');
|
|
131
|
+
prevBtn.classList.add('s-offer-modal-btn-is-active');
|
|
132
132
|
}
|
|
133
133
|
});
|
|
134
134
|
// Navigation
|
|
135
135
|
navButtons.forEach(btn => {
|
|
136
136
|
btn.addEventListener('click', function () {
|
|
137
|
-
btn.classList.contains('s-offer-next-btn') ? current++ : current--;
|
|
137
|
+
btn.classList.contains('s-offer-modal-next-btn') ? current++ : current--;
|
|
138
138
|
slider.scrollTo({
|
|
139
139
|
top: 0,
|
|
140
140
|
left: itemSize * slidesToScroll * current * (isRTL ? -1 : 1),
|
|
@@ -144,12 +144,12 @@ export class SallaOffer {
|
|
|
144
144
|
});
|
|
145
145
|
}
|
|
146
146
|
}
|
|
147
|
-
static get is() { return "salla-offer"; }
|
|
147
|
+
static get is() { return "salla-offer-modal"; }
|
|
148
148
|
static get originalStyleUrls() { return {
|
|
149
|
-
"$": ["salla-offer.scss"]
|
|
149
|
+
"$": ["salla-offer-modal.scss"]
|
|
150
150
|
}; }
|
|
151
151
|
static get styleUrls() { return {
|
|
152
|
-
"$": ["salla-offer.css"]
|
|
152
|
+
"$": ["salla-offer-modal.css"]
|
|
153
153
|
}; }
|
|
154
154
|
static get states() { return {
|
|
155
155
|
"offer": {},
|
package/dist/collection/components/{salla-rating → salla-rating-modal}/order-feedback-response.js
RENAMED
|
File without changes
|