@salla.sa/twilight-components 1.4.5 → 1.4.7
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-button_23.cjs.entry.js +21 -19
- package/dist/cjs/twilight-components.cjs.js +1 -1
- package/dist/collection/components/salla-scopes/salla-scopes.js +34 -31
- package/dist/components/salla-scopes.js +23 -21
- package/dist/esm/loader.js +1 -1
- package/dist/esm/salla-button_23.entry.js +21 -19
- package/dist/esm/twilight-components.js +1 -1
- package/dist/twilight-components/p-629f15e2.entry.js +4 -0
- package/dist/twilight-components/twilight-components.esm.js +1 -1
- package/dist/types/components/salla-scopes/salla-scopes.d.ts +5 -5
- package/dist/types/components.d.ts +12 -6
- package/example/assets/tailwind.css +496 -69
- package/package.json +1 -1
- package/dist/twilight-components/p-91f3dd6d.entry.js +0 -4
package/dist/cjs/loader.cjs.js
CHANGED
|
@@ -17,7 +17,7 @@ const patchEsm = () => {
|
|
|
17
17
|
const defineCustomElements = (win, options) => {
|
|
18
18
|
if (typeof window === 'undefined') return Promise.resolve();
|
|
19
19
|
return patchEsm().then(() => {
|
|
20
|
-
return index.bootstrapLazy([["salla-button_23.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],"points":[32],"exchange_points":[32],"are_you_sure_to_exchange":[32],"for":[32],"cancel":[32],"confirm":[32],"cart_total_point_summary":[32],"cart_point_exchange_now":[32],"login_button":[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"],"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],"open":[64]},[[8,"verified","onVerified"]]],[4,"salla-scopes",{"
|
|
20
|
+
return index.bootstrapLazy([["salla-button_23.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],"points":[32],"exchange_points":[32],"are_you_sure_to_exchange":[32],"for":[32],"cancel":[32],"confirm":[32],"cart_total_point_summary":[32],"cart_point_exchange_now":[32],"login_button":[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"],"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],"open":[64]},[[8,"verified","onVerified"]]],[4,"salla-scopes",{"selection":[1],"searchDisplayLimit":[2,"search-display-limit"],"mode":[32],"current_scope":[32],"scopes":[32],"originalScopesList":[32],"branchNotFound":[32],"ourServiceIsNotFound":[32],"searchForAvailabilityInOtherBranch":[32],"shoppingFromAnotherBranch":[32],"nowBrowsingFrom":[32],"confirmButton":[32],"scopeSearchPlaceholder":[32],"selected_scope":[32],"isDefault":[32],"isOpenedBefore":[32],"close":[64],"open":[64],"handleSubmit":[64]}],[0,"salla-rating-modal",{"orderId":[2,"order-id"],"order":[32],"open":[64],"close":[64]}],[0,"salla-localization-modal",{"language":[1537],"currency":[1537],"languages":[32],"currencies":[32],"languagesTitle":[32],"currenciesTitle":[32],"isLoading":[32],"open":[64],"close":[64],"submit":[64]}],[0,"salla-offer-modal",{"offer":[32],"offer_name":[32],"offer_message":[32],"offer_expires_in":[32],"remember_my_choice":[32],"add_to_cart":[32],"out_of_stock":[32],"open":[64],"showOffer":[64]}],[0,"salla-search",{"inline":[4],"oval":[4],"height":[2],"results":[32],"placeholder":[32],"noResultsText":[32],"typing":[32],"debounce":[32],"search_term":[32]}],[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]}],[0,"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]}],[4,"salla-verify",{"display":[1],"type":[1025],"autoReload":[4,"auto-reload"],"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"],"direction":[1],"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,"onSelect","onSelectedTab"]]],[4,"salla-placeholder",{"icon":[1],"alignment":[1],"iconSize":[1,"icon-size"],"default_title":[32],"default_description":[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]}],[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"],"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-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]}]]],["salla-quantity-input.cjs",[[4,"salla-quantity-input",{"quantity":[32],"decrease":[64],"increase":[64],"setValue":[64]}]]]], options);
|
|
21
21
|
});
|
|
22
22
|
};
|
|
23
23
|
|
|
@@ -1537,9 +1537,13 @@ const SallaScopees = class {
|
|
|
1537
1537
|
this.isDefault = true;
|
|
1538
1538
|
this.isOpenedBefore = salla.storage.get("branch-choosed-before");
|
|
1539
1539
|
/**
|
|
1540
|
-
*
|
|
1540
|
+
* Optionally open the modal or enforce the pop-up to the viewer
|
|
1541
1541
|
*/
|
|
1542
|
-
this.
|
|
1542
|
+
this.selection = 'optional';
|
|
1543
|
+
/**
|
|
1544
|
+
* Dictates when to show the search field
|
|
1545
|
+
*/
|
|
1546
|
+
this.searchDisplayLimit = 6;
|
|
1543
1547
|
this.getFormTitle = () => {
|
|
1544
1548
|
var _a;
|
|
1545
1549
|
if (((_a = this.originalScopesList) === null || _a === void 0 ? void 0 : _a.length) < 2)
|
|
@@ -1551,24 +1555,22 @@ const SallaScopees = class {
|
|
|
1551
1555
|
salla.event.on('scopes::open', ({ mode = null, product_id = null }) => {
|
|
1552
1556
|
if (!!mode)
|
|
1553
1557
|
this.mode = mode;
|
|
1554
|
-
this.isDefault = !mode || mode == ModeType.DEFAULT;
|
|
1555
1558
|
this.open(mode, product_id);
|
|
1556
1559
|
});
|
|
1557
|
-
salla.lang.
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
this.scopeSearchPlaceholder = salla.lang.get('blocks.scope.searching_for_a_branch');
|
|
1565
|
-
});
|
|
1560
|
+
this.branchNotFound = salla.lang.get("blocks.scope.branch_looking_for_not_found");
|
|
1561
|
+
this.ourServiceIsNotFound = salla.lang.get("blocks.scope.our_services_not_available_in_this_branch");
|
|
1562
|
+
this.searchForAvailabilityInOtherBranch = salla.lang.get('blocks.scope.search_for_availability_in_other_branches');
|
|
1563
|
+
this.shoppingFromAnotherBranch = salla.lang.get("blocks.scope.shopping_from_another_branch");
|
|
1564
|
+
this.nowBrowsingFrom = salla.lang.get('blocks.scope.you_are_browse_store_from');
|
|
1565
|
+
this.confirmButton = salla.lang.get('common.elements.confirm');
|
|
1566
|
+
this.scopeSearchPlaceholder = salla.lang.get('blocks.scope.searching_for_a_branch');
|
|
1566
1567
|
}
|
|
1567
1568
|
async close() {
|
|
1568
1569
|
var _a;
|
|
1569
1570
|
return await ((_a = this.modal) === null || _a === void 0 ? void 0 : _a.close());
|
|
1570
1571
|
}
|
|
1571
1572
|
async open(mode = ModeType.DEFAULT, product_id = null) {
|
|
1573
|
+
this.isDefault = !mode || mode == ModeType.DEFAULT;
|
|
1572
1574
|
this.modal.open();
|
|
1573
1575
|
return await (mode == ModeType.AVAILABILITY ? salla.scope.getProductAvailability(product_id) : salla.scope.get())
|
|
1574
1576
|
.then((resp) => {
|
|
@@ -1584,11 +1586,11 @@ const SallaScopees = class {
|
|
|
1584
1586
|
});
|
|
1585
1587
|
}
|
|
1586
1588
|
async handleSubmit() {
|
|
1587
|
-
salla.storage.set("branch-choosed-before", true);
|
|
1588
1589
|
let payload = { 'scope_id': this.current_scope.id };
|
|
1589
1590
|
this.changeBtn.load();
|
|
1590
1591
|
return await salla.scope.change(payload)
|
|
1591
1592
|
.then(() => {
|
|
1593
|
+
salla.storage.set("branch-choosed-before", true);
|
|
1592
1594
|
window.location.reload();
|
|
1593
1595
|
}).catch(e => console.log(e))
|
|
1594
1596
|
.finally(() => {
|
|
@@ -1623,24 +1625,24 @@ const SallaScopees = class {
|
|
|
1623
1625
|
return index$1.h("salla-placeholder", { alignment: "center", class: "s-scopes-placeholder" }, index$1.h("span", { slot: "title" }, this.branchNotFound), index$1.h("span", { slot: "description" }, this.ourServiceIsNotFound));
|
|
1624
1626
|
}
|
|
1625
1627
|
defaultContent() {
|
|
1626
|
-
return [index$1.h("div", { class: "s-scopes-container s-scrollbar" }, this.scopes.map((scope) => index$1.h("div", { class: "s-scopes-input-wrap", "data-
|
|
1628
|
+
return [index$1.h("div", { class: "s-scopes-container s-scrollbar" }, this.scopes.map((scope) => index$1.h("div", { class: "s-scopes-input-wrap", "data-selection": this.selection }, index$1.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$1.h("label", { htmlFor: `${this.selection} + '_scope_' + ${scope.id}`, class: "s-scopes-label s-scopes-clickable" }, index$1.h("span", null, scope.name))))), this.footerContent()];
|
|
1627
1629
|
}
|
|
1628
1630
|
availabilityContent() {
|
|
1629
|
-
return index$1.h("div", { class: "s-scopes-container" }, this.scopes.map((scope) => index$1.h("div", { class: "s-scopes-input-wrap", "data-
|
|
1631
|
+
return index$1.h("div", { class: "s-scopes-container" }, this.scopes.map((scope) => index$1.h("div", { class: "s-scopes-input-wrap", "data-selection": this.selection }, index$1.h("h2", { class: { "s-scopes-label": true, "s-scopes-clickable": this.isDefault } }, index$1.h("span", null, scope.name)), index$1.h("h2", { style: { 'color': scope.availability.color }, class: `s-scopes-${scope.availability.key}` }, scope.availability.label))));
|
|
1630
1632
|
}
|
|
1631
1633
|
footerContent() {
|
|
1632
1634
|
return index$1.h("div", { class: "s-scopes-footer" }, index$1.h("slot", { name: "footer" }, index$1.h("salla-button", { ref: btn => this.changeBtn = btn, disabled: !this.current_scope, onClick: () => this.handleSubmit(), class: "s-scopes-submit", "loader-position": "center", width: "wide" }, this.confirmButton)));
|
|
1633
1635
|
}
|
|
1634
1636
|
render() {
|
|
1635
|
-
return (index$1.h(index$1.Host, null, index$1.h("salla-modal", { ref: modal => this.modal = modal, id: "s-scopes-modal", class: "s-scopes-modal", isLoading: true }, index$1.h("salla-list-tile", { class: this.originalScopesList.length ? "s-scopes-header block" : "s-hidden" }, index$1.h("div", { slot: "icon", class: "s-scopes-header-icon", innerHTML: StoreAlt }), index$1.h("div", { slot: "title", class: "s-scopes-header-title" }, this.nowBrowsingFrom), index$1.h("div", { slot: "subtitle", class: "s-scopes-header-subtitle" }, !!this.selected_scope ? this.selected_scope.name : "")), index$1.h("div", { class: "s-scopes-wrap" }, !!this.originalScopesList.length && index$1.h("h4", { class: "s-scopes-title" }, this.getFormTitle()), this.originalScopesList.length > this.
|
|
1637
|
+
return (index$1.h(index$1.Host, null, index$1.h("salla-modal", { ref: modal => this.modal = modal, id: "s-scopes-modal", isClosable: this.selection == 'optional', class: "s-scopes-modal", isLoading: true }, index$1.h("salla-list-tile", { class: this.originalScopesList.length ? "s-scopes-header block" : "s-hidden" }, index$1.h("div", { slot: "icon", class: "s-scopes-header-icon", innerHTML: StoreAlt }), index$1.h("div", { slot: "title", class: "s-scopes-header-title" }, this.nowBrowsingFrom), index$1.h("div", { slot: "subtitle", class: "s-scopes-header-subtitle" }, !!this.selected_scope ? this.selected_scope.name : "")), index$1.h("div", { class: "s-scopes-wrap" }, !!this.originalScopesList.length && index$1.h("h4", { class: "s-scopes-title" }, this.getFormTitle()), this.originalScopesList.length > this.searchDisplayLimit ?
|
|
1636
1638
|
index$1.h("div", { class: "s-scopes-search-wrapper" }, index$1.h("div", { class: "s-scopes-search-icon", innerHTML: Search }), index$1.h("input", { type: "text", class: "s-scopes-search-input", onInput: e => this.handleSearchFieldTyping(e), placeholder: this.scopeSearchPlaceholder }))
|
|
1637
1639
|
: "", this.scopes.length < 2 ?
|
|
1638
1640
|
this.placeholderContent()
|
|
1639
1641
|
: this.isDefault ? this.defaultContent() : this.availabilityContent()))));
|
|
1640
1642
|
}
|
|
1641
|
-
|
|
1642
|
-
if (!this.isOpenedBefore && this.
|
|
1643
|
-
|
|
1643
|
+
componentDidLoad() {
|
|
1644
|
+
if (!this.isOpenedBefore && this.selection == 'mandatory') {
|
|
1645
|
+
this.open();
|
|
1644
1646
|
}
|
|
1645
1647
|
}
|
|
1646
1648
|
};
|
|
@@ -18,5 +18,5 @@ const patchBrowser = () => {
|
|
|
18
18
|
};
|
|
19
19
|
|
|
20
20
|
patchBrowser().then(options => {
|
|
21
|
-
return index.bootstrapLazy([["salla-button_23.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],"points":[32],"exchange_points":[32],"are_you_sure_to_exchange":[32],"for":[32],"cancel":[32],"confirm":[32],"cart_total_point_summary":[32],"cart_point_exchange_now":[32],"login_button":[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"],"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],"open":[64]},[[8,"verified","onVerified"]]],[4,"salla-scopes",{"
|
|
21
|
+
return index.bootstrapLazy([["salla-button_23.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],"points":[32],"exchange_points":[32],"are_you_sure_to_exchange":[32],"for":[32],"cancel":[32],"confirm":[32],"cart_total_point_summary":[32],"cart_point_exchange_now":[32],"login_button":[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"],"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],"open":[64]},[[8,"verified","onVerified"]]],[4,"salla-scopes",{"selection":[1],"searchDisplayLimit":[2,"search-display-limit"],"mode":[32],"current_scope":[32],"scopes":[32],"originalScopesList":[32],"branchNotFound":[32],"ourServiceIsNotFound":[32],"searchForAvailabilityInOtherBranch":[32],"shoppingFromAnotherBranch":[32],"nowBrowsingFrom":[32],"confirmButton":[32],"scopeSearchPlaceholder":[32],"selected_scope":[32],"isDefault":[32],"isOpenedBefore":[32],"close":[64],"open":[64],"handleSubmit":[64]}],[0,"salla-rating-modal",{"orderId":[2,"order-id"],"order":[32],"open":[64],"close":[64]}],[0,"salla-localization-modal",{"language":[1537],"currency":[1537],"languages":[32],"currencies":[32],"languagesTitle":[32],"currenciesTitle":[32],"isLoading":[32],"open":[64],"close":[64],"submit":[64]}],[0,"salla-offer-modal",{"offer":[32],"offer_name":[32],"offer_message":[32],"offer_expires_in":[32],"remember_my_choice":[32],"add_to_cart":[32],"out_of_stock":[32],"open":[64],"showOffer":[64]}],[0,"salla-search",{"inline":[4],"oval":[4],"height":[2],"results":[32],"placeholder":[32],"noResultsText":[32],"typing":[32],"debounce":[32],"search_term":[32]}],[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]}],[0,"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]}],[4,"salla-verify",{"display":[1],"type":[1025],"autoReload":[4,"auto-reload"],"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"],"direction":[1],"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,"onSelect","onSelectedTab"]]],[4,"salla-placeholder",{"icon":[1],"alignment":[1],"iconSize":[1,"icon-size"],"default_title":[32],"default_description":[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]}],[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"],"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-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]}]]],["salla-quantity-input.cjs",[[4,"salla-quantity-input",{"quantity":[32],"decrease":[64],"increase":[64],"setValue":[64]}]]]], options);
|
|
22
22
|
});
|
|
@@ -13,9 +13,13 @@ export class SallaScopees {
|
|
|
13
13
|
this.isDefault = true;
|
|
14
14
|
this.isOpenedBefore = salla.storage.get("branch-choosed-before");
|
|
15
15
|
/**
|
|
16
|
-
*
|
|
16
|
+
* Optionally open the modal or enforce the pop-up to the viewer
|
|
17
17
|
*/
|
|
18
|
-
this.
|
|
18
|
+
this.selection = 'optional';
|
|
19
|
+
/**
|
|
20
|
+
* Dictates when to show the search field
|
|
21
|
+
*/
|
|
22
|
+
this.searchDisplayLimit = 6;
|
|
19
23
|
this.getFormTitle = () => {
|
|
20
24
|
var _a;
|
|
21
25
|
if (((_a = this.originalScopesList) === null || _a === void 0 ? void 0 : _a.length) < 2)
|
|
@@ -27,24 +31,22 @@ export class SallaScopees {
|
|
|
27
31
|
salla.event.on('scopes::open', ({ mode = null, product_id = null }) => {
|
|
28
32
|
if (!!mode)
|
|
29
33
|
this.mode = mode;
|
|
30
|
-
this.isDefault = !mode || mode == ModeType.DEFAULT;
|
|
31
34
|
this.open(mode, product_id);
|
|
32
35
|
});
|
|
33
|
-
salla.lang.
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
this.scopeSearchPlaceholder = salla.lang.get('blocks.scope.searching_for_a_branch');
|
|
41
|
-
});
|
|
36
|
+
this.branchNotFound = salla.lang.get("blocks.scope.branch_looking_for_not_found");
|
|
37
|
+
this.ourServiceIsNotFound = salla.lang.get("blocks.scope.our_services_not_available_in_this_branch");
|
|
38
|
+
this.searchForAvailabilityInOtherBranch = salla.lang.get('blocks.scope.search_for_availability_in_other_branches');
|
|
39
|
+
this.shoppingFromAnotherBranch = salla.lang.get("blocks.scope.shopping_from_another_branch");
|
|
40
|
+
this.nowBrowsingFrom = salla.lang.get('blocks.scope.you_are_browse_store_from');
|
|
41
|
+
this.confirmButton = salla.lang.get('common.elements.confirm');
|
|
42
|
+
this.scopeSearchPlaceholder = salla.lang.get('blocks.scope.searching_for_a_branch');
|
|
42
43
|
}
|
|
43
44
|
async close() {
|
|
44
45
|
var _a;
|
|
45
46
|
return await ((_a = this.modal) === null || _a === void 0 ? void 0 : _a.close());
|
|
46
47
|
}
|
|
47
48
|
async open(mode = ModeType.DEFAULT, product_id = null) {
|
|
49
|
+
this.isDefault = !mode || mode == ModeType.DEFAULT;
|
|
48
50
|
this.modal.open();
|
|
49
51
|
return await (mode == ModeType.AVAILABILITY ? salla.scope.getProductAvailability(product_id) : salla.scope.get())
|
|
50
52
|
.then((resp) => {
|
|
@@ -60,11 +62,11 @@ export class SallaScopees {
|
|
|
60
62
|
});
|
|
61
63
|
}
|
|
62
64
|
async handleSubmit() {
|
|
63
|
-
salla.storage.set("branch-choosed-before", true);
|
|
64
65
|
let payload = { 'scope_id': this.current_scope.id };
|
|
65
66
|
this.changeBtn.load();
|
|
66
67
|
return await salla.scope.change(payload)
|
|
67
68
|
.then(() => {
|
|
69
|
+
salla.storage.set("branch-choosed-before", true);
|
|
68
70
|
window.location.reload();
|
|
69
71
|
}).catch(e => console.log(e))
|
|
70
72
|
.finally(() => {
|
|
@@ -101,13 +103,13 @@ export class SallaScopees {
|
|
|
101
103
|
h("span", { slot: "description" }, this.ourServiceIsNotFound));
|
|
102
104
|
}
|
|
103
105
|
defaultContent() {
|
|
104
|
-
return [h("div", { class: "s-scopes-container s-scrollbar" }, this.scopes.map((scope) => h("div", { class: "s-scopes-input-wrap", "data-
|
|
105
|
-
h("input", { id: `${this.
|
|
106
|
-
h("label", { htmlFor: `${this.
|
|
106
|
+
return [h("div", { class: "s-scopes-container s-scrollbar" }, this.scopes.map((scope) => h("div", { class: "s-scopes-input-wrap", "data-selection": this.selection },
|
|
107
|
+
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 }),
|
|
108
|
+
h("label", { htmlFor: `${this.selection} + '_scope_' + ${scope.id}`, class: "s-scopes-label s-scopes-clickable" },
|
|
107
109
|
h("span", null, scope.name))))), this.footerContent()];
|
|
108
110
|
}
|
|
109
111
|
availabilityContent() {
|
|
110
|
-
return h("div", { class: "s-scopes-container" }, this.scopes.map((scope) => h("div", { class: "s-scopes-input-wrap", "data-
|
|
112
|
+
return h("div", { class: "s-scopes-container" }, this.scopes.map((scope) => h("div", { class: "s-scopes-input-wrap", "data-selection": this.selection },
|
|
111
113
|
h("h2", { class: { "s-scopes-label": true, "s-scopes-clickable": this.isDefault } },
|
|
112
114
|
h("span", null, scope.name)),
|
|
113
115
|
h("h2", { style: { 'color': scope.availability.color }, class: `s-scopes-${scope.availability.key}` }, scope.availability.label))));
|
|
@@ -119,14 +121,14 @@ export class SallaScopees {
|
|
|
119
121
|
}
|
|
120
122
|
render() {
|
|
121
123
|
return (h(Host, null,
|
|
122
|
-
h("salla-modal", { ref: modal => this.modal = modal, id: "s-scopes-modal", class: "s-scopes-modal", isLoading: true },
|
|
124
|
+
h("salla-modal", { ref: modal => this.modal = modal, id: "s-scopes-modal", isClosable: this.selection == 'optional', class: "s-scopes-modal", isLoading: true },
|
|
123
125
|
h("salla-list-tile", { class: this.originalScopesList.length ? "s-scopes-header block" : "s-hidden" },
|
|
124
126
|
h("div", { slot: "icon", class: "s-scopes-header-icon", innerHTML: StoreAlt }),
|
|
125
127
|
h("div", { slot: "title", class: "s-scopes-header-title" }, this.nowBrowsingFrom),
|
|
126
128
|
h("div", { slot: "subtitle", class: "s-scopes-header-subtitle" }, !!this.selected_scope ? this.selected_scope.name : "")),
|
|
127
129
|
h("div", { class: "s-scopes-wrap" },
|
|
128
130
|
!!this.originalScopesList.length && h("h4", { class: "s-scopes-title" }, this.getFormTitle()),
|
|
129
|
-
this.originalScopesList.length > this.
|
|
131
|
+
this.originalScopesList.length > this.searchDisplayLimit ?
|
|
130
132
|
h("div", { class: "s-scopes-search-wrapper" },
|
|
131
133
|
h("div", { class: "s-scopes-search-icon", innerHTML: Search }),
|
|
132
134
|
h("input", { type: "text", class: "s-scopes-search-input", onInput: e => this.handleSearchFieldTyping(e), placeholder: this.scopeSearchPlaceholder }))
|
|
@@ -135,9 +137,9 @@ export class SallaScopees {
|
|
|
135
137
|
this.placeholderContent()
|
|
136
138
|
: this.isDefault ? this.defaultContent() : this.availabilityContent()))));
|
|
137
139
|
}
|
|
138
|
-
|
|
139
|
-
if (!this.isOpenedBefore && this.
|
|
140
|
-
|
|
140
|
+
componentDidLoad() {
|
|
141
|
+
if (!this.isOpenedBefore && this.selection == 'mandatory') {
|
|
142
|
+
this.open();
|
|
141
143
|
}
|
|
142
144
|
}
|
|
143
145
|
static get is() { return "salla-scopes"; }
|
|
@@ -148,24 +150,25 @@ export class SallaScopees {
|
|
|
148
150
|
"$": ["salla-scopes.css"]
|
|
149
151
|
}; }
|
|
150
152
|
static get properties() { return {
|
|
151
|
-
"
|
|
153
|
+
"selection": {
|
|
152
154
|
"type": "string",
|
|
153
155
|
"mutable": false,
|
|
154
156
|
"complexType": {
|
|
155
|
-
"original": "
|
|
156
|
-
"resolved": "
|
|
157
|
+
"original": "'optional' | 'mandatory'",
|
|
158
|
+
"resolved": "\"mandatory\" | \"optional\"",
|
|
157
159
|
"references": {}
|
|
158
160
|
},
|
|
159
161
|
"required": false,
|
|
160
162
|
"optional": false,
|
|
161
163
|
"docs": {
|
|
162
164
|
"tags": [],
|
|
163
|
-
"text": ""
|
|
165
|
+
"text": "Optionally open the modal or enforce the pop-up to the viewer"
|
|
164
166
|
},
|
|
165
|
-
"attribute": "
|
|
166
|
-
"reflect": false
|
|
167
|
+
"attribute": "selection",
|
|
168
|
+
"reflect": false,
|
|
169
|
+
"defaultValue": "'optional'"
|
|
167
170
|
},
|
|
168
|
-
"
|
|
171
|
+
"searchDisplayLimit": {
|
|
169
172
|
"type": "number",
|
|
170
173
|
"mutable": false,
|
|
171
174
|
"complexType": {
|
|
@@ -177,9 +180,9 @@ export class SallaScopees {
|
|
|
177
180
|
"optional": false,
|
|
178
181
|
"docs": {
|
|
179
182
|
"tags": [],
|
|
180
|
-
"text": "Dictates when to show the
|
|
183
|
+
"text": "Dictates when to show the search field"
|
|
181
184
|
},
|
|
182
|
-
"attribute": "search-
|
|
185
|
+
"attribute": "search-display-limit",
|
|
183
186
|
"reflect": false,
|
|
184
187
|
"defaultValue": "6"
|
|
185
188
|
}
|
|
@@ -40,9 +40,13 @@ const SallaScopees = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
|
40
40
|
this.isDefault = true;
|
|
41
41
|
this.isOpenedBefore = salla.storage.get("branch-choosed-before");
|
|
42
42
|
/**
|
|
43
|
-
*
|
|
43
|
+
* Optionally open the modal or enforce the pop-up to the viewer
|
|
44
44
|
*/
|
|
45
|
-
this.
|
|
45
|
+
this.selection = 'optional';
|
|
46
|
+
/**
|
|
47
|
+
* Dictates when to show the search field
|
|
48
|
+
*/
|
|
49
|
+
this.searchDisplayLimit = 6;
|
|
46
50
|
this.getFormTitle = () => {
|
|
47
51
|
var _a;
|
|
48
52
|
if (((_a = this.originalScopesList) === null || _a === void 0 ? void 0 : _a.length) < 2)
|
|
@@ -54,24 +58,22 @@ const SallaScopees = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
|
54
58
|
salla.event.on('scopes::open', ({ mode = null, product_id = null }) => {
|
|
55
59
|
if (!!mode)
|
|
56
60
|
this.mode = mode;
|
|
57
|
-
this.isDefault = !mode || mode == ModeType.DEFAULT;
|
|
58
61
|
this.open(mode, product_id);
|
|
59
62
|
});
|
|
60
|
-
salla.lang.
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
this.scopeSearchPlaceholder = salla.lang.get('blocks.scope.searching_for_a_branch');
|
|
68
|
-
});
|
|
63
|
+
this.branchNotFound = salla.lang.get("blocks.scope.branch_looking_for_not_found");
|
|
64
|
+
this.ourServiceIsNotFound = salla.lang.get("blocks.scope.our_services_not_available_in_this_branch");
|
|
65
|
+
this.searchForAvailabilityInOtherBranch = salla.lang.get('blocks.scope.search_for_availability_in_other_branches');
|
|
66
|
+
this.shoppingFromAnotherBranch = salla.lang.get("blocks.scope.shopping_from_another_branch");
|
|
67
|
+
this.nowBrowsingFrom = salla.lang.get('blocks.scope.you_are_browse_store_from');
|
|
68
|
+
this.confirmButton = salla.lang.get('common.elements.confirm');
|
|
69
|
+
this.scopeSearchPlaceholder = salla.lang.get('blocks.scope.searching_for_a_branch');
|
|
69
70
|
}
|
|
70
71
|
async close() {
|
|
71
72
|
var _a;
|
|
72
73
|
return await ((_a = this.modal) === null || _a === void 0 ? void 0 : _a.close());
|
|
73
74
|
}
|
|
74
75
|
async open(mode = ModeType.DEFAULT, product_id = null) {
|
|
76
|
+
this.isDefault = !mode || mode == ModeType.DEFAULT;
|
|
75
77
|
this.modal.open();
|
|
76
78
|
return await (mode == ModeType.AVAILABILITY ? salla.scope.getProductAvailability(product_id) : salla.scope.get())
|
|
77
79
|
.then((resp) => {
|
|
@@ -87,11 +89,11 @@ const SallaScopees = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
|
87
89
|
});
|
|
88
90
|
}
|
|
89
91
|
async handleSubmit() {
|
|
90
|
-
salla.storage.set("branch-choosed-before", true);
|
|
91
92
|
let payload = { 'scope_id': this.current_scope.id };
|
|
92
93
|
this.changeBtn.load();
|
|
93
94
|
return await salla.scope.change(payload)
|
|
94
95
|
.then(() => {
|
|
96
|
+
salla.storage.set("branch-choosed-before", true);
|
|
95
97
|
window.location.reload();
|
|
96
98
|
}).catch(e => console.log(e))
|
|
97
99
|
.finally(() => {
|
|
@@ -126,30 +128,30 @@ const SallaScopees = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
|
126
128
|
return h("salla-placeholder", { alignment: "center", class: "s-scopes-placeholder" }, h("span", { slot: "title" }, this.branchNotFound), h("span", { slot: "description" }, this.ourServiceIsNotFound));
|
|
127
129
|
}
|
|
128
130
|
defaultContent() {
|
|
129
|
-
return [h("div", { class: "s-scopes-container s-scrollbar" }, this.scopes.map((scope) => h("div", { class: "s-scopes-input-wrap", "data-
|
|
131
|
+
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()];
|
|
130
132
|
}
|
|
131
133
|
availabilityContent() {
|
|
132
|
-
return h("div", { class: "s-scopes-container" }, this.scopes.map((scope) => h("div", { class: "s-scopes-input-wrap", "data-
|
|
134
|
+
return h("div", { class: "s-scopes-container" }, this.scopes.map((scope) => h("div", { class: "s-scopes-input-wrap", "data-selection": this.selection }, h("h2", { class: { "s-scopes-label": true, "s-scopes-clickable": this.isDefault } }, h("span", null, scope.name)), h("h2", { style: { 'color': scope.availability.color }, class: `s-scopes-${scope.availability.key}` }, scope.availability.label))));
|
|
133
135
|
}
|
|
134
136
|
footerContent() {
|
|
135
137
|
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" }, this.confirmButton)));
|
|
136
138
|
}
|
|
137
139
|
render() {
|
|
138
|
-
return (h(Host, null, h("salla-modal", { ref: modal => this.modal = modal, id: "s-scopes-modal", class: "s-scopes-modal", isLoading: true }, 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" }, this.nowBrowsingFrom), 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.
|
|
140
|
+
return (h(Host, null, h("salla-modal", { ref: modal => this.modal = modal, id: "s-scopes-modal", isClosable: this.selection == 'optional', class: "s-scopes-modal", isLoading: true }, 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" }, this.nowBrowsingFrom), 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 ?
|
|
139
141
|
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: this.scopeSearchPlaceholder }))
|
|
140
142
|
: "", this.scopes.length < 2 ?
|
|
141
143
|
this.placeholderContent()
|
|
142
144
|
: this.isDefault ? this.defaultContent() : this.availabilityContent()))));
|
|
143
145
|
}
|
|
144
|
-
|
|
145
|
-
if (!this.isOpenedBefore && this.
|
|
146
|
-
|
|
146
|
+
componentDidLoad() {
|
|
147
|
+
if (!this.isOpenedBefore && this.selection == 'mandatory') {
|
|
148
|
+
this.open();
|
|
147
149
|
}
|
|
148
150
|
}
|
|
149
151
|
static get style() { return sallaScopesCss; }
|
|
150
152
|
}, [4, "salla-scopes", {
|
|
151
|
-
"
|
|
152
|
-
"
|
|
153
|
+
"selection": [1],
|
|
154
|
+
"searchDisplayLimit": [2, "search-display-limit"],
|
|
153
155
|
"mode": [32],
|
|
154
156
|
"current_scope": [32],
|
|
155
157
|
"scopes": [32],
|
package/dist/esm/loader.js
CHANGED
|
@@ -13,7 +13,7 @@ const patchEsm = () => {
|
|
|
13
13
|
const defineCustomElements = (win, options) => {
|
|
14
14
|
if (typeof window === 'undefined') return Promise.resolve();
|
|
15
15
|
return patchEsm().then(() => {
|
|
16
|
-
return bootstrapLazy([["salla-button_23",[[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],"points":[32],"exchange_points":[32],"are_you_sure_to_exchange":[32],"for":[32],"cancel":[32],"confirm":[32],"cart_total_point_summary":[32],"cart_point_exchange_now":[32],"login_button":[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"],"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],"open":[64]},[[8,"verified","onVerified"]]],[4,"salla-scopes",{"
|
|
16
|
+
return bootstrapLazy([["salla-button_23",[[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],"points":[32],"exchange_points":[32],"are_you_sure_to_exchange":[32],"for":[32],"cancel":[32],"confirm":[32],"cart_total_point_summary":[32],"cart_point_exchange_now":[32],"login_button":[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"],"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],"open":[64]},[[8,"verified","onVerified"]]],[4,"salla-scopes",{"selection":[1],"searchDisplayLimit":[2,"search-display-limit"],"mode":[32],"current_scope":[32],"scopes":[32],"originalScopesList":[32],"branchNotFound":[32],"ourServiceIsNotFound":[32],"searchForAvailabilityInOtherBranch":[32],"shoppingFromAnotherBranch":[32],"nowBrowsingFrom":[32],"confirmButton":[32],"scopeSearchPlaceholder":[32],"selected_scope":[32],"isDefault":[32],"isOpenedBefore":[32],"close":[64],"open":[64],"handleSubmit":[64]}],[0,"salla-rating-modal",{"orderId":[2,"order-id"],"order":[32],"open":[64],"close":[64]}],[0,"salla-localization-modal",{"language":[1537],"currency":[1537],"languages":[32],"currencies":[32],"languagesTitle":[32],"currenciesTitle":[32],"isLoading":[32],"open":[64],"close":[64],"submit":[64]}],[0,"salla-offer-modal",{"offer":[32],"offer_name":[32],"offer_message":[32],"offer_expires_in":[32],"remember_my_choice":[32],"add_to_cart":[32],"out_of_stock":[32],"open":[64],"showOffer":[64]}],[0,"salla-search",{"inline":[4],"oval":[4],"height":[2],"results":[32],"placeholder":[32],"noResultsText":[32],"typing":[32],"debounce":[32],"search_term":[32]}],[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]}],[0,"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]}],[4,"salla-verify",{"display":[1],"type":[1025],"autoReload":[4,"auto-reload"],"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"],"direction":[1],"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,"onSelect","onSelectedTab"]]],[4,"salla-placeholder",{"icon":[1],"alignment":[1],"iconSize":[1,"icon-size"],"default_title":[32],"default_description":[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]}],[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"],"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-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]}]]],["salla-quantity-input",[[4,"salla-quantity-input",{"quantity":[32],"decrease":[64],"increase":[64],"setValue":[64]}]]]], options);
|
|
17
17
|
});
|
|
18
18
|
};
|
|
19
19
|
|
|
@@ -1533,9 +1533,13 @@ const SallaScopees = class {
|
|
|
1533
1533
|
this.isDefault = true;
|
|
1534
1534
|
this.isOpenedBefore = salla.storage.get("branch-choosed-before");
|
|
1535
1535
|
/**
|
|
1536
|
-
*
|
|
1536
|
+
* Optionally open the modal or enforce the pop-up to the viewer
|
|
1537
1537
|
*/
|
|
1538
|
-
this.
|
|
1538
|
+
this.selection = 'optional';
|
|
1539
|
+
/**
|
|
1540
|
+
* Dictates when to show the search field
|
|
1541
|
+
*/
|
|
1542
|
+
this.searchDisplayLimit = 6;
|
|
1539
1543
|
this.getFormTitle = () => {
|
|
1540
1544
|
var _a;
|
|
1541
1545
|
if (((_a = this.originalScopesList) === null || _a === void 0 ? void 0 : _a.length) < 2)
|
|
@@ -1547,24 +1551,22 @@ const SallaScopees = class {
|
|
|
1547
1551
|
salla.event.on('scopes::open', ({ mode = null, product_id = null }) => {
|
|
1548
1552
|
if (!!mode)
|
|
1549
1553
|
this.mode = mode;
|
|
1550
|
-
this.isDefault = !mode || mode == ModeType.DEFAULT;
|
|
1551
1554
|
this.open(mode, product_id);
|
|
1552
1555
|
});
|
|
1553
|
-
salla.lang.
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
this.scopeSearchPlaceholder = salla.lang.get('blocks.scope.searching_for_a_branch');
|
|
1561
|
-
});
|
|
1556
|
+
this.branchNotFound = salla.lang.get("blocks.scope.branch_looking_for_not_found");
|
|
1557
|
+
this.ourServiceIsNotFound = salla.lang.get("blocks.scope.our_services_not_available_in_this_branch");
|
|
1558
|
+
this.searchForAvailabilityInOtherBranch = salla.lang.get('blocks.scope.search_for_availability_in_other_branches');
|
|
1559
|
+
this.shoppingFromAnotherBranch = salla.lang.get("blocks.scope.shopping_from_another_branch");
|
|
1560
|
+
this.nowBrowsingFrom = salla.lang.get('blocks.scope.you_are_browse_store_from');
|
|
1561
|
+
this.confirmButton = salla.lang.get('common.elements.confirm');
|
|
1562
|
+
this.scopeSearchPlaceholder = salla.lang.get('blocks.scope.searching_for_a_branch');
|
|
1562
1563
|
}
|
|
1563
1564
|
async close() {
|
|
1564
1565
|
var _a;
|
|
1565
1566
|
return await ((_a = this.modal) === null || _a === void 0 ? void 0 : _a.close());
|
|
1566
1567
|
}
|
|
1567
1568
|
async open(mode = ModeType.DEFAULT, product_id = null) {
|
|
1569
|
+
this.isDefault = !mode || mode == ModeType.DEFAULT;
|
|
1568
1570
|
this.modal.open();
|
|
1569
1571
|
return await (mode == ModeType.AVAILABILITY ? salla.scope.getProductAvailability(product_id) : salla.scope.get())
|
|
1570
1572
|
.then((resp) => {
|
|
@@ -1580,11 +1582,11 @@ const SallaScopees = class {
|
|
|
1580
1582
|
});
|
|
1581
1583
|
}
|
|
1582
1584
|
async handleSubmit() {
|
|
1583
|
-
salla.storage.set("branch-choosed-before", true);
|
|
1584
1585
|
let payload = { 'scope_id': this.current_scope.id };
|
|
1585
1586
|
this.changeBtn.load();
|
|
1586
1587
|
return await salla.scope.change(payload)
|
|
1587
1588
|
.then(() => {
|
|
1589
|
+
salla.storage.set("branch-choosed-before", true);
|
|
1588
1590
|
window.location.reload();
|
|
1589
1591
|
}).catch(e => console.log(e))
|
|
1590
1592
|
.finally(() => {
|
|
@@ -1619,24 +1621,24 @@ const SallaScopees = class {
|
|
|
1619
1621
|
return h("salla-placeholder", { alignment: "center", class: "s-scopes-placeholder" }, h("span", { slot: "title" }, this.branchNotFound), h("span", { slot: "description" }, this.ourServiceIsNotFound));
|
|
1620
1622
|
}
|
|
1621
1623
|
defaultContent() {
|
|
1622
|
-
return [h("div", { class: "s-scopes-container s-scrollbar" }, this.scopes.map((scope) => h("div", { class: "s-scopes-input-wrap", "data-
|
|
1624
|
+
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()];
|
|
1623
1625
|
}
|
|
1624
1626
|
availabilityContent() {
|
|
1625
|
-
return h("div", { class: "s-scopes-container" }, this.scopes.map((scope) => h("div", { class: "s-scopes-input-wrap", "data-
|
|
1627
|
+
return h("div", { class: "s-scopes-container" }, this.scopes.map((scope) => h("div", { class: "s-scopes-input-wrap", "data-selection": this.selection }, h("h2", { class: { "s-scopes-label": true, "s-scopes-clickable": this.isDefault } }, h("span", null, scope.name)), h("h2", { style: { 'color': scope.availability.color }, class: `s-scopes-${scope.availability.key}` }, scope.availability.label))));
|
|
1626
1628
|
}
|
|
1627
1629
|
footerContent() {
|
|
1628
1630
|
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" }, this.confirmButton)));
|
|
1629
1631
|
}
|
|
1630
1632
|
render() {
|
|
1631
|
-
return (h(Host, null, h("salla-modal", { ref: modal => this.modal = modal, id: "s-scopes-modal", class: "s-scopes-modal", isLoading: true }, 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" }, this.nowBrowsingFrom), 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.
|
|
1633
|
+
return (h(Host, null, h("salla-modal", { ref: modal => this.modal = modal, id: "s-scopes-modal", isClosable: this.selection == 'optional', class: "s-scopes-modal", isLoading: true }, 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" }, this.nowBrowsingFrom), 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 ?
|
|
1632
1634
|
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: this.scopeSearchPlaceholder }))
|
|
1633
1635
|
: "", this.scopes.length < 2 ?
|
|
1634
1636
|
this.placeholderContent()
|
|
1635
1637
|
: this.isDefault ? this.defaultContent() : this.availabilityContent()))));
|
|
1636
1638
|
}
|
|
1637
|
-
|
|
1638
|
-
if (!this.isOpenedBefore && this.
|
|
1639
|
-
|
|
1639
|
+
componentDidLoad() {
|
|
1640
|
+
if (!this.isOpenedBefore && this.selection == 'mandatory') {
|
|
1641
|
+
this.open();
|
|
1640
1642
|
}
|
|
1641
1643
|
}
|
|
1642
1644
|
};
|