@salla.sa/twilight-components 2.13.31 → 2.13.33
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_47.cjs.entry.js +20 -8
- package/dist/cjs/salla-add-product-button_47.cjs.entry.js.map +1 -1
- package/dist/cjs/salla-metadata.cjs.entry.js +3 -0
- package/dist/cjs/salla-metadata.cjs.entry.js.map +1 -1
- package/dist/cjs/salla-offer.cjs.entry.js +6 -5
- package/dist/cjs/salla-offer.cjs.entry.js.map +1 -1
- package/dist/collection/components/salla-metadata/salla-metadata.js +3 -0
- package/dist/collection/components/salla-metadata/salla-metadata.js.map +1 -1
- package/dist/collection/components/salla-offer/salla-offer.js +6 -5
- package/dist/collection/components/salla-offer/salla-offer.js.map +1 -1
- package/dist/collection/components/salla-user-menu/salla-user-menu.js +20 -8
- package/dist/collection/components/salla-user-menu/salla-user-menu.js.map +1 -1
- package/dist/components/salla-metadata.js +3 -0
- package/dist/components/salla-metadata.js.map +1 -1
- package/dist/components/salla-offer.js +6 -5
- package/dist/components/salla-offer.js.map +1 -1
- package/dist/components/salla-user-menu.js +20 -8
- package/dist/components/salla-user-menu.js.map +1 -1
- package/dist/esm/salla-add-product-button_47.entry.js +20 -8
- package/dist/esm/salla-add-product-button_47.entry.js.map +1 -1
- package/dist/esm/salla-metadata.entry.js +3 -0
- package/dist/esm/salla-metadata.entry.js.map +1 -1
- package/dist/esm/salla-offer.entry.js +6 -5
- package/dist/esm/salla-offer.entry.js.map +1 -1
- package/dist/esm-es5/salla-add-product-button_47.entry.js +1 -1
- package/dist/esm-es5/salla-add-product-button_47.entry.js.map +1 -1
- package/dist/esm-es5/salla-metadata.entry.js +1 -1
- package/dist/esm-es5/salla-metadata.entry.js.map +1 -1
- package/dist/esm-es5/salla-offer.entry.js +1 -1
- package/dist/esm-es5/salla-offer.entry.js.map +1 -1
- package/dist/twilight/p-64707107.system.js +1 -1
- package/dist/twilight/p-953c5fdc.entry.js +5 -0
- package/dist/twilight/p-953c5fdc.entry.js.map +1 -0
- package/dist/twilight/{p-6b84f8e3.system.entry.js → p-ac4405da.system.entry.js} +2 -2
- package/dist/twilight/p-ac4405da.system.entry.js.map +1 -0
- package/dist/twilight/p-b7b268e9.entry.js +5 -0
- package/dist/twilight/p-b7b268e9.entry.js.map +1 -0
- package/dist/twilight/{p-52a426c5.entry.js → p-d3986c26.entry.js} +2 -2
- package/dist/twilight/p-d3986c26.entry.js.map +1 -0
- package/dist/twilight/p-f3e35ec4.system.entry.js +5 -0
- package/dist/twilight/p-f3e35ec4.system.entry.js.map +1 -0
- package/dist/twilight/p-fa78ea46.system.entry.js +5 -0
- package/dist/twilight/p-fa78ea46.system.entry.js.map +1 -0
- package/dist/twilight/twilight.esm.js +1 -1
- package/dist/types/components/salla-offer/salla-offer.d.ts +1 -1
- package/dist/types/components/salla-user-menu/salla-user-menu.d.ts +3 -1
- package/package.json +5 -5
- package/dist/twilight/p-2863124d.system.entry.js +0 -5
- package/dist/twilight/p-2863124d.system.entry.js.map +0 -1
- package/dist/twilight/p-4a3847a1.entry.js +0 -5
- package/dist/twilight/p-4a3847a1.entry.js.map +0 -1
- package/dist/twilight/p-52a426c5.entry.js.map +0 -1
- package/dist/twilight/p-6b84f8e3.system.entry.js.map +0 -1
- package/dist/twilight/p-9d26358c.system.entry.js +0 -5
- package/dist/twilight/p-9d26358c.system.entry.js.map +0 -1
- package/dist/twilight/p-fc29f3c5.entry.js +0 -5
- package/dist/twilight/p-fc29f3c5.entry.js.map +0 -1
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Crafted with ❤ by Salla
|
|
3
|
-
*/
|
|
4
|
-
System.register(["./p-a0dabf35.system.js"],(function(t){"use strict";var e,a,n,r;return{setters:[function(t){e=t.r;a=t.h;n=t.H;r=t.g}],execute:function(){var s="";var o=t("salla_metadata",function(){function t(t){e(this,t);this.entity="product";this.entityId=undefined;this.specs=[];this.download=salla.lang.get("pages.thank_you.download")}t.prototype.getValue=function(t){if(t.type==="file"){return'<a href="'.concat(t.value,'" class="text-primary" target="_blank"><span class="sicon-download"></span> ').concat(this.download,"</a>")}if(t.type==="date"){var e=new Date(t.value);var a="".concat(e.getMonth()+1,"/").concat(e.getDate(),"/").concat(e.getFullYear());return a}return t.value};t.prototype.componentWillLoad=function(){var t=this;return new Promise((function(t){return salla.onReady(t)})).then((function(){if(!t.entityId&&salla.url.is_page("product.single")){t.entityId=salla.config.get("page.id")}if(!t.entityId){throw new Error("can't render salla-metadata without enity-id prop!")}salla.lang.onLoaded((function(){return t.download=salla.lang.get("pages.thank_you.download")}));return salla.api.request("metadata/".concat(t.entity,"/").concat(t.entityId)).then((function(t){return t.data}))})).then((function(e){return t.specs=e})).catch((function(t){return salla.logger.error("Error loading more specs:",t)}))};t.prototype.render=function(){var t=this;if(!this.specs.length){return}return a(n,{class:"s-metadata-wrapper"},this.specs.map((function(e){return a("div",{class:"s-metadata-box"},a("div",{class:"s-metadata-box-header"},a("i",{class:"sicon-list"}),e.name),e.fields.map((function(e){return a("div",{class:"s-metadata-row"},a("p",{class:"s-metadata-row-name"},e.name),a("p",{class:"s-metadata-row-value",innerHTML:t.getValue(e)}))})))})))};Object.defineProperty(t.prototype,"host",{get:function(){return r(this)},enumerable:false,configurable:true});return t}());o.style=s}}}));
|
|
5
|
-
//# sourceMappingURL=p-9d26358c.system.entry.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["sallaMetadataCss","SallaMetadata","exports","salla","lang","get","class_1","prototype","getValue","field","type","concat","value","this","download","date","Date","formattedDate","getMonth","getDate","getFullYear","componentWillLoad","_this","Promise","resolve","onReady","then","entityId","url","is_page","config","Error","onLoaded","api","request","entity","response","data","specs","catch","error","logger","render","length","h","Host","class","map","item","name","fields","innerHTML"],"sources":["src/components/salla-metadata/salla-metadata.scss?tag=salla-metadata","src/components/salla-metadata/salla-metadata.tsx"],"sourcesContent":[null,"import { Component, Host, h, Element, Prop, State } from '@stencil/core';\nimport { Field, Specs } from './interfaces'\n@Component({\n tag: 'salla-metadata',\n styleUrl: 'salla-metadata.scss',\n})\nexport class SallaMetadata {\n @Element() host: HTMLElement;\n\n /**\n * The entity type.\n */\n @Prop() entity: string = 'product';\n\n /**\n * The id of the product/the endity to which the specs are going to be fetched for.\n */\n @Prop() entityId: number;\n\n @State() specs: Specs[] = [];\n @State() download: string = salla.lang.get('pages.thank_you.download');\n\n private getValue(field: Field) {\n if (field.type === 'file') {\n return `<a href=\"${field.value}\" class=\"text-primary\" target=\"_blank\"><span class=\"sicon-download\"></span> ${this.download}</a>`;\n }\n if (field.type === 'date') {\n const date = new Date(field.value);\n const formattedDate = `${date.getMonth() + 1}/${date.getDate()}/${date.getFullYear()}`;\n return formattedDate;\n }\n return field.value;\n }\n\n\n componentWillLoad() {\n return (new Promise(resolve => salla.onReady(resolve)))\n .then(() => {\n if (!this.entityId && salla.url.is_page('product.single')) {\n this.entityId = salla.config.get('page.id');\n }\n if (!this.entityId) {\n throw new Error(\"can't render salla-metadata without enity-id prop!\");\n }\n salla.lang.onLoaded(() => this.download = salla.lang.get('pages.thank_you.download'));\n //todo:: check in graylog, if there is too many requests for same users, let's store it in the session storage for 15 minutes same as the offers\n return salla.api.request(`metadata/${this.entity}/${this.entityId}`).then(response => response.data)\n })\n .then(specs => this.specs = specs)\n .catch(error => salla.logger.error('Error loading more specs:', error));\n }\n render() {\n if (!this.specs.length) {\n return;\n }\n return (\n <Host class=\"s-metadata-wrapper\">\n\n {this.specs.map((item: Specs) => {\n return (\n <div class=\"s-metadata-box\">\n <div class=\"s-metadata-box-header\">\n <i class=\"sicon-list\"></i>\n {item.name}\n </div>\n\n {item.fields.map((field: Field) => {\n return <div class=\"s-metadata-row\">\n <p class=\"s-metadata-row-name\">{field.name}</p>\n <p class=\"s-metadata-row-value\" innerHTML={this.getValue(field) as any}></p>\n </div>\n })}\n </div>\n )\n })}\n </Host>\n );\n }\n\n}\n"],"mapp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BAETjC,KAAKyB,MAAMS,KAAI,SAACC,GACf,OACEJ,EAAA,OAAKE,MAAM,kBACTF,EAAA,OAAKE,MAAM,yBACTF,EAAA,KAAGE,MAAM,eACRE,EAAKC,MAGPD,EAAKE,OAAOH,KAAI,SAACtC,GAChB,OAAOmC,EAAA,OAAKE,MAAM,kBAChBF,EAAA,KAAGE,MAAM,uBAAuBrC,EAAMwC,MACtCL,EAAA,KAAGE,MAAM,uBAAuBK,UAAW7B,EAAKd,SAASC,K,iIA/DjD,I"}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Crafted with ❤ by Salla
|
|
3
|
-
*/
|
|
4
|
-
import{r as a,h as s,H as t,g as e}from"./p-fafedb13.js";const r="";const i=class{constructor(s){a(this,s);this.entity="product";this.entityId=undefined;this.specs=[];this.download=salla.lang.get("pages.thank_you.download")}getValue(a){if(a.type==="file"){return`<a href="${a.value}" class="text-primary" target="_blank"><span class="sicon-download"></span> ${this.download}</a>`}if(a.type==="date"){const s=new Date(a.value);const t=`${s.getMonth()+1}/${s.getDate()}/${s.getFullYear()}`;return t}return a.value}componentWillLoad(){return new Promise((a=>salla.onReady(a))).then((()=>{if(!this.entityId&&salla.url.is_page("product.single")){this.entityId=salla.config.get("page.id")}if(!this.entityId){throw new Error("can't render salla-metadata without enity-id prop!")}salla.lang.onLoaded((()=>this.download=salla.lang.get("pages.thank_you.download")));return salla.api.request(`metadata/${this.entity}/${this.entityId}`).then((a=>a.data))})).then((a=>this.specs=a)).catch((a=>salla.logger.error("Error loading more specs:",a)))}render(){if(!this.specs.length){return}return s(t,{class:"s-metadata-wrapper"},this.specs.map((a=>s("div",{class:"s-metadata-box"},s("div",{class:"s-metadata-box-header"},s("i",{class:"sicon-list"}),a.name),a.fields.map((a=>s("div",{class:"s-metadata-row"},s("p",{class:"s-metadata-row-name"},a.name),s("p",{class:"s-metadata-row-value",innerHTML:this.getValue(a)}))))))))}get host(){return e(this)}};i.style=r;export{i as salla_metadata};
|
|
5
|
-
//# sourceMappingURL=p-fc29f3c5.entry.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["sallaMetadataCss","SallaMetadata","salla","lang","get","getValue","field","type","value","this","download","date","Date","formattedDate","getMonth","getDate","getFullYear","componentWillLoad","Promise","resolve","onReady","then","entityId","url","is_page","config","Error","onLoaded","api","request","entity","response","data","specs","catch","error","logger","render","length","h","Host","class","map","item","name","fields","innerHTML"],"sources":["src/components/salla-metadata/salla-metadata.scss?tag=salla-metadata","src/components/salla-metadata/salla-metadata.tsx"],"sourcesContent":[null,"import { Component, Host, h, Element, Prop, State } from '@stencil/core';\nimport { Field, Specs } from './interfaces'\n@Component({\n tag: 'salla-metadata',\n styleUrl: 'salla-metadata.scss',\n})\nexport class SallaMetadata {\n @Element() host: HTMLElement;\n\n /**\n * The entity type.\n */\n @Prop() entity: string = 'product';\n\n /**\n * The id of the product/the endity to which the specs are going to be fetched for.\n */\n @Prop() entityId: number;\n\n @State() specs: Specs[] = [];\n @State() download: string = salla.lang.get('pages.thank_you.download');\n\n private getValue(field: Field) {\n if (field.type === 'file') {\n return `<a href=\"${field.value}\" class=\"text-primary\" target=\"_blank\"><span class=\"sicon-download\"></span> ${this.download}</a>`;\n }\n if (field.type === 'date') {\n const date = new Date(field.value);\n const formattedDate = `${date.getMonth() + 1}/${date.getDate()}/${date.getFullYear()}`;\n return formattedDate;\n }\n return field.value;\n }\n\n\n componentWillLoad() {\n return (new Promise(resolve => salla.onReady(resolve)))\n .then(() => {\n if (!this.entityId && salla.url.is_page('product.single')) {\n this.entityId = salla.config.get('page.id');\n }\n if (!this.entityId) {\n throw new Error(\"can't render salla-metadata without enity-id prop!\");\n }\n salla.lang.onLoaded(() => this.download = salla.lang.get('pages.thank_you.download'));\n //todo:: check in graylog, if there is too many requests for same users, let's store it in the session storage for 15 minutes same as the offers\n return salla.api.request(`metadata/${this.entity}/${this.entityId}`).then(response => response.data)\n })\n .then(specs => this.specs = specs)\n .catch(error => salla.logger.error('Error loading more specs:', error));\n }\n render() {\n if (!this.specs.length) {\n return;\n }\n return (\n <Host class=\"s-metadata-wrapper\">\n\n {this.specs.map((item: Specs) => {\n return (\n <div class=\"s-metadata-box\">\n <div class=\"s-metadata-box-header\">\n <i class=\"sicon-list\"></i>\n {item.name}\n </div>\n\n {item.fields.map((field: Field) => {\n return <div class=\"s-metadata-row\">\n <p class=\"s-metadata-row-name\">{field.name}</p>\n <p class=\"s-metadata-row-value\" innerHTML={this.getValue(field) as any}></p>\n </div>\n })}\n </div>\n )\n })}\n </Host>\n );\n }\n\n}\n"],"mappings":";;;yDAAA,MAAMA,EAAmB,G,MCMZC,EAAa,M,qCAMC,U,mCAOC,G,cACEC,MAAMC,KAAKC,IAAI,2B,CAEnC,QAAAC,CAASC,GACf,GAAIA,EAAMC,OAAS,OAAQ,CACzB,MAAO,YAAYD,EAAME,oFAAoFC,KAAKC,c,CAEpH,GAAIJ,EAAMC,OAAS,OAAQ,CACzB,MAAMI,EAAO,IAAIC,KAAKN,EAAME,OAC5B,MAAMK,EAAgB,GAAGF,EAAKG,WAAa,KAAKH,EAAKI,aAAaJ,EAAKK,gBACvE,OAAOH,C,CAET,OAAOP,EAAME,K,CAIf,iBAAAS,GACE,OAAO,IAAKC,SAAQC,GAAWjB,MAAMkB,QAAQD,KAC1CE,MAAK,KACJ,IAAKZ,KAAKa,UAAYpB,MAAMqB,IAAIC,QAAQ,kBAAmB,CACzDf,KAAKa,SAAWpB,MAAMuB,OAAOrB,IAAI,U,CAEnC,IAAKK,KAAKa,SAAU,CAClB,MAAM,IAAII,MAAM,qD,CAElBxB,MAAMC,KAAKwB,UAAS,IAAMlB,KAAKC,SAAWR,MAAMC,KAAKC,IAAI,8BAEzD,OAAOF,MAAM0B,IAAIC,QAAQ,YAAYpB,KAAKqB,UAAUrB,KAAKa,YAAYD,MAAKU,GAAYA,EAASC,MAAK,IAErGX,MAAKY,GAASxB,KAAKwB,MAAQA,IAC3BC,OAAM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