@salla.sa/twilight-components 1.0.52 → 1.0.54
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 +2 -2
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/salla-branches.cjs.entry.js +2 -2
- package/dist/cjs/salla-button.cjs.entry.js +47 -36
- package/dist/cjs/salla-localization-modal.cjs.entry.js +1 -1
- package/dist/cjs/{salla-login-modal-a2c7fa5d.js → salla-login-modal-d0fb6180.js} +6 -6
- package/dist/cjs/salla-login-modal.cjs.entry.js +1 -1
- package/dist/cjs/salla-modal_2.cjs.entry.js +2 -2
- package/dist/cjs/salla-offer-modal.cjs.entry.js +4 -5
- package/dist/cjs/salla-product-availability.cjs.entry.js +2 -2
- package/dist/cjs/{salla-search-99d08b1f.js → salla-search-f76c6d61.js} +15 -4
- package/dist/cjs/salla-tel-input.cjs.entry.js +4 -6
- package/dist/cjs/salla-verify-modal.cjs.entry.js +6 -6
- package/dist/cjs/twilight-components.cjs.js +1 -1
- package/dist/collection/components/salla-branches/salla-branches.js +2 -2
- package/dist/collection/components/salla-button/salla-button.css +83 -1
- package/dist/collection/components/salla-button/salla-button.js +153 -50
- package/dist/collection/components/salla-localization-modal/salla-localization-modal.css +5 -1
- package/dist/collection/components/salla-login-modal/salla-login-modal.css +5 -1
- package/dist/collection/components/salla-login-modal/salla-login-modal.js +6 -6
- package/dist/collection/components/salla-modal/salla-modal.css +4 -1
- package/dist/collection/components/salla-offer-modal/salla-offer-modal.js +4 -5
- package/dist/collection/components/salla-product-availability/salla-product-availability.js +2 -2
- package/dist/collection/components/salla-search/salla-search.css +11 -0
- package/dist/collection/components/salla-search/salla-search.js +79 -13
- package/dist/collection/components/salla-tel-input/salla-tel-input.js +4 -6
- package/dist/collection/components/salla-verify-modal/salla-verify-modal.css +4 -0
- package/dist/collection/components/salla-verify-modal/salla-verify-modal.js +5 -5
- package/dist/esm/index.js +2 -2
- package/dist/esm/loader.js +1 -1
- package/dist/esm/salla-branches.entry.js +2 -2
- package/dist/esm/salla-button.entry.js +47 -36
- package/dist/esm/salla-localization-modal.entry.js +1 -1
- package/dist/esm/{salla-login-modal-187c1f98.js → salla-login-modal-63f03766.js} +6 -6
- package/dist/esm/salla-login-modal.entry.js +1 -1
- package/dist/esm/salla-modal_2.entry.js +2 -2
- package/dist/esm/salla-offer-modal.entry.js +4 -5
- package/dist/esm/salla-product-availability.entry.js +2 -2
- package/dist/esm/{salla-search-2e3e60cb.js → salla-search-7521be0c.js} +15 -4
- package/dist/esm/salla-tel-input.entry.js +4 -6
- package/dist/esm/salla-verify-modal.entry.js +6 -6
- package/dist/esm/twilight-components.js +1 -1
- package/dist/twilight-components/index.esm.js +1 -1
- package/dist/twilight-components/p-05574321.entry.js +1 -0
- package/dist/twilight-components/{p-ea455ae9.entry.js → p-134fa158.entry.js} +1 -1
- package/dist/twilight-components/p-2a032b88.entry.js +1 -0
- package/dist/twilight-components/p-2f3f4cce.entry.js +1 -0
- package/dist/twilight-components/p-4da2c2c8.entry.js +1 -0
- package/dist/twilight-components/p-635c08a7.entry.js +1 -0
- package/dist/twilight-components/{p-05dff05e.entry.js → p-79ab1ed9.entry.js} +1 -1
- package/dist/twilight-components/p-88dce1e4.js +1 -0
- package/dist/twilight-components/p-a26e2e12.entry.js +1 -0
- package/dist/twilight-components/{p-1f873057.entry.js → p-c51984d6.entry.js} +1 -1
- package/dist/twilight-components/p-e4f716b0.js +1 -0
- package/dist/twilight-components/twilight-components.esm.js +1 -1
- package/dist/types/components/salla-button/salla-button.d.ts +26 -8
- package/dist/types/components/salla-search/salla-search.d.ts +4 -0
- package/dist/types/components.d.ts +52 -6
- package/package.json +1 -1
- package/dist/twilight-components/p-0b599094.js +0 -1
- package/dist/twilight-components/p-2e03db57.entry.js +0 -1
- package/dist/twilight-components/p-5ffd56fb.js +0 -1
- package/dist/twilight-components/p-88d1bb89.entry.js +0 -1
- package/dist/twilight-components/p-8bfa19fb.entry.js +0 -1
- package/dist/twilight-components/p-c0a7b5a2.entry.js +0 -1
- package/dist/twilight-components/p-e6c67b55.entry.js +0 -1
- package/dist/twilight-components/p-f0f51a3c.entry.js +0 -1
package/dist/cjs/index.cjs.js
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const sallaLoginModal = require('./salla-login-modal-
|
|
6
|
-
const sallaSearch = require('./salla-search-
|
|
5
|
+
const sallaLoginModal = require('./salla-login-modal-d0fb6180.js');
|
|
6
|
+
const sallaSearch = require('./salla-search-f76c6d61.js');
|
|
7
7
|
require('./index-0b5b5867.js');
|
|
8
8
|
require('./Helper-98cc9f18.js');
|
|
9
9
|
|
package/dist/cjs/loader.cjs.js
CHANGED
|
@@ -14,7 +14,7 @@ const patchEsm = () => {
|
|
|
14
14
|
const defineCustomElements = (win, options) => {
|
|
15
15
|
if (typeof window === 'undefined') return Promise.resolve();
|
|
16
16
|
return patchEsm().then(() => {
|
|
17
|
-
return index.bootstrapLazy([["salla-button.cjs",[[4,"salla-button",{"
|
|
17
|
+
return index.bootstrapLazy([["salla-button.cjs",[[4,"salla-button",{"buttonType":[513,"button-type"],"color":[513],"fill":[513],"size":[513],"width":[513],"loading":[516],"disabled":[516],"loaderPosition":[1,"loader-position"],"wide":[4],"href":[1],"load":[64],"stop":[64],"setText":[64],"disable":[64],"enable":[64]}]]],["salla-modal_2.cjs",[[0,"salla-search",{"inline":[4],"oval":[4],"height":[2],"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);
|
|
18
18
|
});
|
|
19
19
|
};
|
|
20
20
|
|
|
@@ -10,7 +10,7 @@ const SallaBranches = class {
|
|
|
10
10
|
constructor(hostRef) {
|
|
11
11
|
index.registerInstance(this, hostRef);
|
|
12
12
|
this.open = false;
|
|
13
|
-
this.isOpenedBefore = salla.
|
|
13
|
+
this.isOpenedBefore = salla.storage.get("branch-choosed-before");
|
|
14
14
|
this.displayAs = 'default'; //todo:: change it to boolean, isPopup default false
|
|
15
15
|
this.browseProductsFrom = 'all'; //todo:: get better name
|
|
16
16
|
this.branches = [
|
|
@@ -55,7 +55,7 @@ const SallaBranches = class {
|
|
|
55
55
|
this.btn.load().then(() => {
|
|
56
56
|
setTimeout(() => location.reload(), 2000);
|
|
57
57
|
});
|
|
58
|
-
salla.
|
|
58
|
+
salla.storage.set("branch-choosed-before", true);
|
|
59
59
|
this.show();
|
|
60
60
|
setTimeout(() => {
|
|
61
61
|
this.current = this.selected;
|
|
@@ -3,17 +3,33 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-0b5b5867.js');
|
|
6
|
-
const Helper = require('./Helper-98cc9f18.js');
|
|
7
6
|
|
|
8
|
-
const sallaButtonCss = "";
|
|
7
|
+
const sallaButtonCss = "salla-button{pointer-events:none}salla-button[type=submit]{-webkit-appearance:none}salla-button[width=wide]{width:100%}.s-button-wrap[loading]{pointer-events:none}.s-button-wrap[loading] .s-button-element{pointer-events:none !important}.s-button-wrap[loading] .s-button-loader-center .s-button-text{opacity:0}.s-button-wrap .s-button-element[loading]{pointer-events:none !important}.s-button-wrap .s-button-element:not(:disabled){pointer-events:auto}.s-button-wrap .s-button-solid .s-button-loader:before{border-color:#fff #fff rgba(255, 255, 255, 0.2) rgba(255, 255, 255, 0.2)}.s-button-wrap .s-button-outline{border:1px solid currentColor}.s-button-wrap .s-button-outline:hover{border-color:transparent}.s-button-wrap .s-button-outline .s-button-loader:before{border-top-color:currentColor;border-left-color:currentColor}.s-button-wrap .s-button-icon.s-button-large{width:56px;height:56px}.s-button-wrap .s-button-icon.s-button-small{width:24px;height:24px}.s-button-wrap .s-button-icon.s-button-small .s-button-loader:before{width:0.85rem;height:0.85rem}.s-button-wrap .s-button-loader-after .s-button-load{flex-direction:row}.s-button-wrap .s-button-loader-start.s-button-element{padding-right:40px}.s-button-wrap .s-button-loader-start .s-button-loader{position:absolute;right:8px}.s-button-wrap .s-button-loader-start .s-button-loader [dir=ltr]{left:8px;right:auto}.s-button-wrap .s-button-loader-end.s-button-element{padding-left:40px}.s-button-wrap .s-button-loader-end .s-button-loader{position:absolute;left:8px}.s-button-wrap .s-button-loader-end .s-button-loader [dir=ltr]{right:8px;left:auto}.s-button-wrap .s-button-loader-center .s-button-loader{position:absolute;top:50%;left:50%;transform:translateY(-50%) translateX(-50%);margin:0 !important}";
|
|
9
8
|
|
|
10
9
|
const SallaButton = class {
|
|
11
10
|
constructor(hostRef) {
|
|
12
11
|
index.registerInstance(this, hostRef);
|
|
12
|
+
this.hostAttributes = {};
|
|
13
|
+
/**
|
|
14
|
+
* Button Type
|
|
15
|
+
*/
|
|
16
|
+
this.buttonType = 'btn';
|
|
17
|
+
/**
|
|
18
|
+
* Button Color
|
|
19
|
+
*/
|
|
20
|
+
this.color = 'primary';
|
|
13
21
|
/**
|
|
14
|
-
* Button
|
|
22
|
+
* Button Fill
|
|
15
23
|
*/
|
|
16
|
-
this.
|
|
24
|
+
this.fill = 'solid';
|
|
25
|
+
/**
|
|
26
|
+
* Button Size
|
|
27
|
+
*/
|
|
28
|
+
this.size = 'medium';
|
|
29
|
+
/**
|
|
30
|
+
* Button Width
|
|
31
|
+
*/
|
|
32
|
+
this.width = 'normal';
|
|
17
33
|
/**
|
|
18
34
|
* Is the button currently loading
|
|
19
35
|
*/
|
|
@@ -30,19 +46,6 @@ const SallaButton = class {
|
|
|
30
46
|
* Is the button wide
|
|
31
47
|
*/
|
|
32
48
|
this.wide = false;
|
|
33
|
-
this.hostAttributes = {};
|
|
34
|
-
for (let i = 0; i < this.host.attributes.length; i++) {
|
|
35
|
-
this.hostAttributes[this.host.attributes[i].name] = this.host.attributes[i].value;
|
|
36
|
-
}
|
|
37
|
-
this.hostAttributes.type = this.hostAttributes.type || 'button';
|
|
38
|
-
this.hostAttributes.class += ' s-button-btn btn--has-loading'
|
|
39
|
-
+ ' s-button-' + this.btnStyle
|
|
40
|
-
+ (this.wide ? ' s-button-wide ' : '')
|
|
41
|
-
+ ' s-button-btn-loader-' + this.loaderPosition //todo:: it looks there is no need for this class🤔
|
|
42
|
-
+ (this.loaderPosition == 'after' ? ' s-button-loader-after' : '');
|
|
43
|
-
delete this.hostAttributes['btn-style'];
|
|
44
|
-
delete this.hostAttributes['id'];
|
|
45
|
-
delete this.hostAttributes['data-on-click'];
|
|
46
49
|
if (this.wide) {
|
|
47
50
|
this.host.classList.add('s-button-wide');
|
|
48
51
|
}
|
|
@@ -78,38 +81,46 @@ const SallaButton = class {
|
|
|
78
81
|
*/
|
|
79
82
|
async disable() {
|
|
80
83
|
this.host.setAttribute('disabled', '');
|
|
84
|
+
return this.host;
|
|
81
85
|
}
|
|
82
86
|
/**
|
|
83
87
|
* Remove `disabled` attribute
|
|
84
88
|
*/
|
|
85
89
|
async enable() {
|
|
86
90
|
this.host.removeAttribute('disabled');
|
|
91
|
+
return this.host;
|
|
87
92
|
}
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
93
|
+
getBtnAttributes() {
|
|
94
|
+
for (let i = 0; i < this.host.attributes.length; i++) {
|
|
95
|
+
if (!['type', 'color', 'fill', 'size', 'width', 'id',].includes(this.host.attributes[i].name)) {
|
|
96
|
+
this.hostAttributes[this.host.attributes[i].name] = this.host.attributes[i].value;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
this.hostAttributes.type = this.hostAttributes.type || 'button';
|
|
100
|
+
this.hostAttributes.class +=
|
|
101
|
+
' s-button-element s-button-' + this.buttonType
|
|
102
|
+
+ ' s-button-' + (this.fill == "none" ? 'fill-none' : this.fill)
|
|
103
|
+
+ (this.size != "medium" ? ' s-button-' + this.size : '')
|
|
104
|
+
+ (this.width != "normal" ? ' s-button-' + this.width : '')
|
|
105
|
+
+ (this.buttonType == "link" ? ' s-button-' + this.color + '-link' : '')
|
|
106
|
+
+ (this.buttonType != "link" && this.fill != 'outline' ? ' s-button-' + this.color : '')
|
|
107
|
+
+ (this.fill == 'outline' ? ' s-button-' + this.color + '-outline' : '')
|
|
108
|
+
+ (this.disabled ? ' s-button-disabled ' : '')
|
|
109
|
+
+ (this.buttonType == 'icon' ? ' s-button-loader-center' : ' s-button-loader-' + this.loaderPosition);
|
|
110
|
+
return this.hostAttributes;
|
|
96
111
|
}
|
|
112
|
+
// @Watch('btnStyle')
|
|
113
|
+
// handleVisible(newKind: string, oldKind: string) {
|
|
114
|
+
// //todo::use united styles
|
|
115
|
+
// this.btn.classList.remove('btn-' + oldKind);
|
|
116
|
+
// this.btn.classList.add('btn-' + newKind);
|
|
117
|
+
// }
|
|
97
118
|
render() {
|
|
98
119
|
return (
|
|
99
120
|
//TODO:: use HOST then fake button behaviours
|
|
100
|
-
index.h(index.Host, { class: "s-button-wrap" }, index.h("button", Object.assign({
|
|
101
|
-
//todo::use united styles
|
|
102
|
-
's-button-loader': true,
|
|
103
|
-
's-button-loader-start': this.loaderPosition === 'start',
|
|
104
|
-
's-button-loader-end': this.loaderPosition === 'end',
|
|
105
|
-
's-button-loader-center': this.loaderPosition === 'center',
|
|
106
|
-
} }) : '')));
|
|
121
|
+
index.h(index.Host, { class: "s-button-wrap" }, index.h("button", Object.assign({}, this.getBtnAttributes(), { disabled: this.disabled }), index.h("span", { class: "s-button-text", ref: el => this.text = el }, index.h("slot", null)), this.loading ? index.h("span", { class: "s-button-loader" }) : '')));
|
|
107
122
|
}
|
|
108
123
|
get host() { return index.getElement(this); }
|
|
109
|
-
static get watchers() { return {
|
|
110
|
-
"btnStyle": ["handleVisible"],
|
|
111
|
-
"loading": ["handleLoading"]
|
|
112
|
-
}; }
|
|
113
124
|
};
|
|
114
125
|
SallaButton.style = sallaButtonCss;
|
|
115
126
|
|
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
const index = require('./index-0b5b5867.js');
|
|
6
6
|
const Helper = require('./Helper-98cc9f18.js');
|
|
7
7
|
|
|
8
|
-
const sallaLocalizationModalCss = "";
|
|
8
|
+
const sallaLocalizationModalCss = "#salla-localization .s-localization-modal-select{appearance:none;-webkit-appearance:none}";
|
|
9
9
|
|
|
10
10
|
const SallaLocalizationModal = class {
|
|
11
11
|
constructor(hostRef) {
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
const index = require('./index-0b5b5867.js');
|
|
4
4
|
const Helper = require('./Helper-98cc9f18.js');
|
|
5
5
|
|
|
6
|
-
const sallaLoginModalCss = "";
|
|
6
|
+
const sallaLoginModalCss = "[dir=ltr] #salla-login .s-login-modal-main-btn .arrow{display:inline-block;transform:scale(-1)}";
|
|
7
7
|
|
|
8
8
|
const SallaLoginModal = class {
|
|
9
9
|
constructor(hostRef) {
|
|
@@ -70,7 +70,7 @@ const SallaLoginModal = class {
|
|
|
70
70
|
};
|
|
71
71
|
this.newUser = async () => {
|
|
72
72
|
var _a;
|
|
73
|
-
const { mobile: regPhone, countryCode, countryKey } = await this.regTelInput.getValues(), emailValue = this.regEmail.value || ((_a = this.loginEmail) === null || _a === void 0 ? void 0 : _a.value);
|
|
73
|
+
const { mobile: regPhone, countryCode, countryKey } = this.regType == "email" ? await this.regTelInput.getValues() : await this.loginTelInput.getValues(), emailValue = this.regEmail.value || ((_a = this.loginEmail) === null || _a === void 0 ? void 0 : _a.value);
|
|
74
74
|
await this.newUserValidation();
|
|
75
75
|
await this.regBtn.load();
|
|
76
76
|
await this.regBtn.disable();
|
|
@@ -190,12 +190,12 @@ const SallaLoginModal = class {
|
|
|
190
190
|
}
|
|
191
191
|
render() {
|
|
192
192
|
return (index.h("salla-modal", { id: "salla-login", icon: "sicon-user", title: this.title, ref: modal => this.modal = modal, width: "xs" }, index.h("div", { class: "s-login-modal-wrapper" }, this.isEmailAllowed && this.isMobileAllowed ?
|
|
193
|
-
index.h("div", { class: "s-login-modal-tab", ref: tab => this.homeTab = tab }, index.h("p", { class: "s-login-modal-sub-title" }, this.loginTypeTitle), index.h("slot", { name: "before-login-type" }), index.h("a", { href: "#", class: "s-login-modal-main-btn", onClick: (evt) => this.showTab(this.mobileTab, evt) }, index.h("i", { class: "s-login-modal-main-btn-icon sicon-phone" }), index.h("span", { class: "s-login-modal-main-btn-text" }, this.smsLabel), index.h("i", { class: "
|
|
193
|
+
index.h("div", { class: "s-login-modal-tab", ref: tab => this.homeTab = tab }, index.h("p", { class: "s-login-modal-sub-title" }, this.loginTypeTitle), index.h("slot", { name: "before-login-type" }), index.h("a", { href: "#", class: "s-login-modal-main-btn", onClick: (evt) => this.showTab(this.mobileTab, evt) }, index.h("i", { class: "s-login-modal-main-btn-icon sicon-phone" }), index.h("span", { class: "s-login-modal-main-btn-text" }, this.smsLabel), index.h("i", { class: "sicon-keyboard_arrow_left arrow" })), index.h("a", { href: "#", class: "s-login-modal-main-btn", onClick: (evt) => this.showTab(this.emailTab, evt) }, index.h("i", { class: "s-login-modal-main-btn-icon sicon-mail" }), index.h("span", { class: "s-login-modal-main-btn-text" }, this.emailLabel), index.h("i", { class: "sicon-keyboard_arrow_left arrow" })), index.h("slot", { name: "after-login-type" }))
|
|
194
194
|
: '', this.isMobileAllowed ?
|
|
195
|
-
index.h("div", { class: "s-login-modal-tab", ref: tab => this.mobileTab = tab }, index.h("slot", { name: "before-login-mobile" }), index.h("label", { class: "s-login-modal-label" }, this.mobileLabel), index.h("salla-tel-input", { ref: el => this.loginTelInput = el, onKeyDown: e => this.typing(e, this.loginBySMS) }), index.h("salla-button", { "loader-position": 'center',
|
|
195
|
+
index.h("div", { class: "s-login-modal-tab", ref: tab => this.mobileTab = tab }, index.h("slot", { name: "before-login-mobile" }), index.h("label", { class: "s-login-modal-label" }, this.mobileLabel), index.h("salla-tel-input", { ref: el => this.loginTelInput = el, onKeyDown: e => this.typing(e, this.loginBySMS) }), index.h("salla-button", { "loader-position": 'center', width: "wide", onClick: () => this.loginBySMS(), ref: b => this.smsBtn = b }, salla.lang.get('blocks.header.enter')), this.isEmailAllowed ?
|
|
196
196
|
index.h("a", { href: "#", onClick: () => this.showTab(this.emailTab), class: "s-login-modal-link" }, this.byEmailText) : '', index.h("slot", { name: "after-login-mobile" })) : '', this.isEmailAllowed ?
|
|
197
|
-
index.h("div", { class: "s-login-modal-tab", ref: tab => this.emailTab = tab }, index.h("slot", { name: "before-login-email" }), index.h("label", { class: "s-login-modal-label" }, this.emailLabel), index.h("input", { type: "email", ref: el => this.loginEmail = el, onKeyDown: e => this.typing(e, this.loginByEmail), placeholder: "your@email.com", class: "s-login-modal-input s-ltr" }), index.h("span", { class: "s-login-modal-error-message" }), index.h("salla-button", { "loader-position": 'center',
|
|
198
|
-
index.h("a", { href: "#", onClick: () => this.showTab(this.mobileTab), class: "s-login-modal-link" }, this.bySMSText) : '', index.h("slot", { name: "after-login-email" })) : '', index.h("salla-verify-modal", { withoutModal: true, ref: tab => this.verifyTab = tab, autoReload: false }, index.h("a", { onClick: () => this.showTab(this.regType == 'phone' ? this.mobileTab : this.emailTab), class: "s-verify-modal-back sicon-arrow-right", slot: "after-footer", href: "#" })), index.h("div", { ref: tab => this.registrationTab = tab }, index.h("slot", { name: "before-registration" }), index.h("label", { class: "s-login-modal-label" }, this.firstNameLabel), index.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') }), index.h("span", { class: "s-login-modal-error-message" }), index.h("label", { class: "s-login-modal-label" }, this.lastNameLabel), index.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') }), index.h("span", { class: "s-login-modal-error-message" }), index.h("div", { ref: el => this.regMobileBlock = el, class: "mb-1.5" }, index.h("label", { class: "s-login-modal-label" }, this.mobileLabel), index.h("salla-tel-input", { ref: el => this.regTelInput = el, onKeyDown: e => this.typing(e, this.newUser) })), index.h("div", { ref: el => this.regEmailBlock = el, class: "mb-1.5" }, index.h("label", { class: "s-login-modal-label" }, this.emailLabel), index.h("input", { type: "email", ref: el => this.regEmail = el, onKeyDown: e => this.typing(e, this.newUser), placeholder: "your@email.com", class: "s-login-modal-input s-ltr" }), index.h("span", { class: "s-login-modal-error-message" })), index.h("salla-button", { "loader-position": 'center',
|
|
197
|
+
index.h("div", { class: "s-login-modal-tab", ref: tab => this.emailTab = tab }, index.h("slot", { name: "before-login-email" }), index.h("label", { class: "s-login-modal-label" }, this.emailLabel), index.h("input", { type: "email", ref: el => this.loginEmail = el, onKeyDown: e => this.typing(e, this.loginByEmail), placeholder: "your@email.com", class: "s-login-modal-input s-ltr" }), index.h("span", { class: "s-login-modal-error-message" }), index.h("salla-button", { "loader-position": 'center', width: "wide", onClick: () => this.loginByEmail(), ref: b => this.emailBtn = b }, salla.lang.get('blocks.header.enter')), this.isMobileAllowed ?
|
|
198
|
+
index.h("a", { href: "#", onClick: () => this.showTab(this.mobileTab), class: "s-login-modal-link" }, this.bySMSText) : '', index.h("slot", { name: "after-login-email" })) : '', index.h("salla-verify-modal", { withoutModal: true, ref: tab => this.verifyTab = tab, autoReload: false }, index.h("a", { onClick: () => this.showTab(this.regType == 'phone' ? this.mobileTab : this.emailTab), class: "s-verify-modal-back sicon-arrow-right", slot: "after-footer", href: "#" })), index.h("div", { ref: tab => this.registrationTab = tab }, index.h("slot", { name: "before-registration" }), index.h("label", { class: "s-login-modal-label" }, this.firstNameLabel), index.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') }), index.h("span", { class: "s-login-modal-error-message" }), index.h("label", { class: "s-login-modal-label" }, this.lastNameLabel), index.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') }), index.h("span", { class: "s-login-modal-error-message" }), index.h("div", { ref: el => this.regMobileBlock = el, class: "mb-1.5" }, index.h("label", { class: "s-login-modal-label" }, this.mobileLabel), index.h("salla-tel-input", { ref: el => this.regTelInput = el, onKeyDown: e => this.typing(e, this.newUser) })), index.h("div", { ref: el => this.regEmailBlock = el, class: "mb-1.5" }, index.h("label", { class: "s-login-modal-label" }, this.emailLabel), index.h("input", { type: "email", ref: el => this.regEmail = el, onKeyDown: e => this.typing(e, this.newUser), placeholder: "your@email.com", class: "s-login-modal-input s-ltr" }), index.h("span", { class: "s-login-modal-error-message" })), index.h("salla-button", { "loader-position": 'center', width: "wide", onClick: () => this.newUser(), ref: b => this.regBtn = b }, salla.lang.get('blocks.header.register')), index.h("slot", { name: "after-registration" })))));
|
|
199
199
|
}
|
|
200
200
|
get host() { return index.getElement(this); }
|
|
201
201
|
};
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const sallaLoginModal = require('./salla-login-modal-
|
|
5
|
+
const sallaLoginModal = require('./salla-login-modal-d0fb6180.js');
|
|
6
6
|
require('./index-0b5b5867.js');
|
|
7
7
|
require('./Helper-98cc9f18.js');
|
|
8
8
|
|
|
@@ -4,9 +4,9 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
const index = require('./index-0b5b5867.js');
|
|
6
6
|
const Helper = require('./Helper-98cc9f18.js');
|
|
7
|
-
const sallaSearch = require('./salla-search-
|
|
7
|
+
const sallaSearch = require('./salla-search-f76c6d61.js');
|
|
8
8
|
|
|
9
|
-
const sallaModalCss = "";
|
|
9
|
+
const sallaModalCss = ".salla-modal .s-modal-wrapper{height:calc(var(--vh, 1vh) * 100)}";
|
|
10
10
|
|
|
11
11
|
const SallaModal = class {
|
|
12
12
|
constructor(hostRef) {
|
|
@@ -21,13 +21,12 @@ const SallaOfferModal = class {
|
|
|
21
21
|
});
|
|
22
22
|
this.categorySlot = ((_a = Helper.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>';
|
|
23
23
|
this.productSlot = ((_b = Helper.Helper.getElement('[slot="product"]')) === null || _b === void 0 ? void 0 : _b.innerHTML) || this.defaultProductSlot();
|
|
24
|
-
salla.offer.event.onExisted(
|
|
25
|
-
|
|
26
|
-
if (salla.localData.get('remember-offer-' + data.offer.offer_id)) {
|
|
24
|
+
salla.offer.event.onExisted(offer => {
|
|
25
|
+
if (salla.storage.get('remember-offer-' + offer.id)) {
|
|
27
26
|
salla.log('User selected to don\'t show this offer again.');
|
|
28
27
|
return;
|
|
29
28
|
}
|
|
30
|
-
this.show(
|
|
29
|
+
this.show(offer.product_id);
|
|
31
30
|
});
|
|
32
31
|
}
|
|
33
32
|
/**
|
|
@@ -50,7 +49,7 @@ const SallaOfferModal = class {
|
|
|
50
49
|
return this.modal.show();
|
|
51
50
|
}
|
|
52
51
|
rememberMe(event) {
|
|
53
|
-
salla.
|
|
52
|
+
salla.storage.set('remember-offer-' + this.offer.id, event.target.checked);
|
|
54
53
|
}
|
|
55
54
|
addItem() {
|
|
56
55
|
// this here, is sallaButton
|
|
@@ -34,7 +34,7 @@ const SallaProductAvailability = class {
|
|
|
34
34
|
.then(() => salla.api.product.availabilitySubscribe(data))
|
|
35
35
|
.then(() => {
|
|
36
36
|
this.isSubscribed = true;
|
|
37
|
-
salla.
|
|
37
|
+
salla.storage.set(`product-${this.productId}-subscribed`, true);
|
|
38
38
|
}) //no need to wait until finishing alert animation
|
|
39
39
|
.then(() => this.btn.stop())
|
|
40
40
|
.then(() => this.modal.hide())
|
|
@@ -67,7 +67,7 @@ const SallaProductAvailability = class {
|
|
|
67
67
|
this.channelsWatcher(this.channels);
|
|
68
68
|
this.title_ = this.host.title || salla.lang.get('pages.products.notify_availability_title');
|
|
69
69
|
this.host.removeAttribute('title');
|
|
70
|
-
this.isVisitorSubscribed = salla.
|
|
70
|
+
this.isVisitorSubscribed = salla.storage.get(`product-${this.productId}-subscribed`);
|
|
71
71
|
}
|
|
72
72
|
channelsWatcher(newValue) {
|
|
73
73
|
this.channels_ = newValue.split(',');
|
|
@@ -3,12 +3,16 @@
|
|
|
3
3
|
const index = require('./index-0b5b5867.js');
|
|
4
4
|
const Helper = require('./Helper-98cc9f18.js');
|
|
5
5
|
|
|
6
|
-
const sallaSearchCss = "#s-search-modal .s-modal-wrapper{align-items:flex-start;padding:0}#s-search-modal .s-modal-spacer{display:inline}#s-search-modal .s-modal-body{padding:0;max-width:90%;margin-top:3.2rem;border-radius:0.5rem}#s-search-modal .s-modal-close{top:50%;transform:translateY(-50%)}";
|
|
6
|
+
const sallaSearchCss = "#s-search-modal .s-search-inline{border:1px solid #eee}#s-search-modal .s-search-no-results .s-search-input,#s-search-modal .s-search-container-open .s-search-input{border-bottom:1px solid #f4f4f5}#s-search-modal .s-search-product-image[src=null]{opacity:0}#s-search-modal .s-modal-wrapper{align-items:flex-start;padding:0}#s-search-modal .s-modal-spacer{display:inline}#s-search-modal .s-modal-body{padding:0;max-width:90%;margin-top:3.2rem;border-radius:0.5rem;background:transparent;overflow:visible}#s-search-modal .s-modal-close{top:50%;transform:translateY(-50%)}";
|
|
7
7
|
|
|
8
8
|
const SallaSearch = class {
|
|
9
9
|
constructor(hostRef) {
|
|
10
10
|
index.registerInstance(this, hostRef);
|
|
11
11
|
var _a;
|
|
12
|
+
this.inputValue = '';
|
|
13
|
+
this.inline = false;
|
|
14
|
+
this.oval = false;
|
|
15
|
+
this.height = 60;
|
|
12
16
|
Helper.Helper.setHost(this.host);
|
|
13
17
|
this.productSlot = ((_a = Helper.Helper.getElement('[slot="product"]')) === null || _a === void 0 ? void 0 : _a.innerHTML) || this.getDefaultProductSlot();
|
|
14
18
|
salla.event.on('search::show', () => this.modal.show());
|
|
@@ -24,6 +28,7 @@ const SallaSearch = class {
|
|
|
24
28
|
this.modal.querySelector('.s-search-input').value = '';
|
|
25
29
|
this.results = undefined;
|
|
26
30
|
this.afterSearching();
|
|
31
|
+
this.container.classList.remove('s-search-no-results');
|
|
27
32
|
}
|
|
28
33
|
getDefaultProductSlot() {
|
|
29
34
|
return '<div class="s-search-product-image-container">' +
|
|
@@ -35,6 +40,7 @@ const SallaSearch = class {
|
|
|
35
40
|
}
|
|
36
41
|
//todo:: reset data when closing
|
|
37
42
|
search(e) {
|
|
43
|
+
this.inputValue = e.target.value;
|
|
38
44
|
Helper.Helper.hideElement(this.noResults);
|
|
39
45
|
if (e.target.value.length === 0) {
|
|
40
46
|
this.results = undefined;
|
|
@@ -54,17 +60,22 @@ const SallaSearch = class {
|
|
|
54
60
|
afterSearching(isEmpty = true) {
|
|
55
61
|
var _a;
|
|
56
62
|
this.noResults.style.display = isEmpty || ((_a = this.results) === null || _a === void 0 ? void 0 : _a.data.length) > 0 ? 'none' : 'block';
|
|
57
|
-
Helper.Helper.toggleElement(this.container, 's-search-container-open', 'no-results', () => { var _a; return (_a = this.results) === null || _a === void 0 ? void 0 : _a.data.length; })
|
|
63
|
+
Helper.Helper.toggleElement(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; })
|
|
58
64
|
.toggleElement(this.searchIcon, 's-search-spinner-loader', 'sicon-search', () => false); //stop searching anime
|
|
59
65
|
salla.search.api.previousQuery = ''; //avoid having error 'Query Same As Previous' after reopen modal;
|
|
66
|
+
this.inputValue.length == 0 ? this.container.classList.remove('s-search-no-results') : '';
|
|
60
67
|
}
|
|
61
68
|
render() {
|
|
62
69
|
var _a;
|
|
63
|
-
|
|
70
|
+
const searchContent = index.h("div", { class: { 's-search-container': true, 's-search-inline': this.inline }, ref: container => this.container = container, style: this.oval ? { borderRadius: this.height / 2 + 'px' } : {} }, index.h("input", { class: "s-search-input", type: "text", placeholder: this.placeholder, onInput: e => this.search(e), style: { height: this.height + 'px' } }), index.h("span", { class: "s-search-icon-wrap" }, index.h("i", { class: "s-search-icon sicon-search", ref: el => this.searchIcon = el })), index.h("div", { class: "s-search-results" }, (_a = this.results) === null || _a === void 0 ? void 0 :
|
|
64
71
|
_a.data.map(item => index.h("a", { href: item.url, class: "s-search-product", innerHTML: this.productSlot
|
|
65
72
|
.replace(/\{name\}/g, item.name)
|
|
66
73
|
.replace(/\{price\}/g, item.price) //todo:: get discounted price too
|
|
67
|
-
.replace(/\{image\}/g, item.image_url) })), index.h("p", { ref: el => this.noResults = el, class: "s-search-no-results" }, this.noResultsText)))
|
|
74
|
+
.replace(/\{image\}/g, item.image_url) })), index.h("p", { ref: el => this.noResults = el, class: "s-search-no-results-placeholder" }, this.noResultsText)));
|
|
75
|
+
return (this.inline ?
|
|
76
|
+
index.h("div", { id: "s-search-modal" }, searchContent)
|
|
77
|
+
:
|
|
78
|
+
index.h("salla-modal", { position: "top", id: "s-search-modal", ref: modal => this.modal = modal }, searchContent));
|
|
68
79
|
}
|
|
69
80
|
/**
|
|
70
81
|
* Run it one time after load
|
|
@@ -1438,7 +1438,7 @@ const SallaTelInput = class {
|
|
|
1438
1438
|
return false;
|
|
1439
1439
|
}
|
|
1440
1440
|
initTelInput() {
|
|
1441
|
-
salla.helpers.
|
|
1441
|
+
salla.helpers.inputDigitsOnly(this.phoneInput);
|
|
1442
1442
|
this.iti = intlTelInput(this.phoneInput, {
|
|
1443
1443
|
initialCountry: this.countryCode || 'sa',
|
|
1444
1444
|
preferredCountries: ['sa', 'ae', 'kw', 'bh', 'qa', 'iq', 'om', 'ye', 'eg', 'jo', 'sy', 'ps', 'sd', 'lb', 'dz', 'tn', 'ma', 'ly'],
|
|
@@ -1449,16 +1449,14 @@ const SallaTelInput = class {
|
|
|
1449
1449
|
});
|
|
1450
1450
|
this.phoneInput.addEventListener("countrychange", () => {
|
|
1451
1451
|
let data = this.iti.getSelectedCountryData();
|
|
1452
|
-
this.
|
|
1453
|
-
this.
|
|
1454
|
-
input.value = ('+' + data.dialCode).replace('++', '+');
|
|
1455
|
-
});
|
|
1452
|
+
this.countryCodeInput.value = data.iso2.toUpperCase();
|
|
1453
|
+
this.countryKeyInput.value = ('+' + data.dialCode).replace('++', '+');
|
|
1456
1454
|
});
|
|
1457
1455
|
// on blur: validate
|
|
1458
1456
|
this.phoneInput.addEventListener('blur', () => this.isValid());
|
|
1459
1457
|
// on keyup / change flag: reset
|
|
1460
1458
|
this.phoneInput.addEventListener('input', e => {
|
|
1461
|
-
salla.helpers.
|
|
1459
|
+
salla.helpers.inputDigitsOnly(e.target);
|
|
1462
1460
|
this.reset();
|
|
1463
1461
|
});
|
|
1464
1462
|
}
|
|
@@ -5,12 +5,13 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
const index = require('./index-0b5b5867.js');
|
|
6
6
|
const Helper = require('./Helper-98cc9f18.js');
|
|
7
7
|
|
|
8
|
-
const sallaVerifyModalCss = "salla-verify-modal{display:block}";
|
|
8
|
+
const sallaVerifyModalCss = "salla-verify-modal{display:block}[dir=ltr] #s-verify-modal .s-verify-modal-back{transform:scale(-1)}";
|
|
9
9
|
|
|
10
10
|
const SallaVerifyModal = class {
|
|
11
11
|
constructor(hostRef) {
|
|
12
12
|
index.registerInstance(this, hostRef);
|
|
13
13
|
this.verified = index.createEvent(this, "verified", 7);
|
|
14
|
+
// Helper.setHost(this.host);
|
|
14
15
|
this.initiated = false;
|
|
15
16
|
/**
|
|
16
17
|
* Verifying method
|
|
@@ -20,7 +21,6 @@ const SallaVerifyModal = class {
|
|
|
20
21
|
* should auto reloading the page after success verification
|
|
21
22
|
*/
|
|
22
23
|
this.autoReload = true;
|
|
23
|
-
Helper.Helper.setHost(this.host);
|
|
24
24
|
if (this.withoutModal) {
|
|
25
25
|
this.modal = { show: () => '', hide: () => '' };
|
|
26
26
|
}
|
|
@@ -53,7 +53,7 @@ const SallaVerifyModal = class {
|
|
|
53
53
|
this.resendTimer();
|
|
54
54
|
this.otpInputs = this.host.querySelectorAll('.s-verify-modal-input');
|
|
55
55
|
if (!this.initiated) {
|
|
56
|
-
Helper.Helper.on('input', '.s-verify-modal-input', e => salla.helpers.
|
|
56
|
+
Helper.Helper.on('input', '.s-verify-modal-input', e => salla.helpers.inputDigitsOnly(e.target));
|
|
57
57
|
Helper.Helper.onKeyUp('.s-verify-modal-input', event => {
|
|
58
58
|
var _a, _b, _c, _d;
|
|
59
59
|
let key = event.keyCode || event.charCode;
|
|
@@ -68,7 +68,7 @@ const SallaVerifyModal = class {
|
|
|
68
68
|
this.toggleOTPSubmit();
|
|
69
69
|
});
|
|
70
70
|
Helper.Helper.on('paste', '.s-verify-modal-input', event => {
|
|
71
|
-
let text = event.clipboardData.getData('text')
|
|
71
|
+
let text = salla.helpers.number(event.clipboardData.getData('text')).replace(/[^0-9.]/g, '').replace('..', '.');
|
|
72
72
|
this.otpInputs.forEach((input, i) => input.value = text[i] || '');
|
|
73
73
|
this.toggleOTPSubmit();
|
|
74
74
|
setTimeout(() => this.otpInputs[3].focus(), 100);
|
|
@@ -135,11 +135,11 @@ const SallaVerifyModal = class {
|
|
|
135
135
|
.catch(() => this.btn.stop() && this.btn.enable() && this.reset());
|
|
136
136
|
}
|
|
137
137
|
render() {
|
|
138
|
-
return this.withoutModal ? this.myBody() :
|
|
138
|
+
return this.withoutModal ? index.h(index.Host, null, this.myBody()) :
|
|
139
139
|
index.h("salla-modal", { icon: "sicon-android-phone", width: "xs", id: "s-verify-modal", ref: modal => this.modal = modal, title: this.title }, this.myBody());
|
|
140
140
|
}
|
|
141
141
|
myBody() {
|
|
142
|
-
return (index.h(
|
|
142
|
+
return (index.h("div", { id: "s-verify-modal" }, index.h("div", { class: "s-verify-modal-message", innerHTML: salla.lang.get('pages.profile.verify_message') }), index.h("input", { type: "hidden", name: "code", maxlength: "4", required: true, ref: code => this.code = code }), index.h("div", { class: "s-verify-modal-codes", dir: "ltr" }, [1, 2, 3, 4].map(() => index.h("input", { type: "text", maxlength: "1", class: "s-verify-modal-input", required: true }))), index.h("div", { slot: "footer", class: "s-verify-modal-footer" }, index.h("salla-button", { class: "s-verify-modal-submit", "loader-position": 'center', disabled: true, onClick: () => this.submit(), ref: b => this.btn = b }, salla.lang.get('pages.profile.verify')), index.h("p", { class: "s-verify-modal-resend-message", ref: el => this.resendMessage = el }, salla.lang.get('blocks.header.resend_after'), index.h("b", { class: "s-verify-modal-timer", ref: el => this.timer = el })), index.h("a", { href: "#", class: "s-verify-modal-resend", onClick: () => this.resendCode(), ref: el => this.resend = el }, salla.lang.get('blocks.comments.submit'))), index.h("slot", { name: "after-footer" })));
|
|
143
143
|
}
|
|
144
144
|
get host() { return index.getElement(this); }
|
|
145
145
|
};
|
|
@@ -15,5 +15,5 @@ const patchBrowser = () => {
|
|
|
15
15
|
};
|
|
16
16
|
|
|
17
17
|
patchBrowser().then(options => {
|
|
18
|
-
return index.bootstrapLazy([["salla-button.cjs",[[4,"salla-button",{"
|
|
18
|
+
return index.bootstrapLazy([["salla-button.cjs",[[4,"salla-button",{"buttonType":[513,"button-type"],"color":[513],"fill":[513],"size":[513],"width":[513],"loading":[516],"disabled":[516],"loaderPosition":[1,"loader-position"],"wide":[4],"href":[1],"load":[64],"stop":[64],"setText":[64],"disable":[64],"enable":[64]}]]],["salla-modal_2.cjs",[[0,"salla-search",{"inline":[4],"oval":[4],"height":[2],"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
|
});
|
|
@@ -2,7 +2,7 @@ import { Component, h, Prop, Method, State, Element } from "@stencil/core";
|
|
|
2
2
|
export class SallaBranches {
|
|
3
3
|
constructor() {
|
|
4
4
|
this.open = false;
|
|
5
|
-
this.isOpenedBefore = salla.
|
|
5
|
+
this.isOpenedBefore = salla.storage.get("branch-choosed-before");
|
|
6
6
|
this.displayAs = 'default'; //todo:: change it to boolean, isPopup default false
|
|
7
7
|
this.browseProductsFrom = 'all'; //todo:: get better name
|
|
8
8
|
this.branches = [
|
|
@@ -47,7 +47,7 @@ export class SallaBranches {
|
|
|
47
47
|
this.btn.load().then(() => {
|
|
48
48
|
setTimeout(() => location.reload(), 2000);
|
|
49
49
|
});
|
|
50
|
-
salla.
|
|
50
|
+
salla.storage.set("branch-choosed-before", true);
|
|
51
51
|
this.show();
|
|
52
52
|
setTimeout(() => {
|
|
53
53
|
this.current = this.selected;
|
|
@@ -10,4 +10,86 @@
|
|
|
10
10
|
/*
|
|
11
11
|
* Salla Button Component: has many sizes, styles and loading state.
|
|
12
12
|
* You can use these classes to target the elements in the component.
|
|
13
|
-
*/
|
|
13
|
+
*/
|
|
14
|
+
salla-button {
|
|
15
|
+
pointer-events: none;
|
|
16
|
+
}
|
|
17
|
+
salla-button[type=submit] {
|
|
18
|
+
-webkit-appearance: none;
|
|
19
|
+
}
|
|
20
|
+
salla-button[width=wide] {
|
|
21
|
+
width: 100%;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.s-button-wrap[loading] {
|
|
25
|
+
pointer-events: none;
|
|
26
|
+
}
|
|
27
|
+
.s-button-wrap[loading] .s-button-element {
|
|
28
|
+
pointer-events: none !important;
|
|
29
|
+
}
|
|
30
|
+
.s-button-wrap[loading] .s-button-loader-center .s-button-text {
|
|
31
|
+
opacity: 0;
|
|
32
|
+
}
|
|
33
|
+
.s-button-wrap .s-button-element[loading] {
|
|
34
|
+
pointer-events: none !important;
|
|
35
|
+
}
|
|
36
|
+
.s-button-wrap .s-button-element:not(:disabled) {
|
|
37
|
+
pointer-events: auto;
|
|
38
|
+
}
|
|
39
|
+
.s-button-wrap .s-button-solid .s-button-loader:before {
|
|
40
|
+
border-color: #fff #fff rgba(255, 255, 255, 0.2) rgba(255, 255, 255, 0.2);
|
|
41
|
+
}
|
|
42
|
+
.s-button-wrap .s-button-outline {
|
|
43
|
+
border: 1px solid currentColor;
|
|
44
|
+
}
|
|
45
|
+
.s-button-wrap .s-button-outline:hover {
|
|
46
|
+
border-color: transparent;
|
|
47
|
+
}
|
|
48
|
+
.s-button-wrap .s-button-outline .s-button-loader:before {
|
|
49
|
+
border-top-color: currentColor;
|
|
50
|
+
border-left-color: currentColor;
|
|
51
|
+
}
|
|
52
|
+
.s-button-wrap .s-button-icon.s-button-large {
|
|
53
|
+
width: 56px;
|
|
54
|
+
height: 56px;
|
|
55
|
+
}
|
|
56
|
+
.s-button-wrap .s-button-icon.s-button-small {
|
|
57
|
+
width: 24px;
|
|
58
|
+
height: 24px;
|
|
59
|
+
}
|
|
60
|
+
.s-button-wrap .s-button-icon.s-button-small .s-button-loader:before {
|
|
61
|
+
width: 0.85rem;
|
|
62
|
+
height: 0.85rem;
|
|
63
|
+
}
|
|
64
|
+
.s-button-wrap .s-button-loader-after .s-button-load {
|
|
65
|
+
flex-direction: row;
|
|
66
|
+
}
|
|
67
|
+
.s-button-wrap .s-button-loader-start.s-button-element {
|
|
68
|
+
padding-right: 40px;
|
|
69
|
+
}
|
|
70
|
+
.s-button-wrap .s-button-loader-start .s-button-loader {
|
|
71
|
+
position: absolute;
|
|
72
|
+
right: 8px;
|
|
73
|
+
}
|
|
74
|
+
.s-button-wrap .s-button-loader-start .s-button-loader [dir=ltr] {
|
|
75
|
+
left: 8px;
|
|
76
|
+
right: auto;
|
|
77
|
+
}
|
|
78
|
+
.s-button-wrap .s-button-loader-end.s-button-element {
|
|
79
|
+
padding-left: 40px;
|
|
80
|
+
}
|
|
81
|
+
.s-button-wrap .s-button-loader-end .s-button-loader {
|
|
82
|
+
position: absolute;
|
|
83
|
+
left: 8px;
|
|
84
|
+
}
|
|
85
|
+
.s-button-wrap .s-button-loader-end .s-button-loader [dir=ltr] {
|
|
86
|
+
right: 8px;
|
|
87
|
+
left: auto;
|
|
88
|
+
}
|
|
89
|
+
.s-button-wrap .s-button-loader-center .s-button-loader {
|
|
90
|
+
position: absolute;
|
|
91
|
+
top: 50%;
|
|
92
|
+
left: 50%;
|
|
93
|
+
transform: translateY(-50%) translateX(-50%);
|
|
94
|
+
margin: 0 !important;
|
|
95
|
+
}
|