dromo-uploader-js
Advanced tools
Comparing version 1.1.13 to 1.1.14
@@ -15,3 +15,3 @@ var DromoUploader=function(){"use strict"; | ||
PERFORMANCE OF THIS SOFTWARE. | ||
***************************************************************************** */function e(e,n,t,o){return new(t||(t=Promise))((function(r,i){function s(e){try{a(o.next(e))}catch(e){i(e)}}function c(e){try{a(o.throw(e))}catch(e){i(e)}}function a(e){var n;e.done?r(e.value):(n=e.value,n instanceof t?n:new t((function(e){e(n)}))).then(s,c)}a((o=o.apply(e,n||[])).next())}))}function n(e,n){var t,o,r,i,s={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return i={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function c(i){return function(c){return function(i){if(t)throw new TypeError("Generator is already executing.");for(;s;)try{if(t=1,o&&(r=2&i[0]?o.return:i[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,i[1])).done)return r;switch(o=0,r&&(i=[2&i[0],r.value]),i[0]){case 0:case 1:r=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,o=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!(r=s.trys,(r=r.length>0&&r[r.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!r||i[1]>r[0]&&i[1]<r[3])){s.label=i[1];break}if(6===i[0]&&s.label<r[1]){s.label=r[1],r=i;break}if(r&&s.label<r[2]){s.label=r[2],s.ops.push(i);break}r[2]&&s.ops.pop(),s.trys.pop();continue}i=n.call(e,s)}catch(e){i=[6,e],o=0}finally{t=r=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,c])}}}var t,o,r,i,s,c,a={IFRAME_URL:"https://widget.dromo.io/"}.IFRAME_URL;!function(e){e.INIT_IFRAME="INIT_IFRAME"}(t||(t={})),function(e){e.Call="call",e.Reply="reply",e.Syn="syn",e.SynAck="synAck",e.Ack="ack"}(o||(o={})),function(e){e.Fulfilled="fulfilled",e.Rejected="rejected"}(r||(r={})),function(e){e.ConnectionDestroyed="ConnectionDestroyed",e.ConnectionTimeout="ConnectionTimeout",e.NotInIframe="NotInIframe",e.NoIframeSrc="NoIframeSrc"}(i||(i={})),function(e){e.DataCloneError="DataCloneError"}(s||(s={})),function(e){e.Message="message"}(c||(c={}));const l={"http:":"80","https:":"443"},u=/^(https?:)?\/\/([^/:]+)?(:(\d+))?/,d=["file:","data:"];const f=({name:e,message:n,stack:t})=>({name:e,message:n,stack:t});let h=0;var m=()=>++h,p=(e,n,t,s,a)=>{const{localName:l,local:u,remote:d,originForSending:f,originForReceiving:h}=n;let p=!1;a(`${l}: Connecting call sender`);const v=e=>(...n)=>{let t;a(`${l}: Sending ${e}() call`);try{d.closed&&(t=!0)}catch(e){t=!0}if(t&&s(),p){const n=new Error(`Unable to send ${e}() call due to destroyed connection`);throw n.code=i.ConnectionDestroyed,n}return new Promise(((t,i)=>{const s=m(),p=n=>{if(n.source!==d||n.data.penpal!==o.Reply||n.data.id!==s)return;if(n.origin!==h)return void a(`${l} received message from origin ${n.origin} which did not match expected origin ${h}`);const f=n.data;a(`${l}: Received ${e}() reply`),u.removeEventListener(c.Message,p);let m=f.returnValue;f.returnValueIsError&&(m=(e=>{const n=new Error;return Object.keys(e).forEach((t=>n[t]=e[t])),n})(m)),(f.resolution===r.Fulfilled?t:i)(m)};u.addEventListener(c.Message,p);const v={penpal:o.Call,id:s,methodName:e,args:n};d.postMessage(v,f)}))};return t.reduce(((e,n)=>(e[n]=v(n),e)),e),()=>{p=!0}},v=(e,n,t,i,a)=>{const{destroy:l,onDestroy:u}=i;let d,h;const m={};return i=>{if(i.origin!==n)return void a(`Parent: Handshake - Received ACK message from origin ${i.origin} which did not match expected origin ${n}`);a("Parent: Handshake - Received ACK");const v={localName:"Parent",local:window,remote:i.source,originForSending:t,originForReceiving:n};d&&d(),d=((e,n,t)=>{const{localName:i,local:a,remote:l,originForSending:u,originForReceiving:d}=e;let h=!1;const m=e=>{if(e.source!==l||e.data.penpal!==o.Call)return;if(e.origin!==d)return void t(`${i} received message from origin ${e.origin} which did not match expected origin ${d}`);const c=e.data,{methodName:a,args:m,id:p}=c;t(`${i}: Received ${a}() call`);const v=e=>n=>{if(t(`${i}: Sending ${a}() reply`),h)return void t(`${i}: Unable to send ${a}() reply due to destroyed connection`);const c={penpal:o.Reply,id:p,resolution:e,returnValue:n};e===r.Rejected&&n instanceof Error&&(c.returnValue=f(n),c.returnValueIsError=!0);try{l.postMessage(c,u)}catch(e){if(e.name===s.DataCloneError){const n={penpal:o.Reply,id:p,resolution:r.Rejected,returnValue:f(e),returnValueIsError:!0};l.postMessage(n,u)}throw e}};new Promise((e=>e(n[a].apply(n,m)))).then(v(r.Fulfilled),v(r.Rejected))};return a.addEventListener(c.Message,m),()=>{h=!0,a.removeEventListener(c.Message,m)}})(v,e,a),u(d),h&&h.forEach((e=>{delete m[e]})),h=i.data.methodNames;const y=p(m,v,h,l,a);return u(y),m}};var y=e=>{let{iframe:n,methods:t={},childOrigin:r,timeout:s,debug:a=!1}=e;const f=(e=>(...n)=>{e&&console.log("[Penpal]",...n)})(a),h=(()=>{const e=[];let n=!1;return{destroy(t){n=!0,e.forEach((e=>{e(t)}))},onDestroy(t){n?t():e.push(t)}}})(),{onDestroy:m,destroy:p}=h;r||((e=>{if(!e.src&&!e.srcdoc){const e=new Error("Iframe must have src or srcdoc property defined.");throw e.code=i.NoIframeSrc,e}})(n),r=(e=>{if(e&&d.find((n=>e.startsWith(n))))return"null";const n=document.location,t=u.exec(e);let o,r,i;return t?(o=t[1]?t[1]:n.protocol,r=t[2],i=t[4]):(o=n.protocol,r=n.hostname,i=n.port),`${o}//${r}${i&&i!==l[o]?`:${i}`:""}`})(n.src));const y="null"===r?"*":r,g=((e,n,t,r)=>i=>{if(i.origin!==t)return void e(`Parent: Handshake - Received SYN message from origin ${i.origin} which did not match expected origin ${t}`);e("Parent: Handshake - Received SYN, responding with SYN-ACK");const s={penpal:o.SynAck,methodNames:Object.keys(n)};i.source.postMessage(s,r)})(f,t,r,y),w=v(t,r,y,h,f);return{promise:new Promise(((e,t)=>{const r=((e,n)=>{let t;return void 0!==e&&(t=window.setTimeout((()=>{const t=new Error(`Connection timed out after ${e}ms`);t.code=i.ConnectionTimeout,n(t)}),e)),()=>{clearTimeout(t)}})(s,p),a=t=>{if(t.source===n.contentWindow&&t.data)if(t.data.penpal!==o.Syn)if(t.data.penpal!==o.Ack);else{const n=w(t);n&&(r(),e(n))}else g(t)};window.addEventListener(c.Message,a),f("Parent: Awaiting handshake"),((e,n)=>{const{destroy:t,onDestroy:o}=n,r=setInterval((()=>{e.isConnected||(clearInterval(r),t())}),6e4);o((()=>{clearInterval(r)}))})(n,h),m((e=>{window.removeEventListener(c.Message,a),e||((e=new Error("Connection destroyed")).code=i.ConnectionDestroyed),t(e)}))})),destroy(){p()}}};return function(t,o,r,i){var s=this;this.columnHooks=[],this.rowHooks=[],this.initIFrame=function(){if(!document.getElementById(s.iframeId)){var e=document.createElement("iframe");e.onload=function(){s.connection?s.connection.promise.then((function(e){e.init(s.licenseKey,s.fields,s.settings,s.user)})):console.error("shim cannot connect with Dromo service.")},e.src=a,e.id=s.iframeId,e.style.height="100%",e.style.width="100%",e.style.border="0",e.crossorigin="anonymous",s.iframe=e}},this.createConnection=function(){var t=s,o=s.iframe;o?s.connection=y({iframe:o,methods:{handleColumnHooks:function(o,r){var i=this;return new Promise((function(s){return e(i,void 0,void 0,(function(){var i,c,a,l,u=this;return n(this,(function(d){switch(d.label){case 0:return i=t.columnHooks.filter((function(e){return e.fieldName===o})),c=new Map,a=r,[4,i.reduce((function(t,o){return e(u,void 0,void 0,(function(){var r=this;return n(this,(function(i){switch(i.label){case 0:return[4,t.then((function(){return e(r,void 0,void 0,(function(){return n(this,(function(e){switch(e.label){case 0:return[4,o.callback(a)];case 1:return e.sent().forEach((function(e){if(e.value||e.info){var n={};e.value&&(n.newValue=e.value,a[e.index]=e.value),e.info&&(n.info=e.info),c.set(e.index,n)}})),[2]}}))}))}))];case 1:return i.sent(),[2]}}))}))}),Promise.resolve())];case 1:return d.sent(),l=[],c.forEach((function(e,n){var t={index:n};e.info&&(t.info=e.info),e.newValue&&(t.value=e.newValue),l.push(t)})),s(l),[2]}}))}))}))},handleRowHooks:function(o){var r=this;return new Promise((function(i){return e(r,void 0,void 0,(function(){var r,s,c=this;return n(this,(function(a){switch(a.label){case 0:return r=o.row,s=new Map,[4,t.rowHooks.reduce((function(t,i){return e(c,void 0,void 0,(function(){var c=this;return n(this,(function(a){switch(a.label){case 0:return[4,t.then((function(){return e(c,void 0,void 0,(function(){var e;return n(this,(function(n){switch(n.label){case 0:return[4,i.callback({row:r,index:o.index})];case 1:return e=n.sent(),Object.keys(e.row).forEach((function(n){var t=e.row[n];if(t.value||t.info){var o={};t.value&&(o.value=t.value,r[n].value=t.value),t.info&&(o.info=t.info),s.set(n,o)}})),[2]}}))}))}))];case 1:return a.sent(),[2]}}))}))}),Promise.resolve())];case 1:return a.sent(),i({row:Object.fromEntries(s)}),[2]}}))}))}))},handleResults:function(e){t.resultsCallback&&t.resultsCallback(e),t.close()},handleCloseModal:function(){t.close()},handleCancel:function(){t.cancelCallback&&t.cancelCallback(),t.close()}}}):console.error("shim cannot connect to Dromo.")},this.mountIFrame=function(){if(!document.getElementById(s.iframeId)){var e=document.createElement("div");e.id=s.wrapperId,e.style.zIndex=Number.MAX_SAFE_INTEGER.toString(),e.style.visibility="hidden",e.style.width="0px",e.style.height="0px",e.style.position="fixed",e.style.top="0px",e.style.left="0px",e.style.right="0px",e.style.bottom="0px",e.appendChild(s.iframe),document.body.appendChild(e),s.wrapper=e}},this.registerColumnHook=function(e,n){s.columnHooks.push({fieldName:e,callback:n}),s.connection&&s.connection.promise.then((function(e){e.setNumRegisteredColHooks(s.columnHooks.length)}))},this.registerRowHook=function(e){s.rowHooks.push({callback:e}),s.connection&&s.connection.promise.then((function(e){e.setNumRegisteredRowHooks(s.rowHooks.length)}))},this.onResults=function(e){s.resultsCallback=e},this.onCancel=function(e){s.cancelCallback=e},this.open=function(){s.wrapper||(s.initIFrame(),s.createConnection(),s.mountIFrame()),s.wrapper&&(s.wrapper.style.visibility="visible",s.wrapper.style.width="100%",s.wrapper.style.height="100%",document.body.style.overflow="hidden")},this.close=function(){s.wrapper&&(s.wrapper.style.visibility="hidden",s.wrapper.style.width="0px",s.wrapper.style.height="0px",document.body.style.overflow="inherit")},this.iframeId=Math.random().toString(36).substring(7)+"-dromo-iframe-element",this.wrapperId=Math.random().toString(36).substring(7)+"-dromo-container",this.licenseKey=t,this.fields=o,this.settings=r,this.user=i}}(); | ||
***************************************************************************** */function e(e,n,t,o){return new(t||(t=Promise))((function(r,i){function s(e){try{a(o.next(e))}catch(e){i(e)}}function c(e){try{a(o.throw(e))}catch(e){i(e)}}function a(e){var n;e.done?r(e.value):(n=e.value,n instanceof t?n:new t((function(e){e(n)}))).then(s,c)}a((o=o.apply(e,n||[])).next())}))}function n(e,n){var t,o,r,i,s={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return i={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function c(i){return function(c){return function(i){if(t)throw new TypeError("Generator is already executing.");for(;s;)try{if(t=1,o&&(r=2&i[0]?o.return:i[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,i[1])).done)return r;switch(o=0,r&&(i=[2&i[0],r.value]),i[0]){case 0:case 1:r=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,o=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!(r=s.trys,(r=r.length>0&&r[r.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!r||i[1]>r[0]&&i[1]<r[3])){s.label=i[1];break}if(6===i[0]&&s.label<r[1]){s.label=r[1],r=i;break}if(r&&s.label<r[2]){s.label=r[2],s.ops.push(i);break}r[2]&&s.ops.pop(),s.trys.pop();continue}i=n.call(e,s)}catch(e){i=[6,e],o=0}finally{t=r=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,c])}}}var t,o,r,i,s,c,a={IFRAME_URL:"https://widget.dromo.io/"}.IFRAME_URL;!function(e){e.INIT_IFRAME="INIT_IFRAME"}(t||(t={})),function(e){e.Call="call",e.Reply="reply",e.Syn="syn",e.SynAck="synAck",e.Ack="ack"}(o||(o={})),function(e){e.Fulfilled="fulfilled",e.Rejected="rejected"}(r||(r={})),function(e){e.ConnectionDestroyed="ConnectionDestroyed",e.ConnectionTimeout="ConnectionTimeout",e.NotInIframe="NotInIframe",e.NoIframeSrc="NoIframeSrc"}(i||(i={})),function(e){e.DataCloneError="DataCloneError"}(s||(s={})),function(e){e.Message="message"}(c||(c={}));const l={"http:":"80","https:":"443"},u=/^(https?:)?\/\/([^/:]+)?(:(\d+))?/,d=["file:","data:"];const f=({name:e,message:n,stack:t})=>({name:e,message:n,stack:t});let h=0;var m=()=>++h,p=(e,n,t,s,a)=>{const{localName:l,local:u,remote:d,originForSending:f,originForReceiving:h}=n;let p=!1;a(`${l}: Connecting call sender`);const v=e=>(...n)=>{let t;a(`${l}: Sending ${e}() call`);try{d.closed&&(t=!0)}catch(e){t=!0}if(t&&s(),p){const n=new Error(`Unable to send ${e}() call due to destroyed connection`);throw n.code=i.ConnectionDestroyed,n}return new Promise(((t,i)=>{const s=m(),p=n=>{if(n.source!==d||n.data.penpal!==o.Reply||n.data.id!==s)return;if(n.origin!==h)return void a(`${l} received message from origin ${n.origin} which did not match expected origin ${h}`);const f=n.data;a(`${l}: Received ${e}() reply`),u.removeEventListener(c.Message,p);let m=f.returnValue;f.returnValueIsError&&(m=(e=>{const n=new Error;return Object.keys(e).forEach((t=>n[t]=e[t])),n})(m)),(f.resolution===r.Fulfilled?t:i)(m)};u.addEventListener(c.Message,p);const v={penpal:o.Call,id:s,methodName:e,args:n};d.postMessage(v,f)}))};return t.reduce(((e,n)=>(e[n]=v(n),e)),e),()=>{p=!0}},v=(e,n,t,i,a)=>{const{destroy:l,onDestroy:u}=i;let d,h;const m={};return i=>{if(i.origin!==n)return void a(`Parent: Handshake - Received ACK message from origin ${i.origin} which did not match expected origin ${n}`);a("Parent: Handshake - Received ACK");const v={localName:"Parent",local:window,remote:i.source,originForSending:t,originForReceiving:n};d&&d(),d=((e,n,t)=>{const{localName:i,local:a,remote:l,originForSending:u,originForReceiving:d}=e;let h=!1;const m=e=>{if(e.source!==l||e.data.penpal!==o.Call)return;if(e.origin!==d)return void t(`${i} received message from origin ${e.origin} which did not match expected origin ${d}`);const c=e.data,{methodName:a,args:m,id:p}=c;t(`${i}: Received ${a}() call`);const v=e=>n=>{if(t(`${i}: Sending ${a}() reply`),h)return void t(`${i}: Unable to send ${a}() reply due to destroyed connection`);const c={penpal:o.Reply,id:p,resolution:e,returnValue:n};e===r.Rejected&&n instanceof Error&&(c.returnValue=f(n),c.returnValueIsError=!0);try{l.postMessage(c,u)}catch(e){if(e.name===s.DataCloneError){const n={penpal:o.Reply,id:p,resolution:r.Rejected,returnValue:f(e),returnValueIsError:!0};l.postMessage(n,u)}throw e}};new Promise((e=>e(n[a].apply(n,m)))).then(v(r.Fulfilled),v(r.Rejected))};return a.addEventListener(c.Message,m),()=>{h=!0,a.removeEventListener(c.Message,m)}})(v,e,a),u(d),h&&h.forEach((e=>{delete m[e]})),h=i.data.methodNames;const g=p(m,v,h,l,a);return u(g),m}};var g=e=>{let{iframe:n,methods:t={},childOrigin:r,timeout:s,debug:a=!1}=e;const f=(e=>(...n)=>{e&&console.log("[Penpal]",...n)})(a),h=(()=>{const e=[];let n=!1;return{destroy(t){n=!0,e.forEach((e=>{e(t)}))},onDestroy(t){n?t():e.push(t)}}})(),{onDestroy:m,destroy:p}=h;r||((e=>{if(!e.src&&!e.srcdoc){const e=new Error("Iframe must have src or srcdoc property defined.");throw e.code=i.NoIframeSrc,e}})(n),r=(e=>{if(e&&d.find((n=>e.startsWith(n))))return"null";const n=document.location,t=u.exec(e);let o,r,i;return t?(o=t[1]?t[1]:n.protocol,r=t[2],i=t[4]):(o=n.protocol,r=n.hostname,i=n.port),`${o}//${r}${i&&i!==l[o]?`:${i}`:""}`})(n.src));const g="null"===r?"*":r,w=((e,n,t,r)=>i=>{if(i.origin!==t)return void e(`Parent: Handshake - Received SYN message from origin ${i.origin} which did not match expected origin ${t}`);e("Parent: Handshake - Received SYN, responding with SYN-ACK");const s={penpal:o.SynAck,methodNames:Object.keys(n)};i.source.postMessage(s,r)})(f,t,r,g),y=v(t,r,g,h,f);return{promise:new Promise(((e,t)=>{const r=((e,n)=>{let t;return void 0!==e&&(t=window.setTimeout((()=>{const t=new Error(`Connection timed out after ${e}ms`);t.code=i.ConnectionTimeout,n(t)}),e)),()=>{clearTimeout(t)}})(s,p),a=t=>{if(t.source===n.contentWindow&&t.data)if(t.data.penpal!==o.Syn)if(t.data.penpal!==o.Ack);else{const n=y(t);n&&(r(),e(n))}else w(t)};window.addEventListener(c.Message,a),f("Parent: Awaiting handshake"),((e,n)=>{const{destroy:t,onDestroy:o}=n,r=setInterval((()=>{e.isConnected||(clearInterval(r),t())}),6e4);o((()=>{clearInterval(r)}))})(n,h),m((e=>{window.removeEventListener(c.Message,a),e||((e=new Error("Connection destroyed")).code=i.ConnectionDestroyed),t(e)}))})),destroy(){p()}}};return function(t,o,r,i){var s=this;this.columnHooks=[],this.rowHooks=[],this.initIFrame=function(){if(!document.getElementById(s.iframeId)){var e=document.createElement("iframe");e.onload=function(){s.connection?s.connection.promise.then((function(e){e.init(s.licenseKey,s.fields,s.settings,s.user)})):console.error("shim cannot connect with Dromo service.")},e.src=a,e.id=s.iframeId,e.style.height="100%",e.style.width="100%",e.style.border="0",e.crossorigin="anonymous",s.iframe=e}},this.createConnection=function(){var t=s,o=s.iframe;o?s.connection=g({iframe:o,methods:{handleColumnHooks:function(o,r){var i=this;return new Promise((function(s){return e(i,void 0,void 0,(function(){var i,c,a,l,u=this;return n(this,(function(d){switch(d.label){case 0:return i=t.columnHooks.filter((function(e){return e.fieldName===o})),c=new Map,a=r,[4,i.reduce((function(t,o){return e(u,void 0,void 0,(function(){var r=this;return n(this,(function(i){switch(i.label){case 0:return[4,t.then((function(){return e(r,void 0,void 0,(function(){return n(this,(function(e){switch(e.label){case 0:return[4,o.callback(a)];case 1:return e.sent().forEach((function(e){if(e.value||e.info){var n={};e.value&&(n.newValue=e.value,a[e.index]=e.value),e.info&&(n.info=e.info),c.set(e.index,n)}})),[2]}}))}))}))];case 1:return i.sent(),[2]}}))}))}),Promise.resolve())];case 1:return d.sent(),l=[],c.forEach((function(e,n){var t={index:n};e.info&&(t.info=e.info),e.newValue&&(t.value=e.newValue),l.push(t)})),s(l),[2]}}))}))}))},handleRowHooks:function(o){var r=this;return new Promise((function(i){return e(r,void 0,void 0,(function(){var r,s,c=this;return n(this,(function(a){switch(a.label){case 0:return r=o.row,s=new Map,[4,t.rowHooks.reduce((function(t,i){return e(c,void 0,void 0,(function(){var c=this;return n(this,(function(a){switch(a.label){case 0:return[4,t.then((function(){return e(c,void 0,void 0,(function(){var e;return n(this,(function(n){switch(n.label){case 0:return[4,i.callback({row:r,index:o.index})];case 1:return e=n.sent(),Object.keys(e.row).forEach((function(n){var t=e.row[n];if(t.value||t.info){var o={};t.value&&(o.value=t.value,r[n].value=t.value),t.info&&(o.info=t.info),s.set(n,o)}})),[2]}}))}))}))];case 1:return a.sent(),[2]}}))}))}),Promise.resolve())];case 1:return a.sent(),i({row:Object.fromEntries(s)}),[2]}}))}))}))},handleResults:function(e){t.resultsCallback&&t.resultsCallback(e),t.close()},handleCloseModal:function(){t.close()},handleCancel:function(){t.cancelCallback&&t.cancelCallback(),t.close()}}}):console.error("shim cannot connect to Dromo.")},this.mountIFrame=function(){if(!document.getElementById(s.iframeId)){var e=document.createElement("div");e.id=s.wrapperId,e.style.zIndex=Number.MAX_SAFE_INTEGER.toString(),e.style.visibility="hidden",e.style.width="0px",e.style.height="0px",e.style.position="fixed",e.style.top="0px",e.style.left="0px",e.style.right="0px",e.style.bottom="0px",e.appendChild(s.iframe),document.body.appendChild(e),s.wrapper=e}},this.registerColumnHook=function(e,n){s.columnHooks.push({fieldName:e,callback:n}),s.connection&&s.connection.promise.then((function(e){e.setNumRegisteredColHooks(s.columnHooks.length)}))},this.registerRowHook=function(e){s.rowHooks.push({callback:e}),s.connection&&s.connection.promise.then((function(e){e.setNumRegisteredRowHooks(s.rowHooks.length)}))},this.onResults=function(e){s.resultsCallback=e},this.onCancel=function(e){s.cancelCallback=e},this.open=function(){s.wrapper||(s.initIFrame(),s.createConnection(),s.mountIFrame(),s.connection?s.connection.promise.then((function(e){e.setNumRegisteredRowHooks(s.rowHooks.length),e.setNumRegisteredColHooks(s.columnHooks.length)})):console.error("Unable to connect to Dromo to register hooks.")),s.wrapper&&(s.wrapper.style.visibility="visible",s.wrapper.style.width="100%",s.wrapper.style.height="100%",document.body.style.overflow="hidden")},this.close=function(){s.wrapper&&(s.wrapper.style.visibility="hidden",s.wrapper.style.width="0px",s.wrapper.style.height="0px",document.body.style.overflow="inherit")},this.iframeId=Math.random().toString(36).substring(7)+"-dromo-iframe-element",this.wrapperId=Math.random().toString(36).substring(7)+"-dromo-container",this.licenseKey=t,this.fields=o,this.settings=r,this.user=i}}(); | ||
//# sourceMappingURL=DromoUploader.js.map |
{ | ||
"name": "dromo-uploader-js", | ||
"version": "1.1.13", | ||
"version": "1.1.14", | ||
"description": "Easy to use data (CSV, TSV, Excel) importer", | ||
@@ -5,0 +5,0 @@ "author": "ankitgoyal100", |
Sorry, the diff of this file is not supported yet
77219
195