quasar-factory-lib 0.0.99 → 0.1.1
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/quasar-factory-lib.js +14 -1
- package/dist/quasar-factory-lib.umd.cjs +1 -1
- package/package.json +1 -1
- package/src/components/Table/Table.vue +11 -1
- package/src/components/Table/utils/infiniteScroll.ts +1 -0
- package/src/layouts/PdaLayout.vue +13 -2
- package/src/layouts/PdaLayoutVueCompositionApi.vue +625 -0
|
@@ -13001,6 +13001,16 @@ const q0 = xn({
|
|
|
13001
13001
|
smallDevice(e) {
|
|
13002
13002
|
e ? this.dragAndDropDelay = 200 : this.dragAndDropDelay = 0;
|
|
13003
13003
|
}
|
|
13004
|
+
/* showSkeleton (val: boolean): void {
|
|
13005
|
+
if (!val) {
|
|
13006
|
+
this.handleInfiniteScrollTableCompositionAPi()
|
|
13007
|
+
}
|
|
13008
|
+
},
|
|
13009
|
+
'$q.screen.width' (): void {
|
|
13010
|
+
setTimeout(() => {
|
|
13011
|
+
this.handleInfiniteScrollTableCompositionAPi()
|
|
13012
|
+
}, 500)
|
|
13013
|
+
} */
|
|
13004
13014
|
},
|
|
13005
13015
|
mounted() {
|
|
13006
13016
|
this.getAdvancedFilterColumns();
|
|
@@ -18246,7 +18256,10 @@ const mS = {
|
|
|
18246
18256
|
const o = t ? "q-table__grid-content" : "q-table__middle scroll", a = t ? "Grid" : "Table", l = document.getElementsByClassName(o), r = l.length > 0 ? l[0] : window, i = (s) => {
|
|
18247
18257
|
console.log(n, "totalPage");
|
|
18248
18258
|
const { scrollHeight: c, scrollTop: u, clientHeight: f } = s.target;
|
|
18249
|
-
Math.abs(c - f - u) < 1
|
|
18259
|
+
if (Math.abs(c - f - u) < 1) {
|
|
18260
|
+
debugger;
|
|
18261
|
+
console.log(`[${a}] You are at the bottom!`, n), n++;
|
|
18262
|
+
}
|
|
18250
18263
|
};
|
|
18251
18264
|
window.removeEventListener("scroll", i), r.removeEventListener("scroll", i), r.addEventListener("scroll", i);
|
|
18252
18265
|
});
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* @license MIT
|
|
10
10
|
*/const eC=process.env.NODE_ENV!=="production"?Symbol("pinia"):Symbol();var _o;(function(e){e.direct="direct",e.patchObject="patch object",e.patchFunction="patch function"})(_o||(_o={}));const Yi=typeof window<"u",mm=typeof window=="object"&&window.window===window?window:typeof self=="object"&&self.self===self?self:typeof global=="object"&&global.global===global?global:typeof globalThis=="object"?globalThis:{HTMLElement:null};function tC(e,{autoBom:t=!1}={}){return t&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type)?new Blob(["\uFEFF",e],{type:e.type}):e}function Wi(e,t,n){const o=new XMLHttpRequest;o.open("GET",e),o.responseType="blob",o.onload=function(){pm(o.response,t,n)},o.onerror=function(){console.error("could not download file")},o.send()}function hm(e){const t=new XMLHttpRequest;t.open("HEAD",e,!1);try{t.send()}catch{}return t.status>=200&&t.status<=299}function Fr(e){try{e.dispatchEvent(new MouseEvent("click"))}catch{const n=document.createEvent("MouseEvents");n.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),e.dispatchEvent(n)}}const qr=typeof navigator=="object"?navigator:{userAgent:""},gm=/Macintosh/.test(qr.userAgent)&&/AppleWebKit/.test(qr.userAgent)&&!/Safari/.test(qr.userAgent),pm=Yi?typeof HTMLAnchorElement<"u"&&"download"in HTMLAnchorElement.prototype&&!gm?nC:"msSaveOrOpenBlob"in qr?oC:aC:()=>{};function nC(e,t="download",n){const o=document.createElement("a");o.download=t,o.rel="noopener",typeof e=="string"?(o.href=e,o.origin!==location.origin?hm(o.href)?Wi(e,t,n):(o.target="_blank",Fr(o)):Fr(o)):(o.href=URL.createObjectURL(e),setTimeout(function(){URL.revokeObjectURL(o.href)},4e4),setTimeout(function(){Fr(o)},0))}function oC(e,t="download",n){if(typeof e=="string")if(hm(e))Wi(e,t,n);else{const o=document.createElement("a");o.href=e,o.target="_blank",setTimeout(function(){Fr(o)})}else navigator.msSaveOrOpenBlob(tC(e,n),t)}function aC(e,t,n,o){if(o=o||open("","_blank"),o&&(o.document.title=o.document.body.innerText="downloading..."),typeof e=="string")return Wi(e,t,n);const a=e.type==="application/octet-stream",l=/constructor/i.test(String(mm.HTMLElement))||"safari"in mm,i=/CriOS\/[\d]+/.test(navigator.userAgent);if((i||a&&l||gm)&&typeof FileReader<"u"){const s=new FileReader;s.onloadend=function(){let u=s.result;if(typeof u!="string")throw o=null,new Error("Wrong reader.result type");u=i?u:u.replace(/^data:[^;]*;/,"data:attachment/file;"),o?o.location.href=u:location.assign(u),o=null},s.readAsDataURL(e)}else{const s=URL.createObjectURL(e);o?o.location.assign(s):location.href=s,o=null,setTimeout(function(){URL.revokeObjectURL(s)},4e4)}}function At(e,t){const n="🍍 "+e;typeof __VUE_DEVTOOLS_TOAST__=="function"?__VUE_DEVTOOLS_TOAST__(n,t):t==="error"?console.error(n):t==="warn"?console.warn(n):console.log(n)}function Ki(e){return"_a"in e&&"install"in e}function _m(){if(!("clipboard"in navigator))return At("Your browser doesn't support the Clipboard API","error"),!0}function vm(e){return e instanceof Error&&e.message.toLowerCase().includes("document is not focused")?(At('You need to activate the "Emulate a focused page" setting in the "Rendering" panel of devtools.',"warn"),!0):!1}async function rC(e){if(!_m())try{await navigator.clipboard.writeText(JSON.stringify(e.state.value)),At("Global state copied to clipboard.")}catch(t){if(vm(t))return;At("Failed to serialize the state. Check the console for more details.","error"),console.error(t)}}async function lC(e){if(!_m())try{bm(e,JSON.parse(await navigator.clipboard.readText())),At("Global state pasted from clipboard.")}catch(t){if(vm(t))return;At("Failed to deserialize the state from clipboard. Check the console for more details.","error"),console.error(t)}}async function iC(e){try{pm(new Blob([JSON.stringify(e.state.value)],{type:"text/plain;charset=utf-8"}),"pinia-state.json")}catch(t){At("Failed to export the state as JSON. Check the console for more details.","error"),console.error(t)}}let Pn;function sC(){Pn||(Pn=document.createElement("input"),Pn.type="file",Pn.accept=".json");function e(){return new Promise((t,n)=>{Pn.onchange=async()=>{const o=Pn.files;if(!o)return t(null);const a=o.item(0);return t(a?{text:await a.text(),file:a}:null)},Pn.oncancel=()=>t(null),Pn.onerror=n,Pn.click()})}return e}async function uC(e){try{const n=await sC()();if(!n)return;const{text:o,file:a}=n;bm(e,JSON.parse(o)),At(`Global state imported from "${a.name}".`)}catch(t){At("Failed to import the state from JSON. Check the console for more details.","error"),console.error(t)}}function bm(e,t){for(const n in t){const o=e.state.value[n];o?Object.assign(o,t[n]):e.state.value[n]=t[n]}}function mn(e){return{_custom:{display:e}}}const ym="🍍 Pinia (root)",$r="_root";function cC(e){return Ki(e)?{id:$r,label:ym}:{id:e.$id,label:e.$id}}function dC(e){if(Ki(e)){const n=Array.from(e._s.keys()),o=e._s;return{state:n.map(l=>({editable:!0,key:l,value:e.state.value[l]})),getters:n.filter(l=>o.get(l)._getters).map(l=>{const i=o.get(l);return{editable:!1,key:l,value:i._getters.reduce((s,u)=>(s[u]=i[u],s),{})}})}}const t={state:Object.keys(e.$state).map(n=>({editable:!0,key:n,value:e.$state[n]}))};return e._getters&&e._getters.length&&(t.getters=e._getters.map(n=>({editable:!1,key:n,value:e[n]}))),e._customProperties.size&&(t.customProperties=Array.from(e._customProperties).map(n=>({editable:!0,key:n,value:e[n]}))),t}function fC(e){return e?Array.isArray(e)?e.reduce((t,n)=>(t.keys.push(n.key),t.operations.push(n.type),t.oldValue[n.key]=n.oldValue,t.newValue[n.key]=n.newValue,t),{oldValue:{},keys:[],operations:[],newValue:{}}):{operation:mn(e.type),key:mn(e.key),oldValue:e.oldValue,newValue:e.newValue}:{}}function mC(e){switch(e){case _o.direct:return"mutation";case _o.patchFunction:return"$patch";case _o.patchObject:return"$patch";default:return"unknown"}}let Wo=!0;const Ur=[],vo="pinia:mutations",$t="pinia",{assign:hC}=Object,Hr=e=>"🍍 "+e;function gC(e,t){Cf({id:"dev.esm.pinia",label:"Pinia 🍍",logo:"https://pinia.vuejs.org/logo.svg",packageName:"pinia",homepage:"https://pinia.vuejs.org",componentStateTypes:Ur,app:e},n=>{typeof n.now!="function"&&At("You seem to be using an outdated version of Vue Devtools. Are you still using the Beta release instead of the stable one? You can find the links at https://devtools.vuejs.org/guide/installation.html."),n.addTimelineLayer({id:vo,label:"Pinia 🍍",color:15064968}),n.addInspector({id:$t,label:"Pinia 🍍",icon:"storage",treeFilterPlaceholder:"Search stores",actions:[{icon:"content_copy",action:()=>{rC(t)},tooltip:"Serialize and copy the state"},{icon:"content_paste",action:async()=>{await lC(t),n.sendInspectorTree($t),n.sendInspectorState($t)},tooltip:"Replace the state with the content of your clipboard"},{icon:"save",action:()=>{iC(t)},tooltip:"Save the state as a JSON file"},{icon:"folder_open",action:async()=>{await uC(t),n.sendInspectorTree($t),n.sendInspectorState($t)},tooltip:"Import the state from a JSON file"}],nodeActions:[{icon:"restore",tooltip:'Reset the state (with "$reset")',action:o=>{const a=t._s.get(o);a?typeof a.$reset!="function"?At(`Cannot reset "${o}" store because it doesn't have a "$reset" method implemented.`,"warn"):(a.$reset(),At(`Store "${o}" reset.`)):At(`Cannot reset "${o}" store because it wasn't found.`,"warn")}}]}),n.on.inspectComponent(o=>{const a=o.componentInstance&&o.componentInstance.proxy;if(a&&a._pStores){const l=o.componentInstance.proxy._pStores;Object.values(l).forEach(i=>{o.instanceData.state.push({type:Hr(i.$id),key:"state",editable:!0,value:i._isOptionsAPI?{_custom:{value:r.toRaw(i.$state),actions:[{icon:"restore",tooltip:"Reset the state of this store",action:()=>i.$reset()}]}}:Object.keys(i.$state).reduce((s,u)=>(s[u]=i.$state[u],s),{})}),i._getters&&i._getters.length&&o.instanceData.state.push({type:Hr(i.$id),key:"getters",editable:!1,value:i._getters.reduce((s,u)=>{try{s[u]=i[u]}catch(d){s[u]=d}return s},{})})})}}),n.on.getInspectorTree(o=>{if(o.app===e&&o.inspectorId===$t){let a=[t];a=a.concat(Array.from(t._s.values())),o.rootNodes=(o.filter?a.filter(l=>"$id"in l?l.$id.toLowerCase().includes(o.filter.toLowerCase()):ym.toLowerCase().includes(o.filter.toLowerCase())):a).map(cC)}}),globalThis.$pinia=t,n.on.getInspectorState(o=>{if(o.app===e&&o.inspectorId===$t){const a=o.nodeId===$r?t:t._s.get(o.nodeId);if(!a)return;a&&(o.nodeId!==$r&&(globalThis.$store=r.toRaw(a)),o.state=dC(a))}}),n.on.editInspectorState(o=>{if(o.app===e&&o.inspectorId===$t){const a=o.nodeId===$r?t:t._s.get(o.nodeId);if(!a)return At(`store "${o.nodeId}" not found`,"error");const{path:l}=o;Ki(a)?l.unshift("state"):(l.length!==1||!a._customProperties.has(l[0])||l[0]in a.$state)&&l.unshift("$state"),Wo=!1,o.set(a,l,o.state.value),Wo=!0}}),n.on.editComponentState(o=>{if(o.type.startsWith("🍍")){const a=o.type.replace(/^🍍\s*/,""),l=t._s.get(a);if(!l)return At(`store "${a}" not found`,"error");const{path:i}=o;if(i[0]!=="state")return At(`Invalid path for store "${a}":
|
|
11
11
|
${i}
|
|
12
|
-
Only state can be modified.`);i[0]="$state",Wo=!1,o.set(l,i,o.state.value),Wo=!0}})})}function pC(e,t){Ur.includes(Hr(t.$id))||Ur.push(Hr(t.$id)),Cf({id:"dev.esm.pinia",label:"Pinia 🍍",logo:"https://pinia.vuejs.org/logo.svg",packageName:"pinia",homepage:"https://pinia.vuejs.org",componentStateTypes:Ur,app:e,settings:{logStoreChanges:{label:"Notify about new/deleted stores",type:"boolean",defaultValue:!0}}},n=>{const o=typeof n.now=="function"?n.now.bind(n):Date.now;t.$onAction(({after:i,onError:s,name:u,args:d})=>{const c=Em++;n.addTimelineEvent({layerId:vo,event:{time:o(),title:"🛫 "+u,subtitle:"start",data:{store:mn(t.$id),action:mn(u),args:d},groupId:c}}),i(m=>{Gn=void 0,n.addTimelineEvent({layerId:vo,event:{time:o(),title:"🛬 "+u,subtitle:"end",data:{store:mn(t.$id),action:mn(u),args:d,result:m},groupId:c}})}),s(m=>{Gn=void 0,n.addTimelineEvent({layerId:vo,event:{time:o(),logType:"error",title:"💥 "+u,subtitle:"end",data:{store:mn(t.$id),action:mn(u),args:d,error:m},groupId:c}})})},!0),t._customProperties.forEach(i=>{r.watch(()=>r.unref(t[i]),(s,u)=>{n.notifyComponentUpdate(),n.sendInspectorState($t),Wo&&n.addTimelineEvent({layerId:vo,event:{time:o(),title:"Change",subtitle:i,data:{newValue:s,oldValue:u},groupId:Gn}})},{deep:!0})}),t.$subscribe(({events:i,type:s},u)=>{if(n.notifyComponentUpdate(),n.sendInspectorState($t),!Wo)return;const d={time:o(),title:mC(s),data:hC({store:mn(t.$id)},fC(i)),groupId:Gn};s===_o.patchFunction?d.subtitle="⤵️":s===_o.patchObject?d.subtitle="🧩":i&&!Array.isArray(i)&&(d.subtitle=i.type),i&&(d.data["rawEvent(s)"]={_custom:{display:"DebuggerEvent",type:"object",tooltip:"raw DebuggerEvent[]",value:i}}),n.addTimelineEvent({layerId:vo,event:d})},{detached:!0,flush:"sync"});const a=t._hotUpdate;t._hotUpdate=r.markRaw(i=>{a(i),n.addTimelineEvent({layerId:vo,event:{time:o(),title:"🔥 "+t.$id,subtitle:"HMR update",data:{store:mn(t.$id),info:mn("HMR update")}}}),n.notifyComponentUpdate(),n.sendInspectorTree($t),n.sendInspectorState($t)});const{$dispose:l}=t;t.$dispose=()=>{l(),n.notifyComponentUpdate(),n.sendInspectorTree($t),n.sendInspectorState($t),n.getSettings().logStoreChanges&&At(`Disposed "${t.$id}" store 🗑`)},n.notifyComponentUpdate(),n.sendInspectorTree($t),n.sendInspectorState($t),n.getSettings().logStoreChanges&&At(`"${t.$id}" store installed 🆕`)})}let Em=0,Gn;function Cm(e,t,n){const o=t.reduce((a,l)=>(a[l]=r.toRaw(e)[l],a),{});for(const a in o)e[a]=function(){const l=Em,i=n?new Proxy(e,{get(...u){return Gn=l,Reflect.get(...u)},set(...u){return Gn=l,Reflect.set(...u)}}):e;Gn=l;const s=o[a].apply(i,arguments);return Gn=void 0,s}}function _C({app:e,store:t,options:n}){if(!t.$id.startsWith("__hot:")){if(t._isOptionsAPI=!!n.state,!t._p._testing){Cm(t,Object.keys(n.actions),t._isOptionsAPI);const o=t._hotUpdate;r.toRaw(t)._hotUpdate=function(a){o.apply(this,arguments),Cm(t,Object.keys(a._hmrPayload.actions),!!t._isOptionsAPI)}}pC(e,t)}}function wm(){const e=r.effectScope(!0),t=e.run(()=>r.ref({}));let n=[],o=[];const a=r.markRaw({install(l){a._a=l,l.provide(eC,a),l.config.globalProperties.$pinia=a,process.env.NODE_ENV!=="production"&&process.env.NODE_ENV!=="test"&&Yi&&gC(l,a),o.forEach(i=>n.push(i)),o=[]},use(l){return this._a?n.push(l):o.push(l),this},_p:n,_a:null,_e:e,_s:new Map,state:t});return process.env.NODE_ENV!=="production"&&process.env.NODE_ENV!=="test"&&Yi&&typeof Proxy<"u"&&a.use(_C),a}process.env.NODE_ENV!=="production"?Symbol("pinia:skipHydration"):Symbol();const vC={en:{table:{search:"Search",advancedFilters:"Advanced Filters",cancel:"Cancel",confirm:"Save"},confirmDialog:{cancel:"Cancel",confirm:"Confirm",yes:"Yes",no:"No"},form:{rules:{emptyField:"The field cannot be empty",exceedCharactersTypeList:"Field must not exceed {0} characters"}},header:{hello:"Hello"},global:{total:"Total",retry:"Retray"},taskConfirmed:{repeatTask:"Do you want to continue the task?",repeat:"Yes, continue!",finish:"Finish"},menu:{logout:"Logout",home:"Home",areas:"Areas",filters:"Filters",seeOnlyChecked:"See only checked",seeManufacturing:"See manufacturing",seeSubcontractor:"See subcontractor",confirmRelocation:"Confirm Relocation",deleteAll:"Delete All",activateLoading:"Activate Loading",showExpeditionLines:"Show Expedition Lines",showOrderLines:"Show Order Lines",endTransaction:"End Transaction",translate:"Translate",labelSelectLanguage:"Language",selectLanguageLabelOptions:["Spanish","English"],deleteSelectedLine:"Delete Erroneous Label(s)",seeMap:"See Map",recordReceiptPurchase:"Record Receipt",addContainerNumber:"Add Container Number",showColumnsSelector:"Show columns selector",hideColumnsSelector:"Hide columns selector",sorting:"Sorting"}},es:{table:{search:"Buscar",advancedFilters:"Filtros avanzados",cancel:"Cancelar",confirm:"Guardar"},confirmDialog:{cancel:"Cancelar",confirm:"Confirmar",yes:"Sí",no:"No"},form:{rules:{emptyField:"El campo no puede estar vacío",exceedCharactersTypeList:"El campo no debe exceder más de {0} caracteres"}},header:{hello:"Hola"},global:{total:"Total",retry:"Reintentar"},taskConfirmed:{repeatTask:"¿Quieres continuar la tarea?",repeat:"Sí, continuar!",finish:"Finalizar"},menu:{logout:"Desconectar",home:"Inicio",areas:"Areas",filters:"Filtros",seeOnlyChecked:"Ver solo comprobadas",seeManufacturing:"Ver fabricación",seeSubcontractor:"Ver subcontrata",confirmRelocation:"Confirmar Reubicación",deleteAll:"Anular todos",activateLoading:"Activar Carga",showExpeditionLines:"Mostrar Líneas Expedición",showOrderLines:"Mostrar Líneas Pedidos",endTransaction:"Finalizar Operación",translate:"Traducir",labelSelectLanguage:"Idioma",selectLanguageLabelOptions:["Castellano","Inglés"],deleteSelectedLine:"Eliminar Etiquetas(s) Errónea(s)",seeMap:"Ver Plano",recordReceiptPurchase:"Registrar Recepción",addContainerNumber:"Añadir Nº Contenedor",showColumnsSelector:"Mostrar selector de columnas",hideColumnsSelector:"Hide selector de columnas",sorting:"Ordenar"}}},bC={filter(e,t,n){if(console.log(t),n.search!==""){const o=[],a=n.search?n.search.toLowerCase():"";for(let l=0;l<e.rows.length;l++)this.containsSearchTermInRow(e.rows[l],a)&&o.push(e.rows[l]);return e.filteredRows=o,this.paginationNewTable(e,o)}else return e.filteredRows=t,this.paginationNewTable(e,t)},paginationNewTable(e,t){return t.slice(0,e.$refs.table.pageLength)},containsSearchTermInRow(e,t){if(t!==""){const o=Object.values(e).map(a=>(a+"").toLowerCase());for(let a=0;a<o.length;a++)if(o[a].includes(t))return!0}return!1}},yC={handleInfiniteScrollNewTable(e){e.$nextTick(()=>{const t=e.smallDevice?"q-table__grid-content":"q-table__middle scroll",n=e.smallDevice?"Grid":"Table",o=document.getElementsByClassName(t),a=o.length>0?o[0]:window,l=i=>{const{scrollHeight:s,scrollTop:u,clientHeight:d}=i.target;Math.abs(s-d-u)<1&&(console.log(`[${n}] You are at the bottom!`,e.$refs.table.totalPage),e.$refs.table.totalPage++)};window.removeEventListener("scroll",l),a.removeEventListener("scroll",l),a.addEventListener("scroll",l)})},handleInfiniteScrollNewTableCompositionAPi(e,t,n){e(()=>{const o=t?"q-table__grid-content":"q-table__middle scroll",a=t?"Grid":"Table",l=document.getElementsByClassName(o),i=l.length>0?l[0]:window,s=u=>{console.log(n,"totalPage");const{scrollHeight:d,scrollTop:c,clientHeight:m}=u.target;Math.abs(d-m-c)<1
|
|
12
|
+
Only state can be modified.`);i[0]="$state",Wo=!1,o.set(l,i,o.state.value),Wo=!0}})})}function pC(e,t){Ur.includes(Hr(t.$id))||Ur.push(Hr(t.$id)),Cf({id:"dev.esm.pinia",label:"Pinia 🍍",logo:"https://pinia.vuejs.org/logo.svg",packageName:"pinia",homepage:"https://pinia.vuejs.org",componentStateTypes:Ur,app:e,settings:{logStoreChanges:{label:"Notify about new/deleted stores",type:"boolean",defaultValue:!0}}},n=>{const o=typeof n.now=="function"?n.now.bind(n):Date.now;t.$onAction(({after:i,onError:s,name:u,args:d})=>{const c=Em++;n.addTimelineEvent({layerId:vo,event:{time:o(),title:"🛫 "+u,subtitle:"start",data:{store:mn(t.$id),action:mn(u),args:d},groupId:c}}),i(m=>{Gn=void 0,n.addTimelineEvent({layerId:vo,event:{time:o(),title:"🛬 "+u,subtitle:"end",data:{store:mn(t.$id),action:mn(u),args:d,result:m},groupId:c}})}),s(m=>{Gn=void 0,n.addTimelineEvent({layerId:vo,event:{time:o(),logType:"error",title:"💥 "+u,subtitle:"end",data:{store:mn(t.$id),action:mn(u),args:d,error:m},groupId:c}})})},!0),t._customProperties.forEach(i=>{r.watch(()=>r.unref(t[i]),(s,u)=>{n.notifyComponentUpdate(),n.sendInspectorState($t),Wo&&n.addTimelineEvent({layerId:vo,event:{time:o(),title:"Change",subtitle:i,data:{newValue:s,oldValue:u},groupId:Gn}})},{deep:!0})}),t.$subscribe(({events:i,type:s},u)=>{if(n.notifyComponentUpdate(),n.sendInspectorState($t),!Wo)return;const d={time:o(),title:mC(s),data:hC({store:mn(t.$id)},fC(i)),groupId:Gn};s===_o.patchFunction?d.subtitle="⤵️":s===_o.patchObject?d.subtitle="🧩":i&&!Array.isArray(i)&&(d.subtitle=i.type),i&&(d.data["rawEvent(s)"]={_custom:{display:"DebuggerEvent",type:"object",tooltip:"raw DebuggerEvent[]",value:i}}),n.addTimelineEvent({layerId:vo,event:d})},{detached:!0,flush:"sync"});const a=t._hotUpdate;t._hotUpdate=r.markRaw(i=>{a(i),n.addTimelineEvent({layerId:vo,event:{time:o(),title:"🔥 "+t.$id,subtitle:"HMR update",data:{store:mn(t.$id),info:mn("HMR update")}}}),n.notifyComponentUpdate(),n.sendInspectorTree($t),n.sendInspectorState($t)});const{$dispose:l}=t;t.$dispose=()=>{l(),n.notifyComponentUpdate(),n.sendInspectorTree($t),n.sendInspectorState($t),n.getSettings().logStoreChanges&&At(`Disposed "${t.$id}" store 🗑`)},n.notifyComponentUpdate(),n.sendInspectorTree($t),n.sendInspectorState($t),n.getSettings().logStoreChanges&&At(`"${t.$id}" store installed 🆕`)})}let Em=0,Gn;function Cm(e,t,n){const o=t.reduce((a,l)=>(a[l]=r.toRaw(e)[l],a),{});for(const a in o)e[a]=function(){const l=Em,i=n?new Proxy(e,{get(...u){return Gn=l,Reflect.get(...u)},set(...u){return Gn=l,Reflect.set(...u)}}):e;Gn=l;const s=o[a].apply(i,arguments);return Gn=void 0,s}}function _C({app:e,store:t,options:n}){if(!t.$id.startsWith("__hot:")){if(t._isOptionsAPI=!!n.state,!t._p._testing){Cm(t,Object.keys(n.actions),t._isOptionsAPI);const o=t._hotUpdate;r.toRaw(t)._hotUpdate=function(a){o.apply(this,arguments),Cm(t,Object.keys(a._hmrPayload.actions),!!t._isOptionsAPI)}}pC(e,t)}}function wm(){const e=r.effectScope(!0),t=e.run(()=>r.ref({}));let n=[],o=[];const a=r.markRaw({install(l){a._a=l,l.provide(eC,a),l.config.globalProperties.$pinia=a,process.env.NODE_ENV!=="production"&&process.env.NODE_ENV!=="test"&&Yi&&gC(l,a),o.forEach(i=>n.push(i)),o=[]},use(l){return this._a?n.push(l):o.push(l),this},_p:n,_a:null,_e:e,_s:new Map,state:t});return process.env.NODE_ENV!=="production"&&process.env.NODE_ENV!=="test"&&Yi&&typeof Proxy<"u"&&a.use(_C),a}process.env.NODE_ENV!=="production"?Symbol("pinia:skipHydration"):Symbol();const vC={en:{table:{search:"Search",advancedFilters:"Advanced Filters",cancel:"Cancel",confirm:"Save"},confirmDialog:{cancel:"Cancel",confirm:"Confirm",yes:"Yes",no:"No"},form:{rules:{emptyField:"The field cannot be empty",exceedCharactersTypeList:"Field must not exceed {0} characters"}},header:{hello:"Hello"},global:{total:"Total",retry:"Retray"},taskConfirmed:{repeatTask:"Do you want to continue the task?",repeat:"Yes, continue!",finish:"Finish"},menu:{logout:"Logout",home:"Home",areas:"Areas",filters:"Filters",seeOnlyChecked:"See only checked",seeManufacturing:"See manufacturing",seeSubcontractor:"See subcontractor",confirmRelocation:"Confirm Relocation",deleteAll:"Delete All",activateLoading:"Activate Loading",showExpeditionLines:"Show Expedition Lines",showOrderLines:"Show Order Lines",endTransaction:"End Transaction",translate:"Translate",labelSelectLanguage:"Language",selectLanguageLabelOptions:["Spanish","English"],deleteSelectedLine:"Delete Erroneous Label(s)",seeMap:"See Map",recordReceiptPurchase:"Record Receipt",addContainerNumber:"Add Container Number",showColumnsSelector:"Show columns selector",hideColumnsSelector:"Hide columns selector",sorting:"Sorting"}},es:{table:{search:"Buscar",advancedFilters:"Filtros avanzados",cancel:"Cancelar",confirm:"Guardar"},confirmDialog:{cancel:"Cancelar",confirm:"Confirmar",yes:"Sí",no:"No"},form:{rules:{emptyField:"El campo no puede estar vacío",exceedCharactersTypeList:"El campo no debe exceder más de {0} caracteres"}},header:{hello:"Hola"},global:{total:"Total",retry:"Reintentar"},taskConfirmed:{repeatTask:"¿Quieres continuar la tarea?",repeat:"Sí, continuar!",finish:"Finalizar"},menu:{logout:"Desconectar",home:"Inicio",areas:"Areas",filters:"Filtros",seeOnlyChecked:"Ver solo comprobadas",seeManufacturing:"Ver fabricación",seeSubcontractor:"Ver subcontrata",confirmRelocation:"Confirmar Reubicación",deleteAll:"Anular todos",activateLoading:"Activar Carga",showExpeditionLines:"Mostrar Líneas Expedición",showOrderLines:"Mostrar Líneas Pedidos",endTransaction:"Finalizar Operación",translate:"Traducir",labelSelectLanguage:"Idioma",selectLanguageLabelOptions:["Castellano","Inglés"],deleteSelectedLine:"Eliminar Etiquetas(s) Errónea(s)",seeMap:"Ver Plano",recordReceiptPurchase:"Registrar Recepción",addContainerNumber:"Añadir Nº Contenedor",showColumnsSelector:"Mostrar selector de columnas",hideColumnsSelector:"Hide selector de columnas",sorting:"Ordenar"}}},bC={filter(e,t,n){if(console.log(t),n.search!==""){const o=[],a=n.search?n.search.toLowerCase():"";for(let l=0;l<e.rows.length;l++)this.containsSearchTermInRow(e.rows[l],a)&&o.push(e.rows[l]);return e.filteredRows=o,this.paginationNewTable(e,o)}else return e.filteredRows=t,this.paginationNewTable(e,t)},paginationNewTable(e,t){return t.slice(0,e.$refs.table.pageLength)},containsSearchTermInRow(e,t){if(t!==""){const o=Object.values(e).map(a=>(a+"").toLowerCase());for(let a=0;a<o.length;a++)if(o[a].includes(t))return!0}return!1}},yC={handleInfiniteScrollNewTable(e){e.$nextTick(()=>{const t=e.smallDevice?"q-table__grid-content":"q-table__middle scroll",n=e.smallDevice?"Grid":"Table",o=document.getElementsByClassName(t),a=o.length>0?o[0]:window,l=i=>{const{scrollHeight:s,scrollTop:u,clientHeight:d}=i.target;Math.abs(s-d-u)<1&&(console.log(`[${n}] You are at the bottom!`,e.$refs.table.totalPage),e.$refs.table.totalPage++)};window.removeEventListener("scroll",l),a.removeEventListener("scroll",l),a.addEventListener("scroll",l)})},handleInfiniteScrollNewTableCompositionAPi(e,t,n){e(()=>{const o=t?"q-table__grid-content":"q-table__middle scroll",a=t?"Grid":"Table",l=document.getElementsByClassName(o),i=l.length>0?l[0]:window,s=u=>{console.log(n,"totalPage");const{scrollHeight:d,scrollTop:c,clientHeight:m}=u.target;if(Math.abs(d-m-c)<1){debugger;console.log(`[${a}] You are at the bottom!`,n),n++}};window.removeEventListener("scroll",s),i.removeEventListener("scroll",s),i.addEventListener("scroll",s)})},handleInfiniteScrollModal(e,t){console.log("handleInfiniteScrollModal"),e.$nextTick(()=>{const n=document.getElementById(t),o=e.smallDevice?"q-table__grid-content":"q-table__middle scroll",l=n.getElementsByClassName(o)[0],i=s=>{const u=s.target;if(e.smallDevice)l.scrollTop+l.clientHeight>=l.scrollHeight&&(console.log("[Grid] You are at the bottom!"),e.$refs.table.totalPage++);else{const{scrollHeight:d,scrollTop:c,clientHeight:m}=u;Math.abs(d-m-c)<1&&(console.log("[Table] You are at the bottom!"),e.$refs.table.totalPage++)}};window.removeEventListener("scroll",i),l.removeEventListener("scroll",i),l.addEventListener("scroll",i)})},paginationModal(e,t){return t.slice(0,e.$refs.table.totalPage++)}},EC={setTableHeight(){const e=document.getElementsByClassName("q-page-sticky")[0];let t="";if(e){const l=window.getComputedStyle(e).height;l!=="auto"&&(t=l.replace("px",""))}const n=document.getElementsByClassName("q-header")[0];let o="";if(n){const l=window.getComputedStyle(n).height;l!=="auto"&&(o=l.replace("px",""))}const a=Number(t)+Number(o);return`height:${window.innerHeight-a}px`},setModalTableHeight(e){const t=document.getElementById(e);let n="";if(t){const a=window.getComputedStyle(t).height;a!=="auto"&&(n=a.replace("px",""))}const o=Number(n);return`height:${window.innerHeight-o}px`}},CC={sortMethod(e,t,n,o=[]){const a=[...e];return t&&(o.includes(t)?this.sortDates(t,n,a):a.sort((l,i)=>{const s=n?i:l,u=n?l:i;return s[t]>u[t]?1:s[t]<u[t]?-1:0})),a},sortDates(e,t,n){n.sort(function(o,a){const l=o[e],i=a[e];let s=t?i:l,u=t?l:i;return s=s.split("/").reverse().join("-"),u=u.split("/").reverse().join("-"),s.localeCompare(u)})}};wm();/*!
|
|
13
13
|
* shared v10.0.5
|
|
14
14
|
* (c) 2024 kazuya kawaguchi
|
|
15
15
|
* Released under the MIT License.
|
package/package.json
CHANGED
|
@@ -307,7 +307,17 @@ export default defineComponent({
|
|
|
307
307
|
} else {
|
|
308
308
|
this.dragAndDropDelay = 0
|
|
309
309
|
}
|
|
310
|
-
}
|
|
310
|
+
},
|
|
311
|
+
/* showSkeleton (val: boolean): void {
|
|
312
|
+
if (!val) {
|
|
313
|
+
this.handleInfiniteScrollTableCompositionAPi()
|
|
314
|
+
}
|
|
315
|
+
},
|
|
316
|
+
'$q.screen.width' (): void {
|
|
317
|
+
setTimeout(() => {
|
|
318
|
+
this.handleInfiniteScrollTableCompositionAPi()
|
|
319
|
+
}, 500)
|
|
320
|
+
} */
|
|
311
321
|
},
|
|
312
322
|
mounted () {
|
|
313
323
|
this.getAdvancedFilterColumns()
|
|
@@ -31,6 +31,7 @@ const infiniteScroll = {
|
|
|
31
31
|
console.log(totalPage, 'totalPage')
|
|
32
32
|
const { scrollHeight, scrollTop, clientHeight } = event.target as HTMLElement
|
|
33
33
|
if (Math.abs(scrollHeight - clientHeight - scrollTop) < 1) {
|
|
34
|
+
debugger
|
|
34
35
|
console.log(`[${tableType}] You are at the bottom!`, totalPage)
|
|
35
36
|
totalPage++
|
|
36
37
|
}
|
|
@@ -84,6 +84,7 @@ import NavBarSkeleton from '../components/NavBarSkeleton/NavBarSkeleton.vue'
|
|
|
84
84
|
import TableRowsCounter from'../components/TableRowsCounter/TableRowsCounter.vue'
|
|
85
85
|
import AlertLabelsWithError from '../components/AlertLabelsWithError/AlertLabelsWithError.vue'
|
|
86
86
|
import setTableHeight from '../components/Table/utils/setTableHeight'
|
|
87
|
+
// import infiniteScroll from '../components/Table/utils/infiniteScroll'
|
|
87
88
|
import { tableStore } from '../store/table.js'
|
|
88
89
|
export default {
|
|
89
90
|
components: {
|
|
@@ -100,6 +101,14 @@ export default {
|
|
|
100
101
|
store: tableStore(),
|
|
101
102
|
tableStyle: '',
|
|
102
103
|
columns: [
|
|
104
|
+
{
|
|
105
|
+
name: 'drag-and-drop',
|
|
106
|
+
required: true,
|
|
107
|
+
label: 'Drag and drop',
|
|
108
|
+
align: 'left',
|
|
109
|
+
sortable: true,
|
|
110
|
+
type: 'string',
|
|
111
|
+
},
|
|
103
112
|
{
|
|
104
113
|
name: 'name',
|
|
105
114
|
required: true,
|
|
@@ -547,6 +556,7 @@ export default {
|
|
|
547
556
|
setTimeout(() => {
|
|
548
557
|
this.tableStyle = setTableHeight.setTableHeight()
|
|
549
558
|
this.$refs.table.handleInfiniteScrollTableCompositionAPi()
|
|
559
|
+
// infiniteScroll.handleInfiniteScrollNewTable(this)
|
|
550
560
|
}, 500)
|
|
551
561
|
},
|
|
552
562
|
showSkeleton (val: boolean) {
|
|
@@ -554,6 +564,7 @@ export default {
|
|
|
554
564
|
setTimeout(() => {
|
|
555
565
|
this.tableStyle = setTableHeight.setTableHeight()
|
|
556
566
|
this.$refs.table.handleInfiniteScrollTableCompositionAPi()
|
|
567
|
+
// infiniteScroll.handleInfiniteScrollNewTable(this)
|
|
557
568
|
}, 500)
|
|
558
569
|
}
|
|
559
570
|
}
|
|
@@ -567,11 +578,11 @@ export default {
|
|
|
567
578
|
methods: {
|
|
568
579
|
getRows () {
|
|
569
580
|
setTimeout(()=> {
|
|
570
|
-
|
|
581
|
+
|
|
571
582
|
this.rows = this.rowsData
|
|
572
583
|
this.$nextTick(() =>{
|
|
573
584
|
this.$refs.table.enableDragAndDrop = true
|
|
574
|
-
|
|
585
|
+
this.showSkeleton = false
|
|
575
586
|
})
|
|
576
587
|
}, 1000)
|
|
577
588
|
},
|
|
@@ -0,0 +1,625 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<q-layout
|
|
4
|
+
view="hHh lpR fFf"
|
|
5
|
+
>
|
|
6
|
+
<q-header
|
|
7
|
+
v-if="!showSkeleton"
|
|
8
|
+
class="bg-light-peach text-black"
|
|
9
|
+
>
|
|
10
|
+
<div class="header-container text-black">
|
|
11
|
+
<TaskNavBar
|
|
12
|
+
:logo="'src/assets/vue1.svg'"
|
|
13
|
+
:title="'Pda'"
|
|
14
|
+
:show-btn-back="false"
|
|
15
|
+
:show-btn-search="true"
|
|
16
|
+
@onClickBtnMenu="onClickBtnMenu"
|
|
17
|
+
@on-click-btn-search="toggleSearchVisibility"
|
|
18
|
+
@on-click-btn-menu="toogleColumnsSelectorVisibility">
|
|
19
|
+
</TaskNavBar>
|
|
20
|
+
<TableRowsCounter :counterJson="[
|
|
21
|
+
{ qty: rows.length, title: 'Total', dataCy: 'total', extraClasses: 'class'}
|
|
22
|
+
]"/>
|
|
23
|
+
</div>
|
|
24
|
+
</q-header>
|
|
25
|
+
<NavBarSkeleton
|
|
26
|
+
v-if="showSkeleton"
|
|
27
|
+
:small-device="smallDevice"
|
|
28
|
+
/>
|
|
29
|
+
<!--<AlertLabelsWithError
|
|
30
|
+
ref="AlertLabelsWithError"
|
|
31
|
+
@retry-read-label-axios="retryReadLabel"
|
|
32
|
+
@on-close-dialog-labels-error="onCloseDialogLabelsError"
|
|
33
|
+
/>
|
|
34
|
+
-->
|
|
35
|
+
<q-page-container>
|
|
36
|
+
<q-page>
|
|
37
|
+
<Table
|
|
38
|
+
ref="table"
|
|
39
|
+
:rows="rows"
|
|
40
|
+
:columns="columns"
|
|
41
|
+
:visible-columns="tableStoreObj.visiblecolumns"
|
|
42
|
+
:small-device="smallDevice"
|
|
43
|
+
:store="tableStoreObj"
|
|
44
|
+
:table-style="tableStyle"
|
|
45
|
+
:selectionType="'multiple'"
|
|
46
|
+
:show-skeleton="showSkeleton"
|
|
47
|
+
@on-select-visible-columns="(columns) => {
|
|
48
|
+
tableStoreObj.visiblecolumns = columns
|
|
49
|
+
}"
|
|
50
|
+
:show-icon-advanced-filter="true"
|
|
51
|
+
@on-update-basic-checkbox-value="onUpdateBasicCheckboxValue"
|
|
52
|
+
@on-update-customized-checkbox-value="onUpdateCustomizedCheckboxValue"
|
|
53
|
+
@on-click-button="setItemNotFound"
|
|
54
|
+
@on-drag-start="(args) => {
|
|
55
|
+
console.log(args, 'start')
|
|
56
|
+
}"
|
|
57
|
+
@on-drag-update="(args) => {
|
|
58
|
+
console.log(args, 'update')
|
|
59
|
+
}"
|
|
60
|
+
@on-drag-end="(args) => {
|
|
61
|
+
console.log(args, 'end')
|
|
62
|
+
}"
|
|
63
|
+
/>
|
|
64
|
+
<!--<q-page-sticky
|
|
65
|
+
v-if="smallDevice"
|
|
66
|
+
position="bottom"
|
|
67
|
+
expand
|
|
68
|
+
>
|
|
69
|
+
<q-btn
|
|
70
|
+
class="full-width"
|
|
71
|
+
color="black"
|
|
72
|
+
square/>
|
|
73
|
+
</q-page-sticky>-->
|
|
74
|
+
</q-page>
|
|
75
|
+
</q-page-container>
|
|
76
|
+
</q-layout>
|
|
77
|
+
</div>
|
|
78
|
+
</template>
|
|
79
|
+
<style>
|
|
80
|
+
</style>
|
|
81
|
+
<script setup lang="ts">
|
|
82
|
+
import { useQuasar } from 'quasar'
|
|
83
|
+
import TaskNavBar from '../components/TaskNavBar/TaskNavBar.vue'
|
|
84
|
+
import Table from '../components/Table/Table.vue'
|
|
85
|
+
import NavBarSkeleton from '../components/NavBarSkeleton/NavBarSkeleton.vue'
|
|
86
|
+
import TableRowsCounter from'../components/TableRowsCounter/TableRowsCounter.vue'
|
|
87
|
+
// import AlertLabelsWithError from '../components/AlertLabelsWithError/AlertLabelsWithError.vue'
|
|
88
|
+
import setTableHeight from '../components/Table/utils/setTableHeight'
|
|
89
|
+
// import infiniteScroll from '../components/Table/utils/infiniteScroll'
|
|
90
|
+
import { tableStore } from '../store/table.js'
|
|
91
|
+
import { ref, computed, onMounted, watch } from 'vue'
|
|
92
|
+
|
|
93
|
+
const q = useQuasar()
|
|
94
|
+
const tableStoreObj = tableStore()
|
|
95
|
+
const tabletMaxWidth = ref<number> (1100)
|
|
96
|
+
const tableStyle = ref<string>('')
|
|
97
|
+
const columns = [
|
|
98
|
+
{
|
|
99
|
+
name: 'drag-and-drop',
|
|
100
|
+
required: true,
|
|
101
|
+
label: 'Drag and drop',
|
|
102
|
+
align: 'left',
|
|
103
|
+
sortable: true,
|
|
104
|
+
type: 'string',
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
name: 'name',
|
|
108
|
+
required: true,
|
|
109
|
+
label: 'Dessert (100g serving)',
|
|
110
|
+
align: 'left',
|
|
111
|
+
sortable: true,
|
|
112
|
+
type: 'string',
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
name: 'date',
|
|
116
|
+
required: true,
|
|
117
|
+
label: 'Fecha',
|
|
118
|
+
align: 'left',
|
|
119
|
+
sortable: true,
|
|
120
|
+
type: 'date'
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
name: 'available',
|
|
124
|
+
required: true,
|
|
125
|
+
label: 'Available',
|
|
126
|
+
align: 'left',
|
|
127
|
+
sortable: true,
|
|
128
|
+
showBasicCheckbox: true,
|
|
129
|
+
type: 'boolean',
|
|
130
|
+
checkBoxDataCy: 'checkbox'
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
name: 'booleanIcon',
|
|
134
|
+
required: true,
|
|
135
|
+
label: 'Boolean Icon',
|
|
136
|
+
align: 'left',
|
|
137
|
+
sortable: true,
|
|
138
|
+
showCustomizedIcon: true,
|
|
139
|
+
type: 'boolean'
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
name: 'calories',
|
|
143
|
+
align: 'center',
|
|
144
|
+
label: 'Calories',
|
|
145
|
+
field: 'calories',
|
|
146
|
+
sortable: true,
|
|
147
|
+
editable: true,
|
|
148
|
+
showEditIcon: true,
|
|
149
|
+
popupEditEmit: 'onSaveValuePopupEdit',
|
|
150
|
+
popupEditDataCy: '',
|
|
151
|
+
mask: '#####',
|
|
152
|
+
showSelectNumberOptions: false,
|
|
153
|
+
popupEditInputtype: 'number',
|
|
154
|
+
type: 'number'
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
name: 'fat',
|
|
158
|
+
label: 'Fat (g)',
|
|
159
|
+
field: 'fat',
|
|
160
|
+
sortable: true,
|
|
161
|
+
showCustomizedButton: true,
|
|
162
|
+
btnIcon: 'save',
|
|
163
|
+
btnEmit: 'onClickButton',
|
|
164
|
+
dataCy: 'onClickButton',
|
|
165
|
+
btnColor: 'primary',
|
|
166
|
+
type: 'number'
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
name: 'carbs',
|
|
170
|
+
label: 'Carbs (g)',
|
|
171
|
+
field: 'carbs',
|
|
172
|
+
editable: true,
|
|
173
|
+
popupEditEmit: 'onSaveValuePopupEdit',
|
|
174
|
+
popupEditDataCy: '',
|
|
175
|
+
inputMaxLength: 200,
|
|
176
|
+
popupEditInputtype: 'textarea',
|
|
177
|
+
type: 'string'
|
|
178
|
+
},
|
|
179
|
+
{
|
|
180
|
+
name: 'checked',
|
|
181
|
+
label: 'Checked',
|
|
182
|
+
field: 'carbs',
|
|
183
|
+
sortable: true,
|
|
184
|
+
required: true,
|
|
185
|
+
showCustomizedCheckBox: true,
|
|
186
|
+
checkedIcon: 'check_circle',
|
|
187
|
+
uncheckedIcon: 'cancel',
|
|
188
|
+
checkBoxColorCaseTrue: 'positive',
|
|
189
|
+
checkBoxColorCaseFalse: 'negative',
|
|
190
|
+
checkBoxDataCy: '',
|
|
191
|
+
type: 'boolean'
|
|
192
|
+
},
|
|
193
|
+
{
|
|
194
|
+
name: 'protein',
|
|
195
|
+
label: 'Protein (g)',
|
|
196
|
+
field: 'protein',
|
|
197
|
+
sortable: true,
|
|
198
|
+
required: true,
|
|
199
|
+
editable: true,
|
|
200
|
+
showEditIcon: true,
|
|
201
|
+
popupEditEmit: 'onSaveValuePopupEdit',
|
|
202
|
+
popupEditInputtype: 'text',
|
|
203
|
+
popupEditDataCy: '',
|
|
204
|
+
showInputPopupEdit: true,
|
|
205
|
+
type: 'string'
|
|
206
|
+
},
|
|
207
|
+
{
|
|
208
|
+
name: 'sodium',
|
|
209
|
+
label: 'Sodium (mg)',
|
|
210
|
+
field: 'sodium',
|
|
211
|
+
type: 'string'
|
|
212
|
+
},
|
|
213
|
+
{
|
|
214
|
+
name: 'calcium',
|
|
215
|
+
label: 'Calcium (%)',
|
|
216
|
+
field: 'calcium',
|
|
217
|
+
sortable: true,
|
|
218
|
+
type: 'string'
|
|
219
|
+
},
|
|
220
|
+
{
|
|
221
|
+
name: 'iron',
|
|
222
|
+
label: 'Iron (%)',
|
|
223
|
+
field: 'iron',
|
|
224
|
+
sortable: true,
|
|
225
|
+
type: 'string'
|
|
226
|
+
}
|
|
227
|
+
]
|
|
228
|
+
const rows = ref<object [] | []>([])
|
|
229
|
+
const rowsData = ref<object [] | []>([])
|
|
230
|
+
rowsData.value = [
|
|
231
|
+
{
|
|
232
|
+
id: 1,
|
|
233
|
+
name: 'Frozen Yogurt',
|
|
234
|
+
booleanIcon: true,
|
|
235
|
+
available: true,
|
|
236
|
+
calories: 159,
|
|
237
|
+
fat: 6.0,
|
|
238
|
+
carbs: 24,
|
|
239
|
+
checked: false,
|
|
240
|
+
protein: 4.0,
|
|
241
|
+
sodium: 87,
|
|
242
|
+
calcium: '14%',
|
|
243
|
+
iron: '1%'
|
|
244
|
+
},
|
|
245
|
+
{
|
|
246
|
+
id: 2,
|
|
247
|
+
name: 'Ice cream sandwich',
|
|
248
|
+
booleanIcon: true,
|
|
249
|
+
available: false,
|
|
250
|
+
calories: 237,
|
|
251
|
+
fat: 9.0,
|
|
252
|
+
carbs: 37,
|
|
253
|
+
checked: false,
|
|
254
|
+
protein: 4.3,
|
|
255
|
+
sodium: 129,
|
|
256
|
+
calcium: '8%',
|
|
257
|
+
iron: '1%'
|
|
258
|
+
},
|
|
259
|
+
{
|
|
260
|
+
id: 3,
|
|
261
|
+
name: 'Eclair',
|
|
262
|
+
booleanIcon: true,
|
|
263
|
+
available: true,
|
|
264
|
+
calories: 262,
|
|
265
|
+
fat: 16.0,
|
|
266
|
+
carbs: 23,
|
|
267
|
+
checked: false,
|
|
268
|
+
protein: 6.0,
|
|
269
|
+
sodium: 337,
|
|
270
|
+
calcium: '6%',
|
|
271
|
+
iron: '7%'
|
|
272
|
+
},
|
|
273
|
+
{
|
|
274
|
+
id: 4,
|
|
275
|
+
name: 'Cupcake',
|
|
276
|
+
booleanIcon: false,
|
|
277
|
+
available: false,
|
|
278
|
+
calories: 305,
|
|
279
|
+
fat: 3.7,
|
|
280
|
+
carbs: 67,
|
|
281
|
+
checked: false,
|
|
282
|
+
protein: 4.3,
|
|
283
|
+
sodium: 413,
|
|
284
|
+
calcium: '3%',
|
|
285
|
+
iron: '8%'
|
|
286
|
+
},
|
|
287
|
+
{
|
|
288
|
+
id: 5,
|
|
289
|
+
name: 'Gingerbread',
|
|
290
|
+
booleanIcon: true,
|
|
291
|
+
available: true,
|
|
292
|
+
calories: 356,
|
|
293
|
+
fat: 16.0,
|
|
294
|
+
carbs: 49,
|
|
295
|
+
checked: false,
|
|
296
|
+
protein: 3.9,
|
|
297
|
+
sodium: 327,
|
|
298
|
+
calcium: '7%',
|
|
299
|
+
iron: '16%'
|
|
300
|
+
},
|
|
301
|
+
{
|
|
302
|
+
id: 5,
|
|
303
|
+
name: 'Jelly bean',
|
|
304
|
+
booleanIcon: false,
|
|
305
|
+
available: false,
|
|
306
|
+
calories: 375,
|
|
307
|
+
fat: 0.0,
|
|
308
|
+
carbs: 94,
|
|
309
|
+
checked: true,
|
|
310
|
+
protein: 0.0,
|
|
311
|
+
sodium: 50,
|
|
312
|
+
calcium: '0%',
|
|
313
|
+
iron: '0%'
|
|
314
|
+
},
|
|
315
|
+
{
|
|
316
|
+
id: 6,
|
|
317
|
+
name: 'Lollipop',
|
|
318
|
+
booleanIcon: true,
|
|
319
|
+
available: true,
|
|
320
|
+
calories: 392,
|
|
321
|
+
fat: 0.2,
|
|
322
|
+
carbs: 98,
|
|
323
|
+
checked: false,
|
|
324
|
+
protein: 0,
|
|
325
|
+
sodium: 38,
|
|
326
|
+
calcium: '0%',
|
|
327
|
+
iron: '2%'
|
|
328
|
+
},
|
|
329
|
+
{
|
|
330
|
+
id: 7,
|
|
331
|
+
name: 'Honeycomb',
|
|
332
|
+
booleanIcon: true,
|
|
333
|
+
available: false,
|
|
334
|
+
calories: 408,
|
|
335
|
+
fat: 3.2,
|
|
336
|
+
carbs: 87,
|
|
337
|
+
checked: true,
|
|
338
|
+
protein: 6.5,
|
|
339
|
+
sodium: 562,
|
|
340
|
+
calcium: '0%',
|
|
341
|
+
iron: '45%'
|
|
342
|
+
},
|
|
343
|
+
{
|
|
344
|
+
id: 8,
|
|
345
|
+
name: 'Donut',
|
|
346
|
+
booleanIcon: true,
|
|
347
|
+
available: true,
|
|
348
|
+
calories: 452,
|
|
349
|
+
fat: 25.0,
|
|
350
|
+
carbs: 51,
|
|
351
|
+
checked: false,
|
|
352
|
+
protein: 4.9,
|
|
353
|
+
sodium: 326,
|
|
354
|
+
calcium: '2%',
|
|
355
|
+
iron: '22%'
|
|
356
|
+
},
|
|
357
|
+
{
|
|
358
|
+
id: 9,
|
|
359
|
+
name: 'KitKat',
|
|
360
|
+
booleanIcon: false,
|
|
361
|
+
available: false,
|
|
362
|
+
calories: 518,
|
|
363
|
+
fat: 26.0,
|
|
364
|
+
carbs: 65,
|
|
365
|
+
checked: true,
|
|
366
|
+
protein: 7,
|
|
367
|
+
sodium: 54,
|
|
368
|
+
calcium: '12%',
|
|
369
|
+
iron: '6%'
|
|
370
|
+
},
|
|
371
|
+
{
|
|
372
|
+
id: 10,
|
|
373
|
+
name: 'Frozen Yogurt',
|
|
374
|
+
booleanIcon: true,
|
|
375
|
+
available: true,
|
|
376
|
+
calories: 159,
|
|
377
|
+
fat: 6.0,
|
|
378
|
+
carbs: 24,
|
|
379
|
+
checked: false,
|
|
380
|
+
protein: 4.0,
|
|
381
|
+
sodium: 87,
|
|
382
|
+
calcium: '14%',
|
|
383
|
+
iron: '1%'
|
|
384
|
+
},
|
|
385
|
+
{
|
|
386
|
+
id: 11,
|
|
387
|
+
name: 'Ice cream sandwich',
|
|
388
|
+
booleanIcon: true,
|
|
389
|
+
available: false,
|
|
390
|
+
calories: 237,
|
|
391
|
+
fat: 9.0,
|
|
392
|
+
carbs: 37,
|
|
393
|
+
checked: false,
|
|
394
|
+
protein: 4.3,
|
|
395
|
+
sodium: 129,
|
|
396
|
+
calcium: '8%',
|
|
397
|
+
iron: '1%'
|
|
398
|
+
},
|
|
399
|
+
{
|
|
400
|
+
id: 12,
|
|
401
|
+
name: 'Eclair',
|
|
402
|
+
booleanIcon: true,
|
|
403
|
+
available: true,
|
|
404
|
+
calories: 262,
|
|
405
|
+
fat: 16.0,
|
|
406
|
+
carbs: 23,
|
|
407
|
+
checked: false,
|
|
408
|
+
protein: 6.0,
|
|
409
|
+
sodium: 337,
|
|
410
|
+
calcium: '6%',
|
|
411
|
+
iron: '7%'
|
|
412
|
+
},
|
|
413
|
+
{
|
|
414
|
+
id: 13,
|
|
415
|
+
name: 'Cupcake',
|
|
416
|
+
booleanIcon: false,
|
|
417
|
+
available: false,
|
|
418
|
+
calories: 305,
|
|
419
|
+
fat: 3.7,
|
|
420
|
+
carbs: 67,
|
|
421
|
+
checked: false,
|
|
422
|
+
protein: 4.3,
|
|
423
|
+
sodium: 413,
|
|
424
|
+
calcium: '3%',
|
|
425
|
+
iron: '8%'
|
|
426
|
+
},
|
|
427
|
+
{
|
|
428
|
+
id: 14,
|
|
429
|
+
name: 'Gingerbread',
|
|
430
|
+
booleanIcon: true,
|
|
431
|
+
available: true,
|
|
432
|
+
calories: 356,
|
|
433
|
+
fat: 16.0,
|
|
434
|
+
carbs: 49,
|
|
435
|
+
checked: false,
|
|
436
|
+
protein: 3.9,
|
|
437
|
+
sodium: 327,
|
|
438
|
+
calcium: '7%',
|
|
439
|
+
iron: '16%'
|
|
440
|
+
},
|
|
441
|
+
{
|
|
442
|
+
id: 15,
|
|
443
|
+
name: 'Jelly bean',
|
|
444
|
+
booleanIcon: false,
|
|
445
|
+
available: false,
|
|
446
|
+
calories: 375,
|
|
447
|
+
fat: 0.0,
|
|
448
|
+
carbs: 94,
|
|
449
|
+
checked: true,
|
|
450
|
+
protein: 0.0,
|
|
451
|
+
sodium: 50,
|
|
452
|
+
calcium: '0%',
|
|
453
|
+
iron: '0%'
|
|
454
|
+
},
|
|
455
|
+
{
|
|
456
|
+
id: 16,
|
|
457
|
+
name: 'Lollipop',
|
|
458
|
+
booleanIcon: true,
|
|
459
|
+
available: true,
|
|
460
|
+
calories: 392,
|
|
461
|
+
fat: 0.2,
|
|
462
|
+
carbs: 98,
|
|
463
|
+
checked: false,
|
|
464
|
+
protein: 0,
|
|
465
|
+
sodium: 38,
|
|
466
|
+
calcium: '0%',
|
|
467
|
+
iron: '2%'
|
|
468
|
+
},
|
|
469
|
+
{
|
|
470
|
+
id: 17,
|
|
471
|
+
name: 'Honeycomb',
|
|
472
|
+
booleanIcon: true,
|
|
473
|
+
available: false,
|
|
474
|
+
calories: 408,
|
|
475
|
+
fat: 3.2,
|
|
476
|
+
carbs: 87,
|
|
477
|
+
checked: true,
|
|
478
|
+
protein: 6.5,
|
|
479
|
+
sodium: 562,
|
|
480
|
+
calcium: '0%',
|
|
481
|
+
iron: '45%'
|
|
482
|
+
},
|
|
483
|
+
{
|
|
484
|
+
id: 18,
|
|
485
|
+
name: 'Donut',
|
|
486
|
+
booleanIcon: true,
|
|
487
|
+
available: true,
|
|
488
|
+
calories: 452,
|
|
489
|
+
fat: 25.0,
|
|
490
|
+
carbs: 51,
|
|
491
|
+
checked: false,
|
|
492
|
+
protein: 4.9,
|
|
493
|
+
sodium: 326,
|
|
494
|
+
calcium: '2%',
|
|
495
|
+
iron: '22%'
|
|
496
|
+
},
|
|
497
|
+
{
|
|
498
|
+
id: 19,
|
|
499
|
+
name: 'KitKat',
|
|
500
|
+
booleanIcon: false,
|
|
501
|
+
available: false,
|
|
502
|
+
calories: 518,
|
|
503
|
+
fat: 26.0,
|
|
504
|
+
carbs: 65,
|
|
505
|
+
checked: true,
|
|
506
|
+
protein: 7,
|
|
507
|
+
sodium: 54,
|
|
508
|
+
calcium: '12%',
|
|
509
|
+
iron: '6%'
|
|
510
|
+
},
|
|
511
|
+
{
|
|
512
|
+
id: 20,
|
|
513
|
+
name: 'KitKat',
|
|
514
|
+
booleanIcon: false,
|
|
515
|
+
available: false,
|
|
516
|
+
calories: 518,
|
|
517
|
+
fat: 26.0,
|
|
518
|
+
carbs: 65,
|
|
519
|
+
checked: true,
|
|
520
|
+
protein: 7,
|
|
521
|
+
sodium: 54,
|
|
522
|
+
calcium: '12%',
|
|
523
|
+
iron: '6%'
|
|
524
|
+
},
|
|
525
|
+
{
|
|
526
|
+
id: 21,
|
|
527
|
+
name: 'KitKat',
|
|
528
|
+
booleanIcon: false,
|
|
529
|
+
available: false,
|
|
530
|
+
calories: 518,
|
|
531
|
+
fat: 26.0,
|
|
532
|
+
carbs: 65,
|
|
533
|
+
checked: true,
|
|
534
|
+
protein: 7,
|
|
535
|
+
sodium: 54,
|
|
536
|
+
calcium: '12%',
|
|
537
|
+
iron: '6%'
|
|
538
|
+
}
|
|
539
|
+
]
|
|
540
|
+
const showSkeleton = ref<boolean>(false)
|
|
541
|
+
|
|
542
|
+
const smallDevice = computed(() => {
|
|
543
|
+
return q.screen.width <= tabletMaxWidth.value
|
|
544
|
+
})
|
|
545
|
+
watch(() => '$q.screen.width', () => {
|
|
546
|
+
setTimeout(() => {
|
|
547
|
+
tableStyle.value = setTableHeight.setTableHeight()
|
|
548
|
+
}, 500)
|
|
549
|
+
})
|
|
550
|
+
|
|
551
|
+
watch(() => showSkeleton.value, (val) => {
|
|
552
|
+
if (!val) {
|
|
553
|
+
if (!val) {
|
|
554
|
+
setTimeout(() => {
|
|
555
|
+
tableStyle.value = setTableHeight.setTableHeight()
|
|
556
|
+
}, 500)
|
|
557
|
+
}
|
|
558
|
+
}
|
|
559
|
+
})
|
|
560
|
+
onMounted(() => {
|
|
561
|
+
getRows()
|
|
562
|
+
})
|
|
563
|
+
|
|
564
|
+
function getRows () {
|
|
565
|
+
showSkeleton.value = true
|
|
566
|
+
rows.value = rowsData.value
|
|
567
|
+
setTimeout(()=> {
|
|
568
|
+
showSkeleton.value = false
|
|
569
|
+
|
|
570
|
+
}, 1000)
|
|
571
|
+
}
|
|
572
|
+
function onUpdateBasicCheckboxValue (rows: object []) {
|
|
573
|
+
console.log(rows, 'onUpdateBasicCheckboxValue')
|
|
574
|
+
}
|
|
575
|
+
function onUpdateCustomizedCheckboxValue (rows: object []) {
|
|
576
|
+
console.log(rows, 'onUpdateCustomizedCheckboxValue')
|
|
577
|
+
}
|
|
578
|
+
function setItemNotFound (rows: object []) {
|
|
579
|
+
console.log(rows, 'onClickButton')
|
|
580
|
+
}
|
|
581
|
+
function toggleSearchVisibility () {
|
|
582
|
+
// tableRef.value?.toggleSearchVisibility(this.store)
|
|
583
|
+
// tableRef.value?.filterInputFocus()
|
|
584
|
+
}
|
|
585
|
+
function toggleRightDrawer (): void {
|
|
586
|
+
// this.$refs.sideBar.toggleRightDrawer()
|
|
587
|
+
}
|
|
588
|
+
function toogleColumnsSelectorVisibility () {
|
|
589
|
+
// this.$refs.sideBar.setRightDrawerOpenToFalse()
|
|
590
|
+
// tableRef.value?.toogleColumnsSelectorVisibility()
|
|
591
|
+
}
|
|
592
|
+
function onClickBtnMenu () {
|
|
593
|
+
// this.toggleRightDrawer()
|
|
594
|
+
}
|
|
595
|
+
function retryReadLabel () {
|
|
596
|
+
console.log('retryReadLabel')
|
|
597
|
+
}
|
|
598
|
+
function onCloseDialogLabelsError () {
|
|
599
|
+
console.log('onCloseDialogLabelsError')
|
|
600
|
+
}
|
|
601
|
+
/* function getAlertLabelsWithError () {
|
|
602
|
+
this.$refs.AlertLabelsWithError.alert = true
|
|
603
|
+
this.$refs.AlertLabelsWithError.labelsErrors.push({
|
|
604
|
+
label: '558877',
|
|
605
|
+
error: 'The Bin does not exist. Identification fields and values',
|
|
606
|
+
icon: 'cancel',
|
|
607
|
+
spinner: false
|
|
608
|
+
},
|
|
609
|
+
{
|
|
610
|
+
label: '558871',
|
|
611
|
+
error: 'The Bin does not exist. Identification fields and values',
|
|
612
|
+
icon: 'cancel',
|
|
613
|
+
spinner: false
|
|
614
|
+
})
|
|
615
|
+
} */
|
|
616
|
+
</script>
|
|
617
|
+
<style scoped>
|
|
618
|
+
.header-container {
|
|
619
|
+
padding: 20px 20px 5px 20px;
|
|
620
|
+
}
|
|
621
|
+
.q-toolbar {
|
|
622
|
+
min-height: unset !important;
|
|
623
|
+
padding: 0 !important;
|
|
624
|
+
}
|
|
625
|
+
</style>
|