@salla.sa/twilight-components 2.12.41 → 2.12.42
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/app-globals-fe89d834.js.map +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/salla-add-product-button_41.cjs.entry.js +135 -333
- package/dist/cjs/salla-add-product-button_41.cjs.entry.js.map +1 -1
- package/dist/cjs/salla-products-slider.cjs.entry.js +2 -1
- package/dist/cjs/salla-products-slider.cjs.entry.js.map +1 -1
- package/dist/cjs/twilight.cjs.js +1 -1
- package/dist/collection/components/salla-count-down/salla-count-down.js +12 -12
- package/dist/collection/components/salla-count-down/salla-count-down.js.map +1 -1
- package/dist/collection/components/salla-products-slider/salla-products-slider.js +22 -1
- package/dist/collection/components/salla-products-slider/salla-products-slider.js.map +1 -1
- package/dist/components/index.js.map +1 -1
- package/dist/components/salla-count-down2.js +12 -12
- package/dist/components/salla-count-down2.js.map +1 -1
- package/dist/components/salla-products-slider.js +3 -1
- package/dist/components/salla-products-slider.js.map +1 -1
- package/dist/components/salla-tel-input2.js +123 -321
- package/dist/components/salla-tel-input2.js.map +1 -1
- package/dist/esm/app-globals-4359b023.js.map +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/salla-add-product-button_41.entry.js +135 -333
- package/dist/esm/salla-add-product-button_41.entry.js.map +1 -1
- package/dist/esm/salla-products-slider.entry.js +2 -1
- package/dist/esm/salla-products-slider.entry.js.map +1 -1
- package/dist/esm/twilight.js +1 -1
- package/dist/esm-es5/app-globals-4359b023.js.map +1 -1
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/loader.js.map +1 -1
- package/dist/esm-es5/salla-add-product-button_41.entry.js +4 -4
- package/dist/esm-es5/salla-add-product-button_41.entry.js.map +1 -1
- package/dist/esm-es5/salla-products-slider.entry.js +1 -1
- package/dist/esm-es5/salla-products-slider.entry.js.map +1 -1
- package/dist/esm-es5/twilight.js +1 -1
- package/dist/esm-es5/twilight.js.map +1 -1
- package/dist/twilight/{p-25fc9949.system.entry.js → p-270897bc.system.entry.js} +6 -6
- package/dist/twilight/p-270897bc.system.entry.js.map +1 -0
- package/dist/twilight/p-539cf1d8.system.entry.js +5 -0
- package/dist/twilight/p-539cf1d8.system.entry.js.map +1 -0
- package/dist/twilight/p-a04e6e5e.system.js +1 -1
- package/dist/twilight/p-a04e6e5e.system.js.map +1 -1
- package/dist/twilight/p-a527f060.system.js.map +1 -1
- package/dist/twilight/p-ab4c6cc3.js.map +1 -1
- package/dist/twilight/{p-e23a4e3f.entry.js → p-d2437066.entry.js} +8 -8
- package/dist/twilight/p-d2437066.entry.js.map +1 -0
- package/dist/twilight/p-ff5cfed5.entry.js +5 -0
- package/dist/twilight/p-ff5cfed5.entry.js.map +1 -0
- package/dist/twilight/twilight.esm.js +1 -1
- package/dist/twilight/twilight.esm.js.map +1 -1
- package/dist/types/components/salla-products-slider/salla-products-slider.d.ts +12 -0
- package/dist/types/components.d.ts +10 -0
- package/package.json +2 -2
- package/dist/twilight/p-17869512.system.entry.js +0 -5
- package/dist/twilight/p-17869512.system.entry.js.map +0 -1
- package/dist/twilight/p-25fc9949.system.entry.js.map +0 -1
- package/dist/twilight/p-d7b6c544.entry.js +0 -5
- package/dist/twilight/p-d7b6c544.entry.js.map +0 -1
- package/dist/twilight/p-e23a4e3f.entry.js.map +0 -1
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Crafted with ❤ by Salla
|
|
3
|
-
*/
|
|
4
|
-
import{r as s,h as t,H as e,g as i}from"./p-a3d07260.js";import{H as r}from"./p-ed793fc8.js";const d="";const u=class{constructor(t){s(this,t);this.blockTitle=undefined;this.subTitle=undefined;this.sliderId=undefined;this.displayAllUrl=undefined;this.autoplay=undefined;this.source=undefined;this.sourceValue=undefined;this.limit=undefined;this.productsData=undefined;this.isReady=undefined;this.sourceValueIsValid=undefined;this.hasCustomComponent=undefined;this.apiUrl="";this.parsedSourceValue=undefined}isSourceWithoutValue(){return["offers","latest","sales"].includes(this.getSource())}getItemHTML(s){if(this.hasCustomComponent){return t("div",{class:"s-products-slider-card"},t("custom-salla-product-card",{product:s,source:this.getSource(),"source-value":this.getSourceValue()}))}return t("div",{class:"s-products-slider-card"},t("salla-product-card",{"show-quantity":this.getSource()=="landing-page","hide-add-btn":this.getSource()=="landing-page","shadow-on-hover":true,product:s}))}canRender(){return this.sourceValueIsValid&&this.isReady}componentWillLoad(){return r.onSallaReadyPromise((()=>{this.sourceValueIsValid=!!(this.getSourceValue()||this.isSourceWithoutValue());if(!this.sourceValueIsValid){salla.logger.warn(`source-value prop is required for source [${this.getSource()}]`);return}this.hasCustomComponent=!!customElements.get("custom-salla-product-card");if(this.source==="json"){this.productsData=this.getSourceValue();this.isReady=true;return}return r.fetchProducts(this.getSource(),this.getSourceValue(),this.limit).then((s=>{this.productsData=s.data;this.isReady=true;salla.event.emit("salla-products-slider::products.fetched",s.data)}))}))}getSource(){return r.getProductsSource(this.source)}getSourceValue(){return r.getProductsSourceValue(this.source,this.sourceValue)}render(){var s;if(this.getSource()=="related"&&!salla.config.get("store.settings.product.related_products_enabled")||!this.canRender()){return}return t(e,{class:"s-products-slider-wrapper"},t("salla-slider",{class:"s-products-slider-slider",id:this.sliderId||`s-products-slider-${Math.random().toString(36).substr(2,9)}`,"auto-play":this.autoplay,type:"carousel","block-title":this.blockTitle,"block-subTitle":this.subTitle,"display-all-url":this.displayAllUrl},t("div",{slot:"items"},(s=this.productsData)===null||s===void 0?void 0:s.map((s=>this.getItemHTML(s))))))}get host(){return i(this)}};u.style=d;export{u as salla_products_slider};
|
|
5
|
-
//# sourceMappingURL=p-d7b6c544.entry.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["sallaProductsSliderCss","SallaProductsSlider","isSourceWithoutValue","includes","this","getSource","getItemHTML","product","hasCustomComponent","h","class","source","getSourceValue","canRender","sourceValueIsValid","isReady","componentWillLoad","Helper","onSallaReadyPromise","salla","logger","warn","customElements","get","productsData","fetchProducts","limit","then","res","data","event","emit","getProductsSource","getProductsSourceValue","sourceValue","render","config","Host","id","sliderId","Math","random","toString","substr","autoplay","type","blockTitle","subTitle","displayAllUrl","slot","_a","map"],"sources":["./src/components/salla-products-slider/salla-products-slider.scss?tag=salla-products-slider","./src/components/salla-products-slider/salla-products-slider.tsx"],"sourcesContent":[".s-products-slider{\n &-wrapper{\n\n }\n &-slider{\n\n }\n &-card{\n\n }\n}","import { Component, Host, h, Prop, Element, State } from '@stencil/core';\nimport Helper from '../../Helpers/Helper';\n@Component({\n tag: 'salla-products-slider',\n styleUrl: 'salla-products-slider.scss'\n})\n\n//todo:: extends this component from salla-products-list or the opposite\nexport class SallaProductsSlider {\n private isSourceWithoutValue() {\n return ['offers', 'latest', 'sales'].includes(this.getSource());\n }\n\n @Element() host: HTMLElement;\n //todo:: support limit, default =10, make sure that maximum is 32,\n\n /**\n * Title of the block - works only if slider is true\n * @type {string}\n * @default ''\n * */\n @Prop() blockTitle: string;\n\n /**\n * Sub title of the block - works only if slider is true\n * @type {string}\n * @default ''\n * */\n @Prop() subTitle: string;\n\n /**\n * Slider Id, if not provided will be generated automatically\n * @type {string}\n * @default ''\n * */\n @Prop() sliderId: string;\n\n /**\n * Display 'ALL' URL\n * @type {string}\n * @default ''\n * */\n @Prop() displayAllUrl: string;\n\n /**\n * autoplay option for products slider\n */\n @Prop({ mutable: true }) autoplay: boolean\n\n /**\n * Source of the products, if api will get the products from the API, if json will get the products from the products prop\n * @type {string}\n * @default ''\n * */\n @Prop({\n reflect: true,\n mutable: true\n }) source: 'categories' | 'latest' | 'related' | 'brands' | 'json' | 'tags' | 'selected' | 'offers' | 'landing-page';\n\n /**\n * The source value, cloud be different values as following:\n * - array of ids when `source` in ['categories', 'brands', 'tags', 'selected']\n * - products payload when `source` = 'json'\n * - product_id when `source` = 'related'\n *\n * @type {string}\n * */\n @Prop() sourceValue: string;\n\n /**\n * Limit for number of products in the list.\n */\n @Prop({ mutable: true }) limit: number;\n\n\n @State() productsData: any;\n @State() isReady: boolean;\n @State() sourceValueIsValid: boolean;\n @State() hasCustomComponent: boolean;\n @State() apiUrl: string = '';\n @State() parsedSourceValue: any;\n\n private getItemHTML(product) {\n if (this.hasCustomComponent) {\n return <div class=\"s-products-slider-card\">\n <custom-salla-product-card product={product} source={this.getSource()} source-value={this.getSourceValue()} />\n </div>;\n }\n\n return <div class=\"s-products-slider-card\">\n <salla-product-card\n show-quantity={this.getSource() == 'landing-page'}\n hide-add-btn={this.getSource() == 'landing-page'}\n shadow-on-hover={true}\n product={product} />\n </div>;\n }\n\n\n\n private canRender() {\n return this.sourceValueIsValid && this.isReady;\n }\n componentWillLoad() {\n return Helper.onSallaReadyPromise(() => {\n this.sourceValueIsValid = !!(this.getSourceValue() || this.isSourceWithoutValue());\n if (!this.sourceValueIsValid) {\n salla.logger.warn(`source-value prop is required for source [${\n this.getSource()\n }]`);\n return;\n }\n this.hasCustomComponent = !!customElements.get('custom-salla-product-card');\n\n if (this.source === 'json') {\n this.productsData = this.getSourceValue();\n this.isReady = true\n return;\n }\n return Helper.fetchProducts(this.getSource(), this.getSourceValue(), this.limit).then(res => {\n this.productsData = res.data\n this.isReady = true\n salla.event.emit('salla-products-slider::products.fetched', res.data);\n });\n });\n }\n\n private getSource() {\n return Helper.getProductsSource(this.source);\n }\n\n private getSourceValue() {\n return Helper.getProductsSourceValue(this.source, this.sourceValue);\n }\n\n render() {\n if ((this.getSource() == 'related' && !salla.config.get('store.settings.product.related_products_enabled')) || !this.canRender()) {\n return;\n }\n return (\n <Host class=\"s-products-slider-wrapper\">\n <salla-slider\n class=\"s-products-slider-slider\"\n id={this.sliderId || `s-products-slider-${Math.random().toString(36).substr(2, 9)}`}\n auto-play={this.autoplay}\n type=\"carousel\"\n block-title={this.blockTitle}\n block-subTitle={this.subTitle}\n display-all-url={this.displayAllUrl}\n >\n <div slot=\"items\">\n {this.productsData?.map(product => this.getItemHTML(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