@salla.sa/twilight-components 1.0.52 → 1.0.53
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 +16 -21
- package/dist/cjs/salla-localization-modal.cjs.entry.js +1 -1
- package/dist/cjs/{salla-login-modal-a2c7fa5d.js → salla-login-modal-54cc2e83.js} +1 -1
- 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 +2 -2
- 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 +2 -4
- 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 +51 -1
- package/dist/collection/components/salla-button/salla-button.js +54 -25
- package/dist/collection/components/salla-localization-modal/salla-localization-modal.css +5 -1
- package/dist/collection/components/salla-login-modal/salla-login-modal.js +1 -1
- package/dist/collection/components/salla-modal/salla-modal.css +4 -1
- package/dist/collection/components/salla-offer-modal/salla-offer-modal.js +2 -2
- 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 +2 -4
- 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 +16 -21
- package/dist/esm/salla-localization-modal.entry.js +1 -1
- package/dist/esm/{salla-login-modal-187c1f98.js → salla-login-modal-473768a6.js} +1 -1
- 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 +2 -2
- 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 +2 -4
- 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 → p-105af48d.entry.js} +1 -1
- package/dist/twilight-components/p-10ea748b.js +1 -0
- package/dist/twilight-components/{p-ea455ae9.entry.js → p-134fa158.entry.js} +1 -1
- package/dist/twilight-components/p-17ebe444.entry.js +1 -0
- 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-669a9b08.entry.js +1 -0
- package/dist/twilight-components/p-78b10bac.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 +9 -2
- package/dist/types/components/salla-search/salla-search.d.ts +4 -0
- package/dist/types/components.d.ts +24 -2
- 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/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-54cc2e83.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",{"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);
|
|
17
|
+
return index.bootstrapLazy([["salla-button.cjs",[[4,"salla-button",{"btnStyle":[513,"btn-style"],"icon":[516],"miniIcon":[516,"mini-icon"],"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",{"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,9 +3,8 @@
|
|
|
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}.s-button-wrap[loading]{pointer-events:none}.s-button-wrap[loading] .s-button-text{opacity:0}.s-button-wrap .s-button-icon:not(:disabled),.s-button-wrap .s-button-btn:not(:disabled){pointer-events:auto}.s-button-wrap .s-button-loader-after .s-button-load{flex-direction:row}.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-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}.s-button-wrap .s-button-mini-icon .s-button-loader:before{width:0.85rem;height:0.85rem}.s-button-wrap .s-button-danger .s-button-loader::before,.s-button-wrap .s-button-outline-danger .s-button-loader::before{border-top-color:#f87171;border-left-color:#f87171}";
|
|
9
8
|
|
|
10
9
|
const SallaButton = class {
|
|
11
10
|
constructor(hostRef) {
|
|
@@ -14,6 +13,14 @@ const SallaButton = class {
|
|
|
14
13
|
* Button Style
|
|
15
14
|
*/
|
|
16
15
|
this.btnStyle = 'primary';
|
|
16
|
+
/**
|
|
17
|
+
* Circle Button with icon
|
|
18
|
+
*/
|
|
19
|
+
this.icon = false;
|
|
20
|
+
/**
|
|
21
|
+
* Mini Circle Button with icon
|
|
22
|
+
*/
|
|
23
|
+
this.miniIcon = false;
|
|
17
24
|
/**
|
|
18
25
|
* Is the button currently loading
|
|
19
26
|
*/
|
|
@@ -35,14 +42,13 @@ const SallaButton = class {
|
|
|
35
42
|
this.hostAttributes[this.host.attributes[i].name] = this.host.attributes[i].value;
|
|
36
43
|
}
|
|
37
44
|
this.hostAttributes.type = this.hostAttributes.type || 'button';
|
|
38
|
-
this.hostAttributes.class +=
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
45
|
+
this.hostAttributes.class +=
|
|
46
|
+
(this.icon ? ' s-button-icon s-button-loader-center' : ' s-button-btn ' + 's-button-loader-' + this.loaderPosition)
|
|
47
|
+
+ (this.wide ? ' s-button-wide ' : '')
|
|
48
|
+
+ (this.disabled ? ' s-button-disabled ' : ' s-button-' + this.btnStyle)
|
|
49
|
+
+ (this.miniIcon ? ' s-button-mini-icon ' : '');
|
|
43
50
|
delete this.hostAttributes['btn-style'];
|
|
44
51
|
delete this.hostAttributes['id'];
|
|
45
|
-
delete this.hostAttributes['data-on-click'];
|
|
46
52
|
if (this.wide) {
|
|
47
53
|
this.host.classList.add('s-button-wide');
|
|
48
54
|
}
|
|
@@ -90,25 +96,14 @@ const SallaButton = class {
|
|
|
90
96
|
this.btn.classList.remove('btn-' + oldKind);
|
|
91
97
|
this.btn.classList.add('btn-' + newKind);
|
|
92
98
|
}
|
|
93
|
-
handleLoading(newVal) {
|
|
94
|
-
//todo::use united styles
|
|
95
|
-
Helper.Helper.toggleElement(this.btn, 'btn--is-loading', 'btn--no-loading', () => newVal);
|
|
96
|
-
}
|
|
97
99
|
render() {
|
|
98
100
|
return (
|
|
99
101
|
//TODO:: use HOST then fake button behaviours
|
|
100
|
-
index.h(index.Host, { class: "s-button-wrap" }, index.h("button", Object.assign({ ref: btn => this.btn = btn, disabled: this.disabled }
|
|
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
|
-
} }) : '')));
|
|
102
|
+
index.h(index.Host, { class: "s-button-wrap" }, index.h("button", Object.assign({ ref: btn => this.btn = btn }, this.hostAttributes, { 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
103
|
}
|
|
108
104
|
get host() { return index.getElement(this); }
|
|
109
105
|
static get watchers() { return {
|
|
110
|
-
"btnStyle": ["handleVisible"]
|
|
111
|
-
"loading": ["handleLoading"]
|
|
106
|
+
"btnStyle": ["handleVisible"]
|
|
112
107
|
}; }
|
|
113
108
|
};
|
|
114
109
|
SallaButton.style = sallaButtonCss;
|
|
@@ -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) {
|
|
@@ -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();
|
|
@@ -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-54cc2e83.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) {
|
|
@@ -23,7 +23,7 @@ const SallaOfferModal = class {
|
|
|
23
23
|
this.productSlot = ((_b = Helper.Helper.getElement('[slot="product"]')) === null || _b === void 0 ? void 0 : _b.innerHTML) || this.defaultProductSlot();
|
|
24
24
|
salla.offer.event.onExisted(data => {
|
|
25
25
|
//TODO:: use the best, should we hide the offer by product Id or Offer id🤔
|
|
26
|
-
if (salla.
|
|
26
|
+
if (salla.storage.get('remember-offer-' + data.offer.offer_id)) {
|
|
27
27
|
salla.log('User selected to don\'t show this offer again.');
|
|
28
28
|
return;
|
|
29
29
|
}
|
|
@@ -50,7 +50,7 @@ const SallaOfferModal = class {
|
|
|
50
50
|
return this.modal.show();
|
|
51
51
|
}
|
|
52
52
|
rememberMe(event) {
|
|
53
|
-
salla.
|
|
53
|
+
salla.storage.set('remember-offer-' + this.offer.id, event.target.checked);
|
|
54
54
|
}
|
|
55
55
|
addItem() {
|
|
56
56
|
// 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
|
|
@@ -1449,10 +1449,8 @@ 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());
|
|
@@ -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",{"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);
|
|
18
|
+
return index.bootstrapLazy([["salla-button.cjs",[[4,"salla-button",{"btnStyle":[513,"btn-style"],"icon":[516],"miniIcon":[516,"mini-icon"],"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",{"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,54 @@
|
|
|
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
|
+
|
|
21
|
+
.s-button-wrap[loading] {
|
|
22
|
+
pointer-events: none;
|
|
23
|
+
}
|
|
24
|
+
.s-button-wrap[loading] .s-button-text {
|
|
25
|
+
opacity: 0;
|
|
26
|
+
}
|
|
27
|
+
.s-button-wrap .s-button-icon:not(:disabled), .s-button-wrap .s-button-btn:not(:disabled) {
|
|
28
|
+
pointer-events: auto;
|
|
29
|
+
}
|
|
30
|
+
.s-button-wrap .s-button-loader-after .s-button-load {
|
|
31
|
+
flex-direction: row;
|
|
32
|
+
}
|
|
33
|
+
.s-button-wrap .s-button-loader-start .s-button-loader {
|
|
34
|
+
position: absolute;
|
|
35
|
+
right: 8px;
|
|
36
|
+
}
|
|
37
|
+
.s-button-wrap .s-button-loader-start .s-button-loader [dir=ltr] {
|
|
38
|
+
left: 8px;
|
|
39
|
+
right: auto;
|
|
40
|
+
}
|
|
41
|
+
.s-button-wrap .s-button-loader-end .s-button-loader {
|
|
42
|
+
position: absolute;
|
|
43
|
+
left: 8px;
|
|
44
|
+
}
|
|
45
|
+
.s-button-wrap .s-button-loader-end .s-button-loader [dir=ltr] {
|
|
46
|
+
right: 8px;
|
|
47
|
+
left: auto;
|
|
48
|
+
}
|
|
49
|
+
.s-button-wrap .s-button-loader-center .s-button-loader {
|
|
50
|
+
position: absolute;
|
|
51
|
+
top: 50%;
|
|
52
|
+
left: 50%;
|
|
53
|
+
transform: translateY(-50%) translateX(-50%);
|
|
54
|
+
margin: 0 !important;
|
|
55
|
+
}
|
|
56
|
+
.s-button-wrap .s-button-mini-icon .s-button-loader:before {
|
|
57
|
+
width: 0.85rem;
|
|
58
|
+
height: 0.85rem;
|
|
59
|
+
}
|
|
60
|
+
.s-button-wrap .s-button-danger .s-button-loader::before, .s-button-wrap .s-button-outline-danger .s-button-loader::before {
|
|
61
|
+
border-top-color: #f87171;
|
|
62
|
+
border-left-color: #f87171;
|
|
63
|
+
}
|
|
@@ -1,11 +1,18 @@
|
|
|
1
1
|
import { Component, Element, h, Method, Prop, Watch, Host } from '@stencil/core';
|
|
2
|
-
import Helper from "../../Helpers/Helper";
|
|
3
2
|
export class SallaButton {
|
|
4
3
|
constructor() {
|
|
5
4
|
/**
|
|
6
5
|
* Button Style
|
|
7
6
|
*/
|
|
8
7
|
this.btnStyle = 'primary';
|
|
8
|
+
/**
|
|
9
|
+
* Circle Button with icon
|
|
10
|
+
*/
|
|
11
|
+
this.icon = false;
|
|
12
|
+
/**
|
|
13
|
+
* Mini Circle Button with icon
|
|
14
|
+
*/
|
|
15
|
+
this.miniIcon = false;
|
|
9
16
|
/**
|
|
10
17
|
* Is the button currently loading
|
|
11
18
|
*/
|
|
@@ -27,14 +34,13 @@ export class SallaButton {
|
|
|
27
34
|
this.hostAttributes[this.host.attributes[i].name] = this.host.attributes[i].value;
|
|
28
35
|
}
|
|
29
36
|
this.hostAttributes.type = this.hostAttributes.type || 'button';
|
|
30
|
-
this.hostAttributes.class +=
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
37
|
+
this.hostAttributes.class +=
|
|
38
|
+
(this.icon ? ' s-button-icon s-button-loader-center' : ' s-button-btn ' + 's-button-loader-' + this.loaderPosition)
|
|
39
|
+
+ (this.wide ? ' s-button-wide ' : '')
|
|
40
|
+
+ (this.disabled ? ' s-button-disabled ' : ' s-button-' + this.btnStyle)
|
|
41
|
+
+ (this.miniIcon ? ' s-button-mini-icon ' : '');
|
|
35
42
|
delete this.hostAttributes['btn-style'];
|
|
36
43
|
delete this.hostAttributes['id'];
|
|
37
|
-
delete this.hostAttributes['data-on-click'];
|
|
38
44
|
if (this.wide) {
|
|
39
45
|
this.host.classList.add('s-button-wide');
|
|
40
46
|
}
|
|
@@ -82,24 +88,14 @@ export class SallaButton {
|
|
|
82
88
|
this.btn.classList.remove('btn-' + oldKind);
|
|
83
89
|
this.btn.classList.add('btn-' + newKind);
|
|
84
90
|
}
|
|
85
|
-
handleLoading(newVal) {
|
|
86
|
-
//todo::use united styles
|
|
87
|
-
Helper.toggleElement(this.btn, 'btn--is-loading', 'btn--no-loading', () => newVal);
|
|
88
|
-
}
|
|
89
91
|
render() {
|
|
90
92
|
return (
|
|
91
93
|
//TODO:: use HOST then fake button behaviours
|
|
92
94
|
h(Host, { class: "s-button-wrap" },
|
|
93
|
-
h("button", Object.assign({ ref: btn => this.btn = btn, disabled: this.disabled }
|
|
94
|
-
h("span", { class:
|
|
95
|
+
h("button", Object.assign({ ref: btn => this.btn = btn }, this.hostAttributes, { disabled: this.disabled }),
|
|
96
|
+
h("span", { class: "s-button-text", ref: el => this.text = el },
|
|
95
97
|
h("slot", null)),
|
|
96
|
-
this.loading ? h("span", { class:
|
|
97
|
-
//todo::use united styles
|
|
98
|
-
's-button-loader': true,
|
|
99
|
-
's-button-loader-start': this.loaderPosition === 'start',
|
|
100
|
-
's-button-loader-end': this.loaderPosition === 'end',
|
|
101
|
-
's-button-loader-center': this.loaderPosition === 'center',
|
|
102
|
-
} }) : '')));
|
|
98
|
+
this.loading ? h("span", { class: "s-button-loader" }) : '')));
|
|
103
99
|
}
|
|
104
100
|
static get is() { return "salla-button"; }
|
|
105
101
|
static get originalStyleUrls() { return {
|
|
@@ -113,8 +109,8 @@ export class SallaButton {
|
|
|
113
109
|
"type": "string",
|
|
114
110
|
"mutable": false,
|
|
115
111
|
"complexType": {
|
|
116
|
-
"original": "'primary' | 'outline' | 'outline-primary' | 'danger'",
|
|
117
|
-
"resolved": "\"danger\" | \"outline\" | \"outline-primary\" | \"primary\"",
|
|
112
|
+
"original": "'primary' | 'outline' | 'outline-primary' | 'danger' | 'link' | 'link-danger'",
|
|
113
|
+
"resolved": "\"danger\" | \"link\" | \"link-danger\" | \"outline\" | \"outline-primary\" | \"primary\"",
|
|
118
114
|
"references": {}
|
|
119
115
|
},
|
|
120
116
|
"required": false,
|
|
@@ -127,6 +123,42 @@ export class SallaButton {
|
|
|
127
123
|
"reflect": true,
|
|
128
124
|
"defaultValue": "'primary'"
|
|
129
125
|
},
|
|
126
|
+
"icon": {
|
|
127
|
+
"type": "boolean",
|
|
128
|
+
"mutable": false,
|
|
129
|
+
"complexType": {
|
|
130
|
+
"original": "boolean",
|
|
131
|
+
"resolved": "boolean",
|
|
132
|
+
"references": {}
|
|
133
|
+
},
|
|
134
|
+
"required": false,
|
|
135
|
+
"optional": false,
|
|
136
|
+
"docs": {
|
|
137
|
+
"tags": [],
|
|
138
|
+
"text": "Circle Button with icon"
|
|
139
|
+
},
|
|
140
|
+
"attribute": "icon",
|
|
141
|
+
"reflect": true,
|
|
142
|
+
"defaultValue": "false"
|
|
143
|
+
},
|
|
144
|
+
"miniIcon": {
|
|
145
|
+
"type": "boolean",
|
|
146
|
+
"mutable": false,
|
|
147
|
+
"complexType": {
|
|
148
|
+
"original": "boolean",
|
|
149
|
+
"resolved": "boolean",
|
|
150
|
+
"references": {}
|
|
151
|
+
},
|
|
152
|
+
"required": false,
|
|
153
|
+
"optional": false,
|
|
154
|
+
"docs": {
|
|
155
|
+
"tags": [],
|
|
156
|
+
"text": "Mini Circle Button with icon"
|
|
157
|
+
},
|
|
158
|
+
"attribute": "mini-icon",
|
|
159
|
+
"reflect": true,
|
|
160
|
+
"defaultValue": "false"
|
|
161
|
+
},
|
|
130
162
|
"loading": {
|
|
131
163
|
"type": "boolean",
|
|
132
164
|
"mutable": false,
|
|
@@ -304,8 +336,5 @@ export class SallaButton {
|
|
|
304
336
|
static get watchers() { return [{
|
|
305
337
|
"propName": "btnStyle",
|
|
306
338
|
"methodName": "handleVisible"
|
|
307
|
-
}, {
|
|
308
|
-
"propName": "loading",
|
|
309
|
-
"methodName": "handleLoading"
|
|
310
339
|
}]; }
|
|
311
340
|
}
|
|
@@ -10,4 +10,8 @@
|
|
|
10
10
|
/*
|
|
11
11
|
* Salla Localization Component: Languages & Currencies popup modal
|
|
12
12
|
* You can use these classes to target the elements in the component.
|
|
13
|
-
*/
|
|
13
|
+
*/
|
|
14
|
+
#salla-localization .s-localization-modal-select {
|
|
15
|
+
appearance: none;
|
|
16
|
+
-webkit-appearance: none;
|
|
17
|
+
}
|
|
@@ -75,7 +75,7 @@ export class SallaLoginModal {
|
|
|
75
75
|
};
|
|
76
76
|
this.newUser = async () => {
|
|
77
77
|
var _a;
|
|
78
|
-
const { mobile: regPhone, countryCode, countryKey } = await this.regTelInput.getValues(), emailValue = this.regEmail.value || ((_a = this.loginEmail) === null || _a === void 0 ? void 0 : _a.value);
|
|
78
|
+
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);
|
|
79
79
|
await this.newUserValidation();
|
|
80
80
|
await this.regBtn.load();
|
|
81
81
|
await this.regBtn.disable();
|
|
@@ -20,7 +20,7 @@ export class SallaOfferModal {
|
|
|
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🤔
|
|
23
|
-
if (salla.
|
|
23
|
+
if (salla.storage.get('remember-offer-' + data.offer.offer_id)) {
|
|
24
24
|
salla.log('User selected to don\'t show this offer again.');
|
|
25
25
|
return;
|
|
26
26
|
}
|
|
@@ -47,7 +47,7 @@ export class SallaOfferModal {
|
|
|
47
47
|
return this.modal.show();
|
|
48
48
|
}
|
|
49
49
|
rememberMe(event) {
|
|
50
|
-
salla.
|
|
50
|
+
salla.storage.set('remember-offer-' + this.offer.id, event.target.checked);
|
|
51
51
|
}
|
|
52
52
|
addItem() {
|
|
53
53
|
// this here, is sallaButton
|
|
@@ -26,7 +26,7 @@ export class SallaProductAvailability {
|
|
|
26
26
|
.then(() => salla.api.product.availabilitySubscribe(data))
|
|
27
27
|
.then(() => {
|
|
28
28
|
this.isSubscribed = true;
|
|
29
|
-
salla.
|
|
29
|
+
salla.storage.set(`product-${this.productId}-subscribed`, true);
|
|
30
30
|
}) //no need to wait until finishing alert animation
|
|
31
31
|
.then(() => this.btn.stop())
|
|
32
32
|
.then(() => this.modal.hide())
|
|
@@ -59,7 +59,7 @@ export class SallaProductAvailability {
|
|
|
59
59
|
this.channelsWatcher(this.channels);
|
|
60
60
|
this.title_ = this.host.title || salla.lang.get('pages.products.notify_availability_title');
|
|
61
61
|
this.host.removeAttribute('title');
|
|
62
|
-
this.isVisitorSubscribed = salla.
|
|
62
|
+
this.isVisitorSubscribed = salla.storage.get(`product-${this.productId}-subscribed`);
|
|
63
63
|
}
|
|
64
64
|
channelsWatcher(newValue) {
|
|
65
65
|
this.channels_ = newValue.split(',');
|
|
@@ -11,6 +11,15 @@
|
|
|
11
11
|
* Salla Search Component: Site search modal.
|
|
12
12
|
* You can use these classes to target the elements in the component.
|
|
13
13
|
*/
|
|
14
|
+
#s-search-modal .s-search-inline {
|
|
15
|
+
border: 1px solid #eee;
|
|
16
|
+
}
|
|
17
|
+
#s-search-modal .s-search-no-results .s-search-input, #s-search-modal .s-search-container-open .s-search-input {
|
|
18
|
+
border-bottom: 1px solid #f4f4f5;
|
|
19
|
+
}
|
|
20
|
+
#s-search-modal .s-search-product-image[src=null] {
|
|
21
|
+
opacity: 0;
|
|
22
|
+
}
|
|
14
23
|
/*
|
|
15
24
|
* Override general modal style with custom style for search modal
|
|
16
25
|
*/
|
|
@@ -26,6 +35,8 @@
|
|
|
26
35
|
max-width: 90%;
|
|
27
36
|
margin-top: 3.2rem;
|
|
28
37
|
border-radius: 0.5rem;
|
|
38
|
+
background: transparent;
|
|
39
|
+
overflow: visible;
|
|
29
40
|
}
|
|
30
41
|
#s-search-modal .s-modal-close {
|
|
31
42
|
top: 50%;
|