@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
|
@@ -22,6 +22,7 @@ const sallaScopesCss = ".s-scopes-availability-content{display:flex;justify-cont
|
|
|
22
22
|
const SallaScopees = class {
|
|
23
23
|
constructor(hostRef) {
|
|
24
24
|
registerInstance(this, hostRef);
|
|
25
|
+
this.translationLoaded = false;
|
|
25
26
|
this.mode = ModeType.DEFAULT;
|
|
26
27
|
this.scopes = [];
|
|
27
28
|
this.originalScopesList = [];
|
|
@@ -39,20 +40,14 @@ const SallaScopees = class {
|
|
|
39
40
|
if (((_a = this.originalScopesList) === null || _a === void 0 ? void 0 : _a.length) < 2)
|
|
40
41
|
return "";
|
|
41
42
|
return this.mode === ModeType.DEFAULT ?
|
|
42
|
-
|
|
43
|
-
|
|
43
|
+
salla.lang.get("blocks.scope.shopping_from_another_branch") :
|
|
44
|
+
salla.lang.get('blocks.scope.search_for_availability_in_other_branches');
|
|
44
45
|
};
|
|
45
46
|
salla.event.on('scopes::open', ({ mode = null, product_id = null }) => {
|
|
46
47
|
this.open(mode, product_id);
|
|
47
48
|
});
|
|
48
49
|
salla.lang.onLoaded(() => {
|
|
49
|
-
this.
|
|
50
|
-
this.ourServiceIsNotFound = salla.lang.get("blocks.scope.our_services_not_available_in_this_branch");
|
|
51
|
-
this.searchForAvailabilityInOtherBranch = salla.lang.get('blocks.scope.search_for_availability_in_other_branches');
|
|
52
|
-
this.shoppingFromAnotherBranch = salla.lang.get("blocks.scope.shopping_from_another_branch");
|
|
53
|
-
this.nowBrowsingFrom = salla.lang.get('blocks.scope.you_are_browse_store_from');
|
|
54
|
-
this.confirmButton = salla.lang.get('common.elements.confirm');
|
|
55
|
-
this.scopeSearchPlaceholder = salla.lang.get('blocks.scope.searching_for_a_branch');
|
|
50
|
+
this.translationLoaded = true;
|
|
56
51
|
});
|
|
57
52
|
}
|
|
58
53
|
/**
|
|
@@ -101,10 +96,10 @@ const SallaScopees = class {
|
|
|
101
96
|
'type': this.current_scope.type,
|
|
102
97
|
'id': this.current_scope.id
|
|
103
98
|
});
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
window.location.
|
|
99
|
+
var url = new URL(window.location.href);
|
|
100
|
+
url.searchParams.set('scope', this.current_scope.id);
|
|
101
|
+
window.location.href = url.toString();
|
|
102
|
+
window.location.replace(url.toString());
|
|
108
103
|
}).catch(e => console.log(e))
|
|
109
104
|
.finally(() => {
|
|
110
105
|
this.changeBtn.stop();
|
|
@@ -135,7 +130,7 @@ const SallaScopees = class {
|
|
|
135
130
|
this.current_scope = this.scopes.find(scope => scope.id == event.target.value);
|
|
136
131
|
}
|
|
137
132
|
placeholderContent() {
|
|
138
|
-
return h("salla-placeholder", { alignment: "center", class: "s-scopes-placeholder" }, h("span", { slot: "title" },
|
|
133
|
+
return h("salla-placeholder", { alignment: "center", class: "s-scopes-placeholder" }, h("span", { slot: "title" }, salla.lang.get("blocks.scope.branch_looking_for_not_found")), h("span", { slot: "description" }, salla.lang.get("blocks.scope.our_services_not_available_in_this_branch")));
|
|
139
134
|
}
|
|
140
135
|
defaultContent() {
|
|
141
136
|
return [h("div", { class: "s-scopes-container s-scrollbar" }, this.scopes.map((scope) => h("div", { class: "s-scopes-input-wrap", "data-selection": this.selection }, 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 }), h("label", { htmlFor: `${this.selection} + '_scope_' + ${scope.id}`, class: "s-scopes-label s-scopes-clickable" }, h("span", null, scope.name))))), this.footerContent()];
|
|
@@ -147,11 +142,11 @@ const SallaScopees = class {
|
|
|
147
142
|
}));
|
|
148
143
|
}
|
|
149
144
|
footerContent() {
|
|
150
|
-
return h("div", { class: "s-scopes-footer" }, h("slot", { name: "footer" }, h("salla-button", { ref: btn => this.changeBtn = btn, disabled: !this.current_scope, onClick: () => this.handleSubmit(), class: "s-scopes-submit", "loader-position": "center", width: "wide" },
|
|
145
|
+
return h("div", { class: "s-scopes-footer" }, h("slot", { name: "footer" }, 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'))));
|
|
151
146
|
}
|
|
152
147
|
render() {
|
|
153
|
-
return (h(Host, null, h("salla-modal", { ref: modal => this.modal = modal, isClosable: !!(this.isOpenedBefore || (this.selection == 'optional')), class: "s-scopes-modal", isLoading: true, "has-skeleton": true }, h("div", { slot: "loading" }, h("div", { class: "s-scopes-skeleton" }, h("salla-list-tile", { class: "s-scopes-header" }, h("div", { slot: "icon", class: "s-scopes-header-icon" }, h("salla-skeleton", { type: "circle" })), h("div", { slot: "title", class: "s-scopes-header-title mb-5" }, h("salla-skeleton", { height: '15px', width: '50%' })), h("div", { slot: "subtitle", class: "s-scopes-header-subtitle" }, h("salla-skeleton", { height: '10px' }), h("salla-skeleton", { height: '10px', width: '75%' }))), h("div", { class: "s-scopes-skeleton-search" }, h("salla-skeleton", { height: '10px', width: '50%' }), h("salla-skeleton", { height: '30px', width: '100%' })), h("div", { class: "s-scopes-skeleton-scopes" }, h("salla-skeleton", { height: '10px', width: '30%' }), h("salla-skeleton", { height: '10px', width: '25%' }), h("salla-skeleton", { height: '10px', width: '30%' }), h("salla-skeleton", { height: '10px', width: '25%' }), h("salla-skeleton", { height: '10px', width: '30%' }), h("salla-skeleton", { height: '10px', width: '25%' }), h("salla-skeleton", { height: '10px', width: '30%' }), h("salla-skeleton", { height: '10px', width: '25%' })), h("div", { class: "s-scopes-skeleton-btn" }, h("salla-skeleton", { height: '40px', width: '100%' })))), h("salla-list-tile", { class: this.originalScopesList.length ? "s-scopes-header block" : "s-hidden" }, h("div", { slot: "icon", class: "s-scopes-header-icon", innerHTML: StoreAlt }), h("div", { slot: "title", class: "s-scopes-header-title" },
|
|
154
|
-
h("div", { class: "s-scopes-search-wrapper" }, h("div", { class: "s-scopes-search-icon", innerHTML: Search }), h("input", { type: "text", class: "s-scopes-search-input", onInput: e => this.handleSearchFieldTyping(e), placeholder:
|
|
148
|
+
return (h(Host, null, h("salla-modal", { ref: modal => this.modal = modal, isClosable: !!(this.isOpenedBefore || (this.selection == 'optional')), class: "s-scopes-modal", isLoading: true, "has-skeleton": true }, h("div", { slot: "loading" }, h("div", { class: "s-scopes-skeleton" }, h("salla-list-tile", { class: "s-scopes-header" }, h("div", { slot: "icon", class: "s-scopes-header-icon" }, h("salla-skeleton", { type: "circle" })), h("div", { slot: "title", class: "s-scopes-header-title mb-5" }, h("salla-skeleton", { height: '15px', width: '50%' })), h("div", { slot: "subtitle", class: "s-scopes-header-subtitle" }, h("salla-skeleton", { height: '10px' }), h("salla-skeleton", { height: '10px', width: '75%' }))), h("div", { class: "s-scopes-skeleton-search" }, h("salla-skeleton", { height: '10px', width: '50%' }), h("salla-skeleton", { height: '30px', width: '100%' })), h("div", { class: "s-scopes-skeleton-scopes" }, h("salla-skeleton", { height: '10px', width: '30%' }), h("salla-skeleton", { height: '10px', width: '25%' }), h("salla-skeleton", { height: '10px', width: '30%' }), h("salla-skeleton", { height: '10px', width: '25%' }), h("salla-skeleton", { height: '10px', width: '30%' }), h("salla-skeleton", { height: '10px', width: '25%' }), h("salla-skeleton", { height: '10px', width: '30%' }), h("salla-skeleton", { height: '10px', width: '25%' })), h("div", { class: "s-scopes-skeleton-btn" }, h("salla-skeleton", { height: '40px', width: '100%' })))), h("salla-list-tile", { class: this.originalScopesList.length ? "s-scopes-header block" : "s-hidden" }, h("div", { slot: "icon", class: "s-scopes-header-icon", innerHTML: StoreAlt }), h("div", { slot: "title", class: "s-scopes-header-title" }, salla.lang.get('blocks.scope.you_are_browse_store_from')), h("div", { slot: "subtitle", class: "s-scopes-header-subtitle" }, !!this.selected_scope ? this.selected_scope.name : "")), h("div", { class: "s-scopes-wrap" }, !!this.originalScopesList.length && h("h4", { class: "s-scopes-title" }, this.getFormTitle()), this.originalScopesList.length > this.searchDisplayLimit ?
|
|
149
|
+
h("div", { class: "s-scopes-search-wrapper" }, h("div", { class: "s-scopes-search-icon", innerHTML: Search }), h("input", { type: "text", class: "s-scopes-search-input", onInput: e => this.handleSearchFieldTyping(e), placeholder: salla.lang.get('blocks.scope.searching_for_a_branch') }))
|
|
155
150
|
: "", this.scopes.length < 2 ?
|
|
156
151
|
this.placeholderContent()
|
|
157
152
|
: this.mode === ModeType.DEFAULT ? this.defaultContent() : this.availabilityContent()))));
|
|
@@ -16,5 +16,5 @@ const patchBrowser = () => {
|
|
|
16
16
|
};
|
|
17
17
|
|
|
18
18
|
patchBrowser().then(options => {
|
|
19
|
-
return bootstrapLazy([["salla-button_24",[[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],"
|
|
19
|
+
return bootstrapLazy([["salla-button_24",[[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",[[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",[[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",[[4,"salla-conditional-fields",null,[[0,"change","changeHandler"]]]]],["salla-installment",[[0,"salla-installment",{"price":[1],"language":[1],"currency":[1],"tamaraIsActive":[32],"tabbyIsActive":[32],"spotiiIsActive":[32]}]]]], options);
|
|
20
20
|
});
|