@salla.sa/twilight-components 1.0.56 → 1.0.58
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.cjs.js +2 -2
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/salla-button.cjs.entry.js +7 -7
- package/dist/cjs/salla-conditional-fields.cjs.entry.js +76 -0
- package/dist/cjs/salla-infinite-scroll.cjs.entry.js +1 -1
- package/dist/cjs/{salla-login-modal-d0fb6180.js → salla-login-modal-02e4e65e.js} +5 -5
- package/dist/cjs/salla-login-modal.cjs.entry.js +1 -1
- package/dist/cjs/salla-modal_2.cjs.entry.js +5 -5
- package/dist/cjs/salla-offer-modal.cjs.entry.js +8 -3
- package/dist/cjs/salla-quantity-input.cjs.entry.js +64 -0
- package/dist/cjs/salla-rating-modal.cjs.entry.js +8 -8
- package/dist/cjs/{salla-search-f76c6d61.js → salla-search-9d17eb96.js} +3 -3
- package/dist/cjs/twilight-components.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +2 -0
- package/dist/collection/components/salla-button/salla-button.js +10 -10
- package/dist/collection/components/salla-conditional-fields/salla-conditional-fields.css +3 -0
- package/dist/collection/components/salla-conditional-fields/salla-conditional-fields.js +82 -0
- package/dist/collection/components/salla-infinite-scroll/salla-infinite-scroll.js +1 -1
- package/dist/collection/components/salla-login-modal/salla-login-modal.js +5 -5
- package/dist/collection/components/salla-modal/salla-modal.css +1 -4
- package/dist/collection/components/salla-modal/salla-modal.js +3 -3
- package/dist/collection/components/salla-offer-modal/salla-offer-modal.js +11 -4
- package/dist/collection/components/salla-quantity-input/salla-quantity-input.css +3 -0
- package/dist/collection/components/salla-quantity-input/salla-quantity-input.js +71 -0
- package/dist/collection/components/salla-rating-modal/salla-rating-modal.js +8 -8
- package/dist/collection/components/salla-search/salla-search.js +3 -3
- package/dist/esm/index.js +2 -2
- package/dist/esm/loader.js +1 -1
- package/dist/esm/salla-button.entry.js +7 -7
- package/dist/esm/salla-conditional-fields.entry.js +72 -0
- package/dist/esm/salla-infinite-scroll.entry.js +1 -1
- package/dist/esm/{salla-login-modal-63f03766.js → salla-login-modal-7ad386c8.js} +5 -5
- package/dist/esm/salla-login-modal.entry.js +1 -1
- package/dist/esm/salla-modal_2.entry.js +5 -5
- package/dist/esm/salla-offer-modal.entry.js +8 -3
- package/dist/esm/salla-quantity-input.entry.js +60 -0
- package/dist/esm/salla-rating-modal.entry.js +8 -8
- package/dist/esm/{salla-search-7521be0c.js → salla-search-ce45eb5b.js} +3 -3
- package/dist/esm/twilight-components.js +1 -1
- package/dist/twilight-components/index.esm.js +1 -1
- package/dist/twilight-components/p-1514ed09.js +1 -0
- package/dist/twilight-components/p-40693cd3.entry.js +1 -0
- package/dist/twilight-components/p-5d5b04ec.entry.js +1 -0
- package/dist/twilight-components/p-64977eab.entry.js +1 -0
- package/dist/twilight-components/p-6c928c14.entry.js +1 -0
- package/dist/twilight-components/p-7c4ba872.entry.js +1 -0
- package/dist/twilight-components/p-84936d9d.entry.js +1 -0
- package/dist/twilight-components/{p-e306c6bb.entry.js → p-884a80ca.entry.js} +1 -1
- package/dist/twilight-components/p-ebd63ad4.js +1 -0
- package/dist/twilight-components/p-ee9d8563.entry.js +1 -0
- package/dist/twilight-components/twilight-components.esm.js +1 -1
- package/dist/types/components/salla-button/salla-button.d.ts +2 -2
- package/dist/types/components/salla-conditional-fields/salla-conditional-fields.d.ts +9 -0
- package/dist/types/components/salla-offer-modal/salla-offer-modal.d.ts +2 -0
- package/dist/types/components/salla-quantity-input/salla-quantity-input.d.ts +18 -0
- package/dist/types/components.d.ts +34 -8
- package/example/dist/tailwind.css +944 -326
- package/example/dist/twilight.js +1 -1
- package/example/index.html +523 -123
- package/package.json +1 -1
- package/dist/twilight-components/p-05574321.entry.js +0 -1
- package/dist/twilight-components/p-134fa158.entry.js +0 -1
- package/dist/twilight-components/p-646fbb7f.entry.js +0 -1
- package/dist/twilight-components/p-85427280.entry.js +0 -1
- package/dist/twilight-components/p-88dce1e4.js +0 -1
- package/dist/twilight-components/p-a26e2e12.entry.js +0 -1
- package/dist/twilight-components/p-e4f716b0.js +0 -1
|
@@ -70,7 +70,7 @@ const SallaRatingModal = class {
|
|
|
70
70
|
// Loop through each star, and add or remove the `.selected` class to toggle highlighting
|
|
71
71
|
event.target
|
|
72
72
|
.querySelectorAll('.s-rating-modal-btn-star')
|
|
73
|
-
.forEach((star, index) => Helper.
|
|
73
|
+
.forEach((star, index) => Helper.toggleElementClassIf(star, 's-rating-modal-selected', 's-rating-modal-un-selected', () => index < selectedIndex));
|
|
74
74
|
// Remove aria-pressed from any previously selected star
|
|
75
75
|
event.target.querySelectorAll('.s-rating-modal-btn-star[aria-pressed="true"]').forEach(star => star.removeAttribute('aria-pressed'));
|
|
76
76
|
// Add aria-pressed role to the selected button
|
|
@@ -86,12 +86,12 @@ const SallaRatingModal = class {
|
|
|
86
86
|
showActiveStep(current = null) {
|
|
87
87
|
var _a;
|
|
88
88
|
this.currentTab = current || this.steps[this.currentIndex];
|
|
89
|
-
Helper.
|
|
90
|
-
.
|
|
89
|
+
Helper.toggleClassIf('.s-rating-modal-step-dot', 's-rating-modal-bg-gray', 's-rating-modal-bg-primary', dot => dot != this.dots[this.currentIndex])
|
|
90
|
+
.toggleClassIf('.s-rating-modal-step', 's-rating-modal-active', 's-rating-modal-hidden', tab => tab == this.currentTab);
|
|
91
91
|
if (this.currentIndex != 0) {
|
|
92
92
|
// the animation
|
|
93
|
-
Helper.
|
|
94
|
-
setTimeout(() => Helper.
|
|
93
|
+
Helper.toggleElementClassIf(this.currentTab, 's-rating-modal-unactive', 's-rating-modal-hidden', () => true);
|
|
94
|
+
setTimeout(() => Helper.toggleElementClassIf(this.currentTab, 's-rating-modal-active', 's-rating-modal-unactive', () => true), 300);
|
|
95
95
|
}
|
|
96
96
|
// Btn text
|
|
97
97
|
let nextType = (_a = this.steps[this.currentIndex + 1]) === null || _a === void 0 ? void 0 : _a.dataset.type;
|
|
@@ -123,7 +123,7 @@ const SallaRatingModal = class {
|
|
|
123
123
|
}
|
|
124
124
|
previousTab() {
|
|
125
125
|
this.currentIndex > 0 && this.currentIndex--;
|
|
126
|
-
Helper.
|
|
126
|
+
Helper.toggleElementClassIf(this.backBtn, 's-rating-modal-unvisiable', 'block', () => this.currentIndex == 0);
|
|
127
127
|
this.showActiveStep();
|
|
128
128
|
}
|
|
129
129
|
submit() {
|
|
@@ -134,7 +134,7 @@ const SallaRatingModal = class {
|
|
|
134
134
|
.then(() => this.currentTab.querySelectorAll('[name],.s-rating-modal-btn-star').forEach(el => el.setAttribute('disabled', '')))
|
|
135
135
|
.then(() => this.currentIndex < this.stepsCount && this.currentIndex++)
|
|
136
136
|
.then(() => this.showActiveStep())
|
|
137
|
-
.then(() => Helper.
|
|
137
|
+
.then(() => Helper.toggleClassIf('#prev-btn', 'block', 's-rating-modal-unvisiable', () => true))
|
|
138
138
|
.finally(() => {
|
|
139
139
|
this.nextBtn.stop();
|
|
140
140
|
salla.config.canLeave = true;
|
|
@@ -159,7 +159,7 @@ const SallaRatingModal = class {
|
|
|
159
159
|
return;
|
|
160
160
|
}
|
|
161
161
|
type = type || rating['dataset'].type;
|
|
162
|
-
Helper.
|
|
162
|
+
Helper.toggleElementClassIf(comment, 'save', 's-has-error', el => el.value.length > 3);
|
|
163
163
|
throw validationMessage.innerHTML = stars
|
|
164
164
|
? (salla.lang.get('common.errors.not_less_than_chars', { chars: 4 }) + ' ' + comment.getAttribute('placeholder'))
|
|
165
165
|
: salla.lang.get(`pages.rating.rate_${type}_stars`).replace(' (:item)', '');
|
|
@@ -49,7 +49,7 @@ const SallaSearch = class {
|
|
|
49
49
|
return;
|
|
50
50
|
}
|
|
51
51
|
//run loading spinner or stop it
|
|
52
|
-
Helper.
|
|
52
|
+
Helper.toggleElementClassIf(this.searchIcon, 's-search-spinner-loader', 'sicon-search', () => true);
|
|
53
53
|
salla.search.api.search(e.target.value)
|
|
54
54
|
.then(response => this.results = response)
|
|
55
55
|
.catch(err => err !== 'Query Same As Previous!' ? this.results = undefined : null)
|
|
@@ -58,8 +58,8 @@ const SallaSearch = class {
|
|
|
58
58
|
afterSearching(isEmpty = true) {
|
|
59
59
|
var _a;
|
|
60
60
|
this.noResults.style.display = isEmpty || ((_a = this.results) === null || _a === void 0 ? void 0 : _a.data.length) > 0 ? 'none' : 'block';
|
|
61
|
-
Helper.
|
|
62
|
-
.
|
|
61
|
+
Helper.toggleElementClassIf(this.container, 's-search-container-open', 's-search-no-results', () => { var _a; return (_a = this.results) === null || _a === void 0 ? void 0 : _a.data.length; })
|
|
62
|
+
.toggleElementClassIf(this.searchIcon, 's-search-spinner-loader', 'sicon-search', () => false); //stop searching anime
|
|
63
63
|
salla.search.api.previousQuery = ''; //avoid having error 'Query Same As Previous' after reopen modal;
|
|
64
64
|
this.inputValue.length == 0 ? this.container.classList.remove('s-search-no-results') : '';
|
|
65
65
|
}
|
|
@@ -13,5 +13,5 @@ const patchBrowser = () => {
|
|
|
13
13
|
};
|
|
14
14
|
|
|
15
15
|
patchBrowser().then(options => {
|
|
16
|
-
return bootstrapLazy([["salla-button",[[4,"salla-button",{"
|
|
16
|
+
return bootstrapLazy([["salla-button",[[4,"salla-button",{"shape":[513],"color":[513],"fill":[513],"size":[513],"width":[513],"loading":[516],"disabled":[516],"loaderPosition":[1,"loader-position"],"wide":[4],"href":[1],"load":[64],"stop":[64],"setText":[64],"disable":[64],"enable":[64]}]]],["salla-modal_2",[[0,"salla-search",{"inline":[4],"oval":[4],"height":[2],"results":[32],"placeholder":[32],"noResultsText":[32]},[[0,"modalOpened","onModalOpen"],[0,"modalClosed","onModalClose"]]],[4,"salla-modal",{"isClosable":[1028,"is-closable"],"width":[513],"position":[513],"visible":[516],"isLoading":[1540,"is-loading"],"subTitleFirst":[4,"sub-title-first"],"noPadding":[4,"no-padding"],"subTitle":[1,"sub-title"],"icon":[1],"iconStyle":[1,"icon-style"],"imageIcon":[1,"image-icon"],"title":[32],"show":[64],"hide":[64],"setTitle":[64],"loading":[64],"stopLoading":[64]}]]],["salla-login-modal",[[4,"salla-login-modal",{"isEmailAllowed":[1028,"is-email-allowed"],"isMobileAllowed":[1028,"is-mobile-allowed"],"isEmailRequired":[1028,"is-email-required"],"title":[32],"loginTypeTitle":[32],"loginText":[32],"smsLabel":[32],"mobileLabel":[32],"emailLabel":[32],"enterText":[32],"bySMSText":[32],"byEmailText":[32],"emailErrorMsg":[32],"firstNameLabel":[32],"lastNameLabel":[32],"firstNameErrorMsg":[32],"lastNameErrorMsg":[32],"show":[64]},[[0,"verified","onVerified"]]]]],["salla-product-availability",[[4,"salla-product-availability",{"channels":[1],"productId":[2,"product-id"],"isSubscribed":[1028,"is-subscribed"],"subTitle":[32],"mobileLabel":[32],"emailLabel":[32],"emailPlaceholder":[32],"subscribedMessage":[32],"title_":[32],"emailErrorMsg":[32],"isVisitorSubscribed":[32]}]]],["salla-branches",[[4,"salla-branches",{"position":[1],"displayAs":[1,"display-as"],"browseProductsFrom":[1,"browse-products-from"],"branches":[16],"current":[1026],"open":[32],"selected":[32],"isOpenedBefore":[32],"show":[64],"hide":[64]}]]],["salla-localization-modal",[[0,"salla-localization-modal",{"language":[1537],"currency":[1537],"languages":[32],"currencies":[32],"languagesTitle":[32],"currenciesTitle":[32],"isLoading":[32],"show":[64],"hide":[64],"submit":[64]}]]],["salla-offer-modal",[[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],"show":[64],"showOffer":[64]}]]],["salla-rating-modal",[[0,"salla-rating-modal",{"orderId":[2,"order-id"],"order":[32],"show":[64],"hide":[64]}]]],["salla-conditional-fields",[[4,"salla-conditional-fields",null,[[0,"change","changeHandler"]]]]],["salla-infinite-scroll",[[4,"salla-infinite-scroll",{"nextPage":[1,"next-page"],"nextPageAutoload":[1028,"next-page-autoload"],"container":[1],"item":[1],"loadMore":[32],"noMore":[32],"failedToLoad":[32]}]]],["salla-quantity-input",[[4,"salla-quantity-input",{"quantity":[32]}]]],["salla-verify-modal",[[4,"salla-verify-modal",{"withoutModal":[4,"without-modal"],"url":[513],"by":[1],"autoReload":[4,"auto-reload"],"title":[32],"getCode":[64],"show":[64]}]]],["salla-tel-input",[[0,"salla-tel-input",{"mobile":[1025],"countryCode":[1025,"country-code"],"countryKey":[1025,"country-key"],"mobileRequired":[32],"countryCodeLabel":[32],"mobileLabel":[32],"tooShort":[32],"tooLong":[32],"invalidCountryCode":[32],"invalidNumber":[32],"errorMap":[32],"getValues":[64],"isValid":[64]}]]]], options);
|
|
17
17
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{S as SallaLoginModal}from"./p-
|
|
1
|
+
export{S as SallaLoginModal}from"./p-ebd63ad4.js";export{S as SallaSearch}from"./p-1514ed09.js";import"./p-cb1c59a2.js";import"./p-ed1c00c5.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as s,h as a,g as e}from"./p-cb1c59a2.js";import{H as r}from"./p-ed1c00c5.js";const i=class{constructor(a){var e;s(this,a),this.inputValue="",this.inline=!1,this.oval=!1,this.height=60,r.setHost(this.host),this.productSlot=(null===(e=r.getElement('[slot="product"]'))||void 0===e?void 0:e.innerHTML)||this.getDefaultProductSlot(),salla.event.on("search::show",(()=>this.modal.show())),salla.event.on("languages::translations.loaded",(()=>{this.placeholder=salla.lang.get("blocks.header.search_placeholder"),this.noResultsText=salla.lang.get("common.elements.no_options")}))}onModalOpen(){this.modal.querySelector(".s-search-input").focus()}onModalClose(){this.modal.querySelector(".s-search-input").value="",this.results=void 0,this.afterSearching(),this.container.classList.remove("s-search-no-results")}getDefaultProductSlot(){return'<div class="s-search-product-image-container"> <img class="s-search-product-image" src="{image}" alt="{name}"/></div><div class="s-search-product-details"> <div class="s-search-product-title">{name}</div> <div class="s-search-product-price">{price}</div></div>'}search(s){if(this.inputValue=s.target.value,r.hideElement(this.noResults),0===s.target.value.length)return this.results=void 0,void this.afterSearching();s.target.value.length<=2||(r.toggleElementClassIf(this.searchIcon,"s-search-spinner-loader","sicon-search",(()=>!0)),salla.search.api.search(s.target.value).then((s=>this.results=s)).catch((s=>"Query Same As Previous!"!==s?this.results=void 0:null)).finally((()=>this.afterSearching(!1))))}afterSearching(s=!0){var a;this.noResults.style.display=s||(null===(a=this.results)||void 0===a?void 0:a.data.length)>0?"none":"block",r.toggleElementClassIf(this.container,"s-search-container-open","s-search-no-results",(()=>{var s;return null===(s=this.results)||void 0===s?void 0:s.data.length})).toggleElementClassIf(this.searchIcon,"s-search-spinner-loader","sicon-search",(()=>!1)),salla.search.api.previousQuery="",0==this.inputValue.length&&this.container.classList.remove("s-search-no-results")}render(){var s;const e=a("div",{class:{"s-search-container":!0,"s-search-inline":this.inline},ref:s=>this.container=s,style:this.oval?{borderRadius:this.height/2+"px"}:{}},a("input",{class:"s-search-input",type:"text",placeholder:this.placeholder,onInput:s=>this.search(s),style:{height:this.height+"px"}}),a("span",{class:"s-search-icon-wrap"},a("i",{class:"s-search-icon sicon-search",ref:s=>this.searchIcon=s})),a("div",{class:"s-search-results"},null===(s=this.results)||void 0===s?void 0:s.data.map((s=>a("a",{href:s.url,class:"s-search-product",innerHTML:this.productSlot.replace(/\{name\}/g,s.name).replace(/\{price\}/g,s.price).replace(/\{image\}/g,s.image_url)}))),a("p",{ref:s=>this.noResults=s,class:"s-search-no-results-placeholder"},this.noResultsText)));return this.inline?a("div",{id:"s-search-modal"},e):a("salla-modal",{position:"top",id:"s-search-modal",ref:s=>this.modal=s},e)}componentDidLoad(){this.afterSearching()}get host(){return e(this)}};i.style="#s-search-modal .s-search-inline{border:1px solid #eee}#s-search-modal .s-search-no-results .s-search-input,#s-search-modal .s-search-container-open .s-search-input{border-bottom:1px solid #f4f4f5}#s-search-modal .s-search-product-image[src=null]{opacity:0}#s-search-modal .s-modal-wrapper{align-items:flex-start;padding:0}#s-search-modal .s-modal-spacer{display:inline}#s-search-modal .s-modal-body{padding:0;max-width:90%;margin-top:3.2rem;border-radius:0.5rem;background:transparent;overflow:visible}#s-search-modal .s-modal-close{top:50%;transform:translateY(-50%)}";export{i as S}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as t,h as s,H as o,g as n}from"./p-cb1c59a2.js";const e=class{constructor(s){t(this,s),this.hostAttributes={},this.shape="btn",this.color="primary",this.fill="solid",this.size="medium",this.width="normal",this.loading=!1,this.disabled=!1,this.loaderPosition="after",this.wide=!1,this.wide&&this.host.classList.add("s-button-wide")}async load(){return"center"==this.loaderPosition&&this.text.classList.add("s-button-hide"),this.host.setAttribute("loading",""),this.host}async stop(){return this.host.removeAttribute("loading"),"center"==this.loaderPosition&&this.text.classList.remove("s-button-hide"),this.host}async setText(t){return this.text.innerHTML=t,this.host}async disable(){return this.host.setAttribute("disabled",""),this.host}async enable(){return this.host.removeAttribute("disabled"),this.host}getBtnAttributes(){for(let t=0;t<this.host.attributes.length;t++)["color","fill","size","width","id","loading"].includes(this.host.attributes[t].name)||(this.hostAttributes[this.host.attributes[t].name]=this.host.attributes[t].value);return this.hostAttributes.type=this.hostAttributes.type||"button",this.hostAttributes.class+=" s-button-element s-button-"+this.shape+" s-button-"+("none"==this.fill?"fill-none":this.fill)+("medium"!=this.size?" s-button-"+this.size:"")+("normal"!=this.width?" s-button-"+this.width:"")+("link"==this.shape?" s-button-"+this.color+"-link":"")+("link"!=this.shape&&"outline"!=this.fill?" s-button-"+this.color:"")+("outline"==this.fill?" s-button-"+this.color+"-outline":"")+(this.disabled?" s-button-disabled ":"")+("icon"==this.shape?" s-button-loader-center":" s-button-loader-"+this.loaderPosition),this.hostAttributes}render(){return s(o,{class:"s-button-wrap"},s("button",Object.assign({},this.getBtnAttributes(),{disabled:this.disabled}),s("span",{class:"s-button-text",ref:t=>this.text=t},s("slot",null)),this.loading?s("span",{class:"s-button-loader"}):""))}get host(){return n(this)}};e.style="salla-button{pointer-events:none}salla-button[type=submit]{-webkit-appearance:none}salla-button[width=wide]{width:100%}.s-button-wrap[loading]{pointer-events:none}.s-button-wrap[loading] .s-button-element{pointer-events:none !important}.s-button-wrap[loading] .s-button-loader-center .s-button-text{opacity:0}.s-button-wrap .s-button-element[loading]{pointer-events:none !important}.s-button-wrap .s-button-element:not(:disabled){pointer-events:auto}.s-button-wrap .s-button-solid .s-button-loader:before{border-color:#fff #fff rgba(255, 255, 255, 0.2) rgba(255, 255, 255, 0.2)}.s-button-wrap .s-button-outline{border:1px solid currentColor}.s-button-wrap .s-button-outline:hover{border-color:transparent}.s-button-wrap .s-button-outline .s-button-loader:before{border-top-color:currentColor;border-left-color:currentColor}.s-button-wrap .s-button-icon.s-button-large{width:56px;height:56px}.s-button-wrap .s-button-icon.s-button-small{width:24px;height:24px}.s-button-wrap .s-button-icon.s-button-small .s-button-loader:before{width:0.85rem;height:0.85rem}.s-button-wrap .s-button-loader-after .s-button-load{flex-direction:row}.s-button-wrap .s-button-loader-start.s-button-element{padding-right:40px}.s-button-wrap .s-button-loader-start .s-button-loader{position:absolute;right:8px}.s-button-wrap .s-button-loader-start .s-button-loader [dir=ltr]{left:8px;right:auto}.s-button-wrap .s-button-loader-end.s-button-element{padding-left:40px}.s-button-wrap .s-button-loader-end .s-button-loader{position:absolute;left:8px}.s-button-wrap .s-button-loader-end .s-button-loader [dir=ltr]{right:8px;left:auto}.s-button-wrap .s-button-loader-center .s-button-loader{position:absolute;top:50%;left:50%;transform:translateY(-50%) translateX(-50%);margin:0 !important}";export{e as salla_button}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e,h as t,H as l,g as a}from"./p-cb1c59a2.js";const n=class{constructor(t){e(this,t)}changeHandler(e){if(salla.log("Received the change event: ",e),!["SELECT"].includes(e.target.tagName)&&!["checkbox"].includes(e.target.getAttribute("type")))return void salla.log("Ignore the change because is not support input: "+e.target.tagName);let t=e.target.name.replace("[]",""),l="checkbox"===e.target.getAttribute("type");salla.log("Trying to find all the element with condation:",`[data-show-when^="${t}"]`),this.host.querySelectorAll(`[data-show-when^="${t}"]`).forEach((t=>{let a=!(null==t?void 0:t.dataset.showWhen.includes("!=")),n=null==t?void 0:t.dataset.showWhen.replace(/(.*)(=|!=)(.*)/gm,"$3").trim(),i=!1;i=l?Array.from(this.host.querySelectorAll(`input[name="${e.target.name}"]:checked`),(e=>null==e?void 0:e.value)).includes(n.toString()):n===e.target.value,salla.log("The input is ",l?"Multiple":"Single"," value:",i),a&&i||!a&&!i?(t.classList.remove("hidden"),t.querySelectorAll("[name]").forEach((e=>{e.removeAttribute("disabled"),!["checkbox"].includes(e.getAttribute("type"))&&t.getElementsByClassName("required").length&&e.setAttribute("required","")}))):(t.classList.add("hidden"),t.querySelectorAll("[name]").forEach((e=>{e.setAttribute("disabled",""),e.removeAttribute("required"),["checkbox"].includes(e.getAttribute("type"))&&e.hasOwnProperty("checked")&&(e.checked=!1)})))}))}render(){return t(l,null,t("slot",null))}get host(){return a(this)}};n.style=":host{display:block}";export{n as salla_conditional_fields}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as s,c as i,h as t,H as a,g as l}from"./p-cb1c59a2.js";import{H as e}from"./p-ed1c00c5.js";export{S as salla_search}from"./p-1514ed09.js";const o=class{constructor(t){s(this,t),this.modalOpened=i(this,"modalOpened",7),this.modalClosed=i(this,"modalClosed",7),this.isClosable=!0,this.width="md",this.position="middle",this.visible=!1,this.isLoading=!1,this.subTitleFirst=!1,this.noPadding=!1,this.subTitle="",this.icon="",this.iconStyle="",this.imageIcon="",e.setHost(this.host),salla.event.on("modal::open",(s=>s.dataset.target==this.host.id&&this.show())),salla.event.on("modal::close",(s=>s.dataset.target==this.host.id&&this.hide())),this.title=this.host.title,this.host.removeAttribute("title")}handleVisible(s){if(!s)return this.toggleModal(!1),void this.modalClosed.emit();this.host.classList.remove("s-hidden"),setTimeout((()=>this.toggleModal(!0))),this.modalOpened.emit()}async show(){return this.host.setAttribute("visible",""),this.host}async hide(){return this.host.removeAttribute("visible"),this.host}async setTitle(s){return this.title=s,this.host}async loading(){return this.isLoading=!0,this.host}async stopLoading(){return this.isLoading=!1,this.host}toggleModal(s){const i=this.host.querySelector(".s-modal-body");e.toggleElementClassIf(i,"s-modal-entering","s-modal-leaving",(()=>s)).toggleElementClassIf(this.overlay,"s-modal-entering","s-modal-overlay-leaving",(()=>s)).toggleElementClassIf(document.body,"modal-is-open","modal-is-closed",(()=>s)),s||setTimeout((()=>this.host.classList.add("s-hidden")),350)}closeModal(){this.isClosable&&this.host.removeAttribute("visible")}iconBlockClasses(){return{"s-modal-icon":!0,"s-modal-bg-error":"error"==this.iconStyle,"s-modal-bg-success":"success"==this.iconStyle,"s-modal-bg-normal":"error"!=this.iconStyle&&"success"!=this.iconStyle,"s-modal-bg-primary":"primary"==this.iconStyle}}iconClasses(){return{[this.icon]:!0,"sicon-alert-engine":!this.icon&&"error"==this.iconStyle&&!this.imageIcon,"sicon-check-circle2":!this.icon&&"success"==this.iconStyle&&!this.imageIcon}}render(){return this.host.id=this.host.id||"salla-modal",t(a,{class:"salla-modal s-modal-container s-hidden","aria-modal":"true",role:"dialog"},t("div",{class:"s-modal-overlay",ref:s=>this.overlay=s,onClick:()=>this.closeModal()}),t("div",{class:"s-modal-wrapper"},t("span",{class:"s-modal-spacer s-modal-align-"+this.position},""),t("div",{class:"s-modal-body s-modal-align-"+this.position+" s-modal-"+this.width+(this.noPadding?" s-modal-nopadding":" s-modal-padding")},this.isLoading?t("div",{class:"s-modal-loader-wrap"},t("span",{class:"s-modal-loader"})):[t("div",{class:{"s-modal-header":!0,"s-modal-is-center":""!=this.icon||""!=this.imageIcon}},this.isClosable?t("button",{class:"s-modal-close",onClick:()=>this.closeModal(),type:"button"},t("span",{class:"sicon-cancel"})):"",this.title||this.subTitle?t("div",{class:"s-modal-header-inner"},this.iconStyle||this.icon?t("div",{class:this.iconBlockClasses()},t("i",{class:this.iconClasses()})):this.imageIcon?t("img",{class:"s-modal-header-img",src:this.imageIcon}):"",t("div",{class:"s-modal-header-content"},t("div",{class:{"s-modal-title":!0,"s-modal-title-below":this.subTitleFirst},innerHTML:this.title}),t("p",{class:{"s-modal-sub-title":!0},innerHTML:this.subTitle}))):""),t("slot",null),t("slot",{name:"footer"})])))}get host(){return l(this)}static get watchers(){return{visible:["handleVisible"]}}};o.style="";export{o as salla_modal}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as t,h as s,H as i,g as n}from"./p-cb1c59a2.js";const e=class{constructor(s){t(this,s),this.hostAttributes={},this.hasIncrementSlot=!1,this.hasDecrementSlot=!1,this.quantity=1}watchPropHandler(){salla.helpers.debounce((()=>salla.document.event.fireEvent(this.textInput,"change",{bubbles:!0})))()}componentWillLoad(){this.hasIncrementSlot=!!this.host.querySelector('[slot="increment-button"]'),this.hasDecrementSlot=!!this.host.querySelector('[slot="decrement-button"]')}componentdidLoad(){this.quantity=parseInt(this.host.getAttribute("value"))||1}getInputAttributes(){for(let t=0;t<this.host.attributes.length;t++)["id","value","min","class"].includes(this.host.attributes[t].name)||(this.hostAttributes[this.host.attributes[t].name]=this.host.attributes[t].value);return this.hostAttributes}decrement(){this.quantity<=1||this.quantity--}increment(){let t=parseInt(this.host.getAttribute("max"));t&&this.quantity>=t||this.quantity++}render(){return s(i,{class:"s-quantity-input s-quantity-input-container"},s("button",{onClick:()=>this.increment(),class:"s-quantity-input-button",type:"button"},this.hasIncrementSlot?"":s("i",{class:"sicon-add"}),s("slot",{name:"increment-button"})),s("input",Object.assign({class:"s-quantity-input-input"},this.getInputAttributes(),{min:"1",value:this.quantity,ref:t=>this.textInput=t})),s("button",{class:"s-quantity-input-button",onClick:()=>this.decrement(),type:"button"},this.hasDecrementSlot?"":s("i",{class:"sicon-minus"}),s("slot",{name:"decrement-button"})))}get host(){return n(this)}static get watchers(){return{quantity:["watchPropHandler"]}}};e.style=":host{display:block}";export{e as salla_quantity_input}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{S as salla_login_modal}from"./p-ebd63ad4.js";import"./p-cb1c59a2.js";import"./p-ed1c00c5.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as s,h as a,g as o}from"./p-cb1c59a2.js";import{H as e}from"./p-ed1c00c5.js";const l=class{constructor(a){var o,l;s(this,a),this.offer=null,this.offer_expires_in=salla.lang.get("pages.products.offer_expires_in"),this.remember_my_choice=salla.lang.get("commone.remember_my_choice"),this.add_to_cart=salla.lang.get("pages.cart.add_to_cart"),this.out_of_stock=salla.lang.get("pages.products.out_of_stock"),e.setHost(this.host),salla.event.on("languages::translations.loaded",(()=>{this.offer_expires_in=salla.lang.get("pages.products.offer_expires_in"),this.remember_my_choice=salla.lang.get("common.remember_my_choice"),this.add_to_cart=salla.lang.get("pages.cart.add_to_cart"),this.out_of_stock=salla.lang.get("pages.products.out_of_stock")})),this.categorySlot=(null===(o=e.getElement('[slot="category"]'))||void 0===o?void 0:o.innerHTML)||'<i class="s-offer-modal-badge-icon sicon-tag"></i><span class="s-offer-modal-badge-text">{name}</span>',this.productSlot=(null===(l=e.getElement('[slot="product"]'))||void 0===l?void 0:l.innerHTML)||this.defaultProductSlot(),salla.offer.event.onExisted((s=>{salla.storage.get("remember-offer-"+s.id)?salla.log("User selected to don't show this offer again."):this.show(s.product_id)}))}async show(s){return salla.api.offer.details(s).then((s=>this.showOffer(s.data[0])))}async showOffer(s){return this.offer=s,this.offer_name=s.name,this.offer_message=s.message,this.modal.setTitle(this.offer_name),this.modal.show()}rememberMe(s){salla.storage.set("remember-offer-"+this.offer.id,s.target.checked)}addItem(){return this.load(),salla.cart.api.quickAdd(this.dataset.id).finally((()=>this.stop()))}defaultProductSlot(){return'<a href={url} class="s-offer-modal-product-image-wrap"><img class="s-offer-modal-product-image" src="{image}" /></a><div class="s-offer-modal-product-info"> <a href={url} class="s-offer-modal-product-name">{name}</a> <div class="s-offer-modal-product-price">{price}</div></div>'}render(){var s,o;return a("salla-modal",{id:"salla-offer-modal","sub-title-first":!0,icon:"sicon-special-discount","sub-title":this.offer_message,ref:s=>this.modal=s,"is-loading":null===this.offer},null!==this.offer?[a("div",{class:"s-offer-modal-scrolled-slider-wrap"},a("div",{class:"s-offer-modal-body s-offer-modal-scrolled-slider"},(null===(s=this.offer.get.categories)||void 0===s?void 0:s.length)>0?this.offer.get.categories.map((s=>a("a",{href:s.urls.customer,class:"s-offer-modal-badge s-offer-modal-slider-item",innerHTML:this.categorySlot.replace(/\{name\}/g,s.name).replace(/\{url\}/g,s.urls.customer)}))):null===(o=this.offer.get.products)||void 0===o?void 0:o.map((s=>a("div",{class:{"s-offer-modal-product":!0,"s-offer-modal-slider-item":!0,"s-offer-modal-not-available":!s.is_available},id:"product_"+s.id,innerHTML:this.productSlot.replace(/\{name\}/g,s.name).replace(/\{url\}/g,s.url).replace(/\{image\}/g,s.thumbnail).replace(/\{price\}/g,s.has_special_price?salla.money(s.price)+'<span class="s-offer-modal-product-old-price">'+salla.money(s.regular_price)+"</span>":salla.money(s.price))},a("div",{class:"s-offer-modal-btn-wrap"},a("salla-button",{width:"wide",fill:"outline","data-id":s.id,disabled:!s.is_available,"loader-position":"center",onClick:this.addItem},s.is_available?this.add_to_cart:this.out_of_stock)))))),a("div",{class:"s-offer-modal-slider-nav"},a("button",{class:"s-offer-modal-nav-btn s-offer-modal-prev-btn"},a("span",{class:"s-offer-modal-nav-btn-icon sicon-keyboard_arrow_right"})),a("button",{class:"s-offer-modal-nav-btn s-offer-modal-next-btn"},a("span",{class:"s-offer-modal-nav-btn-icon sicon-keyboard_arrow_left"})))),a("div",{class:"s-offer-modal-footer",slot:"footer"},this.offer.expiry_date?a("p",{class:"s-offer-modal-expiry"},this.offer_expires_in," ",this.offer.expiry_date):"",a("label",{class:"s-offer-modal-remember-label"},a("input",{type:"checkbox",onChange:s=>this.rememberMe(s),class:"s-offer-modal-remember-input"})," ",this.remember_my_choice))]:"")}componentDidRender(){if(this.modal.querySelectorAll("[hidden]").forEach((s=>s.removeAttribute("hidden"))),this.offer&&window.screen.width>639){let s=this.host.querySelector(".s-offer-modal-scrolled-slider-wrap"),a=this.host.querySelector(".s-offer-modal-scrolled-slider"),o=this.host.querySelectorAll(".s-offer-modal-nav-btn"),e=this.host.querySelector(".s-offer-modal-next-btn"),l=this.host.querySelector(".s-offer-modal-prev-btn"),r=this.host.querySelectorAll(".s-offer-modal-slider-item"),t=20,i=0,d=3,f=r[0].offsetWidth,n=r.length*f,c=s.offsetWidth,m=n-c,h=!!document.body.classList.contains("rtl");m>t&&e.classList.add("s-offer-modal-btn-is-active"),window.onresize=function(){c=s.offsetWidth,m=n-c},a.addEventListener("scroll",(function(){let s=Math.abs(a.scrollLeft),o=m-t;s<=t?(e.classList.add("s-offer-modal-btn-is-active"),l.classList.remove("s-offer-modal-btn-is-active")):s<o?(e.classList.add("s-offer-modal-btn-is-active"),l.classList.add("s-offer-modal-btn-is-active")):s>=o&&(e.classList.remove("s-offer-modal-btn-is-active"),l.classList.add("s-offer-modal-btn-is-active"))})),o.forEach((s=>{s.addEventListener("click",(function(){s.classList.contains("s-offer-modal-next-btn")?i++:i--,a.scrollTo({top:0,left:f*d*i*(h?-1:1),behavior:"smooth"})}))}))}}get host(){return o(this)}};l.style="#salla-offer-modal .s-offer-modal-body{-webkit-overflow-scrolling:touch}#salla-offer-modal .s-offer-modal-body::-webkit-scrollbar{display:none}#salla-offer-modal .s-offer-modal-next-btn{background:linear-gradient(90deg, #fff 25%, rgba(255, 255, 255, 0.4) 80%, rgba(255, 255, 255, 0) 100%)}#salla-offer-modal .s-offer-modal-prev-btn{background:linear-gradient(-90deg, #fff 25%, rgba(255, 255, 255, 0.4) 80%, rgba(255, 255, 255, 0) 100%)}";export{l as salla_offer_modal}
|
|
@@ -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.
|
|
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.toggleElementClassIf(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}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as s,h as i,g as l}from"./p-cb1c59a2.js";import{H as t}from"./p-ed1c00c5.js";const a=class{constructor(i){s(this,i),this.isEmailAllowed=salla.config.get("store.settings.auth.email_allowed",!0),this.isMobileAllowed=salla.config.get("store.settings.auth.mobile_allowed",!0),this.isEmailRequired=salla.config.get("store.settings.auth.is_email_required",!1),this.regType="phone",this.title=salla.lang.get("blocks.header.login"),this.loginTypeTitle=salla.lang.get("blocks.header.select_login_way"),this.loginText=salla.lang.get("blocks.header.login"),this.smsLabel=salla.lang.get("blocks.header.sms"),this.mobileLabel=salla.lang.get("common.elements.mobile"),this.emailLabel=salla.lang.get("common.elements.email"),this.enterText=salla.lang.get("blocks.header.enter"),this.bySMSText=salla.lang.get("blocks.header.login_by_sms"),this.byEmailText=salla.lang.get("blocks.header.login_by_email"),this.emailErrorMsg=salla.lang.get("common.elements.email_is_valid"),this.firstNameLabel=salla.lang.get("blocks.header.your_name"),this.lastNameLabel=salla.lang.get("pages.profile.last_name"),this.firstNameErrorMsg=salla.lang.get("common.errors.field_required",{attribute:this.firstNameLabel}),this.lastNameErrorMsg=salla.lang.get("common.errors.field_required",{attribute:this.lastNameLabel}),this.typing=(s,i)=>{const l=s.target.nextElementSibling;s.target.classList.remove("s-has-error"),(null==l?void 0:l.classList.contains("s-login-modal-error-message"))&&(l.innerText=""),"Enter"==s.key&&i()},this.loginBySMS=async()=>{const{mobile:s,countryCode:i}=await this.loginTelInput.getValues();await this.loginTelInput.isValid()&&this.smsBtn.load().then((()=>this.smsBtn.disable())).then((()=>salla.auth.api.login({type:"mobile",phone:s,country_code:i}))).then((()=>this.smsBtn.stop()&&this.smsBtn.enable())).then((()=>this.showTab(this.verifyTab))).then((()=>(this.verifyTab.by="sms")&&(this.verifyTab.url="auth/mobile/verify"))).then((()=>this.verifyTab.show({phone:s,country_code:i})))},this.loginByEmail=()=>{t.isValidEmail(this.loginEmail.value)?this.emailBtn.load().then((()=>this.emailBtn.disable())).then((()=>salla.auth.api.login({type:"email",email:this.loginEmail.value}))).then((()=>this.emailBtn.stop()&&this.emailBtn.enable())).then((()=>this.showTab(this.verifyTab))).then((()=>(this.verifyTab.by="email")&&(this.verifyTab.url="auth/email/verify"))).then((()=>this.verifyTab.show({email:this.loginEmail.value}))):this.validateField(this.loginEmail,this.emailErrorMsg)},this.newUser=async()=>{var s;const{mobile:i,countryCode:l,countryKey:t}="email"==this.regType?await this.regTelInput.getValues():await this.loginTelInput.getValues(),a=this.regEmail.value||(null===(s=this.loginEmail)||void 0===s?void 0:s.value);await this.newUserValidation(),await this.regBtn.load(),await this.regBtn.disable();let e={first_name:this.firstName.value,last_name:this.lastName.value,phone:i||this.loginTelInput.mobile,country_code:l,country_key:t,verified_by:this.regType};a&&(e=Object.assign(Object.assign({},e),{email:a})),this.verifyTab.getCode().then((s=>salla.auth.api.register(Object.assign(Object.assign({},e),{code:s})))).then((()=>window.location.reload())).catch((()=>this.regBtn.stop()&&this.regBtn.enable()))},this.title=this.host.title||salla.lang.get("blocks.header.login"),this.host.removeAttribute("title"),salla.event.on("languages::translations.loaded",(()=>{var s,i,l,t;this.title=salla.lang.get("blocks.header.login"),this.loginTypeTitle=salla.lang.get("blocks.header.select_login_way"),this.loginText=salla.lang.get("blocks.header.login"),this.smsLabel=salla.lang.get("blocks.header.sms"),this.mobileLabel=salla.lang.get("common.elements.mobile"),this.emailLabel=salla.lang.get("common.elements.email"),this.bySMSText=salla.lang.get("blocks.header.login_by_sms"),this.byEmailText=salla.lang.get("blocks.header.login_by_email"),this.emailErrorMsg=salla.lang.get("common.elements.email_is_valid"),this.firstNameLabel=salla.lang.get("blocks.header.your_name"),this.lastNameLabel=salla.lang.get("pages.profile.last_name"),this.firstNameErrorMsg=salla.lang.get("common.errors.field_required",{attribute:this.firstNameLabel}),this.lastNameErrorMsg=salla.lang.get("common.errors.field_required",{attribute:this.lastNameLabel}),null===(s=this.modal)||void 0===s||s.setTitle(this.title),null===(i=this.smsBtn)||void 0===i||i.setText(salla.lang.get("blocks.header.enter")),null===(l=this.emailBtn)||void 0===l||l.setText(salla.lang.get("blocks.header.enter")),null===(t=this.regBtn)||void 0===t||t.setText(salla.lang.get("blocks.header.register"))})),salla.auth.event.onVerificationFailed((()=>{})),salla.event.on("login::show",(()=>this.show())),salla.event.on("twilight::initiated",(()=>{this.isEmailAllowed=salla.config.get("store.settings.auth.email_allowed",!!this.isEmailAllowed),this.isMobileAllowed=salla.config.get("store.settings.auth.mobile_allowed",!!this.isMobileAllowed),this.isEmailRequired=salla.config.get("store.settings.auth.is_email_required",!!this.isEmailRequired)}))}onVerified(s){if(s.detail.case){if("new_customer"===s.detail.case)return this.showTab(this.registrationTab);if("redirect"===salla.auth.event.getTypeActionOnVerified())return s.redirect_url?window.location.href=s.redirect_url:void window.location.reload()}else console.log("verified but without case!")}async show(){return this.isEmailAllowed&&this.isMobileAllowed?this.showTab(this.homeTab):this.isEmailAllowed?this.showTab(this.emailTab):this.isMobileAllowed&&this.showTab(this.mobileTab),this.modal.show()}showTab(s,i){var l,a;null==i||i.preventDefault();let e=[this.homeTab,this.mobileTab,this.emailTab,this.verifyTab,this.registrationTab];e.map((i=>t.toggleElementClassIf(i,"visible","s-hidden",(()=>i==s)))),setTimeout((()=>e.map((i=>t.toggleElementClassIf(i,"s-login-modal-active","s-login-modal-unactive",(()=>i==s))))),200),setTimeout((()=>this.host.querySelector(".s-login-modal-wrapper").setAttribute("style","height:"+(null==s?void 0:s.scrollHeight)+"px"))),[this.mobileTab,this.emailTab].includes(s)&&(this.regType=s===this.mobileTab?"phone":"email");let o=s==this.registrationTab;return o&&(null===(l=this.firstName)||void 0===l||l.focus()),null===(a=this.modal)||void 0===a||a.setTitle(o?salla.lang.get("common.titles.registration"):this.title),o||t.toggleElementClassIf(this.regMobileBlock,"s-hidden","s-block",(()=>"phone"===this.regType)).toggleElementClassIf(this.regEmailBlock,"s-hidden","s-block",(()=>"email"===this.regType)),this}async newUserValidation(){const s="phone"==this.regType,i=this.regEmail.value||"email"==this.regType&&this.loginEmail.value,l=t.isValidEmail(i),a=this.firstName.value.length>0,e=this.lastName.value.length>0,o=await this.regTelInput.isValid()||s&&await this.loginTelInput.isValid();if(!((i&&l||!i&&!this.isEmailRequired)&&o&&a&&e))throw!l&&this.validateField(this.regEmail,this.emailErrorMsg),!a&&this.validateField(this.firstName,this.firstNameErrorMsg),!e&&this.validateField(this.lastName,this.lastNameErrorMsg),"Please insert required fields"}validateField(s,i){s.classList.add("s-has-error"),s.nextElementSibling.innerText="* "+i}render(){return i("salla-modal",{id:"salla-login",icon:"sicon-user",title:this.title,ref:s=>this.modal=s,width:"xs"},i("div",{class:"s-login-modal-wrapper"},this.isEmailAllowed&&this.isMobileAllowed?i("div",{class:"s-login-modal-tab",ref:s=>this.homeTab=s},i("p",{class:"s-login-modal-sub-title"},this.loginTypeTitle),i("slot",{name:"before-login-type"}),i("a",{href:"#",class:"s-login-modal-main-btn",onClick:s=>this.showTab(this.mobileTab,s)},i("i",{class:"s-login-modal-main-btn-icon sicon-phone"}),i("span",{class:"s-login-modal-main-btn-text"},this.smsLabel),i("i",{class:"sicon-keyboard_arrow_left arrow"})),i("a",{href:"#",class:"s-login-modal-main-btn",onClick:s=>this.showTab(this.emailTab,s)},i("i",{class:"s-login-modal-main-btn-icon sicon-mail"}),i("span",{class:"s-login-modal-main-btn-text"},this.emailLabel),i("i",{class:"sicon-keyboard_arrow_left arrow"})),i("slot",{name:"after-login-type"})):"",this.isMobileAllowed?i("div",{class:"s-login-modal-tab",ref:s=>this.mobileTab=s},i("slot",{name:"before-login-mobile"}),i("label",{class:"s-login-modal-label"},this.mobileLabel),i("salla-tel-input",{ref:s=>this.loginTelInput=s,onKeyDown:s=>this.typing(s,this.loginBySMS)}),i("salla-button",{"loader-position":"center",width:"wide",onClick:()=>this.loginBySMS(),ref:s=>this.smsBtn=s},salla.lang.get("blocks.header.enter")),this.isEmailAllowed?i("a",{href:"#",onClick:()=>this.showTab(this.emailTab),class:"s-login-modal-link"},this.byEmailText):"",i("slot",{name:"after-login-mobile"})):"",this.isEmailAllowed?i("div",{class:"s-login-modal-tab",ref:s=>this.emailTab=s},i("slot",{name:"before-login-email"}),i("label",{class:"s-login-modal-label"},this.emailLabel),i("input",{type:"email",ref:s=>this.loginEmail=s,onKeyDown:s=>this.typing(s,this.loginByEmail),placeholder:"your@email.com",class:"s-login-modal-input s-ltr"}),i("span",{class:"s-login-modal-error-message"}),i("salla-button",{"loader-position":"center",width:"wide",onClick:()=>this.loginByEmail(),ref:s=>this.emailBtn=s},salla.lang.get("blocks.header.enter")),this.isMobileAllowed?i("a",{href:"#",onClick:()=>this.showTab(this.mobileTab),class:"s-login-modal-link"},this.bySMSText):"",i("slot",{name:"after-login-email"})):"",i("salla-verify-modal",{withoutModal:!0,ref:s=>this.verifyTab=s,autoReload:!1},i("a",{onClick:()=>this.showTab("phone"==this.regType?this.mobileTab:this.emailTab),class:"s-verify-modal-back sicon-arrow-right",slot:"after-footer",href:"#"})),i("div",{ref:s=>this.registrationTab=s},i("slot",{name:"before-registration"}),i("label",{class:"s-login-modal-label"},this.firstNameLabel),i("input",{type:"text",class:"s-login-modal-input",ref:s=>this.firstName=s,onKeyDown:s=>this.typing(s,this.newUser),placeholder:salla.lang.get("pages.profile.first_name")}),i("span",{class:"s-login-modal-error-message"}),i("label",{class:"s-login-modal-label"},this.lastNameLabel),i("input",{type:"text",class:"s-login-modal-input",ref:s=>this.lastName=s,onKeyDown:s=>this.typing(s,this.newUser),placeholder:salla.lang.get("pages.profile.last_name")}),i("span",{class:"s-login-modal-error-message"}),i("div",{ref:s=>this.regMobileBlock=s,class:"mb-1.5"},i("label",{class:"s-login-modal-label"},this.mobileLabel),i("salla-tel-input",{ref:s=>this.regTelInput=s,onKeyDown:s=>this.typing(s,this.newUser)})),i("div",{ref:s=>this.regEmailBlock=s,class:"mb-1.5"},i("label",{class:"s-login-modal-label"},this.emailLabel),i("input",{type:"email",ref:s=>this.regEmail=s,onKeyDown:s=>this.typing(s,this.newUser),placeholder:"your@email.com",class:"s-login-modal-input s-ltr"}),i("span",{class:"s-login-modal-error-message"})),i("salla-button",{"loader-position":"center",width:"wide",onClick:()=>this.newUser(),ref:s=>this.regBtn=s},salla.lang.get("blocks.header.register")),i("slot",{name:"after-registration"}))))}get host(){return l(this)}};a.style="[dir=ltr] #salla-login .s-login-modal-main-btn .arrow{display:inline-block;transform:scale(-1)}";export{a as S}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as s,h as t,H as a,g as i}from"./p-cb1c59a2.js";import{H as r}from"./p-ed1c00c5.js";const e=class{constructor(t){s(this,t),this.stepsCount=0,this.currentIndex=0,this.submitted=[],this.orderId=salla.config.get("page.id"),this.rate_the_store=salla.lang.get("pages.rating.rate_the_store"),this.write_store_rate=salla.lang.get("pages.rating.write_store_rate"),this.rate_product_stars=salla.lang.get("pages.rating.rate_product_stars"),this.write_product_rate=salla.lang.get("pages.rating.write_product_rate"),this.rate_shipping=salla.lang.get("pages.rating.rate_shipping"),this.write_shipping_rate=salla.lang.get("pages.rating.write_shipping_rate"),this.thanks=salla.lang.get("pages.rating.thanks"),this.back=salla.lang.get("common.elements.back"),this.next=salla.lang.get("common.elements.next"),r.setHost(this.host),salla.event.on("rating::show",(()=>this.show())),salla.event.on("languages::translations.loaded",(()=>{this.rate_the_store=salla.lang.get("pages.rating.rate_the_store"),this.write_store_rate=salla.lang.get("pages.rating.write_store_rate"),this.rate_product_stars=salla.lang.get("pages.rating.rate_product_stars"),this.write_product_rate=salla.lang.get("pages.rating.write_product_rate"),this.rate_shipping=salla.lang.get("pages.rating.rate_shipping"),this.write_shipping_rate=salla.lang.get("pages.rating.write_shipping_rate"),this.thanks=salla.lang.get("pages.rating.thanks"),this.back=salla.lang.get("common.elements.back"),this.next=salla.lang.get("common.elements.next")}))}async show(){return this.modal.show().then((()=>this.order||salla.feedback.api.order(this.orderId).then((s=>this.order=s.data)))).then((()=>this.modal.setTitle(salla.lang.get("pages.rating.rate_order")+' <span class="unicode">(#'+this.order.id+")</span>"))).then((()=>this.modal.stopLoading())).then((()=>this.stepsCount=[this.order.testimonials_enabled,this.order.products_enabled,this.order.shipping_enabled].filter((s=>s)).length)).then((()=>setTimeout((()=>this.initiateRating()),100)))}async hide(){return this.modal.hide()}initiateRating(){this.handleWizard(),this.highlightSelectedStars(),salla.document.event.onSubmit(".s-rating-modal-stars-element",(function(s){s.preventDefault();let t=s.target.querySelectorAll(".s-rating-modal-btn-star.s-rating-modal-hovered"),a=t[t.length-1];if(!a)return;let i=parseInt(a.dataset.star,10);s.target.querySelector(".rating_hidden_input").value=i,s.target.querySelectorAll(".s-rating-modal-btn-star").forEach(((s,t)=>r.toggleElementClassIf(s,"s-rating-modal-selected","s-rating-modal-un-selected",(()=>t<i)))),s.target.querySelectorAll('.s-rating-modal-btn-star[aria-pressed="true"]').forEach((s=>s.removeAttribute("aria-pressed"))),a.setAttribute("aria-pressed","")}))}handleWizard(){this.steps=this.host.querySelectorAll(".s-rating-modal-step"),this.dots=this.host.querySelectorAll(".s-rating-modal-step-dot"),this.showActiveStep()}showActiveStep(s=null){var t;this.currentTab=s||this.steps[this.currentIndex],r.toggleClassIf(".s-rating-modal-step-dot","s-rating-modal-bg-gray","s-rating-modal-bg-primary",(s=>s!=this.dots[this.currentIndex])).toggleClassIf(".s-rating-modal-step","s-rating-modal-active","s-rating-modal-hidden",(s=>s==this.currentTab)),0!=this.currentIndex&&(r.toggleElementClassIf(this.currentTab,"s-rating-modal-unactive","s-rating-modal-hidden",(()=>!0)),setTimeout((()=>r.toggleElementClassIf(this.currentTab,"s-rating-modal-active","s-rating-modal-unactive",(()=>!0))),300));let a=null===(t=this.steps[this.currentIndex+1])||void 0===t?void 0:t.dataset.type;this.nextBtn.setText(a?salla.lang.get("pages.rating.rate")+" "+salla.lang.get("pages.rating."+a):salla.lang.get("pages.rating.send_ratings")),setTimeout((()=>{var s;return this.body.setAttribute("style","height:"+(null===(s=this.currentTab)||void 0===s?void 0:s.scrollHeight)+"px")}))}highlightSelectedStars(){let s=["s-rating-modal-hovered"];r.all(".s-rating-modal-stars-element",(t=>{let a=t.querySelectorAll(".s-rating-modal-btn-star");t.addEventListener("mouseout",(()=>a.forEach((t=>t.classList.remove(...s))))),a.forEach(((t,i)=>{t.addEventListener("mouseover",(()=>{if(t.classList.add(...s),i<=1)"BUTTON"===t.previousElementSibling.tagName&&t.previousElementSibling.classList.add(...s);else for(let t=0;t<i;t++)a[t].classList.add(...s)})),t.addEventListener("mouseout",(()=>t.classList.remove(...s)))}))}))}previousTab(){this.currentIndex>0&&this.currentIndex--,r.toggleElementClassIf(this.backBtn,"s-rating-modal-unvisiable","block",(()=>0==this.currentIndex)),this.showActiveStep()}submit(){this.submittedBefore()||this.validate(),salla.config.canLeave=!1,this.nextBtn.load().then((()=>this.submittedBefore()||this.sendFeedback())).then((()=>this.currentTab.querySelectorAll("[name],.s-rating-modal-btn-star").forEach((s=>s.setAttribute("disabled",""))))).then((()=>this.currentIndex<this.stepsCount&&this.currentIndex++)).then((()=>this.showActiveStep())).then((()=>r.toggleClassIf("#prev-btn","block","s-rating-modal-unvisiable",(()=>!0)))).finally((()=>{this.nextBtn.stop(),salla.config.canLeave=!0,this.currentIndex==this.stepsCount&&this.showThankYou(),this.modal.isClosable=!1}))}submittedBefore(){return this.submitted.includes(this.currentIndex)}validate(s=null,t=null){if(!s&&"products"==this.currentTab.dataset.type)return this.currentTab.querySelectorAll(".rating-outer-form").forEach((s=>this.validate(s,"product")));let a=(s=s||this.currentTab).querySelector(".rating_hidden_input").value,i=s.querySelector(".s-rating-modal-comment"),e=s.querySelector(".s-rating-modal-validation-msg");if(a&&i.value&&i.value.length>3)return i.classList.remove("s-has-error"),void(e.innerHTML="");throw t=t||s.dataset.type,r.toggleElementClassIf(i,"save","s-has-error",(s=>s.value.length>3)),e.innerHTML=a?salla.lang.get("common.errors.not_less_than_chars",{chars:4})+" "+i.getAttribute("placeholder"):salla.lang.get(`pages.rating.rate_${t}_stars`).replace(" (:item)","")}sendFeedback(){let s={};if(this.currentTab.querySelectorAll("[name]").forEach((t=>{let a=salla.helpers.inputData(t.name,t.value,s);s[a.name]=a.value})),0!=Object.keys(s).length)return s.order_id=this.orderId,s.type=this.currentTab.dataset.type,this.submitted.push(this.currentIndex),salla.feedback.api[this.currentTab.dataset.type](s)}showThankYou(){let s=10,t=setInterval((()=>{this.thanksTime.innerHTML="00:0"+s--,s>0||(clearInterval(t),this.thanksTime.remove(),this.hide().then((()=>window.location.reload())))}),1e3);this.host.querySelector(".s-rating-modal-footer").classList.add("s-rating-modal-unvisiable"),this.showActiveStep(this.thanksTab)}renderRatingStars(s,a="rating"){return t("form",{class:"s-rating-modal-stars-element"},t("input",{type:"hidden",class:"rating_hidden_input",name:a,value:""}),[1,2,3,4,5].map((a=>t("button",{type:"submit",class:"s-rating-modal-btn-star s-rating-modal-btn-star-"+s,"data-star":a},t("i",{class:"sicon-star2"})))))}render(){return t(a,{id:"s-rating"},t("salla-modal",{isLoading:!0,width:"md",ref:s=>this.modal=s},this.order?[t("div",{class:"s-rating-modal-wrapper",ref:s=>this.body=s},this.order.testimonials_enabled?t("div",{class:"rating-outer-form s-rating-modal-step-wrap s-rating-modal-step s-rating-modal-hidden","data-type":"store"},t("div",{class:"s-rating-modal-rounded-icon"},t("img",{src:salla.config.get("store.logo","https://assets.salla.sa/cp/assets/images/logo-new.png"),alt:"store name",class:"s-rating-modal-store-logo"})),t("h2",{class:"s-rating-modal-title"},this.rate_the_store),t("div",{class:"s-rating-modal-stars-company"}," ",this.renderRatingStars("large")),t("textarea",{id:"storeReview",name:"comment",class:"s-rating-modal-comment",placeholder:this.write_store_rate}),t("small",{class:"s-rating-modal-validation-msg"})):"",this.order.products_enabled?t("section",{class:"s-rating-modal-step s-rating-modal-hidden","data-type":"products"},this.order.products.map(((s,a)=>t("div",{class:"rating-outer-form s-rating-modal-product","data-stars-error":this.rate_product_stars},t("img",{src:s.product.thumbnail,alt:s.product.name,class:"s-rating-modal-product-img"}),t("div",{class:"s-rating-modal-product-details"},t("h3",{class:"s-rating-modal-product-title"}," ",s.product.name),t("div",{class:"s-rating-modal-stars-product"}," ",this.renderRatingStars("small",`products[${a}][rating]`)),t("input",{type:"hidden",name:`products[${a}][product_id]`,value:s.product.id}),t("textarea",{placeholder:this.write_product_rate,name:`products[${a}][comment]`,class:"s-rating-modal-comment"}),t("small",{class:"s-rating-modal-validation-msg"})))))):"",this.order.shipping_enabled?t("div",{class:"rating-outer-form s-rating-modal-step-wrap s-rating-modal-step s-rating-modal-hidden","data-type":"shipping"},t("input",{type:"hidden",name:"shipping_company_id",value:this.order.shipping.company.id}),this.order.shipping.company.logo?t("div",{class:"s-rating-modal-rounded-icon"},t("img",{src:this.order.shipping.company.logo,class:"s-rating-modal-shipping-logo",alt:this.order.shipping.company.name})):t("span",{class:"s-rating-modal-icon sicon-shipping-fast"}),t("div",{class:"s-rating-modal-title"}," ",this.rate_shipping+" "+this.order.shipping.company.name),t("div",{class:"s-rating-modal-stars-company"},this.renderRatingStars("large")),t("textarea",{name:"comment",class:"s-rating-modal-comment",placeholder:this.write_shipping_rate}),t("small",{class:"s-rating-modal-validation-msg"})):"",t("div",{class:"s-rating-modal-thanks s-rating-modal-hidden",ref:s=>this.thanksTab=s},t("span",{class:"s-rating-modal-icon sicon-check-circle2"}),t("h3",{class:"s-rating-modal-thanks-title"},this.thanks),t("div",{class:"s-rating-modal-thanks-msg",innerHTML:this.order.thanks_message}),t("time",{class:"s-rating-modal-thanks-time",ref:s=>this.thanksTime=s}))),t("div",{class:"s-rating-modal-footer"},t("button",{ref:s=>this.backBtn=s,onClick:()=>this.previousTab(),class:"s-rating-modal-btn s-rating-modal-unvisiable"},this.back),this.stepsCount>1?t("ul",{class:"s-rating-modal-dots"},[0,1,2].slice(0,this.stepsCount).map((()=>t("li",{class:"s-rating-modal-bg-gray s-rating-modal-step-dot"})))):"",t("salla-button",{"loader-position":"center",ref:s=>this.nextBtn=s,onClick:()=>this.submit()},this.next))]:""))}componentDidRender(){this.modal.querySelectorAll("[hidden]").forEach((s=>s.removeAttribute("hidden")))}componentDidLoad(){salla.event.dispatch("rating::ready",this)}get host(){return i(this)}};e.style="#s-rating-modal .unicode{unicode-bidi:plaintext}";export{e as salla_rating_modal}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as e,b as
|
|
1
|
+
import{p as e,b as l}from"./p-cb1c59a2.js";(()=>{const l=import.meta.url,a={};return""!==l&&(a.resourcesUrl=new URL(".",l).href),e(a)})().then((e=>l([["p-40693cd3",[[4,"salla-button",{shape:[513],color:[513],fill:[513],size:[513],width:[513],loading:[516],disabled:[516],loaderPosition:[1,"loader-position"],wide:[4],href:[1],load:[64],stop:[64],setText:[64],disable:[64],enable:[64]}]]],["p-64977eab",[[0,"salla-search",{inline:[4],oval:[4],height:[2],results:[32],placeholder:[32],noResultsText:[32]},[[0,"modalOpened","onModalOpen"],[0,"modalClosed","onModalClose"]]],[4,"salla-modal",{isClosable:[1028,"is-closable"],width:[513],position:[513],visible:[516],isLoading:[1540,"is-loading"],subTitleFirst:[4,"sub-title-first"],noPadding:[4,"no-padding"],subTitle:[1,"sub-title"],icon:[1],iconStyle:[1,"icon-style"],imageIcon:[1,"image-icon"],title:[32],show:[64],hide:[64],setTitle:[64],loading:[64],stopLoading:[64]}]]],["p-7c4ba872",[[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-2f3f4cce",[[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-2a032b88",[[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-c51984d6",[[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-84936d9d",[[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],show:[64],showOffer:[64]}]]],["p-ee9d8563",[[0,"salla-rating-modal",{orderId:[2,"order-id"],order:[32],show:[64],hide:[64]}]]],["p-5d5b04ec",[[4,"salla-conditional-fields",null,[[0,"change","changeHandler"]]]]],["p-884a80ca",[[4,"salla-infinite-scroll",{nextPage:[1,"next-page"],nextPageAutoload:[1028,"next-page-autoload"],container:[1],item:[1],loadMore:[32],noMore:[32],failedToLoad:[32]}]]],["p-6c928c14",[[4,"salla-quantity-input",{quantity:[32]}]]],["p-635c08a7",[[4,"salla-verify-modal",{withoutModal:[4,"without-modal"],url:[513],by:[1],autoReload:[4,"auto-reload"],title:[32],getCode:[64],show:[64]}]]],["p-79ab1ed9",[[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)));
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* its to easy to use, currenlty its support select & checkbox input as trigger for show/hide the dom
|
|
3
|
+
* the dom you can put it like this data-show-when="{name of the field} {= or !=} {value of the field}"
|
|
4
|
+
*/
|
|
5
|
+
export declare class SallaConditionalFields {
|
|
6
|
+
host: HTMLElement;
|
|
7
|
+
changeHandler(event: any): void;
|
|
8
|
+
render(): any;
|
|
9
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export declare class SallaQuantityInput {
|
|
2
|
+
host: HTMLElement;
|
|
3
|
+
private hostAttributes;
|
|
4
|
+
private hasIncrementSlot;
|
|
5
|
+
private hasDecrementSlot;
|
|
6
|
+
private textInput;
|
|
7
|
+
quantity: number;
|
|
8
|
+
/**
|
|
9
|
+
* Workaround to fire change event for the input.
|
|
10
|
+
*/
|
|
11
|
+
watchPropHandler(): void;
|
|
12
|
+
componentWillLoad(): void;
|
|
13
|
+
componentdidLoad(): void;
|
|
14
|
+
private getInputAttributes;
|
|
15
|
+
decrement(): void;
|
|
16
|
+
increment(): void;
|
|
17
|
+
render(): any;
|
|
18
|
+
}
|
|
@@ -16,10 +16,6 @@ export namespace Components {
|
|
|
16
16
|
"show": () => Promise<HTMLElement>;
|
|
17
17
|
}
|
|
18
18
|
interface SallaButton {
|
|
19
|
-
/**
|
|
20
|
-
* Button Type
|
|
21
|
-
*/
|
|
22
|
-
"buttonType": 'link' | 'icon' | 'btn';
|
|
23
19
|
/**
|
|
24
20
|
* Button Color
|
|
25
21
|
*/
|
|
@@ -61,6 +57,10 @@ export namespace Components {
|
|
|
61
57
|
* @param html
|
|
62
58
|
*/
|
|
63
59
|
"setText": (html: string) => Promise<HTMLElement>;
|
|
60
|
+
/**
|
|
61
|
+
* Button Type todo :: find better name,
|
|
62
|
+
*/
|
|
63
|
+
"shape": 'link' | 'icon' | 'btn';
|
|
64
64
|
/**
|
|
65
65
|
* Button Size
|
|
66
66
|
*/
|
|
@@ -78,6 +78,8 @@ export namespace Components {
|
|
|
78
78
|
*/
|
|
79
79
|
"width": 'wide' | 'normal';
|
|
80
80
|
}
|
|
81
|
+
interface SallaConditionalFields {
|
|
82
|
+
}
|
|
81
83
|
interface SallaInfiniteScroll {
|
|
82
84
|
/**
|
|
83
85
|
* Class selector to know the container if it's not the host `<salla-infinite-scroll>`
|
|
@@ -205,6 +207,8 @@ export namespace Components {
|
|
|
205
207
|
*/
|
|
206
208
|
"productId": number;
|
|
207
209
|
}
|
|
210
|
+
interface SallaQuantityInput {
|
|
211
|
+
}
|
|
208
212
|
interface SallaRatingModal {
|
|
209
213
|
/**
|
|
210
214
|
* Show the rating modal
|
|
@@ -287,6 +291,12 @@ declare global {
|
|
|
287
291
|
prototype: HTMLSallaButtonElement;
|
|
288
292
|
new (): HTMLSallaButtonElement;
|
|
289
293
|
};
|
|
294
|
+
interface HTMLSallaConditionalFieldsElement extends Components.SallaConditionalFields, HTMLStencilElement {
|
|
295
|
+
}
|
|
296
|
+
var HTMLSallaConditionalFieldsElement: {
|
|
297
|
+
prototype: HTMLSallaConditionalFieldsElement;
|
|
298
|
+
new (): HTMLSallaConditionalFieldsElement;
|
|
299
|
+
};
|
|
290
300
|
interface HTMLSallaInfiniteScrollElement extends Components.SallaInfiniteScroll, HTMLStencilElement {
|
|
291
301
|
}
|
|
292
302
|
var HTMLSallaInfiniteScrollElement: {
|
|
@@ -323,6 +333,12 @@ declare global {
|
|
|
323
333
|
prototype: HTMLSallaProductAvailabilityElement;
|
|
324
334
|
new (): HTMLSallaProductAvailabilityElement;
|
|
325
335
|
};
|
|
336
|
+
interface HTMLSallaQuantityInputElement extends Components.SallaQuantityInput, HTMLStencilElement {
|
|
337
|
+
}
|
|
338
|
+
var HTMLSallaQuantityInputElement: {
|
|
339
|
+
prototype: HTMLSallaQuantityInputElement;
|
|
340
|
+
new (): HTMLSallaQuantityInputElement;
|
|
341
|
+
};
|
|
326
342
|
interface HTMLSallaRatingModalElement extends Components.SallaRatingModal, HTMLStencilElement {
|
|
327
343
|
}
|
|
328
344
|
var HTMLSallaRatingModalElement: {
|
|
@@ -350,12 +366,14 @@ declare global {
|
|
|
350
366
|
interface HTMLElementTagNameMap {
|
|
351
367
|
"salla-branches": HTMLSallaBranchesElement;
|
|
352
368
|
"salla-button": HTMLSallaButtonElement;
|
|
369
|
+
"salla-conditional-fields": HTMLSallaConditionalFieldsElement;
|
|
353
370
|
"salla-infinite-scroll": HTMLSallaInfiniteScrollElement;
|
|
354
371
|
"salla-localization-modal": HTMLSallaLocalizationModalElement;
|
|
355
372
|
"salla-login-modal": HTMLSallaLoginModalElement;
|
|
356
373
|
"salla-modal": HTMLSallaModalElement;
|
|
357
374
|
"salla-offer-modal": HTMLSallaOfferModalElement;
|
|
358
375
|
"salla-product-availability": HTMLSallaProductAvailabilityElement;
|
|
376
|
+
"salla-quantity-input": HTMLSallaQuantityInputElement;
|
|
359
377
|
"salla-rating-modal": HTMLSallaRatingModalElement;
|
|
360
378
|
"salla-search": HTMLSallaSearchElement;
|
|
361
379
|
"salla-tel-input": HTMLSallaTelInputElement;
|
|
@@ -371,10 +389,6 @@ declare namespace LocalJSX {
|
|
|
371
389
|
"position"?: string;
|
|
372
390
|
}
|
|
373
391
|
interface SallaButton {
|
|
374
|
-
/**
|
|
375
|
-
* Button Type
|
|
376
|
-
*/
|
|
377
|
-
"buttonType"?: 'link' | 'icon' | 'btn';
|
|
378
392
|
/**
|
|
379
393
|
* Button Color
|
|
380
394
|
*/
|
|
@@ -399,6 +413,10 @@ declare namespace LocalJSX {
|
|
|
399
413
|
* Is the button currently loading
|
|
400
414
|
*/
|
|
401
415
|
"loading"?: boolean;
|
|
416
|
+
/**
|
|
417
|
+
* Button Type todo :: find better name,
|
|
418
|
+
*/
|
|
419
|
+
"shape"?: 'link' | 'icon' | 'btn';
|
|
402
420
|
/**
|
|
403
421
|
* Button Size
|
|
404
422
|
*/
|
|
@@ -412,6 +430,8 @@ declare namespace LocalJSX {
|
|
|
412
430
|
*/
|
|
413
431
|
"width"?: 'wide' | 'normal';
|
|
414
432
|
}
|
|
433
|
+
interface SallaConditionalFields {
|
|
434
|
+
}
|
|
415
435
|
interface SallaInfiniteScroll {
|
|
416
436
|
/**
|
|
417
437
|
* Class selector to know the container if it's not the host `<salla-infinite-scroll>`
|
|
@@ -497,6 +517,8 @@ declare namespace LocalJSX {
|
|
|
497
517
|
*/
|
|
498
518
|
"productId"?: number;
|
|
499
519
|
}
|
|
520
|
+
interface SallaQuantityInput {
|
|
521
|
+
}
|
|
500
522
|
interface SallaRatingModal {
|
|
501
523
|
/**
|
|
502
524
|
* The order id, to rate on its products & shipping
|
|
@@ -545,12 +567,14 @@ declare namespace LocalJSX {
|
|
|
545
567
|
interface IntrinsicElements {
|
|
546
568
|
"salla-branches": SallaBranches;
|
|
547
569
|
"salla-button": SallaButton;
|
|
570
|
+
"salla-conditional-fields": SallaConditionalFields;
|
|
548
571
|
"salla-infinite-scroll": SallaInfiniteScroll;
|
|
549
572
|
"salla-localization-modal": SallaLocalizationModal;
|
|
550
573
|
"salla-login-modal": SallaLoginModal;
|
|
551
574
|
"salla-modal": SallaModal;
|
|
552
575
|
"salla-offer-modal": SallaOfferModal;
|
|
553
576
|
"salla-product-availability": SallaProductAvailability;
|
|
577
|
+
"salla-quantity-input": SallaQuantityInput;
|
|
554
578
|
"salla-rating-modal": SallaRatingModal;
|
|
555
579
|
"salla-search": SallaSearch;
|
|
556
580
|
"salla-tel-input": SallaTelInput;
|
|
@@ -563,12 +587,14 @@ declare module "@stencil/core" {
|
|
|
563
587
|
interface IntrinsicElements {
|
|
564
588
|
"salla-branches": LocalJSX.SallaBranches & JSXBase.HTMLAttributes<HTMLSallaBranchesElement>;
|
|
565
589
|
"salla-button": LocalJSX.SallaButton & JSXBase.HTMLAttributes<HTMLSallaButtonElement>;
|
|
590
|
+
"salla-conditional-fields": LocalJSX.SallaConditionalFields & JSXBase.HTMLAttributes<HTMLSallaConditionalFieldsElement>;
|
|
566
591
|
"salla-infinite-scroll": LocalJSX.SallaInfiniteScroll & JSXBase.HTMLAttributes<HTMLSallaInfiniteScrollElement>;
|
|
567
592
|
"salla-localization-modal": LocalJSX.SallaLocalizationModal & JSXBase.HTMLAttributes<HTMLSallaLocalizationModalElement>;
|
|
568
593
|
"salla-login-modal": LocalJSX.SallaLoginModal & JSXBase.HTMLAttributes<HTMLSallaLoginModalElement>;
|
|
569
594
|
"salla-modal": LocalJSX.SallaModal & JSXBase.HTMLAttributes<HTMLSallaModalElement>;
|
|
570
595
|
"salla-offer-modal": LocalJSX.SallaOfferModal & JSXBase.HTMLAttributes<HTMLSallaOfferModalElement>;
|
|
571
596
|
"salla-product-availability": LocalJSX.SallaProductAvailability & JSXBase.HTMLAttributes<HTMLSallaProductAvailabilityElement>;
|
|
597
|
+
"salla-quantity-input": LocalJSX.SallaQuantityInput & JSXBase.HTMLAttributes<HTMLSallaQuantityInputElement>;
|
|
572
598
|
"salla-rating-modal": LocalJSX.SallaRatingModal & JSXBase.HTMLAttributes<HTMLSallaRatingModalElement>;
|
|
573
599
|
"salla-search": LocalJSX.SallaSearch & JSXBase.HTMLAttributes<HTMLSallaSearchElement>;
|
|
574
600
|
"salla-tel-input": LocalJSX.SallaTelInput & JSXBase.HTMLAttributes<HTMLSallaTelInputElement>;
|