@salla.sa/twilight-components 2.9.2 → 2.9.3
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/salla-add-product-button.cjs.entry.js +5 -8
- package/dist/cjs/salla-button_30.cjs.entry.js +2 -2
- package/dist/collection/components/salla-add-product-button/salla-add-product-button.js +5 -8
- package/dist/collection/components/salla-comment-form/salla-comment-form.js +2 -2
- package/dist/components/salla-add-product-button.js +5 -8
- package/dist/components/salla-comment-form.js +2 -2
- package/dist/esm/salla-add-product-button.entry.js +5 -8
- package/dist/esm/salla-button_30.entry.js +2 -2
- package/dist/esm-es5/salla-add-product-button.entry.js +1 -1
- package/dist/esm-es5/salla-button_30.entry.js +1 -1
- package/dist/twilight/p-18e385e6.entry.js +4 -0
- package/dist/twilight/p-5a22c7bb.system.entry.js +4 -0
- package/dist/twilight/{p-dd56d0ec.system.entry.js → p-984370cf.system.entry.js} +1 -1
- package/dist/twilight/{p-4191f73f.entry.js → p-9c6769f6.entry.js} +1 -1
- package/dist/twilight/p-d393a5f3.system.js +1 -1
- package/dist/twilight/twilight.esm.js +1 -1
- package/dist/types/components/salla-comment-form/salla-comment-form.d.ts +1 -1
- package/package.json +3 -3
- package/dist/twilight/p-13129ac9.entry.js +0 -4
- package/dist/twilight/p-a7caaba3.system.entry.js +0 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@salla.sa/twilight-components",
|
|
3
|
-
"version": "2.9.
|
|
3
|
+
"version": "2.9.3",
|
|
4
4
|
"license": "GPL-3.0",
|
|
5
5
|
"author": "Salla Team <support@salla.dev> (https://salla.dev)",
|
|
6
6
|
"bugs": {
|
|
@@ -75,7 +75,7 @@
|
|
|
75
75
|
"typescript": "^4.4.3"
|
|
76
76
|
},
|
|
77
77
|
"dependencies": {
|
|
78
|
-
"@salla.sa/twilight": "^2.9.
|
|
78
|
+
"@salla.sa/twilight": "^2.9.3",
|
|
79
79
|
"@salla.sa/twilight-tailwind-theme": "^2.9.2",
|
|
80
80
|
"animejs": "^3.2.1",
|
|
81
81
|
"filepond": "^4.30.4",
|
|
@@ -87,5 +87,5 @@
|
|
|
87
87
|
"intl-tel-input": "^17.0.13",
|
|
88
88
|
"swiper": "^8.3.1"
|
|
89
89
|
},
|
|
90
|
-
"gitHead": "
|
|
90
|
+
"gitHead": "53c468dc76b66fa78990a733ad3356217f0bd351"
|
|
91
91
|
}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Crafted with ❤ by Salla
|
|
3
|
-
*/
|
|
4
|
-
import{r as t,c as s,h as i,H as a,g as l}from"./p-ca68752d.js";const o=class{constructor(i){t(this,i),this.success=s(this,"success",7),this.failed=s(this,"failed",7),this.hostAttributes={},this.hasLabel=!1,this.channels=null,this.quantity=0,this.donatingAmount=0,this.productStatus="sale",this.productType="product"}getLabel(){return"sale"===this.productStatus?salla.lang.get("pages.cart.add_to_cart"):"donating"!==this.productType?salla.lang.get("pages.products.out_of_stock"):salla.lang.get("pages.products.donation_exceed")}addProductToCart(t){if("submit"===this.hostAttributes.type)return!1;t.preventDefault();const s=Object.entries({id:this.productId,donating_amount:this.donatingAmount,quantity:this.quantity}).reduce(((t,[s,i])=>i?(t[s]=i,t):t),{});return salla.cart.quickAdd(s).then((t=>this.success.emit(t))).catch((t=>this.failed.emit(t)))}getBtnAttributes(){for(let t=0;t<this.host.attributes.length;t++)["id","class"].includes(this.host.attributes[t].name)||(this.hostAttributes[this.host.attributes[t].name]=this.host.attributes[t].value);return this.hostAttributes}componentWillLoad(){this.hasLabel=!!this.host.innerHTML.replace("\x3c!----\x3e","").trim()}render(){return i(a,null,"out-and-notify"===this.productStatus&&this.channels?i("salla-product-availability",Object.assign({},this.getBtnAttributes()),i("slot",null)):i("salla-button",Object.assign({ref:t=>this.btn=t,onClick:t=>this.addProductToCart(t),type:"button",fill:"sale"===this.productStatus?"solid":"outline",color:"sale"===this.productStatus?"primary":"light","loader-position":"center"},this.getBtnAttributes(),{disabled:"sale"!==this.productStatus}),i("slot",null)))}componentDidRender(){this.hasLabel||(this.btn.setText(this.getLabel()||"اضافة للسلة"),salla.lang.onLoaded((()=>{this.btn.setText(this.getLabel()||"اضافة للسلة")})))}get host(){return l(this)}};o.style=":host{display:block}salla-add-product-button[width=wide]{width:100%}";export{o as salla_add_product_button}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Crafted with ❤ by Salla
|
|
3
|
-
*/
|
|
4
|
-
System.register(["./p-db0ba553.system.js"],(function(t){"use strict";var e,s,i,n,a;return{setters:[function(t){e=t.r;s=t.c;i=t.h;n=t.H;a=t.g}],execute:function(){var r=":host{display:block}salla-add-product-button[width=wide]{width:100%}";var o=t("salla_add_product_button",function(){function t(t){e(this,t);this.success=s(this,"success",7);this.failed=s(this,"failed",7);this.hostAttributes={};this.hasLabel=false;this.channels=null;this.quantity=0;this.donatingAmount=0;this.productStatus="sale";this.productType="product"}t.prototype.getLabel=function(){if(this.productStatus==="sale"){return salla.lang.get("pages.cart.add_to_cart")}if(this.productType!=="donating"){return salla.lang.get("pages.products.out_of_stock")}return salla.lang.get("pages.products.donation_exceed")};t.prototype.addProductToCart=function(t){var e=this;if(this.hostAttributes["type"]==="submit"){return false}t.preventDefault();var s=Object.entries({id:this.productId,donating_amount:this.donatingAmount,quantity:this.quantity}).reduce((function(t,e){var s=e[0],i=e[1];return i?(t[s]=i,t):t}),{});return salla.cart.quickAdd(s).then((function(t){return e.success.emit(t)})).catch((function(t){return e.failed.emit(t)}))};t.prototype.getBtnAttributes=function(){for(var t=0;t<this.host.attributes.length;t++){if(!["id","class"].includes(this.host.attributes[t].name)){this.hostAttributes[this.host.attributes[t].name]=this.host.attributes[t].value}}return this.hostAttributes};t.prototype.componentWillLoad=function(){this.hasLabel=!!this.host.innerHTML.replace("\x3c!----\x3e","").trim()};t.prototype.render=function(){var t=this;return i(n,null,this.productStatus==="out-and-notify"&&this.channels?i("salla-product-availability",Object.assign({},this.getBtnAttributes()),i("slot",null)):i("salla-button",Object.assign({ref:function(e){return t.btn=e},onClick:function(e){return t.addProductToCart(e)},type:"button",fill:this.productStatus==="sale"?"solid":"outline",color:this.productStatus==="sale"?"primary":"light","loader-position":"center"},this.getBtnAttributes(),{disabled:this.productStatus!=="sale"}),i("slot",null)))};t.prototype.componentDidRender=function(){var t=this;if(this.hasLabel){return}this.btn.setText(this.getLabel()||"اضافة للسلة");salla.lang.onLoaded((function(){t.btn.setText(t.getLabel()||"اضافة للسلة")}))};Object.defineProperty(t.prototype,"host",{get:function(){return a(this)},enumerable:false,configurable:true});return t}());o.style=r}}}));
|