actuel-inactuel/site/plugins/your-plugin/index.js

2 lines
995 B
JavaScript
Raw Normal View History

2025-11-28 17:58:50 +01:00
(function(){"use strict";function d(n,t,o,c,s,r,i,a){var e=typeof n=="function"?n.options:n;return t&&(e.render=t,e.staticRenderFns=o,e._compiled=!0),{exports:n,options:e}}const l={__name:"Web2PrintBtn",props:{htmlPageString:String},setup(n){const{htmlPageString:t}=n;async function o(){const r=await fetch("https://web2print.studio-variable.com",{method:"POST","Content-Type":"application/pdf","X-API-Key":"25377ab6e2153b159d1d5fa22501228810b6aec9d63346bd0614045dc167061c",body:{html:t}});if(r.ok){const i=await r.blob(),a=window.URL.createObjectURL(i),e=document.createElement("a");e.href=a,e.download="document.pdf",e.click()}else{const i=await r.json();console.error("Erreur:",i)}}return{__sfc:!0,getPdf:o}}};var u=function(){var t=this,o=t._self._c,c=t._self._setupProxy;return o("k-button",{attrs:{variant:"filled"},on:{click:function(s){return c.getPdf()}}},[t._v("Button")])},f=[],_=d(l,u,f);const p=_.exports;window.panel.plugin("studio-variable/web2print",{fields:{web2print:p}})})();