@salla.sa/twilight-components 1.5.12 → 1.5.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/salla-add-product-button.cjs.entry.js +7 -1
- package/dist/cjs/salla-button_24.cjs.entry.js +86 -134
- package/dist/cjs/salla-scopes.cjs.entry.js +12 -17
- package/dist/cjs/twilight-components.cjs.js +1 -1
- package/dist/collection/assets/svg/star3.svg +1 -1
- package/dist/collection/components/salla-add-product-button/salla-add-product-button.js +7 -1
- package/dist/collection/components/salla-localization-modal/salla-localization-modal.css +4 -0
- package/dist/collection/components/salla-localization-modal/salla-localization-modal.js +5 -8
- package/dist/collection/components/salla-login-modal/salla-login-modal.js +25 -41
- package/dist/collection/components/salla-loyalty/salla-loyalty.js +12 -31
- package/dist/collection/components/salla-offer-modal/salla-offer-modal.js +6 -15
- package/dist/collection/components/salla-placeholder/salla-placeholder.js +5 -6
- package/dist/collection/components/salla-product-availability/salla-product-availability.js +12 -26
- package/dist/collection/components/salla-rating-modal/salla-rating-modal.js +13 -28
- package/dist/collection/components/salla-scopes/salla-scopes.js +14 -25
- package/dist/collection/components/salla-search/salla-search.js +18 -7
- package/dist/collection/components/salla-social-share/salla-social-share.js +12 -14
- package/dist/collection/components/salla-tabs/salla-tab-content.js +4 -4
- package/dist/collection/components/salla-tabs/salla-tab-header.js +3 -3
- package/dist/collection/components/salla-tabs/salla-tabs.js +3 -3
- package/dist/collection/components/salla-verify/salla-verify.js +4 -3
- package/dist/collection/global/app.js +2 -2
- package/dist/components/salla-add-product-button.js +7 -1
- package/dist/components/salla-localization-modal.js +6 -9
- package/dist/components/salla-login-modal.js +20 -36
- package/dist/components/salla-loyalty.js +9 -28
- package/dist/components/salla-offer-modal.js +6 -15
- package/dist/components/salla-placeholder2.js +4 -5
- package/dist/components/salla-product-availability2.js +12 -26
- package/dist/components/salla-rating-modal.js +7 -22
- package/dist/components/salla-scopes.js +13 -24
- package/dist/components/salla-search.js +11 -7
- package/dist/components/salla-social-share.js +12 -14
- package/dist/components/salla-tab-content2.js +2 -2
- package/dist/components/salla-tab-header2.js +1 -1
- package/dist/components/salla-tabs2.js +3 -3
- package/dist/components/salla-verify2.js +4 -3
- package/dist/esm/loader.js +1 -1
- package/dist/esm/salla-add-product-button.entry.js +7 -1
- package/dist/esm/salla-button_24.entry.js +86 -134
- package/dist/esm/salla-scopes.entry.js +12 -17
- package/dist/esm/twilight-components.js +1 -1
- package/dist/twilight-components/p-30b2c5b0.entry.js +4 -0
- package/dist/twilight-components/p-5fb32395.entry.js +4 -0
- package/dist/twilight-components/{p-b9fe5498.entry.js → p-76cb2574.entry.js} +1 -1
- package/dist/twilight-components/twilight-components.esm.js +1 -1
- package/dist/types/components/salla-localization-modal/salla-localization-modal.d.ts +1 -2
- package/dist/types/components/salla-login-modal/salla-login-modal.d.ts +2 -10
- package/dist/types/components/salla-loyalty/salla-loyalty.d.ts +1 -9
- package/dist/types/components/salla-offer-modal/salla-offer-modal.d.ts +1 -4
- package/dist/types/components/salla-placeholder/salla-placeholder.d.ts +1 -2
- package/dist/types/components/salla-product-availability/salla-product-availability.d.ts +1 -8
- package/dist/types/components/salla-rating-modal/salla-rating-modal.d.ts +1 -9
- package/dist/types/components/salla-scopes/salla-scopes.d.ts +1 -7
- package/dist/types/components/salla-search/salla-search.d.ts +2 -2
- package/dist/types/components/salla-tabs/interfaces.d.ts +1 -1
- package/dist/types/components/salla-tabs/salla-tab-content.d.ts +2 -2
- package/dist/types/components/salla-tabs/salla-tab-header.d.ts +1 -1
- package/dist/types/components/salla-verify/salla-verify.d.ts +1 -0
- package/dist/types/components.d.ts +2 -2
- package/package.json +6 -6
- package/dist/twilight-components/p-88f8666d.entry.js +0 -4
- package/dist/twilight-components/p-952f6c78.entry.js +0 -4
|
@@ -26,6 +26,7 @@ const sallaScopesCss = ".s-scopes-availability-content{display:flex;justify-cont
|
|
|
26
26
|
const SallaScopees = class {
|
|
27
27
|
constructor(hostRef) {
|
|
28
28
|
index.registerInstance(this, hostRef);
|
|
29
|
+
this.translationLoaded = false;
|
|
29
30
|
this.mode = ModeType.DEFAULT;
|
|
30
31
|
this.scopes = [];
|
|
31
32
|
this.originalScopesList = [];
|
|
@@ -43,20 +44,14 @@ const SallaScopees = class {
|
|
|
43
44
|
if (((_a = this.originalScopesList) === null || _a === void 0 ? void 0 : _a.length) < 2)
|
|
44
45
|
return "";
|
|
45
46
|
return this.mode === ModeType.DEFAULT ?
|
|
46
|
-
|
|
47
|
-
|
|
47
|
+
salla.lang.get("blocks.scope.shopping_from_another_branch") :
|
|
48
|
+
salla.lang.get('blocks.scope.search_for_availability_in_other_branches');
|
|
48
49
|
};
|
|
49
50
|
salla.event.on('scopes::open', ({ mode = null, product_id = null }) => {
|
|
50
51
|
this.open(mode, product_id);
|
|
51
52
|
});
|
|
52
53
|
salla.lang.onLoaded(() => {
|
|
53
|
-
this.
|
|
54
|
-
this.ourServiceIsNotFound = salla.lang.get("blocks.scope.our_services_not_available_in_this_branch");
|
|
55
|
-
this.searchForAvailabilityInOtherBranch = salla.lang.get('blocks.scope.search_for_availability_in_other_branches');
|
|
56
|
-
this.shoppingFromAnotherBranch = salla.lang.get("blocks.scope.shopping_from_another_branch");
|
|
57
|
-
this.nowBrowsingFrom = salla.lang.get('blocks.scope.you_are_browse_store_from');
|
|
58
|
-
this.confirmButton = salla.lang.get('common.elements.confirm');
|
|
59
|
-
this.scopeSearchPlaceholder = salla.lang.get('blocks.scope.searching_for_a_branch');
|
|
54
|
+
this.translationLoaded = true;
|
|
60
55
|
});
|
|
61
56
|
}
|
|
62
57
|
/**
|
|
@@ -105,10 +100,10 @@ const SallaScopees = class {
|
|
|
105
100
|
'type': this.current_scope.type,
|
|
106
101
|
'id': this.current_scope.id
|
|
107
102
|
});
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
window.location.
|
|
103
|
+
var url = new URL(window.location.href);
|
|
104
|
+
url.searchParams.set('scope', this.current_scope.id);
|
|
105
|
+
window.location.href = url.toString();
|
|
106
|
+
window.location.replace(url.toString());
|
|
112
107
|
}).catch(e => console.log(e))
|
|
113
108
|
.finally(() => {
|
|
114
109
|
this.changeBtn.stop();
|
|
@@ -139,7 +134,7 @@ const SallaScopees = class {
|
|
|
139
134
|
this.current_scope = this.scopes.find(scope => scope.id == event.target.value);
|
|
140
135
|
}
|
|
141
136
|
placeholderContent() {
|
|
142
|
-
return index.h("salla-placeholder", { alignment: "center", class: "s-scopes-placeholder" }, index.h("span", { slot: "title" },
|
|
137
|
+
return index.h("salla-placeholder", { alignment: "center", class: "s-scopes-placeholder" }, index.h("span", { slot: "title" }, salla.lang.get("blocks.scope.branch_looking_for_not_found")), index.h("span", { slot: "description" }, salla.lang.get("blocks.scope.our_services_not_available_in_this_branch")));
|
|
143
138
|
}
|
|
144
139
|
defaultContent() {
|
|
145
140
|
return [index.h("div", { class: "s-scopes-container s-scrollbar" }, this.scopes.map((scope) => index.h("div", { class: "s-scopes-input-wrap", "data-selection": this.selection }, index.h("input", { id: `${this.selection} + '_scope_' + ${scope.id}`, name: "lang", type: "radio", value: scope.id, onChange: (event) => this.handleScopeSelection(event), class: "s-scopes-input", checked: !!this.current_scope && this.current_scope.id == scope.id }), index.h("label", { htmlFor: `${this.selection} + '_scope_' + ${scope.id}`, class: "s-scopes-label s-scopes-clickable" }, index.h("span", null, scope.name))))), this.footerContent()];
|
|
@@ -151,11 +146,11 @@ const SallaScopees = class {
|
|
|
151
146
|
}));
|
|
152
147
|
}
|
|
153
148
|
footerContent() {
|
|
154
|
-
return index.h("div", { class: "s-scopes-footer" }, index.h("slot", { name: "footer" }, index.h("salla-button", { ref: btn => this.changeBtn = btn, disabled: !this.current_scope, onClick: () => this.handleSubmit(), class: "s-scopes-submit", "loader-position": "center", width: "wide" },
|
|
149
|
+
return index.h("div", { class: "s-scopes-footer" }, index.h("slot", { name: "footer" }, index.h("salla-button", { ref: btn => this.changeBtn = btn, disabled: !this.current_scope, onClick: () => this.handleSubmit(), class: "s-scopes-submit", "loader-position": "center", width: "wide" }, salla.lang.get('common.elements.confirm'))));
|
|
155
150
|
}
|
|
156
151
|
render() {
|
|
157
|
-
return (index.h(index.Host, null, index.h("salla-modal", { ref: modal => this.modal = modal, isClosable: !!(this.isOpenedBefore || (this.selection == 'optional')), class: "s-scopes-modal", isLoading: true, "has-skeleton": true }, index.h("div", { slot: "loading" }, index.h("div", { class: "s-scopes-skeleton" }, index.h("salla-list-tile", { class: "s-scopes-header" }, index.h("div", { slot: "icon", class: "s-scopes-header-icon" }, index.h("salla-skeleton", { type: "circle" })), index.h("div", { slot: "title", class: "s-scopes-header-title mb-5" }, index.h("salla-skeleton", { height: '15px', width: '50%' })), index.h("div", { slot: "subtitle", class: "s-scopes-header-subtitle" }, index.h("salla-skeleton", { height: '10px' }), index.h("salla-skeleton", { height: '10px', width: '75%' }))), index.h("div", { class: "s-scopes-skeleton-search" }, index.h("salla-skeleton", { height: '10px', width: '50%' }), index.h("salla-skeleton", { height: '30px', width: '100%' })), index.h("div", { class: "s-scopes-skeleton-scopes" }, index.h("salla-skeleton", { height: '10px', width: '30%' }), index.h("salla-skeleton", { height: '10px', width: '25%' }), index.h("salla-skeleton", { height: '10px', width: '30%' }), index.h("salla-skeleton", { height: '10px', width: '25%' }), index.h("salla-skeleton", { height: '10px', width: '30%' }), index.h("salla-skeleton", { height: '10px', width: '25%' }), index.h("salla-skeleton", { height: '10px', width: '30%' }), index.h("salla-skeleton", { height: '10px', width: '25%' })), index.h("div", { class: "s-scopes-skeleton-btn" }, index.h("salla-skeleton", { height: '40px', width: '100%' })))), index.h("salla-list-tile", { class: this.originalScopesList.length ? "s-scopes-header block" : "s-hidden" }, index.h("div", { slot: "icon", class: "s-scopes-header-icon", innerHTML: StoreAlt }), index.h("div", { slot: "title", class: "s-scopes-header-title" },
|
|
158
|
-
index.h("div", { class: "s-scopes-search-wrapper" }, index.h("div", { class: "s-scopes-search-icon", innerHTML: search.Search }), index.h("input", { type: "text", class: "s-scopes-search-input", onInput: e => this.handleSearchFieldTyping(e), placeholder:
|
|
152
|
+
return (index.h(index.Host, null, index.h("salla-modal", { ref: modal => this.modal = modal, isClosable: !!(this.isOpenedBefore || (this.selection == 'optional')), class: "s-scopes-modal", isLoading: true, "has-skeleton": true }, index.h("div", { slot: "loading" }, index.h("div", { class: "s-scopes-skeleton" }, index.h("salla-list-tile", { class: "s-scopes-header" }, index.h("div", { slot: "icon", class: "s-scopes-header-icon" }, index.h("salla-skeleton", { type: "circle" })), index.h("div", { slot: "title", class: "s-scopes-header-title mb-5" }, index.h("salla-skeleton", { height: '15px', width: '50%' })), index.h("div", { slot: "subtitle", class: "s-scopes-header-subtitle" }, index.h("salla-skeleton", { height: '10px' }), index.h("salla-skeleton", { height: '10px', width: '75%' }))), index.h("div", { class: "s-scopes-skeleton-search" }, index.h("salla-skeleton", { height: '10px', width: '50%' }), index.h("salla-skeleton", { height: '30px', width: '100%' })), index.h("div", { class: "s-scopes-skeleton-scopes" }, index.h("salla-skeleton", { height: '10px', width: '30%' }), index.h("salla-skeleton", { height: '10px', width: '25%' }), index.h("salla-skeleton", { height: '10px', width: '30%' }), index.h("salla-skeleton", { height: '10px', width: '25%' }), index.h("salla-skeleton", { height: '10px', width: '30%' }), index.h("salla-skeleton", { height: '10px', width: '25%' }), index.h("salla-skeleton", { height: '10px', width: '30%' }), index.h("salla-skeleton", { height: '10px', width: '25%' })), index.h("div", { class: "s-scopes-skeleton-btn" }, index.h("salla-skeleton", { height: '40px', width: '100%' })))), index.h("salla-list-tile", { class: this.originalScopesList.length ? "s-scopes-header block" : "s-hidden" }, index.h("div", { slot: "icon", class: "s-scopes-header-icon", innerHTML: StoreAlt }), index.h("div", { slot: "title", class: "s-scopes-header-title" }, salla.lang.get('blocks.scope.you_are_browse_store_from')), index.h("div", { slot: "subtitle", class: "s-scopes-header-subtitle" }, !!this.selected_scope ? this.selected_scope.name : "")), index.h("div", { class: "s-scopes-wrap" }, !!this.originalScopesList.length && index.h("h4", { class: "s-scopes-title" }, this.getFormTitle()), this.originalScopesList.length > this.searchDisplayLimit ?
|
|
153
|
+
index.h("div", { class: "s-scopes-search-wrapper" }, index.h("div", { class: "s-scopes-search-icon", innerHTML: search.Search }), index.h("input", { type: "text", class: "s-scopes-search-input", onInput: e => this.handleSearchFieldTyping(e), placeholder: salla.lang.get('blocks.scope.searching_for_a_branch') }))
|
|
159
154
|
: "", this.scopes.length < 2 ?
|
|
160
155
|
this.placeholderContent()
|
|
161
156
|
: this.mode === ModeType.DEFAULT ? this.defaultContent() : this.availabilityContent()))));
|
|
@@ -18,5 +18,5 @@ const patchBrowser = () => {
|
|
|
18
18
|
};
|
|
19
19
|
|
|
20
20
|
patchBrowser().then(options => {
|
|
21
|
-
return index.bootstrapLazy([["salla-button_24.cjs",[[4,"salla-loyalty",{"prizePoints":[8,"prize-points"],"customerPoints":[2,"customer-points"],"prizeTitle":[1,"prize-title"],"allowEmail":[4,"allow-email"],"allowMobile":[4,"allow-mobile"],"requireEmail":[4,"require-email"],"guestMessage":[1,"guest-message"],"loyaltyProgram":[32],"buttonLoading":[32],"selectedItem":[32],"askConfirmation":[32],"is_loggedin":[32],"
|
|
21
|
+
return index.bootstrapLazy([["salla-button_24.cjs",[[4,"salla-loyalty",{"prizePoints":[8,"prize-points"],"customerPoints":[2,"customer-points"],"prizeTitle":[1,"prize-title"],"allowEmail":[4,"allow-email"],"allowMobile":[4,"allow-mobile"],"requireEmail":[4,"require-email"],"guestMessage":[1,"guest-message"],"loyaltyProgram":[32],"buttonLoading":[32],"selectedItem":[32],"askConfirmation":[32],"is_loggedin":[32],"translationLoaded":[32],"open":[64],"close":[64],"resetExchange":[64],"exchangeLoyaltyPoint":[64]}],[4,"salla-product-size-guide",{"guides":[32],"productId":[32],"open":[64],"close":[64]}],[4,"salla-login-modal",{"isEmailAllowed":[1028,"is-email-allowed"],"isMobileAllowed":[1028,"is-mobile-allowed"],"isEmailRequired":[1028,"is-email-required"],"translationLoaded":[32],"title":[32],"emailErrorMsg":[32],"firstNameErrorMsg":[32],"lastNameErrorMsg":[32],"open":[64]},[[8,"verified","onVerified"]]],[0,"salla-localization-modal",{"language":[1537],"currency":[1537],"translationLoaded":[32],"languages":[32],"currencies":[32],"isLoading":[32],"open":[64],"close":[64],"submit":[64]}],[0,"salla-rating-modal",{"orderId":[2,"order-id"],"order":[32],"translationLoaded":[32],"open":[64],"close":[64]}],[0,"salla-offer-modal",{"offer":[32],"offer_name":[32],"offer_message":[32],"translationLoaded":[32],"open":[64],"showOffer":[64]}],[0,"salla-search",{"inline":[4],"oval":[4],"height":[2],"translationLoaded":[32],"results":[32],"loading":[32],"typing":[32],"debounce":[32],"search_term":[32]},[[0,"keydown","handleKeyDown"]]],[4,"salla-social-share",{"url":[513],"urlName":[513,"url-name"],"platforms":[16],"opened":[32],"allPlatforms":[32],"platformIcons":[32],"open":[64]}],[4,"salla-infinite-scroll",{"nextPage":[1,"next-page"],"autoload":[1028],"container":[1],"item":[1],"loadMore":[32],"noMore":[32],"failedToLoad":[32]}],[4,"salla-quantity-input",{"quantity":[32],"decrease":[64],"increase":[64],"setValue":[64]}],[0,"salla-product-availability",{"channels":[1],"productId":[2,"product-id"],"isSubscribed":[1028,"is-subscribed"],"translationLoaded":[32],"title_":[32],"isVisitorSubscribed":[32]}],[4,"salla-verify",{"display":[1],"type":[1025],"autoReload":[4,"auto-reload"],"translationLoaded":[32],"title":[32],"resendAfter":[32],"isProfileVerify":[32],"getCode":[64],"open":[64]}],[4,"salla-swiper",{"loop":[4],"speed":[2],"itemPerView":[8,"item-per-view"],"spaceBetweenItems":[2,"space-between-items"],"currentIndex":[32],"isLastSlideItem":[32],"isFirstSlideItem":[32]}],[0,"salla-rating-stars",{"name":[1],"size":[1],"value":[2]}],[4,"salla-list-tile",{"href":[1],"target":[1]}],[4,"salla-tab-content",{"name":[1],"isSelected":[32],"getChild":[64]}],[4,"salla-tab-header",{"name":[1],"activeClass":[1,"active-class"],"height":[8],"centered":[4],"isSelected":[32],"getChild":[64]}],[4,"salla-tabs",{"backgroundColor":[1,"background-color"],"vertical":[4]},[[0,"tabSelected","onSelectedTab"]]],[4,"salla-placeholder",{"icon":[1],"alignment":[1],"iconSize":[1,"icon-size"],"translationLoaded":[32]}],[0,"salla-tel-input",{"phone":[1025],"name":[1],"countryCode":[1025,"country-code"],"mobileRequired":[32],"countryCodeLabel":[32],"mobileLabel":[32],"tooShort":[32],"tooLong":[32],"invalidCountryCode":[32],"invalidNumber":[32],"errorMap":[32],"getValues":[64],"isValid":[64]}],[0,"salla-skeleton",{"type":[1],"width":[1],"height":[1]}],[4,"salla-modal",{"isClosable":[1028,"is-closable"],"width":[513],"position":[513],"visible":[516],"hasSkeleton":[516,"has-skeleton"],"isLoading":[1540,"is-loading"],"subTitleFirst":[4,"sub-title-first"],"noPadding":[4,"no-padding"],"subTitle":[1,"sub-title"],"centered":[4],"iconStyle":[1,"icon-style"],"modalTitle":[32],"open":[64],"close":[64],"setTitle":[64],"loading":[64],"stopLoading":[64]}],[4,"salla-button",{"shape":[513],"color":[513],"fill":[513],"size":[513],"width":[513],"loading":[516],"disabled":[516],"loaderPosition":[1,"loader-position"],"href":[1],"load":[64],"stop":[64],"setText":[64],"disable":[64],"enable":[64]}],[0,"salla-loading",{"size":[8],"width":[8],"color":[1],"bgColor":[1,"bg-color"]}]]],["salla-scopes.cjs",[[4,"salla-scopes",{"selection":[1],"searchDisplayLimit":[2,"search-display-limit"],"translationLoaded":[32],"mode":[32],"current_scope":[32],"scopes":[32],"originalScopesList":[32],"selected_scope":[32],"isOpenedBefore":[32],"close":[64],"open":[64],"handleSubmit":[64]}]]],["salla-add-product-button.cjs",[[4,"salla-add-product-button",{"channels":[513],"quantity":[514],"donatingAmount":[514,"donating-amount"],"productId":[520,"product-id"],"productStatus":[513,"product-status"],"productType":[513,"product-type"]}]]],["salla-conditional-fields.cjs",[[4,"salla-conditional-fields",null,[[0,"change","changeHandler"]]]]],["salla-installment.cjs",[[0,"salla-installment",{"price":[1],"language":[1],"currency":[1],"tamaraIsActive":[32],"tabbyIsActive":[32],"spotiiIsActive":[32]}]]]], options);
|
|
22
22
|
});
|
|
@@ -81,7 +81,13 @@ export class SallaAddProductButton {
|
|
|
81
81
|
}
|
|
82
82
|
componentDidRender() {
|
|
83
83
|
//if label not passed, get label
|
|
84
|
-
|
|
84
|
+
if (this.hasLabel) {
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
this.btn.setText(this.getLabel() || 'اضافة للسلة');
|
|
88
|
+
salla.lang.onLoaded(() => {
|
|
89
|
+
this.btn.setText(this.getLabel() || 'اضافة للسلة');
|
|
90
|
+
});
|
|
85
91
|
}
|
|
86
92
|
static get is() { return "salla-add-product-button"; }
|
|
87
93
|
static get originalStyleUrls() { return {
|
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
* Salla Localization Component: Languages & Currencies popup modal
|
|
3
3
|
* You can use these classes to target the elements in the component.
|
|
4
4
|
*/
|
|
5
|
+
.s-localization-modal-select {
|
|
6
|
+
background-image: url("data:image/svg+xml;utf8,<svg fill='gray' height='24' viewBox='0 0 24 24' width='24' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/><path d='M0 0h24v24H0z' fill='none'/></svg>");
|
|
7
|
+
}
|
|
8
|
+
|
|
5
9
|
.iti__flag {
|
|
6
10
|
width: 20px;
|
|
7
11
|
}
|
|
@@ -12,6 +12,7 @@ import Helper from "../../Helpers/Helper";
|
|
|
12
12
|
export class SallaLocalizationModal {
|
|
13
13
|
constructor() {
|
|
14
14
|
var _a, _b;
|
|
15
|
+
this.translationLoaded = false;
|
|
15
16
|
this.languages = [];
|
|
16
17
|
this.currencies = [];
|
|
17
18
|
this.isLoading = true;
|
|
@@ -26,10 +27,7 @@ export class SallaLocalizationModal {
|
|
|
26
27
|
Helper.setHost(this.host);
|
|
27
28
|
salla.event.on('localization::open', () => this.open());
|
|
28
29
|
salla.lang.onLoaded(() => {
|
|
29
|
-
|
|
30
|
-
this.languagesTitle = salla.lang.get('common.titles.language');
|
|
31
|
-
this.currenciesTitle = salla.lang.get('common.titles.currency');
|
|
32
|
-
(_a = this.btn) === null || _a === void 0 ? void 0 : _a.setText(salla.lang.get('common.elements.ok'));
|
|
30
|
+
this.translationLoaded = true;
|
|
33
31
|
});
|
|
34
32
|
/**
|
|
35
33
|
* letting developer to insert his own slot like:
|
|
@@ -115,7 +113,7 @@ export class SallaLocalizationModal {
|
|
|
115
113
|
h("div", { class: "s-localization-modal-inner" },
|
|
116
114
|
this.languages.length > 1 ?
|
|
117
115
|
h("div", { class: "s-localization-modal-section" },
|
|
118
|
-
h("label", { class: "s-localization-modal-title" },
|
|
116
|
+
h("label", { class: "s-localization-modal-title" }, salla.lang.get('common.titles.language')),
|
|
119
117
|
h("div", { class: "s-localization-modal-section-inner" }, this.languages.length < 6 ?
|
|
120
118
|
this.languages.map(lang => h("div", { class: "s-localization-modal-item" },
|
|
121
119
|
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 }),
|
|
@@ -127,7 +125,7 @@ export class SallaLocalizationModal {
|
|
|
127
125
|
: '',
|
|
128
126
|
this.currencies.length > 1 ?
|
|
129
127
|
h("div", { class: "s-localization-modal-section" },
|
|
130
|
-
h("label", { class: "s-localization-modal-title" },
|
|
128
|
+
h("label", { class: "s-localization-modal-title" }, salla.lang.get('common.titles.currency')),
|
|
131
129
|
h("div", { class: "s-localization-modal-section-inner" }, this.currencies.length < 6 ?
|
|
132
130
|
this.currencies.map(currency => h("div", { class: "s-localization-modal-item" },
|
|
133
131
|
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 }),
|
|
@@ -193,10 +191,9 @@ export class SallaLocalizationModal {
|
|
|
193
191
|
}
|
|
194
192
|
}; }
|
|
195
193
|
static get states() { return {
|
|
194
|
+
"translationLoaded": {},
|
|
196
195
|
"languages": {},
|
|
197
196
|
"currencies": {},
|
|
198
|
-
"languagesTitle": {},
|
|
199
|
-
"currenciesTitle": {},
|
|
200
197
|
"isLoading": {}
|
|
201
198
|
}; }
|
|
202
199
|
static get methods() { return {
|
|
@@ -34,6 +34,7 @@ export class SallaLoginModal {
|
|
|
34
34
|
*/
|
|
35
35
|
this.isEmailRequired = false;
|
|
36
36
|
this.regType = 'phone';
|
|
37
|
+
this.translationLoaded = false;
|
|
37
38
|
this.typing = (e, submitMethod) => {
|
|
38
39
|
const error = e.target.nextElementSibling;
|
|
39
40
|
e.target.classList.remove('s-has-error');
|
|
@@ -79,28 +80,13 @@ export class SallaLoginModal {
|
|
|
79
80
|
};
|
|
80
81
|
this.title = this.host.title || salla.lang.get('blocks.header.login');
|
|
81
82
|
this.host.removeAttribute('title');
|
|
83
|
+
this.emailErrorMsg = salla.lang.get('common.elements.email_is_valid');
|
|
84
|
+
this.firstNameErrorMsg = salla.lang.get('common.errors.field_required', { attribute: salla.lang.get('pages.profile.first_name') });
|
|
85
|
+
this.lastNameErrorMsg = salla.lang.get('common.errors.field_required', { attribute: salla.lang.get('pages.profile.last_name') });
|
|
82
86
|
salla.lang.onLoaded(() => {
|
|
83
|
-
|
|
87
|
+
this.translationLoaded = true;
|
|
84
88
|
this.title = salla.lang.get('blocks.header.login');
|
|
85
|
-
this.
|
|
86
|
-
this.loginText = salla.lang.get('blocks.header.login');
|
|
87
|
-
this.smsLabel = salla.lang.get('blocks.header.sms');
|
|
88
|
-
this.mobileLabel = salla.lang.get('common.elements.mobile');
|
|
89
|
-
this.emailLabel = salla.lang.get('common.elements.email');
|
|
90
|
-
this.bySMSText = salla.lang.get('blocks.header.login_by_sms');
|
|
91
|
-
this.byEmailText = salla.lang.get('blocks.header.login_by_email');
|
|
92
|
-
this.emailErrorMsg = salla.lang.get('common.elements.email_is_valid');
|
|
93
|
-
this.firstNameLabel = salla.lang.get('blocks.header.your_name');
|
|
94
|
-
this.lastNameLabel = salla.lang.get('pages.profile.last_name');
|
|
95
|
-
this.firstNameErrorMsg = salla.lang.get('common.errors.field_required', { attribute: this.firstNameLabel });
|
|
96
|
-
this.lastNameErrorMsg = salla.lang.get('common.errors.field_required', { attribute: this.lastNameLabel });
|
|
97
|
-
(_a = this.modal) === null || _a === void 0 ? void 0 : _a.setTitle(this.title);
|
|
98
|
-
(_b = this.smsBtn) === null || _b === void 0 ? void 0 : _b.setText(salla.lang.get('blocks.header.enter'));
|
|
99
|
-
(_c = this.emailBtn) === null || _c === void 0 ? void 0 : _c.setText(salla.lang.get('blocks.header.enter'));
|
|
100
|
-
(_d = this.regBtn) === null || _d === void 0 ? void 0 : _d.setText(salla.lang.get('blocks.header.register'));
|
|
101
|
-
});
|
|
102
|
-
salla.auth.event.onVerificationFailed(() => {
|
|
103
|
-
//
|
|
89
|
+
this.updateTranslations();
|
|
104
90
|
});
|
|
105
91
|
salla.event.on('login::open', (event) => this.open(event));
|
|
106
92
|
salla.event.on('twilight::initiated', () => {
|
|
@@ -133,6 +119,13 @@ export class SallaLoginModal {
|
|
|
133
119
|
}
|
|
134
120
|
window.location.reload();
|
|
135
121
|
}
|
|
122
|
+
updateTranslations() {
|
|
123
|
+
var _a;
|
|
124
|
+
this.emailErrorMsg = salla.lang.get('common.elements.email_is_valid');
|
|
125
|
+
this.firstNameErrorMsg = salla.lang.get('common.errors.field_required', { attribute: salla.lang.get('pages.profile.first_name') });
|
|
126
|
+
this.lastNameErrorMsg = salla.lang.get('common.errors.field_required', { attribute: salla.lang.get('pages.profile.last_name') });
|
|
127
|
+
(_a = this.modal) === null || _a === void 0 ? void 0 : _a.setTitle(this.title);
|
|
128
|
+
}
|
|
136
129
|
/**
|
|
137
130
|
* Open login component
|
|
138
131
|
*/
|
|
@@ -206,36 +199,36 @@ export class SallaLoginModal {
|
|
|
206
199
|
h("div", { class: "s-login-modal-wrapper" },
|
|
207
200
|
this.isEmailAllowed && this.isMobileAllowed ?
|
|
208
201
|
h("div", { class: "s-login-modal-tab", ref: tab => this.homeTab = tab },
|
|
209
|
-
h("p", { class: "s-login-modal-sub-title" },
|
|
202
|
+
h("p", { class: "s-login-modal-sub-title" }, salla.lang.get('blocks.header.select_login_way')),
|
|
210
203
|
h("slot", { name: "before-login-type" }),
|
|
211
204
|
h("a", { href: "#", class: "s-login-modal-main-btn", onClick: (evt) => this.showTab(this.mobileTab, evt) },
|
|
212
205
|
h("span", { class: "s-login-modal-main-btn-icon", innerHTML: PhoneIcon }),
|
|
213
|
-
h("span", { class: "s-login-modal-main-btn-text" },
|
|
206
|
+
h("span", { class: "s-login-modal-main-btn-text" }, salla.lang.get('blocks.header.sms')),
|
|
214
207
|
h("span", { class: "s-login-modal-main-btn-arrow", innerHTML: KeyboardArrowRightIcon })),
|
|
215
208
|
h("a", { href: "#", class: "s-login-modal-main-btn", onClick: (evt) => this.showTab(this.emailTab, evt) },
|
|
216
209
|
h("span", { class: "s-login-modal-main-btn-icon", innerHTML: EmailIcon }),
|
|
217
|
-
h("span", { class: "s-login-modal-main-btn-text" },
|
|
210
|
+
h("span", { class: "s-login-modal-main-btn-text" }, salla.lang.get('common.elements.email')),
|
|
218
211
|
h("span", { class: "s-login-modal-main-btn-arrow", innerHTML: KeyboardArrowRightIcon })),
|
|
219
212
|
h("slot", { name: "after-login-type" }))
|
|
220
213
|
: '',
|
|
221
214
|
this.isMobileAllowed ?
|
|
222
215
|
h("div", { class: "s-login-modal-tab", ref: tab => this.mobileTab = tab },
|
|
223
216
|
h("slot", { name: "before-login-mobile" }),
|
|
224
|
-
h("label", { class: "s-login-modal-label" },
|
|
217
|
+
h("label", { class: "s-login-modal-label" }, salla.lang.get('common.elements.mobile')),
|
|
225
218
|
h("salla-tel-input", { ref: el => this.loginTelInput = el, onKeyDown: e => this.typing(e, this.loginBySMS) }),
|
|
226
219
|
h("salla-button", { "loader-position": 'center', width: "wide", onClick: () => this.loginBySMS(), ref: b => this.smsBtn = b }, salla.lang.get('blocks.header.enter')),
|
|
227
220
|
this.isEmailAllowed ?
|
|
228
|
-
h("a", { href: "#", onClick: () => this.showTab(this.emailTab), class: "s-login-modal-link" },
|
|
221
|
+
h("a", { href: "#", onClick: () => this.showTab(this.emailTab), class: "s-login-modal-link" }, salla.lang.get('blocks.header.login_by_email')) : '',
|
|
229
222
|
h("slot", { name: "after-login-mobile" })) : '',
|
|
230
223
|
this.isEmailAllowed ?
|
|
231
224
|
h("div", { class: "s-login-modal-tab", ref: tab => this.emailTab = tab },
|
|
232
225
|
h("slot", { name: "before-login-email" }),
|
|
233
|
-
h("label", { class: "s-login-modal-label" },
|
|
226
|
+
h("label", { class: "s-login-modal-label" }, salla.lang.get('common.elements.email')),
|
|
234
227
|
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" }),
|
|
235
228
|
h("span", { class: "s-login-modal-error-message" }),
|
|
236
229
|
h("salla-button", { "loader-position": 'center', width: "wide", onClick: () => this.loginByEmail(), ref: b => this.emailBtn = b }, salla.lang.get('blocks.header.enter')),
|
|
237
230
|
this.isMobileAllowed ?
|
|
238
|
-
h("a", { href: "#", onClick: () => this.showTab(this.mobileTab), class: "s-login-modal-link" },
|
|
231
|
+
h("a", { href: "#", onClick: () => this.showTab(this.mobileTab), class: "s-login-modal-link" }, salla.lang.get('blocks.header.login_by_sms'))
|
|
239
232
|
: '',
|
|
240
233
|
h("slot", { name: "after-login-email" })) : '',
|
|
241
234
|
h("salla-verify", { display: "inline", ref: tab => this.verifyTab = tab, autoReload: false },
|
|
@@ -243,18 +236,18 @@ export class SallaLoginModal {
|
|
|
243
236
|
h("div", { ref: tab => this.registrationTab = tab },
|
|
244
237
|
h("slot", { name: "before-registration" }),
|
|
245
238
|
h("div", null,
|
|
246
|
-
h("label", { class: "s-login-modal-label" },
|
|
239
|
+
h("label", { class: "s-login-modal-label" }, salla.lang.get('blocks.header.your_name')),
|
|
247
240
|
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') }),
|
|
248
241
|
h("span", { class: "s-login-modal-error-message" })),
|
|
249
242
|
h("div", null,
|
|
250
|
-
h("label", { class: "s-login-modal-label" },
|
|
243
|
+
h("label", { class: "s-login-modal-label" }, salla.lang.get('pages.profile.last_name')),
|
|
251
244
|
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') }),
|
|
252
245
|
h("span", { class: "s-login-modal-error-message" })),
|
|
253
246
|
h("div", { ref: el => this.regMobileBlock = el, class: "mb-1.5" },
|
|
254
|
-
h("label", { class: "s-login-modal-label" },
|
|
247
|
+
h("label", { class: "s-login-modal-label" }, salla.lang.get('common.elements.mobile')),
|
|
255
248
|
h("salla-tel-input", { ref: el => this.regTelInput = el, onKeyDown: e => this.typing(e, this.newUser) })),
|
|
256
249
|
h("div", { ref: el => this.regEmailBlock = el, class: "mb-1.5" },
|
|
257
|
-
h("label", { class: "s-login-modal-label" },
|
|
250
|
+
h("label", { class: "s-login-modal-label" }, salla.lang.get('common.elements.email')),
|
|
258
251
|
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" }),
|
|
259
252
|
h("span", { class: "s-login-modal-error-message" })),
|
|
260
253
|
h("salla-button", { "loader-position": 'center', width: "wide", onClick: () => this.newUser(), ref: b => this.regBtn = b }, salla.lang.get('blocks.header.register')),
|
|
@@ -324,18 +317,9 @@ export class SallaLoginModal {
|
|
|
324
317
|
}
|
|
325
318
|
}; }
|
|
326
319
|
static get states() { return {
|
|
320
|
+
"translationLoaded": {},
|
|
327
321
|
"title": {},
|
|
328
|
-
"loginTypeTitle": {},
|
|
329
|
-
"loginText": {},
|
|
330
|
-
"smsLabel": {},
|
|
331
|
-
"mobileLabel": {},
|
|
332
|
-
"emailLabel": {},
|
|
333
|
-
"enterText": {},
|
|
334
|
-
"bySMSText": {},
|
|
335
|
-
"byEmailText": {},
|
|
336
322
|
"emailErrorMsg": {},
|
|
337
|
-
"firstNameLabel": {},
|
|
338
|
-
"lastNameLabel": {},
|
|
339
323
|
"firstNameErrorMsg": {},
|
|
340
324
|
"lastNameErrorMsg": {}
|
|
341
325
|
}; }
|
|
@@ -42,18 +42,7 @@ export class SallaLoyalty {
|
|
|
42
42
|
this.is_loggedin = true;
|
|
43
43
|
});
|
|
44
44
|
salla.lang.onLoaded(() => {
|
|
45
|
-
this.
|
|
46
|
-
this.exchange_points = salla.lang.get('pages.loyalty_program.exchange_points');
|
|
47
|
-
this.are_you_sure_to_exchange = salla.lang.get('pages.loyalty_program.are_you_sure_to_exchange');
|
|
48
|
-
this.for = salla.lang.get('pages.loyalty_program.for');
|
|
49
|
-
this.confirm = salla.lang.get('pages.loyalty_program.confirm');
|
|
50
|
-
this.cancel = salla.lang.get('pages.loyalty_program.cancellation');
|
|
51
|
-
this.cart_total_point_summary = salla.lang.get('pages.loyalty_program.cart_total_point_summary', { "balance": this.customerPoints });
|
|
52
|
-
this.cart_point_exchange_now = salla.lang.get('pages.loyalty_program.cart_point_exchange_now');
|
|
53
|
-
this.login_button = salla.lang.get('blocks.header.login');
|
|
54
|
-
if (!this.guestMessage) {
|
|
55
|
-
this.guestMessage = salla.lang.get('pages.loyalty_program.guest_message');
|
|
56
|
-
}
|
|
45
|
+
this.translationLoaded = true;
|
|
57
46
|
});
|
|
58
47
|
}
|
|
59
48
|
setSelectedPrizeItem(item) {
|
|
@@ -82,7 +71,7 @@ export class SallaLoyalty {
|
|
|
82
71
|
h("div", { class: "s-loyalty-prize-item-points" },
|
|
83
72
|
item.cost_points,
|
|
84
73
|
" ",
|
|
85
|
-
|
|
74
|
+
salla.lang.get('pages.loyalty_program.point'),
|
|
86
75
|
h("div", { class: "s-loyalty-prize-item-check" },
|
|
87
76
|
h("div", null))));
|
|
88
77
|
}
|
|
@@ -90,19 +79,19 @@ export class SallaLoyalty {
|
|
|
90
79
|
var _a, _b;
|
|
91
80
|
return [
|
|
92
81
|
h("salla-placeholder", { alignment: "center", icon: Star3, class: "s-loyalty-confirmation-modal-content" },
|
|
93
|
-
h("div", { slot: "title", class: "s-loyalty-confirmation-title" },
|
|
82
|
+
h("div", { slot: "title", class: "s-loyalty-confirmation-title" }, salla.lang.get('pages.loyalty_program.exchange_points')),
|
|
94
83
|
h("div", { slot: "description" },
|
|
95
|
-
|
|
84
|
+
salla.lang.get('pages.loyalty_program.are_you_sure_to_exchange'),
|
|
96
85
|
" ( ",
|
|
97
86
|
h("strong", null, (_a = this.selectedItem) === null || _a === void 0 ? void 0 : _a.cost_points),
|
|
98
87
|
" ) ",
|
|
99
|
-
|
|
88
|
+
salla.lang.get('pages.loyalty_program.for'),
|
|
100
89
|
" ( ",
|
|
101
90
|
h("strong", null, (_b = this.selectedItem) === null || _b === void 0 ? void 0 : _b.name),
|
|
102
91
|
" )")),
|
|
103
92
|
h("div", { class: "s-loyalty-confirmation-actions" },
|
|
104
|
-
h("salla-button", { fill: 'outline', width: "wide", onClick: () => this.cancelProcess() },
|
|
105
|
-
h("salla-button", { loading: this.buttonLoading, width: "wide", onClick: () => this.exchangeLoyaltyPoint() },
|
|
93
|
+
h("salla-button", { fill: 'outline', width: "wide", onClick: () => this.cancelProcess() }, salla.lang.get('pages.loyalty_program.cancellation')),
|
|
94
|
+
h("salla-button", { loading: this.buttonLoading, width: "wide", onClick: () => this.exchangeLoyaltyPoint() }, salla.lang.get('pages.loyalty_program.confirm')))
|
|
106
95
|
];
|
|
107
96
|
}
|
|
108
97
|
getAfterExchangeUI() {
|
|
@@ -193,10 +182,10 @@ export class SallaLoyalty {
|
|
|
193
182
|
h("salla-list-tile", { class: 's-loyalty-widget' },
|
|
194
183
|
h("div", { slot: "icon", class: "s-loyalty-widget-icon", innerHTML: Star2 }),
|
|
195
184
|
h("div", { slot: "subtitle" },
|
|
196
|
-
this.is_loggedin ?
|
|
197
|
-
h("salla-button", { shape: "link", color: "primary", onClick: () => salla.event.dispatch("loyalty::open") }, this.is_loggedin ?
|
|
185
|
+
this.is_loggedin ? salla.lang.get('pages.loyalty_program.cart_total_point_summary', { "balance": this.customerPoints }) : (this.guestMessage || salla.lang.get('pages.loyalty_program.guest_message')),
|
|
186
|
+
h("salla-button", { shape: "link", color: "primary", onClick: () => salla.event.dispatch("loyalty::open") }, this.is_loggedin ? salla.lang.get('pages.loyalty_program.cart_point_exchange_now') : salla.lang.get('blocks.header.login')))) :
|
|
198
187
|
''),
|
|
199
|
-
h("salla-modal", { noPadding: true,
|
|
188
|
+
h("salla-modal", { noPadding: true, width: "sm", ref: modal => this.confirmationModal = modal }, this.getConfirmationModal()),
|
|
200
189
|
h("salla-modal", { isLoading: true, "has-skeleton": true, width: "md", ref: modal => this.modal = modal },
|
|
201
190
|
h("div", { slot: "loading" },
|
|
202
191
|
h("div", { class: "s-loyalty-skeleton" },
|
|
@@ -230,7 +219,7 @@ export class SallaLoyalty {
|
|
|
230
219
|
h("span", null, prize.title))),
|
|
231
220
|
this.loyaltyProgram.prizes.map((prize) => h("salla-tab-content", { slot: "content", name: prize.title },
|
|
232
221
|
h("salla-swiper", { "space-between-items": "20" }, prize.items.map((item) => this.prizeItem(item)))))),
|
|
233
|
-
h("salla-button", { disabled: !this.selectedItem, width: "wide", class: "s-loyalty-program-redeem-btn", onClick: () => this.openConfirmation() },
|
|
222
|
+
h("salla-button", { disabled: !this.selectedItem, width: "wide", class: "s-loyalty-program-redeem-btn", onClick: () => this.openConfirmation() }, salla.lang.get('pages.loyalty_program.exchange_points')),
|
|
234
223
|
]
|
|
235
224
|
: h("salla-placeholder", { class: "s-loyalty-placeholder", alignment: "center" })),
|
|
236
225
|
];
|
|
@@ -378,15 +367,7 @@ export class SallaLoyalty {
|
|
|
378
367
|
"selectedItem": {},
|
|
379
368
|
"askConfirmation": {},
|
|
380
369
|
"is_loggedin": {},
|
|
381
|
-
"
|
|
382
|
-
"exchange_points": {},
|
|
383
|
-
"are_you_sure_to_exchange": {},
|
|
384
|
-
"for": {},
|
|
385
|
-
"cancel": {},
|
|
386
|
-
"confirm": {},
|
|
387
|
-
"cart_total_point_summary": {},
|
|
388
|
-
"cart_point_exchange_now": {},
|
|
389
|
-
"login_button": {}
|
|
370
|
+
"translationLoaded": {}
|
|
390
371
|
}; }
|
|
391
372
|
static get methods() { return {
|
|
392
373
|
"open": {
|
|
@@ -16,16 +16,10 @@ export class SallaOfferModal {
|
|
|
16
16
|
constructor() {
|
|
17
17
|
var _a, _b;
|
|
18
18
|
this.offer = null;
|
|
19
|
-
this.
|
|
20
|
-
this.remember_my_choice = salla.lang.get('commone.remember_my_choice');
|
|
21
|
-
this.add_to_cart = salla.lang.get('pages.cart.add_to_cart');
|
|
22
|
-
this.out_of_stock = salla.lang.get('pages.products.out_of_stock');
|
|
19
|
+
this.translationLoaded = false;
|
|
23
20
|
Helper.setHost(this.host);
|
|
24
21
|
salla.lang.onLoaded(() => {
|
|
25
|
-
this.
|
|
26
|
-
this.remember_my_choice = salla.lang.get('common.elements.remember_my_choice');
|
|
27
|
-
this.add_to_cart = salla.lang.get('pages.cart.add_to_cart');
|
|
28
|
-
this.out_of_stock = salla.lang.get('pages.products.out_of_stock');
|
|
22
|
+
this.translationLoaded = true;
|
|
29
23
|
});
|
|
30
24
|
this.categorySlot = ((_a = Helper.getElement('[slot="category"]')) === null || _a === void 0 ? void 0 : _a.innerHTML) || `<span class="s-offer-modal-badge-icon">{tagIcon}</span><span class="s-offer-modal-badge-text">{name}</span>`;
|
|
31
25
|
this.productSlot = ((_b = Helper.getElement('[slot="product"]')) === null || _b === void 0 ? void 0 : _b.innerHTML) || this.defaultProductSlot();
|
|
@@ -94,7 +88,7 @@ export class SallaOfferModal {
|
|
|
94
88
|
? salla.money(product.price) + '<span class="s-offer-modal-product-old-price">' + salla.money(product.regular_price) + '</span>'
|
|
95
89
|
: salla.money(product.price)) },
|
|
96
90
|
h("div", { class: "s-offer-modal-btn-wrap" },
|
|
97
|
-
h("salla-button", { width: "wide", fill: 'outline', "data-id": product.id, disabled: !product.is_available, "loader-position": "center", onClick: this.addItem }, product.is_available ?
|
|
91
|
+
h("salla-button", { width: "wide", fill: 'outline', "data-id": product.id, disabled: !product.is_available, "loader-position": "center", onClick: this.addItem }, product.is_available ? salla.lang.get('pages.cart.add_to_cart') : salla.lang.get('pages.products.out_of_stock')))))),
|
|
98
92
|
h("div", { class: "s-offer-modal-slider-nav" },
|
|
99
93
|
h("button", { class: "s-offer-modal-nav-btn s-offer-modal-prev-btn" },
|
|
100
94
|
h("span", { class: "s-offer-modal-nav-btn-icon", innerHTML: KeyboardArrowLeftIcon })),
|
|
@@ -102,14 +96,14 @@ export class SallaOfferModal {
|
|
|
102
96
|
h("span", { class: "s-offer-modal-nav-btn-icon", innerHTML: KeyboardArrowRightIcon })))), h("div", { class: "s-offer-modal-footer", slot: "footer" },
|
|
103
97
|
this.offer.formatted_date ?
|
|
104
98
|
h("p", { class: "s-offer-modal-expiry" },
|
|
105
|
-
|
|
99
|
+
salla.lang.get('pages.products.offer_expires_in'),
|
|
106
100
|
" ",
|
|
107
101
|
this.offer.formatted_date)
|
|
108
102
|
: '',
|
|
109
103
|
h("label", { class: "s-offer-modal-remember-label" },
|
|
110
104
|
h("input", { type: "checkbox", onChange: e => this.rememberMe(e), class: "s-offer-modal-remember-input" }),
|
|
111
105
|
"\u00A0 ",
|
|
112
|
-
|
|
106
|
+
salla.lang.get('common.elements.remember_my_choice'))),
|
|
113
107
|
] : '');
|
|
114
108
|
}
|
|
115
109
|
componentDidRender() {
|
|
@@ -168,10 +162,7 @@ export class SallaOfferModal {
|
|
|
168
162
|
"offer": {},
|
|
169
163
|
"offer_name": {},
|
|
170
164
|
"offer_message": {},
|
|
171
|
-
"
|
|
172
|
-
"remember_my_choice": {},
|
|
173
|
-
"add_to_cart": {},
|
|
174
|
-
"out_of_stock": {}
|
|
165
|
+
"translationLoaded": {}
|
|
175
166
|
}; }
|
|
176
167
|
static get methods() { return {
|
|
177
168
|
"open": {
|
|
@@ -5,6 +5,7 @@ import { Component, Prop, State, h, Host } from '@stencil/core';
|
|
|
5
5
|
import Inbox from '../../assets/svg/inbox.svg';
|
|
6
6
|
export class SallaPlaceholder {
|
|
7
7
|
constructor() {
|
|
8
|
+
this.translationLoaded = false;
|
|
8
9
|
/**
|
|
9
10
|
* Custom icon to display, defaults to [`sicon-inbox`]
|
|
10
11
|
*/
|
|
@@ -18,8 +19,7 @@ export class SallaPlaceholder {
|
|
|
18
19
|
*/
|
|
19
20
|
this.iconSize = 'md';
|
|
20
21
|
salla.lang.onLoaded(() => {
|
|
21
|
-
this.
|
|
22
|
-
this.default_description = salla.lang.get('common.errors.empty_results');
|
|
22
|
+
this.translationLoaded = true;
|
|
23
23
|
});
|
|
24
24
|
}
|
|
25
25
|
alignmentClass() {
|
|
@@ -35,10 +35,10 @@ export class SallaPlaceholder {
|
|
|
35
35
|
h("div", { class: `s-placeholder-icon s-placeholder-icon-${this.iconSize}`, innerHTML: this.icon }),
|
|
36
36
|
h("div", { class: "s-placeholder-title" },
|
|
37
37
|
h("slot", { name: 'title' },
|
|
38
|
-
h("span", null,
|
|
38
|
+
h("span", null, salla.lang.get('common.elements.no_options')))),
|
|
39
39
|
h("div", { class: "s-placeholder-description" },
|
|
40
40
|
h("slot", { name: 'description' },
|
|
41
|
-
h("span", null,
|
|
41
|
+
h("span", null, salla.lang.get('common.errors.empty_results'))))));
|
|
42
42
|
}
|
|
43
43
|
static get is() { return "salla-placeholder"; }
|
|
44
44
|
static get originalStyleUrls() { return {
|
|
@@ -104,7 +104,6 @@ export class SallaPlaceholder {
|
|
|
104
104
|
}
|
|
105
105
|
}; }
|
|
106
106
|
static get states() { return {
|
|
107
|
-
"
|
|
108
|
-
"default_description": {}
|
|
107
|
+
"translationLoaded": {}
|
|
109
108
|
}; }
|
|
110
109
|
}
|