@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.
@@ -11,7 +11,7 @@ export declare class SallaCommentForm {
11
11
  placeholder: string;
12
12
  submitText: string;
13
13
  canComment: boolean;
14
- private commmentField;
14
+ private commentField;
15
15
  private submitBtn;
16
16
  private commentForm;
17
17
  private submit;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salla.sa/twilight-components",
3
- "version": "2.9.2",
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.2",
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": "1464250a7e6c1f5bca7f44b7172ed136a244db0b"
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}}}));