-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This reverts commit 281881b.
- Loading branch information
Showing
3 changed files
with
26 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),x=require("./axios-tuVKNgv9.cjs"),E=(c,l={},f={},d=10,p=0)=>{const n=e.ref(d),a=e.ref(p),u=e.ref(l),i=e.ref(f);console.log("SPRUNJER DEBUG SORT",u,l);const t=e.ref({}),s=e.ref(!1);async function v(){s.value=!0,x.axios.get(e.toValue(c),{params:{size:n.value,page:a.value,sorts:u.value,filters:i.value}}).then(o=>{t.value=o.data,s.value=!1}).catch(o=>{console.error(o)})}const g=e.computed(()=>Math.max(Math.ceil((t.value.count_filtered??0)/n.value)-1,0)),m=e.computed(()=>t.value.count??0),h=e.computed(()=>Math.min(a.value*n.value+1,t.value.count??0)),S=e.computed(()=>Math.min((a.value+1)*n.value,t.value.count??0)),w=e.computed(()=>t.value.count_filtered??0),M=e.computed(()=>t.value.rows??[]);function y(){console.log("Not yet implemented")}function j(o){let r;u.value[o]==="asc"?r="desc":u.value[o]==="desc"?r=null:r="asc",u.value[o]=r}return e.watchEffect(()=>{v()}),{dataUrl:c,size:n,page:a,sorts:u,filters:i,data:t,fetch:v,loading:s,downloadCsv:y,totalPages:g,countFiltered:w,count:m,rows:M,first:h,last:S,toggleSort:j}};exports.useSprunjer=E; | ||
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),x=require("./axios-tuVKNgv9.cjs"),b=(c,v={},f={},d=10,p=0)=>{const o=e.ref(d),r=e.ref(p),a=e.ref(v),l=e.ref(f),t=e.ref({}),s=e.ref(!1);async function i(){s.value=!0,x.axios.get(e.toValue(c),{params:{size:o.value,page:r.value,sorts:a.value,filters:l.value}}).then(u=>{t.value=u.data,s.value=!1}).catch(u=>{console.error(u)})}const m=e.computed(()=>Math.max(Math.ceil((t.value.count_filtered??0)/o.value)-1,0)),g=e.computed(()=>t.value.count??0),h=e.computed(()=>Math.min(r.value*o.value+1,t.value.count??0)),w=e.computed(()=>Math.min((r.value+1)*o.value,t.value.count??0)),M=e.computed(()=>t.value.count_filtered??0),S=e.computed(()=>t.value.rows??[]);function y(){console.log("Not yet implemented")}function j(u){let n;a.value[u]==="asc"?n="desc":a.value[u]==="desc"?n=null:n="asc",a.value[u]=n}return e.watchEffect(()=>{i()}),{dataUrl:c,size:o,page:r,sorts:a,filters:l,data:t,fetch:i,loading:s,downloadCsv:y,totalPages:m,countFiltered:M,count:g,rows:S,first:h,last:w,toggleSort:j}};exports.useSprunjer=b; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,52 +1,50 @@ | ||
import { ref as a, computed as n, watchEffect as y, toValue as z } from "vue"; | ||
import { a as N } from "./axios-CXDYiOMX.js"; | ||
const _ = (c, v = {}, d = {}, g = 10, m = 0) => { | ||
const l = a(g), s = a(m), o = a(v), i = a(d); | ||
console.log("SPRUNJER DEBUG SORT", o, v); | ||
const e = a({}), r = a(!1); | ||
async function f() { | ||
r.value = !0, N.get(z(c), { | ||
import { ref as a, computed as o, watchEffect as _, toValue as j } from "vue"; | ||
import { a as C } from "./axios-CXDYiOMX.js"; | ||
const N = (c, f = {}, d = {}, m = 10, p = 0) => { | ||
const n = a(m), u = a(p), s = a(f), v = a(d), e = a({}), r = a(!1); | ||
async function i() { | ||
r.value = !0, C.get(j(c), { | ||
params: { | ||
size: l.value, | ||
page: s.value, | ||
sorts: o.value, | ||
filters: i.value | ||
size: n.value, | ||
page: u.value, | ||
sorts: s.value, | ||
filters: v.value | ||
} | ||
}).then((t) => { | ||
e.value = t.data, r.value = !1; | ||
}).catch((t) => { | ||
console.error(t); | ||
}); | ||
} | ||
const p = n(() => Math.max(Math.ceil((e.value.count_filtered ?? 0) / l.value) - 1, 0)), h = n(() => e.value.count ?? 0), w = n(() => Math.min(s.value * l.value + 1, e.value.count ?? 0)), M = n(() => Math.min((s.value + 1) * l.value, e.value.count ?? 0)), x = n(() => e.value.count_filtered ?? 0), E = n(() => e.value.rows ?? []); | ||
function R() { | ||
const g = o(() => Math.max(Math.ceil((e.value.count_filtered ?? 0) / n.value) - 1, 0)), h = o(() => e.value.count ?? 0), w = o(() => Math.min(u.value * n.value + 1, e.value.count ?? 0)), M = o(() => Math.min((u.value + 1) * n.value, e.value.count ?? 0)), x = o(() => e.value.count_filtered ?? 0), y = o(() => e.value.rows ?? []); | ||
function z() { | ||
console.log("Not yet implemented"); | ||
} | ||
function S(t) { | ||
let u; | ||
o.value[t] === "asc" ? u = "desc" : o.value[t] === "desc" ? u = null : u = "asc", o.value[t] = u; | ||
let l; | ||
s.value[t] === "asc" ? l = "desc" : s.value[t] === "desc" ? l = null : l = "asc", s.value[t] = l; | ||
} | ||
return y(() => { | ||
f(); | ||
return _(() => { | ||
i(); | ||
}), { | ||
dataUrl: c, | ||
size: l, | ||
page: s, | ||
sorts: o, | ||
filters: i, | ||
size: n, | ||
page: u, | ||
sorts: s, | ||
filters: v, | ||
data: e, | ||
fetch: f, | ||
fetch: i, | ||
loading: r, | ||
downloadCsv: R, | ||
totalPages: p, | ||
downloadCsv: z, | ||
totalPages: g, | ||
countFiltered: x, | ||
count: h, | ||
rows: E, | ||
rows: y, | ||
first: w, | ||
last: M, | ||
toggleSort: S | ||
}; | ||
}; | ||
export { | ||
_ as useSprunjer | ||
N as useSprunjer | ||
}; |