diff --git a/dist/.vite/manifest.json b/dist/.vite/manifest.json index db40359..ecfa4bb 100644 --- a/dist/.vite/manifest.json +++ b/dist/.vite/manifest.json @@ -1,6 +1,6 @@ { "gamutable.js": { - "file": "assets/gamutable-CAcZWA31.js", + "file": "assets/gamutable-Cq_WjPEr.js", "name": "gamutable", "src": "gamutable.js", "isEntry": true diff --git a/dist/assets/gamutable-CAcZWA31.js b/dist/assets/gamutable-Cq_WjPEr.js similarity index 99% rename from dist/assets/gamutable-CAcZWA31.js rename to dist/assets/gamutable-Cq_WjPEr.js index 7fd28e3..fdce8d3 100644 --- a/dist/assets/gamutable-CAcZWA31.js +++ b/dist/assets/gamutable-Cq_WjPEr.js @@ -48,4 +48,4 @@ License: MIT `:"\r"}(X,Te)),T=!1,p.delimiter)F(p.delimiter)&&(p.delimiter=p.delimiter(X),te.meta.delimiter=p.delimiter);else{var h=function(w,L,D,j,Z){var J,G,P,Y;Z=Z||[","," ","|",";",a.RECORD_SEP,a.UNIT_SEP];for(var oe=0;oe=K)return We(!0)}else for(Q=V,V++;;){if((Q=ie.indexOf(u,Q+1))===-1)return ye||Ce.push({type:"Quotes",code:"MissingQuotes",message:"Quoted field unterminated",row:le.length,index:V}),Pe();if(Q===te-1)return Pe(ie.substring(V,Q).replace(oe,u));if(u!==W||ie[Q+1]!==W){if(u===W||Q===0||ie[Q-1]!==W){P!==-1&&P=K)return We(!0);break}Ce.push({type:"Quotes",code:"InvalidQuotes",message:"Trailing quote on quoted field is malformed",row:le.length,index:V}),Q++}}else Q++}return Pe();function Ie(x){le.push(x),he=V}function ve(x){var A=0;if(x!==-1){var S=ie.substring(Q+1,x);S&&S.trim()===""&&(A=S.length)}return A}function Pe(x){return ye||(x===void 0&&(x=ie.substring(V)),X.push(x),V=te,Ie(X),ce&&Vt()),We()}function Ke(x){V=x,Ie(X),X=[],Y=ie.indexOf(T,V)}function We(x){return{data:le,errors:Ce,meta:{delimiter:g,linebreak:T,aborted:z,truncated:!!x,cursor:he+(Me||0)}}}function Vt(){O(We()),le=[],Ce=[]}},this.abort=function(){z=!0},this.getCharIndex=function(){return V}}function N(p){var u=p.data,g=o[u.workerId],T=!1;if(u.error)g.userError(u.error,u.file);else if(u.results&&u.results.data){var v={abort:function(){T=!0,_(u.workerId,{data:[],errors:[],meta:{aborted:!0}})},pause:k,resume:k};if(F(g.userStep)){for(var O=0;O{try{const n=new Blob([e],{type:"text/csv"}),s=URL.createObjectURL(n),i=document.createElement("a");i.id=`csv-${parseInt(Math.random().toString().slice(2,16))}`,i.href=s,document.body.appendChild(i);const r=document.getElementById(i.id);return r.style.visibility="hidden",r.download=`${t}.csv`,r.click(),setTimeout(()=>{document.body.removeChild(i)},1),!0}catch{return!1}},uv=e=>e.map(t=>JSON.stringify(t)).reduce((t,n)=>(t.find(s=>s===n)||t.push(n),t),[]).map(t=>JSON.parse(t)),pa={install(e,t){const n={download:cv,dedupe:uv},s=Object.entries(av).reduce((r,[o,l])=>(r[o]=l,r),{}),i=Object.assign(s,n);"config"in e&&"globalProperties"in e.config?e.config.globalProperties.$papa=i:e.prototype.$papa=i}},ga={GamuTable:iv};of();function of(){let e=1;for(const t of document.getElementsByClassName("vue-gamutable"))e===1?(window.app=Zr({components:ga,mounted(){app.rechargerJson=this.$refs.montableau.rechargerJson,app.delLigne=this.$refs.montableau.delLigne}}),app.use(pa),app.provide("$papa",app.config.globalProperties.$papa),app.mount(t)):e===2&&(window.app2=Zr({components:ga,mounted(){app2.rechargerJson=this.$refs.montableau_deux.rechargerJson,app2.delLigne=this.$refs.montableau_deux.delLigne}}),app2.use(pa),app2.provide("$papa",app2.config.globalProperties.$papa),app2.mount(t)),e++}window.gamutable=of;$("#vueGamutable").on("click",".url_action, .url_action--ss_css",function(e){e.preventDefault(),e.stopPropagation();let t=$(this).data("confirm");if(t!==void 0&&!confirm(t))return;let n=$(this).attr("href"),s=$(this).data("id"),i="1";$(this).parents(".gamutableDeux").length&&(i="2"),$(this).data("treload")!==void 0&&(i=$(this).data("treload").toString());let r=i.indexOf("1")!==-1,o=i.indexOf("2")!==-1;$(this).has("i.icon, i.fa")&&$(this).find("i.icon, i.fa").eq(0).replaceWith('');let l=$(this).data("ajaxreload");$.ajax({url:n,dataType:"json",async:!0}).done(function(a){!$.isEmptyObject(a)&&!$.isEmptyObject(a.message_erreur)?alert(a.message_erreur):(parseInt(s)>0?(r&&app.rechargerJson(s),o&&app2.rechargerJson(s)):parseInt(s)<0?(r&&app.delLigne(s),o&&app2.delLigne(s)):(r&&app.rechargerJson("maj 1"),o&&app2.rechargerJson("maj 2")),l!==void 0&&ajaxReload(l,{args:{id:s},callback:function(){}}))})}); +`);var V=0,z=!1;this.parse=function(ie,Me,ye){if(typeof ie!="string")throw new Error("Input must be a string");var te=ie.length,Ae=g.length,M=T.length,U=v.length,ce=F(O),le=[],Ce=[],X=[],he=V=0;if(!ie)return We();if(p.header&&!Me){var Ee=ie.split(T)[0].split(g),Te=[],h={},m=!1;for(var w in Ee){var L=Ee[w];F(p.transformHeader)&&(L=p.transformHeader(L,w));var D=L,j=h[L]||0;for(0=K)return We(!0)}else for(Q=V,V++;;){if((Q=ie.indexOf(u,Q+1))===-1)return ye||Ce.push({type:"Quotes",code:"MissingQuotes",message:"Quoted field unterminated",row:le.length,index:V}),Pe();if(Q===te-1)return Pe(ie.substring(V,Q).replace(oe,u));if(u!==W||ie[Q+1]!==W){if(u===W||Q===0||ie[Q-1]!==W){P!==-1&&P=K)return We(!0);break}Ce.push({type:"Quotes",code:"InvalidQuotes",message:"Trailing quote on quoted field is malformed",row:le.length,index:V}),Q++}}else Q++}return Pe();function Ie(x){le.push(x),he=V}function ve(x){var A=0;if(x!==-1){var S=ie.substring(Q+1,x);S&&S.trim()===""&&(A=S.length)}return A}function Pe(x){return ye||(x===void 0&&(x=ie.substring(V)),X.push(x),V=te,Ie(X),ce&&Vt()),We()}function Ke(x){V=x,Ie(X),X=[],Y=ie.indexOf(T,V)}function We(x){return{data:le,errors:Ce,meta:{delimiter:g,linebreak:T,aborted:z,truncated:!!x,cursor:he+(Me||0)}}}function Vt(){O(We()),le=[],Ce=[]}},this.abort=function(){z=!0},this.getCharIndex=function(){return V}}function N(p){var u=p.data,g=o[u.workerId],T=!1;if(u.error)g.userError(u.error,u.file);else if(u.results&&u.results.data){var v={abort:function(){T=!0,_(u.workerId,{data:[],errors:[],meta:{aborted:!0}})},pause:k,resume:k};if(F(g.userStep)){for(var O=0;O{try{const n=new Blob([e],{type:"text/csv"}),s=URL.createObjectURL(n),i=document.createElement("a");i.id=`csv-${parseInt(Math.random().toString().slice(2,16))}`,i.href=s,document.body.appendChild(i);const r=document.getElementById(i.id);return r.style.visibility="hidden",r.download=`${t}.csv`,r.click(),setTimeout(()=>{document.body.removeChild(i)},1),!0}catch{return!1}},uv=e=>e.map(t=>JSON.stringify(t)).reduce((t,n)=>(t.find(s=>s===n)||t.push(n),t),[]).map(t=>JSON.parse(t)),pa={install(e,t){const n={download:cv,dedupe:uv},s=Object.entries(av).reduce((r,[o,l])=>(r[o]=l,r),{}),i=Object.assign(s,n);"config"in e&&"globalProperties"in e.config?e.config.globalProperties.$papa=i:e.prototype.$papa=i}},ga={GamuTable:iv};try{const t=function(n,s){return new Array(s+1).join(n)}("gamutable ",100);localStorage.setItem("test_gamutable",t),localStorage.removeItem("test_gamutable")}catch(e){console.log(e.code),(e.code===22||e.code===1024)&&(console.error("On fait le ménage de tout le localstorage"),localStorage.clear())}of();function of(){let e=1;for(const t of document.getElementsByClassName("vue-gamutable"))e===1?(window.app=Zr({components:ga,mounted(){app.rechargerJson=this.$refs.montableau.rechargerJson,app.delLigne=this.$refs.montableau.delLigne}}),app.use(pa),app.provide("$papa",app.config.globalProperties.$papa),app.mount(t)):e===2&&(window.app2=Zr({components:ga,mounted(){app2.rechargerJson=this.$refs.montableau_deux.rechargerJson,app2.delLigne=this.$refs.montableau_deux.delLigne}}),app2.use(pa),app2.provide("$papa",app2.config.globalProperties.$papa),app2.mount(t)),e++}window.gamutable=of;$("#vueGamutable").on("click",".url_action, .url_action--ss_css",function(e){e.preventDefault(),e.stopPropagation();let t=$(this).data("confirm");if(t!==void 0&&!confirm(t))return;let n=$(this).attr("href"),s=$(this).data("id"),i="1";$(this).parents(".gamutableDeux").length&&(i="2"),$(this).data("treload")!==void 0&&(i=$(this).data("treload").toString());let r=i.indexOf("1")!==-1,o=i.indexOf("2")!==-1;$(this).has("i.icon, i.fa")&&$(this).find("i.icon, i.fa").eq(0).replaceWith('');let l=$(this).data("ajaxreload");$.ajax({url:n,dataType:"json",async:!0}).done(function(a){!$.isEmptyObject(a)&&!$.isEmptyObject(a.message_erreur)?alert(a.message_erreur):(parseInt(s)>0?(r&&app.rechargerJson(s),o&&app2.rechargerJson(s)):parseInt(s)<0?(r&&app.delLigne(s),o&&app2.delLigne(s)):(r&&app.rechargerJson("maj 1"),o&&app2.rechargerJson("maj 2")),l!==void 0&&ajaxReload(l,{args:{id:s},callback:function(){}}))})}); diff --git a/paquet.xml b/paquet.xml index 543d978..6b56ee5 100644 --- a/paquet.xml +++ b/paquet.xml @@ -1,7 +1,7 @@