@salla.sa/twilight-components 1.0.51 → 1.0.52

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.
@@ -50,7 +50,8 @@ const SallaInfiniteScroll = class {
50
50
  this.btnLoader.style.display = isLoading ? 'inherit' : 'none';
51
51
  }
52
52
  componentWillLoad() {
53
- this.nextPageAutoload = ['', 'true'].includes(this.host.getAttribute('next-page.autoload').toLowerCase());
53
+ var _a;
54
+ this.nextPageAutoload = ['', 'true'].includes((_a = this.host.getAttribute('next-page.autoload')) === null || _a === void 0 ? void 0 : _a.toLowerCase());
54
55
  }
55
56
  render() {
56
57
  return this.nextPage.length > 1 ?
@@ -44,7 +44,8 @@ export class SallaInfiniteScroll {
44
44
  this.btnLoader.style.display = isLoading ? 'inherit' : 'none';
45
45
  }
46
46
  componentWillLoad() {
47
- this.nextPageAutoload = ['', 'true'].includes(this.host.getAttribute('next-page.autoload').toLowerCase());
47
+ var _a;
48
+ this.nextPageAutoload = ['', 'true'].includes((_a = this.host.getAttribute('next-page.autoload')) === null || _a === void 0 ? void 0 : _a.toLowerCase());
48
49
  }
49
50
  render() {
50
51
  return this.nextPage.length > 1 ?
@@ -46,7 +46,8 @@ const SallaInfiniteScroll = class {
46
46
  this.btnLoader.style.display = isLoading ? 'inherit' : 'none';
47
47
  }
48
48
  componentWillLoad() {
49
- this.nextPageAutoload = ['', 'true'].includes(this.host.getAttribute('next-page.autoload').toLowerCase());
49
+ var _a;
50
+ this.nextPageAutoload = ['', 'true'].includes((_a = this.host.getAttribute('next-page.autoload')) === null || _a === void 0 ? void 0 : _a.toLowerCase());
50
51
  }
51
52
  render() {
52
53
  return this.nextPage.length > 1 ?
@@ -1 +1 @@
1
- import{r as t,h as s,H as n,g as i}from"./p-cb1c59a2.js";import{H as l}from"./p-ed1c00c5.js";const e=class{constructor(s){t(this,s),this.nextPage="",this.nextPageAutoload=!1,this.container=".s-infinite-scroll-container",this.item=".list-block",l.setHost(this.host),this.status=document.createElement("div"),this.status.className="s-infinite-scroll-wrapper",this.status.innerHTML=`<div class="s-infinite-scroll-status" style="display:none">\n <p class="s-infinite-scroll-last infinite-scroll-last"></p>\n <p class="s-infinite-scroll-error infinite-scroll-error"></p>\n </div>\n <a href="${this.nextPage}" class="s-infinite-scroll-btn s-button-btn btn--has-loading s-button-primary">\n <span class="s-button-text s-infinite-scroll-btn-text">${salla.lang.get("common.elements.load_more")}</span>\n <span class="s-button-loader s-button-loader-center s-infinite-scroll-btn-loader" style="display: none"></span>\n </a>`,this.btnLoader=this.status.querySelector(".s-button-loader"),salla.event.on("languages::translations.loaded",(()=>{this.status.querySelector(".s-button-text").innerHTML=salla.lang.get("common.elements.load_more"),this.status.querySelector(".s-infinite-scroll-last").innerHTML=salla.lang.get("common.elements.end_of_content"),this.status.querySelector(".s-infinite-scroll-error").innerHTML=salla.lang.get("common.elements.failed_to_load_more")}))}loading(t=!0){let s=this.status.querySelector(".s-button-text");l.toggleElement(s,"s-button-hide","s-button-show",(()=>t)),this.btnLoader.style.display=t?"inherit":"none"}componentWillLoad(){this.nextPageAutoload=["","true"].includes(this.host.getAttribute("next-page.autoload").toLowerCase())}render(){return this.nextPage.length>1?s(n,{class:"s-infinite-scroll-container"},s("slot",null)):""}componentDidLoad(){if(0===this.nextPage.length)return;this.host.insertAdjacentElement("afterend",this.status);let t=this,s=salla.infiniteScroll.initiate(this.container,{history:!!this.nextPageAutoload&&"push",scrollThreshold:!!this.nextPageAutoload&&400,nextPage:this.nextPage,checkLastPage:'salla-infinite-scroll[next-page*=":"],salla-infinite-scroll[next-page*="."]',status:".s-infinite-scroll-status",button:this.status.querySelector(".s-button-btn"),append:this.item,path:function(){return t.nextPage.replace(/page\=(\d)/g,"page="+(this.loadCount+2))}}).on("request",(()=>this.loading())).on("load",(()=>{this.loading(!1),2==s.pageIndex&&s.option({loadOnScroll:!1}),3==s.pageIndex&&s.option({loadOnScroll:!0})})).on("error",(()=>this.loading(!1)))}get host(){return i(this)}};e.style="";export{e as salla_infinite_scroll}
1
+ import{r as t,h as s,H as n,g as i}from"./p-cb1c59a2.js";import{H as l}from"./p-ed1c00c5.js";const e=class{constructor(s){t(this,s),this.nextPage="",this.nextPageAutoload=!1,this.container=".s-infinite-scroll-container",this.item=".list-block",l.setHost(this.host),this.status=document.createElement("div"),this.status.className="s-infinite-scroll-wrapper",this.status.innerHTML=`<div class="s-infinite-scroll-status" style="display:none">\n <p class="s-infinite-scroll-last infinite-scroll-last"></p>\n <p class="s-infinite-scroll-error infinite-scroll-error"></p>\n </div>\n <a href="${this.nextPage}" class="s-infinite-scroll-btn s-button-btn btn--has-loading s-button-primary">\n <span class="s-button-text s-infinite-scroll-btn-text">${salla.lang.get("common.elements.load_more")}</span>\n <span class="s-button-loader s-button-loader-center s-infinite-scroll-btn-loader" style="display: none"></span>\n </a>`,this.btnLoader=this.status.querySelector(".s-button-loader"),salla.event.on("languages::translations.loaded",(()=>{this.status.querySelector(".s-button-text").innerHTML=salla.lang.get("common.elements.load_more"),this.status.querySelector(".s-infinite-scroll-last").innerHTML=salla.lang.get("common.elements.end_of_content"),this.status.querySelector(".s-infinite-scroll-error").innerHTML=salla.lang.get("common.elements.failed_to_load_more")}))}loading(t=!0){let s=this.status.querySelector(".s-button-text");l.toggleElement(s,"s-button-hide","s-button-show",(()=>t)),this.btnLoader.style.display=t?"inherit":"none"}componentWillLoad(){var t;this.nextPageAutoload=["","true"].includes(null===(t=this.host.getAttribute("next-page.autoload"))||void 0===t?void 0:t.toLowerCase())}render(){return this.nextPage.length>1?s(n,{class:"s-infinite-scroll-container"},s("slot",null)):""}componentDidLoad(){if(0===this.nextPage.length)return;this.host.insertAdjacentElement("afterend",this.status);let t=this,s=salla.infiniteScroll.initiate(this.container,{history:!!this.nextPageAutoload&&"push",scrollThreshold:!!this.nextPageAutoload&&400,nextPage:this.nextPage,checkLastPage:'salla-infinite-scroll[next-page*=":"],salla-infinite-scroll[next-page*="."]',status:".s-infinite-scroll-status",button:this.status.querySelector(".s-button-btn"),append:this.item,path:function(){return t.nextPage.replace(/page\=(\d)/g,"page="+(this.loadCount+2))}}).on("request",(()=>this.loading())).on("load",(()=>{this.loading(!1),2==s.pageIndex&&s.option({loadOnScroll:!1}),3==s.pageIndex&&s.option({loadOnScroll:!0})})).on("error",(()=>this.loading(!1)))}get host(){return i(this)}};e.style="";export{e as salla_infinite_scroll}
@@ -1 +1 @@
1
- import{p as e,b as l}from"./p-cb1c59a2.js";(()=>{const l=import.meta.url,o={};return""!==l&&(o.resourcesUrl=new URL(".",l).href),e(o)})().then((e=>l([["p-88d1bb89",[[4,"salla-button",{btnStyle:[513,"btn-style"],loading:[516],disabled:[516],loaderPosition:[1,"loader-position"],wide:[4],load:[64],stop:[64],setText:[64],disable:[64],enable:[64]}]]],["p-ea455ae9",[[0,"salla-search",{results:[32],placeholder:[32],noResultsText:[32]},[[0,"modalOpened","onModalOpen"],[0,"modalClosed","onModalClose"]]],[4,"salla-modal",{isClosable:[1028,"is-closable"],width:[513],position:[513],visible:[516],isLoading:[1540,"is-loading"],subTitleFirst:[4,"sub-title-first"],noPadding:[4,"no-padding"],subTitle:[1,"sub-title"],icon:[1],iconStyle:[1,"icon-style"],imageIcon:[1,"image-icon"],title:[32],show:[64],hide:[64],setTitle:[64],loading:[64],stopLoading:[64]}]]],["p-2e03db57",[[4,"salla-login-modal",{isEmailAllowed:[1028,"is-email-allowed"],isMobileAllowed:[1028,"is-mobile-allowed"],isEmailRequired:[1028,"is-email-required"],title:[32],loginTypeTitle:[32],loginText:[32],smsLabel:[32],mobileLabel:[32],emailLabel:[32],enterText:[32],bySMSText:[32],byEmailText:[32],emailErrorMsg:[32],firstNameLabel:[32],lastNameLabel:[32],firstNameErrorMsg:[32],lastNameErrorMsg:[32],show:[64]},[[0,"verified","onVerified"]]]]],["p-c0a7b5a2",[[4,"salla-product-availability",{channels:[1],productId:[2,"product-id"],isSubscribed:[1028,"is-subscribed"],subTitle:[32],mobileLabel:[32],emailLabel:[32],emailPlaceholder:[32],subscribedMessage:[32],title_:[32],emailErrorMsg:[32],isVisitorSubscribed:[32]}]]],["p-e6c67b55",[[4,"salla-branches",{position:[1],displayAs:[1,"display-as"],browseProductsFrom:[1,"browse-products-from"],branches:[16],current:[1026],open:[32],selected:[32],isOpenedBefore:[32],show:[64],hide:[64]}]]],["p-1f873057",[[0,"salla-localization-modal",{language:[1537],currency:[1537],languages:[32],currencies:[32],languagesTitle:[32],currenciesTitle:[32],isLoading:[32],show:[64],hide:[64],submit:[64]}]]],["p-8bfa19fb",[[0,"salla-offer-modal",{offer:[32],offer_name:[32],offer_message:[32],offer_expires_in:[32],remember_my_choice:[32],show:[64],showOffer:[64]}]]],["p-85427280",[[0,"salla-rating-modal",{orderId:[2,"order-id"],order:[32],show:[64],hide:[64]}]]],["p-f89bc866",[[4,"salla-infinite-scroll",{nextPage:[1,"next-page"],nextPageAutoload:[1028,"next-page-autoload"],container:[1],item:[1],loadMore:[32],noMore:[32],failedToLoad:[32]}]]],["p-f0f51a3c",[[4,"salla-verify-modal",{withoutModal:[4,"without-modal"],url:[513],by:[1],autoReload:[4,"auto-reload"],title:[32],getCode:[64],show:[64]}]]],["p-05dff05e",[[0,"salla-tel-input",{mobile:[1025],countryCode:[1025,"country-code"],countryKey:[1025,"country-key"],mobileRequired:[32],countryCodeLabel:[32],mobileLabel:[32],tooShort:[32],tooLong:[32],invalidCountryCode:[32],invalidNumber:[32],errorMap:[32],getValues:[64],isValid:[64]}]]]],e)));
1
+ import{p as e,b as l}from"./p-cb1c59a2.js";(()=>{const l=import.meta.url,o={};return""!==l&&(o.resourcesUrl=new URL(".",l).href),e(o)})().then((e=>l([["p-88d1bb89",[[4,"salla-button",{btnStyle:[513,"btn-style"],loading:[516],disabled:[516],loaderPosition:[1,"loader-position"],wide:[4],load:[64],stop:[64],setText:[64],disable:[64],enable:[64]}]]],["p-ea455ae9",[[0,"salla-search",{results:[32],placeholder:[32],noResultsText:[32]},[[0,"modalOpened","onModalOpen"],[0,"modalClosed","onModalClose"]]],[4,"salla-modal",{isClosable:[1028,"is-closable"],width:[513],position:[513],visible:[516],isLoading:[1540,"is-loading"],subTitleFirst:[4,"sub-title-first"],noPadding:[4,"no-padding"],subTitle:[1,"sub-title"],icon:[1],iconStyle:[1,"icon-style"],imageIcon:[1,"image-icon"],title:[32],show:[64],hide:[64],setTitle:[64],loading:[64],stopLoading:[64]}]]],["p-2e03db57",[[4,"salla-login-modal",{isEmailAllowed:[1028,"is-email-allowed"],isMobileAllowed:[1028,"is-mobile-allowed"],isEmailRequired:[1028,"is-email-required"],title:[32],loginTypeTitle:[32],loginText:[32],smsLabel:[32],mobileLabel:[32],emailLabel:[32],enterText:[32],bySMSText:[32],byEmailText:[32],emailErrorMsg:[32],firstNameLabel:[32],lastNameLabel:[32],firstNameErrorMsg:[32],lastNameErrorMsg:[32],show:[64]},[[0,"verified","onVerified"]]]]],["p-c0a7b5a2",[[4,"salla-product-availability",{channels:[1],productId:[2,"product-id"],isSubscribed:[1028,"is-subscribed"],subTitle:[32],mobileLabel:[32],emailLabel:[32],emailPlaceholder:[32],subscribedMessage:[32],title_:[32],emailErrorMsg:[32],isVisitorSubscribed:[32]}]]],["p-e6c67b55",[[4,"salla-branches",{position:[1],displayAs:[1,"display-as"],browseProductsFrom:[1,"browse-products-from"],branches:[16],current:[1026],open:[32],selected:[32],isOpenedBefore:[32],show:[64],hide:[64]}]]],["p-1f873057",[[0,"salla-localization-modal",{language:[1537],currency:[1537],languages:[32],currencies:[32],languagesTitle:[32],currenciesTitle:[32],isLoading:[32],show:[64],hide:[64],submit:[64]}]]],["p-8bfa19fb",[[0,"salla-offer-modal",{offer:[32],offer_name:[32],offer_message:[32],offer_expires_in:[32],remember_my_choice:[32],show:[64],showOffer:[64]}]]],["p-85427280",[[0,"salla-rating-modal",{orderId:[2,"order-id"],order:[32],show:[64],hide:[64]}]]],["p-e306c6bb",[[4,"salla-infinite-scroll",{nextPage:[1,"next-page"],nextPageAutoload:[1028,"next-page-autoload"],container:[1],item:[1],loadMore:[32],noMore:[32],failedToLoad:[32]}]]],["p-f0f51a3c",[[4,"salla-verify-modal",{withoutModal:[4,"without-modal"],url:[513],by:[1],autoReload:[4,"auto-reload"],title:[32],getCode:[64],show:[64]}]]],["p-05dff05e",[[0,"salla-tel-input",{mobile:[1025],countryCode:[1025,"country-code"],countryKey:[1025,"country-key"],mobileRequired:[32],countryCodeLabel:[32],mobileLabel:[32],tooShort:[32],tooLong:[32],invalidCountryCode:[32],invalidNumber:[32],errorMap:[32],getValues:[64],isValid:[64]}]]]],e)));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salla.sa/twilight-components",
3
- "version": "1.0.51",
3
+ "version": "1.0.52",
4
4
  "license": "MIT",
5
5
  "keywords": [
6
6
  "twilight",