-
-
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.
Set sorts & filters as associative Array
- Loading branch information
Showing
4 changed files
with
59 additions
and
41 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
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"),g=require("./axios-tuVKNgv9.cjs"),h=c=>{const o=e.ref(10),u=e.ref(0),l=e.ref(""),t=e.ref({}),r=e.ref(!1);async function s(){r.value=!0,g.axios.get(e.toValue(c)+"?size="+o.value+"&page="+u.value+"&sorts%5Boccurred_at%5D=desc").then(n=>{t.value=n.data,r.value=!1}).catch(n=>{console.error(n)})}const i=e.computed(()=>Math.ceil(t.value.count_filtered/o.value)-1),a=e.computed(()=>t.value.count),d=e.computed(()=>u.value*o.value+1),v=e.computed(()=>Math.min((u.value+1)*o.value,a.value)),f=e.computed(()=>t.value.count_filtered),p=e.computed(()=>t.value.rows);function m(){console.log("Not yet implemented")}return e.watchEffect(()=>{s()}),{dataUrl:c,size:o,page:u,sorts:l,data:t,fetch:s,loading:r,downloadCsv:m,totalPages:i,countFiltered:f,count:a,rows:p,first:d,last:v}};exports.useSprunjer=h; | ||
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),h=require("./axios-tuVKNgv9.cjs"),w=s=>{const o=e.ref(10),u=e.ref(0),a=e.ref({}),c=e.ref({}),t=e.ref({}),r=e.ref(!1);async function l(){r.value=!0,h.axios.get(e.toValue(s),{params:{size:o.value,page:u.value,sorts:a.value,filters:c.value}}).then(n=>{t.value=n.data,r.value=!1}).catch(n=>{console.error(n)})}const v=e.computed(()=>Math.ceil(t.value.count_filtered/o.value)-1),i=e.computed(()=>t.value.count),f=e.computed(()=>u.value*o.value+1),d=e.computed(()=>Math.min((u.value+1)*o.value,i.value)),p=e.computed(()=>t.value.count_filtered),m=e.computed(()=>t.value.rows);function g(){console.log("Not yet implemented")}return e.watchEffect(()=>{l()}),{dataUrl:s,size:o,page:u,sorts:a,filters:c,data:t,fetch:l,loading:r,downloadCsv:g,totalPages:v,countFiltered:p,count:i,rows:m,first:f,last:d}};exports.useSprunjer=w; |
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,39 +1,45 @@ | ||
import { ref as n, computed as t, watchEffect as h, toValue as w } from "vue"; | ||
import { a as _ } from "./axios-CXDYiOMX.js"; | ||
const z = (s) => { | ||
const o = n(10), a = n(0), v = n(""), e = n({}), r = n(!1); | ||
async function c() { | ||
r.value = !0, _.get( | ||
w(s) + "?size=" + o.value + "&page=" + a.value + "&sorts%5Boccurred_at%5D=desc" | ||
).then((u) => { | ||
e.value = u.data, r.value = !1; | ||
}).catch((u) => { | ||
console.error(u); | ||
import { ref as t, computed as o, watchEffect as w, toValue as x } from "vue"; | ||
import { a as y } from "./axios-CXDYiOMX.js"; | ||
const _ = (u) => { | ||
const a = t(10), n = t(0), l = t({}), c = t({}), e = t({}), r = t(!1); | ||
async function v() { | ||
r.value = !0, y.get(x(u), { | ||
params: { | ||
size: a.value, | ||
page: n.value, | ||
sorts: l.value, | ||
filters: c.value | ||
} | ||
}).then((s) => { | ||
e.value = s.data, r.value = !1; | ||
}).catch((s) => { | ||
console.error(s); | ||
}); | ||
} | ||
const i = t(() => Math.ceil(e.value.count_filtered / o.value) - 1), l = t(() => e.value.count), f = t(() => a.value * o.value + 1), d = t(() => Math.min((a.value + 1) * o.value, l.value)), m = t(() => e.value.count_filtered), p = t(() => e.value.rows); | ||
function g() { | ||
const f = o(() => Math.ceil(e.value.count_filtered / a.value) - 1), i = o(() => e.value.count), d = o(() => n.value * a.value + 1), m = o(() => Math.min((n.value + 1) * a.value, i.value)), p = o(() => e.value.count_filtered), g = o(() => e.value.rows); | ||
function h() { | ||
console.log("Not yet implemented"); | ||
} | ||
return h(() => { | ||
c(); | ||
return w(() => { | ||
v(); | ||
}), { | ||
dataUrl: s, | ||
size: o, | ||
page: a, | ||
sorts: v, | ||
dataUrl: u, | ||
size: a, | ||
page: n, | ||
sorts: l, | ||
filters: c, | ||
data: e, | ||
fetch: c, | ||
fetch: v, | ||
loading: r, | ||
downloadCsv: g, | ||
totalPages: i, | ||
countFiltered: m, | ||
count: l, | ||
rows: p, | ||
first: f, | ||
last: d | ||
downloadCsv: h, | ||
totalPages: f, | ||
countFiltered: p, | ||
count: i, | ||
rows: g, | ||
first: d, | ||
last: m | ||
}; | ||
}; | ||
export { | ||
z as useSprunjer | ||
_ as useSprunjer | ||
}; |