@xlork/core
Advanced tools
Comparing version 2.0.6 to 2.0.7
@@ -1,2 +0,2 @@ | ||
var xLorkClient=function(a){this.props=a;let{settings:d={},licenseKey:b,user:c,origin:e="https://app.xlork.com",onCancel:f=function(a){console.log("[onCancelDefault]",a)},onComplete:g=function(a){console.log("[onCompleteDefault]",a)}}=this.props;d=Object.assign({},{title:"Data",allowInvalidSubmit:!0,theme:null,maxRecords:0,sampleUrl:null,columns:[],display:"popup",header:!0,branding:!1,history:!1,social:!0},d);const h="__xlork",i=e+"/embed/"+b,j=`<div class=${"inline"==d?.display?"__xlork_iframe_container _inline":"__xlork_iframe_container"}><div class="__xlork_loader" id="__xlork_loader" style="height:100%"><div class="loader_ripple"><div></div><div></div></div><span> Connecting ...</span></div><iframe name="__xlork_iframe" id="__xlork_iframe" src=${i} frameBorder="0" style="height:0%" ></iframe> </div>`;let k={error:!0,message:""};const l=a=>new Promise(b=>setTimeout(b,a)),m=({settings:a,licenseKey:b,user:c,embedURL:d,onComplete:e,onCancel:f})=>{let g="";b?c?c?.email?d?e&&"function"!=typeof e?g=`[REQUIRED] onComplete should be function type.`:f&&"function"!=typeof f?g=`[REQUIRED] onCancel should be function type.`:a?a?.hasOwnProperty("columns")?0<!a?.columns?.length||a?.columns?.forEach(a=>{if(!(a.label&&a.key))return g=`[REQUIRED] each column should have label & key in 'columns'`,!1}):g=`[REQUIRED] should have required property 'columns'`:g=`[REQUIRED] setting not defined.`:g=`[REQUIRED] embedURL not defined.`:g=`[REQUIRED] email(unique) not defined.`:g=`[REQUIRED] user not defined.`:g="[REQUIRED] A Valid licenseKey is required.",k={error:!!g,message:g},n(k)},n=async a=>{if(a?.error&&a?.message)alert(a?.message);else{for(;"complete"!=document.readyState;)await l(100);o(j,"__xlork_main_container")}},o=function(a,b){const c=document.getElementById(b);c&&c.remove();let d=document.body||document.getElementsByTagName("body")[0],e=document.createElement("div");e.id=b,e.innerHTML=a,d.appendChild(e)},p=a=>{const e=a?.data;if("object"==typeof e&&e?.channel==h)switch(e?.type){case"[IFRAME LOADED]":const a={type:"[CONFIG INITILIZE]",channel:h,settings:d,licenseKey:b,user:c};window.frames.__xlork_iframe.postMessage(a,"*");try{document.getElementById("__xlork_loader").style.display="none",document.getElementById("__xlork_iframe").style.height="100%"}catch(a){console.log(a)}break;case"[onComplete]":g&&g(e.value);case"[onCancel]":r(),f&&f();}},q=a=>{const b=document.getElementById(a);b&&b.remove();const c=document.createElement("style");c.textContent=`.__xlork_hidden { | ||
var xLorkClient=function(e){this.props=e;let{settings:o={},licenseKey:i,user:l,origin:n="https://app.xlork.com",onCancel:r=function(e){console.log("[onCancelDefault]",e)},onComplete:t=function(e){console.log("[onCompleteDefault]",e)}}=this.props;o=Object.assign({},{title:"Data",allowInvalidSubmit:!0,theme:null,maxRecords:0,sampleUrl:null,columns:[],display:"popup",header:!0,branding:!1,history:!1,social:!0},o);let a="__xlork",d=n+"/embed/"+i,s=`<div class=${o?.display=="inline"?"__xlork_iframe_container _inline":"__xlork_iframe_container"}><div class="__xlork_loader" id="__xlork_loader" style="height:100%"><div class="loader_ripple"><div></div><div></div></div><span> Connecting ...</span></div><iframe name="__xlork_iframe" id="__xlork_iframe" src=${d} frameBorder="0" style="height:0%" allowFullScreen ></iframe> </div>`,p=`.__xlork_hidden { | ||
display: none; | ||
@@ -109,2 +109,2 @@ } | ||
} | ||
`,c.id=a,c.type="text/css",document.head.appendChild(c)},r=()=>{window.removeEventListener("message",p,!1);try{document.body.classList.remove("__xlork_modal_open");const a=document.getElementById("__xlork_main_container");a&&a.remove()}catch(a){console.log("__xlork_modal_open",a)}};this.init=()=>{q("__xlork_styles"),window.addEventListener("message",p,!1),m({settings:d,licenseKey:b,user:c,embedURL:i,onComplete:g,onCancel:f})}}; | ||
`,c={error:!0,message:""},f=e=>new Promise(o=>setTimeout(o,e)),m=({settings:e,licenseKey:o,user:i,embedURL:l,onComplete:n,onCancel:r})=>{let t="";o?i?i?.email?l?n&&"function"!=typeof n?t="[REQUIRED] onComplete should be function type.":r&&"function"!=typeof r?t="[REQUIRED] onCancel should be function type.":e?e?.hasOwnProperty("columns")?!e?.columns?.length>0||e?.columns?.forEach(e=>{if(!(e.label&&e.key))return t="[REQUIRED] each column should have label & key in 'columns'",!1}):t="[REQUIRED] should have required property 'columns'":t="[REQUIRED] setting not defined.":t="[REQUIRED] embedURL not defined.":t="[REQUIRED] email(unique) not defined.":t="[REQUIRED] user not defined.":t="[REQUIRED] A Valid licenseKey is required.",x(c={error:!!t,message:t})},x=async e=>{if(e?.error&&e?.message)alert(e?.message);else{for(;"complete"!=document.readyState;)await f(100);$(s,"__xlork_main_container")}},$=function(e,o){let i=document.getElementById(o);i&&i.remove();let l=document.body||document.getElementsByTagName("body")[0],n=document.createElement("div");n.id=o,n.innerHTML=e,l.appendChild(n)},h=e=>{let n=e?.data;if("object"==typeof n&&n?.channel==a)switch(n?.type){case"[IFRAME LOADED]":let d={type:"[CONFIG INITILIZE]",channel:a,settings:o,licenseKey:i,user:l};window.frames.__xlork_iframe.postMessage(d,"*");try{document.getElementById("__xlork_loader").style.display="none",document.getElementById("__xlork_iframe").style.height="100%"}catch(s){console.log(s)}break;case"[onComplete]":t&&t(n.value);case"[onCancel]":u(),r&&r()}},y=e=>{let o=document.getElementById(e);o&&o.remove();let i=document.createElement("style");i.textContent=p,i.id=e,i.type="text/css",document.head.appendChild(i)},u=()=>{window.removeEventListener("message",h,!1);try{document.body.classList.remove("__xlork_modal_open");let e=document.getElementById("__xlork_main_container");e&&e.remove()}catch(o){console.log("__xlork_modal_open",o)}};this.init=()=>{y("__xlork_styles"),window.addEventListener("message",h,!1),m({settings:o,licenseKey:i,user:l,embedURL:d,onComplete:t,onCancel:r})}}; |
{ | ||
"name": "@xlork/core", | ||
"version": "2.0.6", | ||
"version": "2.0.7", | ||
"description": "XLork is a powerful Node.js/ Vanilla js package for parsing and manipulating CSV and XML files. With its intuitive API, XLork makes it easy to read, write, and modify CSV and XML data in your Node.js applications. Whether you're dealing with large datasets or just need to perform some quick data transformations, XLork has you covered. Plus, with its comprehensive documentation and responsive community support, XLork is the perfect choice for developers looking to work with CSV and XML data in Node.js. Install XLork today and start parsing and manipulating your data with ease!", | ||
@@ -5,0 +5,0 @@ "author": "Shavron", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
8494
111