@sulzanoks/vue-datatable 0.3.4 → 0.3.5
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/datatable-card.es.js +184 -150
- package/dist/datatable-card.umd.js +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/src/Components/DatatableCard.vue +83 -25
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ref as gi, shallowRef as ia, defineComponent as vi, markRaw as Li, h as Nr, resolveComponent as oa, openBlock as L, createElementBlock as M, normalizeClass as
|
|
1
|
+
import { ref as gi, shallowRef as ia, defineComponent as vi, markRaw as Li, h as Nr, resolveComponent as oa, openBlock as L, createElementBlock as M, normalizeClass as le, createElementVNode as P, toDisplayString as ve, createCommentVNode as ie, renderSlot as Bi, createVNode as aa, withCtx as sa, withModifiers as la, Fragment as Le, renderList as dt, normalizeStyle as ca, withDirectives as ua, vModelCheckbox as fa, createBlock as da, createTextVNode as Mi, pushScopeId as pa, popScopeId as ha } from "vue";
|
|
2
2
|
function go(e, t) {
|
|
3
3
|
return function() {
|
|
4
4
|
return e.apply(t, arguments);
|
|
@@ -320,10 +320,10 @@ function Gr(e, t, r) {
|
|
|
320
320
|
if (m.endsWith(g, "{}"))
|
|
321
321
|
g = i ? g : g.slice(0, -2), d = JSON.stringify(d);
|
|
322
322
|
else if (m.isArray(d) && Qa(d) || (m.isFileList(d) || m.endsWith(g, "[]")) && (w = m.toArray(d)))
|
|
323
|
-
return g = Po(g), w.forEach(function(N,
|
|
323
|
+
return g = Po(g), w.forEach(function(N, R) {
|
|
324
324
|
!(m.isUndefined(N) || N === null) && t.append(
|
|
325
325
|
// eslint-disable-next-line no-nested-ternary
|
|
326
|
-
l === !0 ? Ui([g],
|
|
326
|
+
l === !0 ? Ui([g], R, a) : l === null ? g : g + "[]",
|
|
327
327
|
f(N)
|
|
328
328
|
);
|
|
329
329
|
}), !1;
|
|
@@ -339,14 +339,14 @@ function Gr(e, t, r) {
|
|
|
339
339
|
if (!m.isUndefined(d)) {
|
|
340
340
|
if (v.indexOf(d) !== -1)
|
|
341
341
|
throw Error("Circular reference detected in " + g.join("."));
|
|
342
|
-
v.push(d), m.forEach(d, function(w,
|
|
342
|
+
v.push(d), m.forEach(d, function(w, C) {
|
|
343
343
|
(!(m.isUndefined(w) || w === null) && o.call(
|
|
344
344
|
t,
|
|
345
345
|
w,
|
|
346
|
-
m.isString(
|
|
346
|
+
m.isString(C) ? C.trim() : C,
|
|
347
347
|
g,
|
|
348
348
|
S
|
|
349
|
-
)) === !0 && b(w, g ? g.concat(
|
|
349
|
+
)) === !0 && b(w, g ? g.concat(C) : [C]);
|
|
350
350
|
}), v.pop();
|
|
351
351
|
}
|
|
352
352
|
}
|
|
@@ -1892,8 +1892,8 @@ var fi = wl, ao = fi.custom, so = Wo(ao) ? ao : null, Nl = function e(t, r, i, o
|
|
|
1892
1892
|
return typeof t == "object" && !bt ? Vt(g) : g;
|
|
1893
1893
|
}
|
|
1894
1894
|
if (zl(t)) {
|
|
1895
|
-
for (var _ = "<" + to.call(String(t.nodeName)), w = t.attributes || [],
|
|
1896
|
-
_ += " " + w[
|
|
1895
|
+
for (var _ = "<" + to.call(String(t.nodeName)), w = t.attributes || [], C = 0; C < w.length; C++)
|
|
1896
|
+
_ += " " + w[C].name + "=" + Vo(Il(w[C].value), "double", a);
|
|
1897
1897
|
return _ += ">", t.childNodes && t.childNodes.length && (_ += "..."), _ += "</" + to.call(String(t.nodeName)) + ">", _;
|
|
1898
1898
|
}
|
|
1899
1899
|
if (di(t)) {
|
|
@@ -1903,8 +1903,8 @@ var fi = wl, ao = fi.custom, so = Wo(ao) ? ao : null, Nl = function e(t, r, i, o
|
|
|
1903
1903
|
return v && !Jl(N) ? "[" + pi(N, v) + "]" : "[ " + Te.call(N, ", ") + " ]";
|
|
1904
1904
|
}
|
|
1905
1905
|
if (Ll(t)) {
|
|
1906
|
-
var
|
|
1907
|
-
return !("cause" in Error.prototype) && "cause" in t && !Ho.call(t, "cause") ? "{ [" + String(t) + "] " + Te.call(ro.call("[cause]: " + S(t.cause),
|
|
1906
|
+
var R = Tr(t, S);
|
|
1907
|
+
return !("cause" in Error.prototype) && "cause" in t && !Ho.call(t, "cause") ? "{ [" + String(t) + "] " + Te.call(ro.call("[cause]: " + S(t.cause), R), ", ") + " }" : R.length === 0 ? "[" + String(t) + "]" : "{ [" + String(t) + "] " + Te.call(R, ", ") + " }";
|
|
1908
1908
|
}
|
|
1909
1909
|
if (typeof t == "object" && l) {
|
|
1910
1910
|
if (so && typeof t[so] == "function" && fi)
|
|
@@ -2378,14 +2378,14 @@ var xi = Ti, At = vl, Ql = Nl, Xl = xi("%TypeError%"), Pr = xi("%WeakMap%", !0),
|
|
|
2378
2378
|
}, Oc = function(t) {
|
|
2379
2379
|
return typeof t == "string" || typeof t == "number" || typeof t == "boolean" || typeof t == "symbol" || typeof t == "bigint";
|
|
2380
2380
|
}, ri = {}, Ec = function e(t, r, i, o, a, l, c, p, f, h, v, S, b, d, g, _) {
|
|
2381
|
-
for (var w = t,
|
|
2382
|
-
var $ =
|
|
2381
|
+
for (var w = t, C = _, N = 0, R = !1; (C = C.get(ri)) !== void 0 && !R; ) {
|
|
2382
|
+
var $ = C.get(t);
|
|
2383
2383
|
if (N += 1, typeof $ < "u") {
|
|
2384
2384
|
if ($ === N)
|
|
2385
2385
|
throw new RangeError("Cyclic object value");
|
|
2386
|
-
|
|
2386
|
+
R = !0;
|
|
2387
2387
|
}
|
|
2388
|
-
typeof
|
|
2388
|
+
typeof C.get(ri) > "u" && (N = 0);
|
|
2389
2389
|
}
|
|
2390
2390
|
if (typeof p == "function" ? w = p(r, w) : w instanceof Date ? w = v(w) : i === "comma" && Be(w) && (w = Mr.maybeMap(w, function(be) {
|
|
2391
2391
|
return be instanceof Date ? v(be) : be;
|
|
@@ -2646,19 +2646,19 @@ var xi = Ti, At = vl, Ql = Nl, Xl = xi("%TypeError%"), Pr = xi("%WeakMap%", !0),
|
|
|
2646
2646
|
}, r.status = null, r.set = function(d) {
|
|
2647
2647
|
var g = r.isStarted();
|
|
2648
2648
|
d = o(d, i.minimum, 1), r.status = d === 1 ? null : d;
|
|
2649
|
-
var _ = r.render(!g), w = _.querySelector(i.barSelector),
|
|
2650
|
-
return _.offsetWidth, c(function(
|
|
2651
|
-
i.positionUsing === "" && (i.positionUsing = r.getPositioningCSS()), p(w, l(d,
|
|
2649
|
+
var _ = r.render(!g), w = _.querySelector(i.barSelector), C = i.speed, N = i.easing;
|
|
2650
|
+
return _.offsetWidth, c(function(R) {
|
|
2651
|
+
i.positionUsing === "" && (i.positionUsing = r.getPositioningCSS()), p(w, l(d, C, N)), d === 1 ? (p(_, {
|
|
2652
2652
|
transition: "none",
|
|
2653
2653
|
opacity: 1
|
|
2654
2654
|
}), _.offsetWidth, setTimeout(function() {
|
|
2655
2655
|
p(_, {
|
|
2656
|
-
transition: "all " +
|
|
2656
|
+
transition: "all " + C + "ms linear",
|
|
2657
2657
|
opacity: 0
|
|
2658
2658
|
}), setTimeout(function() {
|
|
2659
|
-
r.remove(),
|
|
2660
|
-
},
|
|
2661
|
-
},
|
|
2659
|
+
r.remove(), R();
|
|
2660
|
+
}, C);
|
|
2661
|
+
}, C)) : setTimeout(R, C);
|
|
2662
2662
|
}), this;
|
|
2663
2663
|
}, r.isStarted = function() {
|
|
2664
2664
|
return typeof r.status == "number";
|
|
@@ -2690,11 +2690,11 @@ var xi = Ti, At = vl, Ql = Nl, Xl = xi("%TypeError%"), Pr = xi("%WeakMap%", !0),
|
|
|
2690
2690
|
h(document.documentElement, "nprogress-busy");
|
|
2691
2691
|
var g = document.createElement("div");
|
|
2692
2692
|
g.id = "nprogress", g.innerHTML = i.template;
|
|
2693
|
-
var _ = g.querySelector(i.barSelector), w = d ? "-100" : a(r.status || 0),
|
|
2693
|
+
var _ = g.querySelector(i.barSelector), w = d ? "-100" : a(r.status || 0), C = document.querySelector(i.parent), N;
|
|
2694
2694
|
return p(_, {
|
|
2695
2695
|
transition: "all 0 linear",
|
|
2696
2696
|
transform: "translate3d(" + w + "%,0,0)"
|
|
2697
|
-
}), i.showSpinner || (N = g.querySelector(i.spinnerSelector), N && b(N)),
|
|
2697
|
+
}), i.showSpinner || (N = g.querySelector(i.spinnerSelector), N && b(N)), C != document.body && h(C, "nprogress-custom-parent"), C.appendChild(g), g;
|
|
2698
2698
|
}, r.remove = function() {
|
|
2699
2699
|
v(document.documentElement, "nprogress-busy"), v(document.querySelector(i.parent), "nprogress-custom-parent");
|
|
2700
2700
|
var d = document.getElementById("nprogress");
|
|
@@ -2726,33 +2726,33 @@ var xi = Ti, At = vl, Ql = Nl, Xl = xi("%TypeError%"), Pr = xi("%WeakMap%", !0),
|
|
|
2726
2726
|
};
|
|
2727
2727
|
}(), p = function() {
|
|
2728
2728
|
var d = ["Webkit", "O", "Moz", "ms"], g = {};
|
|
2729
|
-
function _(
|
|
2730
|
-
return
|
|
2729
|
+
function _(R) {
|
|
2730
|
+
return R.replace(/^-ms-/, "ms-").replace(/-([\da-z])/gi, function($, O) {
|
|
2731
2731
|
return O.toUpperCase();
|
|
2732
2732
|
});
|
|
2733
2733
|
}
|
|
2734
|
-
function w(
|
|
2734
|
+
function w(R) {
|
|
2735
2735
|
var $ = document.body.style;
|
|
2736
|
-
if (
|
|
2737
|
-
return
|
|
2738
|
-
for (var O = d.length, T =
|
|
2736
|
+
if (R in $)
|
|
2737
|
+
return R;
|
|
2738
|
+
for (var O = d.length, T = R.charAt(0).toUpperCase() + R.slice(1), j; O--; )
|
|
2739
2739
|
if (j = d[O] + T, j in $)
|
|
2740
2740
|
return j;
|
|
2741
|
-
return
|
|
2741
|
+
return R;
|
|
2742
2742
|
}
|
|
2743
|
-
function
|
|
2744
|
-
return
|
|
2743
|
+
function C(R) {
|
|
2744
|
+
return R = _(R), g[R] || (g[R] = w(R));
|
|
2745
2745
|
}
|
|
2746
|
-
function N(
|
|
2747
|
-
$ =
|
|
2746
|
+
function N(R, $, O) {
|
|
2747
|
+
$ = C($), R.style[$] = O;
|
|
2748
2748
|
}
|
|
2749
|
-
return function(
|
|
2749
|
+
return function(R, $) {
|
|
2750
2750
|
var O = arguments, T, j;
|
|
2751
2751
|
if (O.length == 2)
|
|
2752
2752
|
for (T in $)
|
|
2753
|
-
j = $[T], j !== void 0 && $.hasOwnProperty(T) && N(
|
|
2753
|
+
j = $[T], j !== void 0 && $.hasOwnProperty(T) && N(R, T, j);
|
|
2754
2754
|
else
|
|
2755
|
-
N(
|
|
2755
|
+
N(R, O[1], O[2]);
|
|
2756
2756
|
};
|
|
2757
2757
|
}();
|
|
2758
2758
|
function f(d, g) {
|
|
@@ -2945,20 +2945,20 @@ var yo = typeof window > "u", Kc = class {
|
|
|
2945
2945
|
}, onCancel: g = () => {
|
|
2946
2946
|
}, onSuccess: _ = () => {
|
|
2947
2947
|
}, onError: w = () => {
|
|
2948
|
-
}, queryStringArrayFormat:
|
|
2948
|
+
}, queryStringArrayFormat: C = "brackets" } = {}) {
|
|
2949
2949
|
let N = typeof e == "string" ? ht(e) : e;
|
|
2950
2950
|
if ((yi(r) || f) && !(r instanceof FormData) && (r = ea(r)), !(r instanceof FormData)) {
|
|
2951
|
-
let [O, T] = na(t, N, r,
|
|
2951
|
+
let [O, T] = na(t, N, r, C);
|
|
2952
2952
|
N = ht(O), r = T;
|
|
2953
2953
|
}
|
|
2954
|
-
let
|
|
2955
|
-
if (v(
|
|
2954
|
+
let R = { url: N, method: t, data: r, replace: i, preserveScroll: o, preserveState: a, only: l, headers: c, errorBag: p, forceFormData: f, queryStringArrayFormat: C, cancelled: !1, completed: !1, interrupted: !1 };
|
|
2955
|
+
if (v(R) === !1 || !$c(R))
|
|
2956
2956
|
return;
|
|
2957
2957
|
this.activeVisit && this.cancelVisit(this.activeVisit, { interrupted: !0 }), this.saveScrollPositions();
|
|
2958
2958
|
let $ = this.createVisitId();
|
|
2959
|
-
this.activeVisit = { ...
|
|
2959
|
+
this.activeVisit = { ...R, onCancelToken: h, onBefore: v, onStart: S, onProgress: b, onFinish: d, onCancel: g, onSuccess: _, onError: w, queryStringArrayFormat: C, cancelToken: new AbortController() }, h({ cancel: () => {
|
|
2960
2960
|
this.activeVisit && this.cancelVisit(this.activeVisit, { cancelled: !0 });
|
|
2961
|
-
} }), zc(
|
|
2961
|
+
} }), zc(R), S(R), li({ method: t, url: zt(N).href, data: t === "get" ? {} : r, params: t === "get" ? r : {}, signal: this.activeVisit.cancelToken.signal, headers: { ...c, Accept: "text/html, application/xhtml+xml", "X-Requested-With": "XMLHttpRequest", "X-Inertia": !0, ...l.length ? { "X-Inertia-Partial-Component": this.page.component, "X-Inertia-Partial-Data": l.join(",") } : {}, ...p && p.length ? { "X-Inertia-Error-Bag": p } : {}, ...this.page.version ? { "X-Inertia-Version": this.page.version } : {} }, onUploadProgress: (O) => {
|
|
2962
2962
|
r instanceof FormData && (O.percentage = O.progress ? Math.round(O.progress * 100) : 0, Wc(O), b(O));
|
|
2963
2963
|
} }).then((O) => {
|
|
2964
2964
|
var X;
|
|
@@ -3126,8 +3126,8 @@ function Yc(e) {
|
|
|
3126
3126
|
var mi = new Kc(), qr = { exports: {} };
|
|
3127
3127
|
qr.exports;
|
|
3128
3128
|
(function(e, t) {
|
|
3129
|
-
var r = 200, i = "__lodash_hash_undefined__", o = 9007199254740991, a = "[object Arguments]", l = "[object Array]", c = "[object Boolean]", p = "[object Date]", f = "[object Error]", h = "[object Function]", v = "[object GeneratorFunction]", S = "[object Map]", b = "[object Number]", d = "[object Object]", g = "[object Promise]", _ = "[object RegExp]", w = "[object Set]",
|
|
3130
|
-
U[a] = U[l] = U[$] = U[O] = U[c] = U[p] = U[T] = U[j] = U[Q] = U[X] = U[de] = U[S] = U[b] = U[d] = U[_] = U[w] = U[
|
|
3129
|
+
var r = 200, i = "__lodash_hash_undefined__", o = 9007199254740991, a = "[object Arguments]", l = "[object Array]", c = "[object Boolean]", p = "[object Date]", f = "[object Error]", h = "[object Function]", v = "[object GeneratorFunction]", S = "[object Map]", b = "[object Number]", d = "[object Object]", g = "[object Promise]", _ = "[object RegExp]", w = "[object Set]", C = "[object String]", N = "[object Symbol]", R = "[object WeakMap]", $ = "[object ArrayBuffer]", O = "[object DataView]", T = "[object Float32Array]", j = "[object Float64Array]", Q = "[object Int8Array]", X = "[object Int16Array]", de = "[object Int32Array]", V = "[object Uint8Array]", oe = "[object Uint8ClampedArray]", pe = "[object Uint16Array]", Re = "[object Uint32Array]", be = /[\\^$.*+?()[\]{}|]/g, Kr = /\w*$/, Qr = /^\[object .+?Constructor\]$/, Xr = /^(?:0|[1-9]\d*)$/, U = {};
|
|
3130
|
+
U[a] = U[l] = U[$] = U[O] = U[c] = U[p] = U[T] = U[j] = U[Q] = U[X] = U[de] = U[S] = U[b] = U[d] = U[_] = U[w] = U[C] = U[N] = U[V] = U[oe] = U[pe] = U[Re] = !0, U[f] = U[h] = U[R] = !1;
|
|
3131
3131
|
var Yr = typeof Me == "object" && Me && Me.Object === Object && Me, Zr = typeof self == "object" && self && self.Object === Object && self, he = Yr || Zr || Function("return this")(), tr = t && !t.nodeType && t, k = tr && !0 && e && !e.nodeType && e, rr = k && k.exports === tr;
|
|
3132
3132
|
function en(n, s) {
|
|
3133
3133
|
return n.set(s[0], s[1]), n;
|
|
@@ -3190,7 +3190,7 @@ qr.exports;
|
|
|
3190
3190
|
return n ? "Symbol(src)_1." + n : "";
|
|
3191
3191
|
}(), cr = rn.toString, we = tt.hasOwnProperty, rt = tt.toString, nn = RegExp(
|
|
3192
3192
|
"^" + cr.call(we).replace(be, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
|
|
3193
|
-
), We = rr ? he.Buffer : void 0, nt = he.Symbol, Rt = he.Uint8Array,
|
|
3193
|
+
), We = rr ? he.Buffer : void 0, nt = he.Symbol, Rt = he.Uint8Array, ue = Pt(Object.getPrototypeOf, Object), ur = Object.create, fr = tt.propertyIsEnumerable, on = tn.splice, xt = Object.getOwnPropertySymbols, it = We ? We.isBuffer : void 0, dr = Pt(Object.keys, Object), ot = ge(he, "DataView"), ze = ge(he, "Map"), me = ge(he, "Promise"), at = ge(he, "Set"), Nt = ge(he, "WeakMap"), Ge = ge(Object, "create"), It = ne(ot), Je = ne(ze), Ft = ne(me), Lt = ne(at), Bt = ne(Nt), Ue = nt ? nt.prototype : void 0, pr = Ue ? Ue.valueOf : void 0;
|
|
3194
3194
|
function xe(n) {
|
|
3195
3195
|
var s = -1, u = n ? n.length : 0;
|
|
3196
3196
|
for (this.clear(); ++s < u; ) {
|
|
@@ -3443,7 +3443,7 @@ qr.exports;
|
|
|
3443
3443
|
return Pn(u) ? u : void 0;
|
|
3444
3444
|
}
|
|
3445
3445
|
var Ne = xt ? Pt(xt, Object) : $n, Ie = Tn;
|
|
3446
|
-
(ot && Ie(new ot(new ArrayBuffer(1))) != O || ze && Ie(new ze()) != S || me && Ie(me.resolve()) != g || at && Ie(new at()) != w || Nt && Ie(new Nt()) !=
|
|
3446
|
+
(ot && Ie(new ot(new ArrayBuffer(1))) != O || ze && Ie(new ze()) != S || me && Ie(me.resolve()) != g || at && Ie(new at()) != w || Nt && Ie(new Nt()) != R) && (Ie = function(n) {
|
|
3447
3447
|
var s = rt.call(n), u = s == d ? n.constructor : void 0, y = u ? ne(u) : void 0;
|
|
3448
3448
|
if (y)
|
|
3449
3449
|
switch (y) {
|
|
@@ -3456,7 +3456,7 @@ qr.exports;
|
|
|
3456
3456
|
case Lt:
|
|
3457
3457
|
return w;
|
|
3458
3458
|
case Bt:
|
|
3459
|
-
return
|
|
3459
|
+
return R;
|
|
3460
3460
|
}
|
|
3461
3461
|
return s;
|
|
3462
3462
|
});
|
|
@@ -3465,7 +3465,7 @@ qr.exports;
|
|
|
3465
3465
|
return s && typeof n[0] == "string" && we.call(n, "index") && (u.index = n.index, u.input = n.input), u;
|
|
3466
3466
|
}
|
|
3467
3467
|
function Ae(n) {
|
|
3468
|
-
return typeof n.constructor == "function" && !vr(n) ? On(
|
|
3468
|
+
return typeof n.constructor == "function" && !vr(n) ? On(ue(n)) : {};
|
|
3469
3469
|
}
|
|
3470
3470
|
function Mn(n, s, u, y) {
|
|
3471
3471
|
var E = n.constructor;
|
|
@@ -3490,7 +3490,7 @@ qr.exports;
|
|
|
3490
3490
|
case S:
|
|
3491
3491
|
return mr(n, y, u);
|
|
3492
3492
|
case b:
|
|
3493
|
-
case
|
|
3493
|
+
case C:
|
|
3494
3494
|
return new E(n);
|
|
3495
3495
|
case _:
|
|
3496
3496
|
return gr(n);
|
|
@@ -3573,8 +3573,8 @@ qr.exports;
|
|
|
3573
3573
|
var Hr = { exports: {} };
|
|
3574
3574
|
Hr.exports;
|
|
3575
3575
|
(function(e, t) {
|
|
3576
|
-
var r = 200, i = "__lodash_hash_undefined__", o = 1, a = 2, l = 9007199254740991, c = "[object Arguments]", p = "[object Array]", f = "[object AsyncFunction]", h = "[object Boolean]", v = "[object Date]", S = "[object Error]", b = "[object Function]", d = "[object GeneratorFunction]", g = "[object Map]", _ = "[object Number]", w = "[object Null]",
|
|
3577
|
-
k[oe] = k[pe] = k[Re] = k[be] = k[Kr] = k[Qr] = k[Xr] = k[U] = k[Yr] = !0, k[c] = k[p] = k[de] = k[h] = k[V] = k[v] = k[S] = k[b] = k[g] = k[_] = k[
|
|
3576
|
+
var r = 200, i = "__lodash_hash_undefined__", o = 1, a = 2, l = 9007199254740991, c = "[object Arguments]", p = "[object Array]", f = "[object AsyncFunction]", h = "[object Boolean]", v = "[object Date]", S = "[object Error]", b = "[object Function]", d = "[object GeneratorFunction]", g = "[object Map]", _ = "[object Number]", w = "[object Null]", C = "[object Object]", N = "[object Promise]", R = "[object Proxy]", $ = "[object RegExp]", O = "[object Set]", T = "[object String]", j = "[object Symbol]", Q = "[object Undefined]", X = "[object WeakMap]", de = "[object ArrayBuffer]", V = "[object DataView]", oe = "[object Float32Array]", pe = "[object Float64Array]", Re = "[object Int8Array]", be = "[object Int16Array]", Kr = "[object Int32Array]", Qr = "[object Uint8Array]", Xr = "[object Uint8ClampedArray]", U = "[object Uint16Array]", Yr = "[object Uint32Array]", Zr = /[\\^$.*+?()[\]{}|]/g, he = /^\[object .+?Constructor\]$/, tr = /^(?:0|[1-9]\d*)$/, k = {};
|
|
3577
|
+
k[oe] = k[pe] = k[Re] = k[be] = k[Kr] = k[Qr] = k[Xr] = k[U] = k[Yr] = !0, k[c] = k[p] = k[de] = k[h] = k[V] = k[v] = k[S] = k[b] = k[g] = k[_] = k[C] = k[$] = k[O] = k[T] = k[X] = !1;
|
|
3578
3578
|
var rr = typeof Me == "object" && Me && Me.Object === Object && Me, en = typeof self == "object" && self && self.Object === Object && self, ye = rr || en || Function("return this")(), nr = t && !t.nodeType && t, ir = nr && !0 && e && !e.nodeType && e, Ot = ir && ir.exports === nr, Et = Ot && rr.process, or = function() {
|
|
3579
3579
|
try {
|
|
3580
3580
|
return Et && Et.binding && Et.binding("util");
|
|
@@ -3632,11 +3632,11 @@ Hr.exports;
|
|
|
3632
3632
|
u[++s] = y;
|
|
3633
3633
|
}), u;
|
|
3634
3634
|
}
|
|
3635
|
-
var rt = Array.prototype, nn = Function.prototype, We = Object.prototype, nt = ye["__core-js_shared__"], Rt = nn.toString,
|
|
3635
|
+
var rt = Array.prototype, nn = Function.prototype, We = Object.prototype, nt = ye["__core-js_shared__"], Rt = nn.toString, ue = We.hasOwnProperty, ur = function() {
|
|
3636
3636
|
var n = /[^.]+$/.exec(nt && nt.keys && nt.keys.IE_PROTO || "");
|
|
3637
3637
|
return n ? "Symbol(src)_1." + n : "";
|
|
3638
3638
|
}(), fr = We.toString, on = RegExp(
|
|
3639
|
-
"^" + Rt.call(
|
|
3639
|
+
"^" + Rt.call(ue).replace(Zr, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
|
|
3640
3640
|
), xt = Ot ? ye.Buffer : void 0, it = ye.Symbol, dr = ye.Uint8Array, ot = We.propertyIsEnumerable, ze = rt.splice, me = it ? it.toStringTag : void 0, at = Object.getOwnPropertySymbols, Nt = xt ? xt.isBuffer : void 0, Ge = cr(Object.keys, Object), It = Ne(ye, "DataView"), Je = Ne(ye, "Map"), Ft = Ne(ye, "Promise"), Lt = Ne(ye, "Set"), Bt = Ne(ye, "WeakMap"), Ue = Ne(Object, "create"), pr = ne(It), xe = ne(Je), an = ne(Ft), sn = ne(Lt), ln = ne(Bt), hr = it ? it.prototype : void 0, Mt = hr ? hr.valueOf : void 0;
|
|
3641
3641
|
function J(n) {
|
|
3642
3642
|
var s = -1, u = n == null ? 0 : n.length;
|
|
@@ -3658,11 +3658,11 @@ Hr.exports;
|
|
|
3658
3658
|
var u = s[n];
|
|
3659
3659
|
return u === i ? void 0 : u;
|
|
3660
3660
|
}
|
|
3661
|
-
return
|
|
3661
|
+
return ue.call(s, n) ? s[n] : void 0;
|
|
3662
3662
|
}
|
|
3663
3663
|
function dn(n) {
|
|
3664
3664
|
var s = this.__data__;
|
|
3665
|
-
return Ue ? s[n] !== void 0 :
|
|
3665
|
+
return Ue ? s[n] !== void 0 : ue.call(s, n);
|
|
3666
3666
|
}
|
|
3667
3667
|
function pn(n, s) {
|
|
3668
3668
|
var u = this.__data__;
|
|
@@ -3770,7 +3770,7 @@ Hr.exports;
|
|
|
3770
3770
|
function Cn(n, s) {
|
|
3771
3771
|
var u = ut(n), y = !u && br(n), E = !u && !y && ft(n), A = !u && !y && !E && Ar(n), I = u || y || E || A, F = I ? tn(n.length, String) : [], q = F.length;
|
|
3772
3772
|
for (var D in n)
|
|
3773
|
-
(s ||
|
|
3773
|
+
(s || ue.call(n, D)) && !(I && // Safari 9 has enumerable `arguments.length` in strict mode.
|
|
3774
3774
|
(D == "length" || // Node.js 0.10 has enumerable non-index properties on buffers.
|
|
3775
3775
|
E && (D == "offset" || D == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays.
|
|
3776
3776
|
A && (D == "buffer" || D == "byteLength" || D == "byteOffset") || // Skip index properties.
|
|
@@ -3798,8 +3798,8 @@ Hr.exports;
|
|
|
3798
3798
|
}
|
|
3799
3799
|
function Rn(n, s, u, y, E, A) {
|
|
3800
3800
|
var I = ut(n), F = ut(s), q = I ? p : Ae(n), D = F ? p : Ae(s);
|
|
3801
|
-
q = q == c ?
|
|
3802
|
-
var Z = q ==
|
|
3801
|
+
q = q == c ? C : q, D = D == c ? C : D;
|
|
3802
|
+
var Z = q == C, se = D == C, W = q == D;
|
|
3803
3803
|
if (W && ft(n)) {
|
|
3804
3804
|
if (!ft(s))
|
|
3805
3805
|
return !1;
|
|
@@ -3808,7 +3808,7 @@ Hr.exports;
|
|
|
3808
3808
|
if (W && !Z)
|
|
3809
3809
|
return A || (A = new _e()), I || Ar(n) ? Ut(n, s, u, y, E, A) : Fn(n, s, q, u, y, E, A);
|
|
3810
3810
|
if (!(u & o)) {
|
|
3811
|
-
var ee = Z &&
|
|
3811
|
+
var ee = Z && ue.call(n, "__wrapped__"), K = se && ue.call(s, "__wrapped__");
|
|
3812
3812
|
if (ee || K) {
|
|
3813
3813
|
var ke = ee ? n.value() : n, Fe = K ? s.value() : s;
|
|
3814
3814
|
return A || (A = new _e()), E(ke, Fe, u, y, A);
|
|
@@ -3830,7 +3830,7 @@ Hr.exports;
|
|
|
3830
3830
|
return Ge(n);
|
|
3831
3831
|
var s = [];
|
|
3832
3832
|
for (var u in Object(n))
|
|
3833
|
-
|
|
3833
|
+
ue.call(n, u) && u != "constructor" && s.push(u);
|
|
3834
3834
|
return s;
|
|
3835
3835
|
}
|
|
3836
3836
|
function Ut(n, s, u, y, E, A) {
|
|
@@ -3907,7 +3907,7 @@ Hr.exports;
|
|
|
3907
3907
|
return !1;
|
|
3908
3908
|
for (var se = q; se--; ) {
|
|
3909
3909
|
var W = F[se];
|
|
3910
|
-
if (!(I ? W in s :
|
|
3910
|
+
if (!(I ? W in s : ue.call(s, W)))
|
|
3911
3911
|
return !1;
|
|
3912
3912
|
}
|
|
3913
3913
|
var ee = A.get(n);
|
|
@@ -3944,7 +3944,7 @@ Hr.exports;
|
|
|
3944
3944
|
return xn(u) ? u : void 0;
|
|
3945
3945
|
}
|
|
3946
3946
|
function Ie(n) {
|
|
3947
|
-
var s =
|
|
3947
|
+
var s = ue.call(n, me), u = n[me];
|
|
3948
3948
|
try {
|
|
3949
3949
|
n[me] = void 0;
|
|
3950
3950
|
var y = !0;
|
|
@@ -3959,7 +3959,7 @@ Hr.exports;
|
|
|
3959
3959
|
}));
|
|
3960
3960
|
} : $n, Ae = Ke;
|
|
3961
3961
|
(It && Ae(new It(new ArrayBuffer(1))) != V || Je && Ae(new Je()) != g || Ft && Ae(Ft.resolve()) != N || Lt && Ae(new Lt()) != O || Bt && Ae(new Bt()) != X) && (Ae = function(n) {
|
|
3962
|
-
var s = Ke(n), u = s ==
|
|
3962
|
+
var s = Ke(n), u = s == C ? n.constructor : void 0, y = u ? ne(u) : "";
|
|
3963
3963
|
if (y)
|
|
3964
3964
|
switch (y) {
|
|
3965
3965
|
case pr:
|
|
@@ -4011,7 +4011,7 @@ Hr.exports;
|
|
|
4011
4011
|
var br = mr(function() {
|
|
4012
4012
|
return arguments;
|
|
4013
4013
|
}()) ? mr : function(n) {
|
|
4014
|
-
return Oe(n) &&
|
|
4014
|
+
return Oe(n) && ue.call(n, "callee") && !ot.call(n, "callee");
|
|
4015
4015
|
}, ut = Array.isArray;
|
|
4016
4016
|
function kt(n) {
|
|
4017
4017
|
return n != null && $t(n.length) && !wr(n);
|
|
@@ -4024,7 +4024,7 @@ Hr.exports;
|
|
|
4024
4024
|
if (!_r(n))
|
|
4025
4025
|
return !1;
|
|
4026
4026
|
var s = Ke(n);
|
|
4027
|
-
return s == b || s == d || s == f || s ==
|
|
4027
|
+
return s == b || s == d || s == f || s == R;
|
|
4028
4028
|
}
|
|
4029
4029
|
function $t(n) {
|
|
4030
4030
|
return typeof n == "number" && n > -1 && n % 1 == 0 && n <= l;
|
|
@@ -4049,18 +4049,18 @@ Hr.exports;
|
|
|
4049
4049
|
e.exports = kn;
|
|
4050
4050
|
})(Hr, Hr.exports);
|
|
4051
4051
|
Hr.exports;
|
|
4052
|
-
var
|
|
4052
|
+
var ce = gi(null), Rr = gi(null), ni = ia(null), xr = gi(null), mo = null;
|
|
4053
4053
|
vi({ name: "Inertia", props: { initialPage: { type: Object, required: !0 }, initialComponent: { type: Object, required: !1 }, resolveComponent: { type: Function, required: !1 }, titleCallback: { type: Function, required: !1, default: (e) => e }, onHeadUpdate: { type: Function, required: !1, default: () => () => {
|
|
4054
4054
|
} } }, setup({ initialPage: e, initialComponent: t, resolveComponent: r, titleCallback: i, onHeadUpdate: o }) {
|
|
4055
|
-
|
|
4055
|
+
ce.value = t ? Li(t) : null, Rr.value = e, xr.value = null;
|
|
4056
4056
|
let a = typeof window > "u";
|
|
4057
4057
|
return mo = Xc(a, i, o), a || (mi.init({ initialPage: e, resolveComponent: r, swapComponent: async (l) => {
|
|
4058
|
-
|
|
4058
|
+
ce.value = Li(l.component), Rr.value = l.page, xr.value = l.preserveState ? xr.value : Date.now();
|
|
4059
4059
|
} }), mi.on("navigate", () => mo.forceUpdate())), () => {
|
|
4060
|
-
if (
|
|
4061
|
-
|
|
4062
|
-
let l = Nr(
|
|
4063
|
-
return ni.value && (
|
|
4060
|
+
if (ce.value) {
|
|
4061
|
+
ce.value.inheritAttrs = !!ce.value.inheritAttrs;
|
|
4062
|
+
let l = Nr(ce.value, { ...Rr.value.props, key: xr.value });
|
|
4063
|
+
return ni.value && (ce.value.layout = ni.value, ni.value = null), ce.value.layout ? typeof ce.value.layout == "function" ? ce.value.layout(Nr, l) : (Array.isArray(ce.value.layout) ? ce.value.layout : [ce.value.layout]).concat(l).reverse().reduce((c, p) => (p.inheritAttrs = !!p.inheritAttrs, Nr(p, { ...Rr.value.props }, () => c))) : l;
|
|
4064
4064
|
}
|
|
4065
4065
|
};
|
|
4066
4066
|
} });
|
|
@@ -4262,6 +4262,35 @@ const tu = (e, t) => {
|
|
|
4262
4262
|
}
|
|
4263
4263
|
},
|
|
4264
4264
|
methods: {
|
|
4265
|
+
/**
|
|
4266
|
+
* Resolve classes for a cell based on column definition and row data.
|
|
4267
|
+
*
|
|
4268
|
+
* column.classes supports:
|
|
4269
|
+
* 1) String => always applied, e.g. "text-end bg-light"
|
|
4270
|
+
* 2) Array of rules => [{ min, max, class, valueKey? }]
|
|
4271
|
+
* - valueKey (optional) lets you read a different field than column.data
|
|
4272
|
+
* - min/max are numeric thresholds (inclusive)
|
|
4273
|
+
*/
|
|
4274
|
+
getCellClasses(e, t) {
|
|
4275
|
+
const r = [];
|
|
4276
|
+
if (!e.classes)
|
|
4277
|
+
return r;
|
|
4278
|
+
if (typeof e.classes == "string")
|
|
4279
|
+
return r.push(e.classes), r;
|
|
4280
|
+
if (Array.isArray(e.classes)) {
|
|
4281
|
+
const i = t[e.data];
|
|
4282
|
+
e.classes.forEach((o) => {
|
|
4283
|
+
if (!o || !o.class)
|
|
4284
|
+
return;
|
|
4285
|
+
let l = o.valueKey ? t[o.valueKey] : i;
|
|
4286
|
+
if (typeof l == "string" && (l = parseFloat(l.replace("%", "").trim())), typeof l != "number" || isNaN(l))
|
|
4287
|
+
return;
|
|
4288
|
+
const c = o.min !== void 0 ? o.min : -1 / 0, p = o.max !== void 0 ? o.max : 1 / 0;
|
|
4289
|
+
l >= c && l <= p && r.push(o.class);
|
|
4290
|
+
});
|
|
4291
|
+
}
|
|
4292
|
+
return r;
|
|
4293
|
+
},
|
|
4265
4294
|
handleEmit(e, t) {
|
|
4266
4295
|
this.$emit(e, t);
|
|
4267
4296
|
},
|
|
@@ -4398,7 +4427,7 @@ const tu = (e, t) => {
|
|
|
4398
4427
|
mounted() {
|
|
4399
4428
|
this.initColumnSettings(), this.loadDataOnInit && this.loadData();
|
|
4400
4429
|
}
|
|
4401
|
-
}, Ce = (e) => (pa("data-v-
|
|
4430
|
+
}, Ce = (e) => (pa("data-v-c63fe957"), e = e(), ha(), e), nu = {
|
|
4402
4431
|
key: 0,
|
|
4403
4432
|
class: "card-icon"
|
|
4404
4433
|
}, iu = {
|
|
@@ -4413,46 +4442,46 @@ const tu = (e, t) => {
|
|
|
4413
4442
|
}, su = {
|
|
4414
4443
|
key: 2,
|
|
4415
4444
|
class: "card-title text-danger"
|
|
4416
|
-
}, lu = { class: "form-group label-floating is-empty" }, cu = /* @__PURE__ */ Ce(() => /* @__PURE__ */
|
|
4445
|
+
}, lu = { class: "form-group label-floating is-empty" }, cu = /* @__PURE__ */ Ce(() => /* @__PURE__ */ P("i", { class: "material-icons search-icon-left" }, "search", -1)), uu = /* @__PURE__ */ Ce(() => /* @__PURE__ */ P("i", { class: "material-icons" }, "close", -1)), fu = [
|
|
4417
4446
|
uu
|
|
4418
|
-
], du = { class: "card-actions icons right-top" }, pu = { key: 0 }, hu = /* @__PURE__ */ Ce(() => /* @__PURE__ */
|
|
4447
|
+
], du = { class: "card-actions icons right-top" }, pu = { key: 0 }, hu = /* @__PURE__ */ Ce(() => /* @__PURE__ */ P("i", { class: "material-icons" }, "add", -1)), yu = /* @__PURE__ */ Ce(() => /* @__PURE__ */ P("i", { class: "material-icons" }, "search", -1)), mu = [
|
|
4419
4448
|
yu
|
|
4420
4449
|
], gu = {
|
|
4421
4450
|
class: "dropdown",
|
|
4422
4451
|
"data-tippy-content": "Show Entries"
|
|
4423
|
-
}, vu = /* @__PURE__ */ Ce(() => /* @__PURE__ */
|
|
4452
|
+
}, vu = /* @__PURE__ */ Ce(() => /* @__PURE__ */ P("a", {
|
|
4424
4453
|
href: "javascript:void(0)",
|
|
4425
4454
|
"data-bs-toggle": "dropdown"
|
|
4426
4455
|
}, [
|
|
4427
|
-
/* @__PURE__ */
|
|
4428
|
-
], -1)), Su = { class: "dropdown-menu dropdown-menu-right" }, bu = /* @__PURE__ */ Ce(() => /* @__PURE__ */
|
|
4456
|
+
/* @__PURE__ */ P("i", { class: "material-icons" }, "more_vert")
|
|
4457
|
+
], -1)), Su = { class: "dropdown-menu dropdown-menu-right" }, bu = /* @__PURE__ */ Ce(() => /* @__PURE__ */ P("a", { href: "javascript:void(0)" }, "10", -1)), wu = [
|
|
4429
4458
|
bu
|
|
4430
|
-
], _u = /* @__PURE__ */ Ce(() => /* @__PURE__ */
|
|
4459
|
+
], _u = /* @__PURE__ */ Ce(() => /* @__PURE__ */ P("a", { href: "javascript:void(0)" }, "25", -1)), Au = [
|
|
4431
4460
|
_u
|
|
4432
|
-
], Ou = /* @__PURE__ */ Ce(() => /* @__PURE__ */
|
|
4461
|
+
], Ou = /* @__PURE__ */ Ce(() => /* @__PURE__ */ P("a", { href: "javascript:void(0)" }, "50", -1)), Eu = [
|
|
4433
4462
|
Ou
|
|
4434
|
-
], Tu = /* @__PURE__ */ Ce(() => /* @__PURE__ */
|
|
4463
|
+
], Tu = /* @__PURE__ */ Ce(() => /* @__PURE__ */ P("a", { href: "javascript:void(0)" }, "100", -1)), Pu = [
|
|
4435
4464
|
Tu
|
|
4436
|
-
], Cu = { class: "card-body" }, Ru = ["name", "placeholder"], xu = /* @__PURE__ */ Ce(() => /* @__PURE__ */
|
|
4465
|
+
], Cu = { class: "card-body" }, Ru = ["name", "placeholder"], xu = /* @__PURE__ */ Ce(() => /* @__PURE__ */ P("button", {
|
|
4437
4466
|
type: "submit",
|
|
4438
4467
|
class: "btn btn-primary"
|
|
4439
4468
|
}, "Meklēt", -1)), Nu = { class: "table-responsive" }, Iu = { class: "dataTables_wrapper no-footer" }, Fu = { key: 0 }, Lu = ["onClick"], Bu = {
|
|
4440
4469
|
key: 1,
|
|
4441
4470
|
class: "w-25"
|
|
4442
|
-
}, Mu = ["onClick"], Du = { key: 0 }, ju = ["value"], Uu =
|
|
4471
|
+
}, Mu = ["onClick"], Du = { key: 0 }, ju = ["value"], Uu = ["href", "innerHTML"], ku = ["innerHTML"], $u = { key: 1 }, qu = ["onClick"], Hu = {
|
|
4443
4472
|
key: 0,
|
|
4444
4473
|
class: "material-icons"
|
|
4445
|
-
}, Wu = { class: "dataTables_info" }, zu = { key: 0 }, Gu = {
|
|
4474
|
+
}, Vu = { class: "d-flex justify-content-between align-items-center mt-3" }, Wu = { class: "dataTables_info" }, zu = { key: 0 }, Gu = {
|
|
4446
4475
|
class: "dataTables_paginate paging_simple_numbers user-select-none",
|
|
4447
4476
|
id: "document-index-table_paginate"
|
|
4448
4477
|
}, Ju = ["onClick"];
|
|
4449
4478
|
function Ku(e, t, r, i, o, a) {
|
|
4450
4479
|
const l = oa("Link");
|
|
4451
4480
|
return L(), M("div", {
|
|
4452
|
-
class:
|
|
4481
|
+
class: le(["card", r.cardClasses])
|
|
4453
4482
|
}, [
|
|
4454
|
-
|
|
4455
|
-
class:
|
|
4483
|
+
P("header", {
|
|
4484
|
+
class: le(["card-header", { "card-header-primary": !o.cardError && r.cardIcon, "card-header-danger": o.cardError && r.cardIcon, "card-header-icon": r.cardIcon }])
|
|
4456
4485
|
}, [
|
|
4457
4486
|
r.cardIcon ? (L(), M("div", nu, [
|
|
4458
4487
|
o.cardError ? (L(), M("i", ou, "dangerous")) : (L(), M("i", iu, ve(r.cardIcon), 1))
|
|
@@ -4461,18 +4490,18 @@ function Ku(e, t, r, i, o, a) {
|
|
|
4461
4490
|
o.cardError ? (L(), M("h4", su, ve(o.cardError), 1)) : ie("", !0),
|
|
4462
4491
|
r.advancedSearch ? ie("", !0) : (L(), M("div", {
|
|
4463
4492
|
key: 3,
|
|
4464
|
-
class:
|
|
4493
|
+
class: le(["card-search", { open: o.searchBarOpen }])
|
|
4465
4494
|
}, [
|
|
4466
|
-
|
|
4495
|
+
P("div", lu, [
|
|
4467
4496
|
cu,
|
|
4468
|
-
|
|
4497
|
+
P("input", {
|
|
4469
4498
|
type: "text",
|
|
4470
4499
|
class: "form-control filter-input",
|
|
4471
4500
|
placeholder: "Search...",
|
|
4472
4501
|
autocomplete: "off",
|
|
4473
4502
|
onKeyup: t[0] || (t[0] = (...c) => a.setSearchTerm && a.setSearchTerm(...c))
|
|
4474
4503
|
}, null, 32),
|
|
4475
|
-
|
|
4504
|
+
P("a", {
|
|
4476
4505
|
href: "javascript:void(0)",
|
|
4477
4506
|
class: "close-search",
|
|
4478
4507
|
onClick: t[1] || (t[1] = (...c) => a.clearSearch && a.clearSearch(...c)),
|
|
@@ -4480,7 +4509,7 @@ function Ku(e, t, r, i, o, a) {
|
|
|
4480
4509
|
}, fu)
|
|
4481
4510
|
])
|
|
4482
4511
|
], 2)),
|
|
4483
|
-
|
|
4512
|
+
P("ul", du, [
|
|
4484
4513
|
Bi(e.$slots, "actions", {}, void 0, !0),
|
|
4485
4514
|
r.createLink ? (L(), M("li", pu, [
|
|
4486
4515
|
aa(l, {
|
|
@@ -4493,39 +4522,39 @@ function Ku(e, t, r, i, o, a) {
|
|
|
4493
4522
|
_: 1
|
|
4494
4523
|
}, 8, ["href"])
|
|
4495
4524
|
])) : ie("", !0),
|
|
4496
|
-
|
|
4497
|
-
|
|
4525
|
+
P("li", null, [
|
|
4526
|
+
P("a", {
|
|
4498
4527
|
href: "javascript:void(0)",
|
|
4499
4528
|
"data-tippy-content": "Meklēt",
|
|
4500
4529
|
onClick: t[2] || (t[2] = (...c) => a.toggleSearch && a.toggleSearch(...c))
|
|
4501
4530
|
}, mu)
|
|
4502
4531
|
]),
|
|
4503
|
-
|
|
4532
|
+
P("li", gu, [
|
|
4504
4533
|
vu,
|
|
4505
|
-
|
|
4506
|
-
|
|
4534
|
+
P("ul", Su, [
|
|
4535
|
+
P("li", {
|
|
4507
4536
|
onClick: t[3] || (t[3] = (c) => a.setPageLength(10))
|
|
4508
4537
|
}, wu),
|
|
4509
|
-
|
|
4538
|
+
P("li", {
|
|
4510
4539
|
onClick: t[4] || (t[4] = (c) => a.setPageLength(25))
|
|
4511
4540
|
}, Au),
|
|
4512
|
-
|
|
4541
|
+
P("li", {
|
|
4513
4542
|
onClick: t[5] || (t[5] = (c) => a.setPageLength(50))
|
|
4514
4543
|
}, Eu),
|
|
4515
|
-
|
|
4544
|
+
P("li", {
|
|
4516
4545
|
onClick: t[6] || (t[6] = (c) => a.setPageLength(100))
|
|
4517
4546
|
}, Pu)
|
|
4518
4547
|
])
|
|
4519
4548
|
])
|
|
4520
4549
|
])
|
|
4521
4550
|
], 2),
|
|
4522
|
-
|
|
4551
|
+
P("div", Cu, [
|
|
4523
4552
|
Bi(e.$slots, "default", {}, void 0, !0),
|
|
4524
4553
|
r.advancedSearch ? (L(), M("div", {
|
|
4525
4554
|
key: 0,
|
|
4526
|
-
class:
|
|
4555
|
+
class: le(["toolbar", { open: o.searchBarOpen }])
|
|
4527
4556
|
}, [
|
|
4528
|
-
|
|
4557
|
+
P("form", {
|
|
4529
4558
|
onSubmit: t[7] || (t[7] = la((...c) => a.setAdvancedSearchFilters && a.setAdvancedSearchFilters(...c), ["prevent"]))
|
|
4530
4559
|
}, [
|
|
4531
4560
|
(L(!0), M(Le, null, dt(r.columns, (c, p) => (L(), M(Le, null, [
|
|
@@ -4533,7 +4562,7 @@ function Ku(e, t, r, i, o, a) {
|
|
|
4533
4562
|
class: "bmd-form-group",
|
|
4534
4563
|
key: p
|
|
4535
4564
|
}, [
|
|
4536
|
-
|
|
4565
|
+
P("input", {
|
|
4537
4566
|
name: c.name,
|
|
4538
4567
|
class: "form-control advanced-filter-input",
|
|
4539
4568
|
placeholder: c.displayName,
|
|
@@ -4544,15 +4573,15 @@ function Ku(e, t, r, i, o, a) {
|
|
|
4544
4573
|
xu
|
|
4545
4574
|
], 32)
|
|
4546
4575
|
], 2)) : ie("", !0),
|
|
4547
|
-
|
|
4548
|
-
|
|
4549
|
-
|
|
4550
|
-
class:
|
|
4576
|
+
P("div", Nu, [
|
|
4577
|
+
P("div", Iu, [
|
|
4578
|
+
P("table", {
|
|
4579
|
+
class: le(["table data-table dataTable no-footer", { "table-hover": r.clickableRows }])
|
|
4551
4580
|
}, [
|
|
4552
|
-
|
|
4553
|
-
|
|
4581
|
+
P("thead", null, [
|
|
4582
|
+
P("tr", null, [
|
|
4554
4583
|
r.selectableRows ? (L(), M("th", Fu, [
|
|
4555
|
-
|
|
4584
|
+
P("input", {
|
|
4556
4585
|
type: "checkbox",
|
|
4557
4586
|
onClick: t[8] || (t[8] = (...c) => a.selectAllRows && a.selectAllRows(...c)),
|
|
4558
4587
|
ref: "selectAllRows"
|
|
@@ -4561,7 +4590,7 @@ function Ku(e, t, r, i, o, a) {
|
|
|
4561
4590
|
(L(!0), M(Le, null, dt(r.columns, (c, p) => (L(), M(Le, { key: p }, [
|
|
4562
4591
|
c.visible !== !1 ? (L(), M("th", {
|
|
4563
4592
|
key: 0,
|
|
4564
|
-
class:
|
|
4593
|
+
class: le([a.columnSortingClasses[p], c.sortable !== !1 ? "sorting" : ""]),
|
|
4565
4594
|
onClick: (f) => a.setSorting(p),
|
|
4566
4595
|
style: ca(c.width ? { width: c.width } : {})
|
|
4567
4596
|
}, ve(c.displayName), 15, Lu)) : ie("", !0)
|
|
@@ -4569,13 +4598,13 @@ function Ku(e, t, r, i, o, a) {
|
|
|
4569
4598
|
r.actions ? (L(), M("th", Bu, "Darbības")) : ie("", !0)
|
|
4570
4599
|
])
|
|
4571
4600
|
]),
|
|
4572
|
-
|
|
4601
|
+
P("tbody", null, [
|
|
4573
4602
|
(L(!0), M(Le, null, dt(o.rows, (c, p) => (L(), M("tr", {
|
|
4574
4603
|
key: p,
|
|
4575
4604
|
onClick: (f) => r.clickableRows ? e.$emit("row-click", c) : null
|
|
4576
4605
|
}, [
|
|
4577
4606
|
r.selectableRows ? (L(), M("td", Du, [
|
|
4578
|
-
ua(
|
|
4607
|
+
ua(P("input", {
|
|
4579
4608
|
type: "checkbox",
|
|
4580
4609
|
value: c.id,
|
|
4581
4610
|
"onUpdate:modelValue": t[9] || (t[9] = (f) => o.selectedRows = f)
|
|
@@ -4584,7 +4613,10 @@ function Ku(e, t, r, i, o, a) {
|
|
|
4584
4613
|
])
|
|
4585
4614
|
])) : ie("", !0),
|
|
4586
4615
|
(L(!0), M(Le, null, dt(r.columns, (f, h) => (L(), M(Le, { key: h }, [
|
|
4587
|
-
f.visible !== !1 ? (L(), M("td",
|
|
4616
|
+
f.visible !== !1 ? (L(), M("td", {
|
|
4617
|
+
key: 0,
|
|
4618
|
+
class: le(a.getCellClasses(f, c))
|
|
4619
|
+
}, [
|
|
4588
4620
|
f.linkParams && r.hyperlinkStyle === "Link" ? (L(), da(l, {
|
|
4589
4621
|
key: 0,
|
|
4590
4622
|
href: a.generateLink(f.linkParams, c),
|
|
@@ -4593,59 +4625,61 @@ function Ku(e, t, r, i, o, a) {
|
|
|
4593
4625
|
key: 1,
|
|
4594
4626
|
href: a.generateLink(f.linkParams, c),
|
|
4595
4627
|
innerHTML: c[f.data]
|
|
4596
|
-
}, null, 8,
|
|
4628
|
+
}, null, 8, Uu)) : (L(), M("span", {
|
|
4597
4629
|
key: 2,
|
|
4598
4630
|
innerHTML: c[f.data]
|
|
4599
|
-
}, null, 8,
|
|
4600
|
-
])) : ie("", !0)
|
|
4631
|
+
}, null, 8, ku))
|
|
4632
|
+
], 2)) : ie("", !0)
|
|
4601
4633
|
], 64))), 128)),
|
|
4602
|
-
r.actions ? (L(), M("td",
|
|
4634
|
+
r.actions ? (L(), M("td", $u, [
|
|
4603
4635
|
(L(!0), M(Le, null, dt(r.actions, (f, h) => (L(), M("button", {
|
|
4604
4636
|
key: h,
|
|
4605
|
-
class:
|
|
4637
|
+
class: le(["btn btn-sm", f.class]),
|
|
4606
4638
|
onClick: (v) => a.handleEmit(f.emit, c)
|
|
4607
4639
|
}, [
|
|
4608
|
-
f.icon ? (L(), M("i",
|
|
4640
|
+
f.icon ? (L(), M("i", Hu, ve(f.icon), 1)) : ie("", !0),
|
|
4609
4641
|
Mi(" " + ve(f.label), 1)
|
|
4610
|
-
], 10,
|
|
4642
|
+
], 10, qu))), 128))
|
|
4611
4643
|
])) : ie("", !0)
|
|
4612
4644
|
], 8, Mu))), 128))
|
|
4613
4645
|
])
|
|
4614
4646
|
], 2),
|
|
4615
|
-
|
|
4616
|
-
|
|
4617
|
-
|
|
4618
|
-
|
|
4619
|
-
R("div", Gu, [
|
|
4620
|
-
R("a", {
|
|
4621
|
-
class: ue(["paginate_button first user-select-none", { disabled: o.columnSettings.start == 0 }]),
|
|
4622
|
-
onClick: t[10] || (t[10] = (c) => a.setPage(1))
|
|
4623
|
-
}, "Pirmā", 2),
|
|
4624
|
-
R("a", {
|
|
4625
|
-
class: ue(["paginate_button previous", { disabled: o.columnSettings.start == 0 }]),
|
|
4626
|
-
onClick: t[11] || (t[11] = (c) => a.setPage(a.currentPage - 1))
|
|
4627
|
-
}, "Iepriekšējā", 2),
|
|
4628
|
-
R("span", null, [
|
|
4629
|
-
(L(!0), M(Le, null, dt(a.pages, (c, p) => (L(), M("a", {
|
|
4630
|
-
class: ue(["paginate_button", { current: c == a.currentPage }]),
|
|
4631
|
-
onClick: (f) => a.setPage(c)
|
|
4632
|
-
}, ve(c), 11, Ju))), 256))
|
|
4647
|
+
P("div", Vu, [
|
|
4648
|
+
P("div", Wu, [
|
|
4649
|
+
Mi(" Rāda " + ve(a.firstRecord) + ". līdz " + ve(a.lastRecord) + ". no " + ve(o.recordsFiltered) + " ierakstiem ", 1),
|
|
4650
|
+
o.recordsFiltered != o.recordsTotal ? (L(), M("span", zu, " (kopā " + ve(o.recordsTotal) + " ieraksti) ", 1)) : ie("", !0)
|
|
4633
4651
|
]),
|
|
4634
|
-
|
|
4635
|
-
|
|
4636
|
-
|
|
4637
|
-
|
|
4638
|
-
|
|
4639
|
-
|
|
4640
|
-
|
|
4641
|
-
|
|
4652
|
+
P("div", Gu, [
|
|
4653
|
+
P("a", {
|
|
4654
|
+
class: le(["paginate_button first user-select-none", { disabled: o.columnSettings.start == 0 }]),
|
|
4655
|
+
onClick: t[10] || (t[10] = (c) => a.setPage(1))
|
|
4656
|
+
}, "Pirmā", 2),
|
|
4657
|
+
P("a", {
|
|
4658
|
+
class: le(["paginate_button previous", { disabled: o.columnSettings.start == 0 }]),
|
|
4659
|
+
onClick: t[11] || (t[11] = (c) => a.setPage(a.currentPage - 1))
|
|
4660
|
+
}, "Iepriekšējā", 2),
|
|
4661
|
+
P("span", null, [
|
|
4662
|
+
(L(!0), M(Le, null, dt(a.pages, (c, p) => (L(), M("a", {
|
|
4663
|
+
class: le(["paginate_button", { current: c == a.currentPage }]),
|
|
4664
|
+
onClick: (f) => a.setPage(c)
|
|
4665
|
+
}, ve(c), 11, Ju))), 256))
|
|
4666
|
+
]),
|
|
4667
|
+
P("a", {
|
|
4668
|
+
class: le(["paginate_button next", { disabled: o.columnSettings.start >= a.lastPageStart }]),
|
|
4669
|
+
onClick: t[12] || (t[12] = (c) => a.setPage(a.currentPage + 1))
|
|
4670
|
+
}, "Nākamā", 2),
|
|
4671
|
+
P("a", {
|
|
4672
|
+
class: le(["paginate_button last", { disabled: o.columnSettings.start >= a.lastPageStart }]),
|
|
4673
|
+
onClick: t[13] || (t[13] = (c) => a.setPage(a.pageCount))
|
|
4674
|
+
}, "Pēdējā", 2)
|
|
4675
|
+
])
|
|
4642
4676
|
])
|
|
4643
4677
|
])
|
|
4644
4678
|
])
|
|
4645
4679
|
])
|
|
4646
4680
|
], 2);
|
|
4647
4681
|
}
|
|
4648
|
-
const Xu = /* @__PURE__ */ tu(ru, [["render", Ku], ["__scopeId", "data-v-
|
|
4682
|
+
const Xu = /* @__PURE__ */ tu(ru, [["render", Ku], ["__scopeId", "data-v-c63fe957"]]);
|
|
4649
4683
|
export {
|
|
4650
4684
|
Xu as default
|
|
4651
4685
|
};
|
|
@@ -8,4 +8,4 @@
|
|
|
8
8
|
|
|
9
9
|
Please specify a more appropriate element using the "as" attribute. For example:
|
|
10
10
|
|
|
11
|
-
<Link href="${a}" method="${o}" as="button">...</Link>`),d.h(e.as,{...r,...i==="a"?{href:a}:{},onClick:c=>{_c(c)&&(c.preventDefault(),Rn.visit(a,{data:l,method:o,replace:e.replace,preserveScroll:e.preserveScroll,preserveState:e.preserveState??o!=="get",only:e.only,headers:e.headers,onCancelToken:r.onCancelToken||(()=>({})),onBefore:r.onBefore||(()=>({})),onStart:r.onStart||(()=>({})),onProgress:r.onProgress||(()=>({})),onFinish:r.onFinish||(()=>({})),onCancel:r.onCancel||(()=>({})),onSuccess:r.onSuccess||(()=>({})),onError:r.onError||(()=>({}))}))}},t)}}}),Oc=Ac;const vu="",Tc=(e,t)=>{const r=e.__vccOpts||e;for(const[i,o]of t)r[i]=o;return r},Pc={name:"DatatableCard",components:{Link:Oc},props:{cardTitle:{type:String,required:!1,default:null},cardIconStyle:{type:String,required:!1,default:"card-header-primary"},cardIcon:{type:String,required:!1,default:null},cardClasses:{type:String,required:!1,default:null},createLink:{type:String,required:!1,default:null},columns:{type:Array,required:!0},url:{type:String,required:!0},selectableRows:{type:Boolean,required:!1,default:!1},order:{type:Array,required:!1,default:[{column:0,dir:"asc"}]},advancedSearch:{type:Boolean,required:!1,default:!1},loadDataOnInit:{type:Boolean,required:!1,default:!0},requestQueryParams:{type:Object,required:!1,default:()=>({})},actions:{type:Array,required:!1},clickableRows:{type:Boolean,required:!1,default:!1},hyperlinkStyle:{type:String,required:!1,default:"Link"}},emits:["row-click"],data(){return{searchBarOpen:!1,rows:[],columnSettings:{},searchTerm:"",recordsTotal:0,recordsFiltered:0,selectedRows:[],cardError:null}},watch:{selectedRows:function(e,t){this.selectableRows&&(e.length===this.rows.length&&e.length>0?(this.$refs.selectAllRows.indeterminate=!1,this.$refs.selectAllRows.checked=!0):e.length===0?(this.$refs.selectAllRows.indeterminate=!1,this.$refs.selectAllRows.checked=!1):this.$refs.selectAllRows.indeterminate=!0)}},computed:{firstRecord(){return this.columnSettings.start+1},lastRecord(){return this.columnSettings.start+this.rows.length},currentPage(){return Math.ceil(this.columnSettings.start/this.columnSettings.length)+1},pageCount(){return Math.ceil(this.recordsFiltered/this.columnSettings.length)},lastPageStart(){return(this.pageCount-1)*this.columnSettings.length},columnSortingClasses(){let e=[];if(!this.columnSettings.order)return e;for(let t=0;t<this.columns.length;t++){let r="";for(let i=0;i<this.columnSettings.order.length;i++)this.columnSettings.order[i].column==t&&(r=this.columnSettings.order[i].dir=="asc"?"sorting_asc":"sorting_desc");e.push(r)}return e},pages(){let e=[],t=this.currentPage-2,r=this.currentPage+2;t<1&&(t=1,r=5),r>this.pageCount&&(t=this.pageCount-4,r=this.pageCount),t<1&&(t=1);for(let i=t;i<=r;i++)e.push(i);return e}},methods:{handleEmit(e,t){this.$emit(e,t)},refresh(){this.initColumnSettings(),this.searchBarOpen=!1,this.loadDataOnInit?this.loadData():this.rows=[],this.selectedRows=[],this.advancedSearch||(this.$el.querySelector(".filter-input").value=""),this.$el.querySelectorAll(".advanced-filter-input").forEach(e=>{e.value=""})},toggleSearch(){this.advancedSearch||(this.searchBarOpen=!0),this.advancedSearch&&(this.searchBarOpen=!this.searchBarOpen)},clearSearch(){this.searchBarOpen=!1,this.$el.querySelector(".filter-input").value="",this.columnSettings.search.value="",this.loadData()},setAdvancedSearchFilters(){this.columnSettings.columns.forEach((e,t)=>{e.searchable&&(e.search.value=this.$el.querySelector(`input[name="${e.name}"]`).value)}),this.loadData()},loadData(){this.columnSettings.draw++,this.clearSelectedRows();const e={...this.requestQueryParams,...this.columnSettings};rn.get(this.url,{params:e}).then(t=>{if(t.data.error){this.cardError="error loading data. see console for details",console.error(t.data.error);return}this.cardError=null,this.rows=t.data.data,this.recordsTotal=t.data.recordsTotal,this.recordsFiltered=t.data.recordsFiltered}).catch(t=>{this.cardError=t.response.data.message,console.error(t)})},initColumnSettings(){this.columnSettings={draw:0,columns:this.columns.map((e,t)=>({data:e.data,name:e.name,searchable:e.searchable===void 0?!0:e.searchable,sortable:e.sortable===void 0?!0:e.sortable,visible:e.visible===void 0?!0:e.visible,search:{value:"",regex:!1}})),order:this.order,start:0,length:10,search:{value:"",regex:!1}}},setPageLength(e){this.columnSettings.length=e,this.loadData()},setPage(e){e<1||e>this.pageCount||(this.columnSettings.start=(e-1)*this.columnSettings.length,this.loadData())},setSearchTerm(){setTimeout(()=>{this.columnSettings.search.value=this.$el.querySelector(".filter-input").value,this.columnSettings.start=0,this.loadData()},500)},setSorting(e){this.columnSettings.columns[e].sortable&&(this.columnSettings.order[0].column==e?this.columnSettings.order[0].dir=this.columnSettings.order[0].dir=="asc"?"desc":"asc":this.columnSettings.order=[{column:e,dir:"asc"}],this.loadData())},generateLink(e,t){const r=(o,a)=>{if(!a||typeof a!="object")return o;const l=new URLSearchParams(a).toString();return l?`${o}?${l}`:o},i=(o,a)=>{if(!o)return"";let l=o.replace(/\{(\w+)\}/g,(c,h)=>a[h]??"");return l=l.replace(/(^|[^:]):(\w+)/g,(c,h,f)=>`${h}${a[f]??""}`),l};if(typeof e=="string")return i(e,t);if(!e||typeof e!="object")return"";if(e.template){const o={...t||{},...e.params||{}},a=i(e.template,o);return r(a,e.query)}if(e.name){const o=Array.isArray(e.resourceIds)?e.resourceIds.map(l=>t?t[l]:void 0):[];let a=route(e.name,o);return r(a,e.query)}return""},selectAllRows(){this.selectedRows.length==this.rows.length?this.selectedRows=[]:this.selectedRows=this.rows.map(e=>e.id)},clearSelectedRows(){this.selectedRows=[]},filterColumns(e){this.columnSettings.columns.forEach((t,r)=>{t.searchable&&(t.search.value="",e.forEach(i=>{i.name==t.name&&(t.search.value=i.value)}))}),this.loadData()},getSelectedRows(){return this.selectedRows}},mounted(){this.initColumnSettings(),this.loadDataOnInit&&this.loadData()}},Se=e=>(d.pushScopeId("data-v-d1594d95"),e=e(),d.popScopeId(),e),Cc={key:0,class:"card-icon"},Rc={key:0,class:"material-icons"},xc={key:1,class:"material-icons"},Nc={key:1,class:"card-title"},Bc={key:2,class:"card-title text-danger"},Ic={class:"form-group label-floating is-empty"},Fc=Se(()=>d.createElementVNode("i",{class:"material-icons search-icon-left"},"search",-1)),kc=[Se(()=>d.createElementVNode("i",{class:"material-icons"},"close",-1))],Lc={class:"card-actions icons right-top"},Dc={key:0},Mc=Se(()=>d.createElementVNode("i",{class:"material-icons"},"add",-1)),jc=[Se(()=>d.createElementVNode("i",{class:"material-icons"},"search",-1))],Uc={class:"dropdown","data-tippy-content":"Show Entries"},Vc=Se(()=>d.createElementVNode("a",{href:"javascript:void(0)","data-bs-toggle":"dropdown"},[d.createElementVNode("i",{class:"material-icons"},"more_vert")],-1)),$c={class:"dropdown-menu dropdown-menu-right"},qc=[Se(()=>d.createElementVNode("a",{href:"javascript:void(0)"},"10",-1))],Hc=[Se(()=>d.createElementVNode("a",{href:"javascript:void(0)"},"25",-1))],zc=[Se(()=>d.createElementVNode("a",{href:"javascript:void(0)"},"50",-1))],Wc=[Se(()=>d.createElementVNode("a",{href:"javascript:void(0)"},"100",-1))],Gc={class:"card-body"},Jc=["name","placeholder"],Kc=Se(()=>d.createElementVNode("button",{type:"submit",class:"btn btn-primary"},"Meklēt",-1)),Qc={class:"table-responsive"},Xc={class:"dataTables_wrapper no-footer"},Yc={key:0},Zc=["onClick"],eu={key:1,class:"w-25"},tu=["onClick"],ru={key:0},nu=["value"],iu={key:0},ou=["href","innerHTML"],au=["innerHTML"],su={key:1},lu=["onClick"],cu={key:0,class:"material-icons"},uu={class:"dataTables_info"},fu={key:0},du={class:"dataTables_paginate paging_simple_numbers user-select-none",id:"document-index-table_paginate"},pu=["onClick"];function hu(e,t,r,i,o,a){const l=d.resolveComponent("Link");return d.openBlock(),d.createElementBlock("div",{class:d.normalizeClass(["card",r.cardClasses])},[d.createElementVNode("header",{class:d.normalizeClass(["card-header",{"card-header-primary":!o.cardError&&r.cardIcon,"card-header-danger":o.cardError&&r.cardIcon,"card-header-icon":r.cardIcon}])},[r.cardIcon?(d.openBlock(),d.createElementBlock("div",Cc,[o.cardError?(d.openBlock(),d.createElementBlock("i",xc,"dangerous")):(d.openBlock(),d.createElementBlock("i",Rc,d.toDisplayString(r.cardIcon),1))])):d.createCommentVNode("",!0),r.cardTitle&&!o.cardError?(d.openBlock(),d.createElementBlock("h4",Nc,d.toDisplayString(r.cardTitle),1)):d.createCommentVNode("",!0),o.cardError?(d.openBlock(),d.createElementBlock("h4",Bc,d.toDisplayString(o.cardError),1)):d.createCommentVNode("",!0),r.advancedSearch?d.createCommentVNode("",!0):(d.openBlock(),d.createElementBlock("div",{key:3,class:d.normalizeClass(["card-search",{open:o.searchBarOpen}])},[d.createElementVNode("div",Ic,[Fc,d.createElementVNode("input",{type:"text",class:"form-control filter-input",placeholder:"Search...",autocomplete:"off",onKeyup:t[0]||(t[0]=(...c)=>a.setSearchTerm&&a.setSearchTerm(...c))},null,32),d.createElementVNode("a",{href:"javascript:void(0)",class:"close-search",onClick:t[1]||(t[1]=(...c)=>a.clearSearch&&a.clearSearch(...c)),"data-tippy-content":"Close"},kc)])],2)),d.createElementVNode("ul",Lc,[d.renderSlot(e.$slots,"actions",{},void 0,!0),r.createLink?(d.openBlock(),d.createElementBlock("li",Dc,[d.createVNode(l,{href:r.createLink,"data-tippy-content":"Create new"},{default:d.withCtx(()=>[Mc]),_:1},8,["href"])])):d.createCommentVNode("",!0),d.createElementVNode("li",null,[d.createElementVNode("a",{href:"javascript:void(0)","data-tippy-content":"Meklēt",onClick:t[2]||(t[2]=(...c)=>a.toggleSearch&&a.toggleSearch(...c))},jc)]),d.createElementVNode("li",Uc,[Vc,d.createElementVNode("ul",$c,[d.createElementVNode("li",{onClick:t[3]||(t[3]=c=>a.setPageLength(10))},qc),d.createElementVNode("li",{onClick:t[4]||(t[4]=c=>a.setPageLength(25))},Hc),d.createElementVNode("li",{onClick:t[5]||(t[5]=c=>a.setPageLength(50))},zc),d.createElementVNode("li",{onClick:t[6]||(t[6]=c=>a.setPageLength(100))},Wc)])])])],2),d.createElementVNode("div",Gc,[d.renderSlot(e.$slots,"default",{},void 0,!0),r.advancedSearch?(d.openBlock(),d.createElementBlock("div",{key:0,class:d.normalizeClass(["toolbar",{open:o.searchBarOpen}])},[d.createElementVNode("form",{onSubmit:t[7]||(t[7]=d.withModifiers((...c)=>a.setAdvancedSearchFilters&&a.setAdvancedSearchFilters(...c),["prevent"]))},[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(r.columns,(c,h)=>(d.openBlock(),d.createElementBlock(d.Fragment,null,[c.searchable!==!1?(d.openBlock(),d.createElementBlock("span",{class:"bmd-form-group",key:h},[d.createElementVNode("input",{name:c.name,class:"form-control advanced-filter-input",placeholder:c.displayName,autocomplete:"off"},null,8,Jc)])):d.createCommentVNode("",!0)],64))),256)),Kc],32)],2)):d.createCommentVNode("",!0),d.createElementVNode("div",Qc,[d.createElementVNode("div",Xc,[d.createElementVNode("table",{class:d.normalizeClass(["table data-table dataTable no-footer",{"table-hover":r.clickableRows}])},[d.createElementVNode("thead",null,[d.createElementVNode("tr",null,[r.selectableRows?(d.openBlock(),d.createElementBlock("th",Yc,[d.createElementVNode("input",{type:"checkbox",onClick:t[8]||(t[8]=(...c)=>a.selectAllRows&&a.selectAllRows(...c)),ref:"selectAllRows"},null,512)])):d.createCommentVNode("",!0),(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(r.columns,(c,h)=>(d.openBlock(),d.createElementBlock(d.Fragment,{key:h},[c.visible!==!1?(d.openBlock(),d.createElementBlock("th",{key:0,class:d.normalizeClass([a.columnSortingClasses[h],c.sortable!==!1?"sorting":""]),onClick:f=>a.setSorting(h),style:d.normalizeStyle(c.width?{width:c.width}:{})},d.toDisplayString(c.displayName),15,Zc)):d.createCommentVNode("",!0)],64))),128)),r.actions?(d.openBlock(),d.createElementBlock("th",eu,"Darbības")):d.createCommentVNode("",!0)])]),d.createElementVNode("tbody",null,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(o.rows,(c,h)=>(d.openBlock(),d.createElementBlock("tr",{key:h,onClick:f=>r.clickableRows?e.$emit("row-click",c):null},[r.selectableRows?(d.openBlock(),d.createElementBlock("td",ru,[d.withDirectives(d.createElementVNode("input",{type:"checkbox",value:c.id,"onUpdate:modelValue":t[9]||(t[9]=f=>o.selectedRows=f)},null,8,nu),[[d.vModelCheckbox,o.selectedRows]])])):d.createCommentVNode("",!0),(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(r.columns,(f,y)=>(d.openBlock(),d.createElementBlock(d.Fragment,{key:y},[f.visible!==!1?(d.openBlock(),d.createElementBlock("td",iu,[f.linkParams&&r.hyperlinkStyle==="Link"?(d.openBlock(),d.createBlock(l,{key:0,href:a.generateLink(f.linkParams,c),innerHTML:c[f.data]},null,8,["href","innerHTML"])):f.linkParams&&r.hyperlinkStyle==="a"?(d.openBlock(),d.createElementBlock("a",{key:1,href:a.generateLink(f.linkParams,c),innerHTML:c[f.data]},null,8,ou)):(d.openBlock(),d.createElementBlock("span",{key:2,innerHTML:c[f.data]},null,8,au))])):d.createCommentVNode("",!0)],64))),128)),r.actions?(d.openBlock(),d.createElementBlock("td",su,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(r.actions,(f,y)=>(d.openBlock(),d.createElementBlock("button",{key:y,class:d.normalizeClass(["btn btn-sm",f.class]),onClick:b=>a.handleEmit(f.emit,c)},[f.icon?(d.openBlock(),d.createElementBlock("i",cu,d.toDisplayString(f.icon),1)):d.createCommentVNode("",!0),d.createTextVNode(" "+d.toDisplayString(f.label),1)],10,lu))),128))])):d.createCommentVNode("",!0)],8,tu))),128))])],2),d.createElementVNode("div",uu,[d.createTextVNode(" Rāda "+d.toDisplayString(a.firstRecord)+". līdz "+d.toDisplayString(a.lastRecord)+". no "+d.toDisplayString(o.recordsFiltered)+" ierakstiem ",1),o.recordsFiltered!=o.recordsTotal?(d.openBlock(),d.createElementBlock("span",fu," (kopā "+d.toDisplayString(o.recordsTotal)+" ieraksti) ",1)):d.createCommentVNode("",!0)]),d.createElementVNode("div",du,[d.createElementVNode("a",{class:d.normalizeClass(["paginate_button first user-select-none",{disabled:o.columnSettings.start==0}]),onClick:t[10]||(t[10]=c=>a.setPage(1))},"Pirmā",2),d.createElementVNode("a",{class:d.normalizeClass(["paginate_button previous",{disabled:o.columnSettings.start==0}]),onClick:t[11]||(t[11]=c=>a.setPage(a.currentPage-1))},"Iepriekšējā",2),d.createElementVNode("span",null,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(a.pages,(c,h)=>(d.openBlock(),d.createElementBlock("a",{class:d.normalizeClass(["paginate_button",{current:c==a.currentPage}]),onClick:f=>a.setPage(c)},d.toDisplayString(c),11,pu))),256))]),d.createElementVNode("a",{class:d.normalizeClass(["paginate_button next",{disabled:o.columnSettings.start>=a.lastPageStart}]),onClick:t[12]||(t[12]=c=>a.setPage(a.currentPage+1))},"Nākamā",2),d.createElementVNode("a",{class:d.normalizeClass(["paginate_button last",{disabled:o.columnSettings.start>=a.lastPageStart}]),onClick:t[13]||(t[13]=c=>a.setPage(a.pageCount))},"Pēdējā",2)])])])])],2)}return Tc(Pc,[["render",hu],["__scopeId","data-v-d1594d95"]])});
|
|
11
|
+
<Link href="${a}" method="${o}" as="button">...</Link>`),d.h(e.as,{...r,...i==="a"?{href:a}:{},onClick:c=>{_c(c)&&(c.preventDefault(),Rn.visit(a,{data:l,method:o,replace:e.replace,preserveScroll:e.preserveScroll,preserveState:e.preserveState??o!=="get",only:e.only,headers:e.headers,onCancelToken:r.onCancelToken||(()=>({})),onBefore:r.onBefore||(()=>({})),onStart:r.onStart||(()=>({})),onProgress:r.onProgress||(()=>({})),onFinish:r.onFinish||(()=>({})),onCancel:r.onCancel||(()=>({})),onSuccess:r.onSuccess||(()=>({})),onError:r.onError||(()=>({}))}))}},t)}}}),Oc=Ac;const vu="",Tc=(e,t)=>{const r=e.__vccOpts||e;for(const[i,o]of t)r[i]=o;return r},Pc={name:"DatatableCard",components:{Link:Oc},props:{cardTitle:{type:String,required:!1,default:null},cardIconStyle:{type:String,required:!1,default:"card-header-primary"},cardIcon:{type:String,required:!1,default:null},cardClasses:{type:String,required:!1,default:null},createLink:{type:String,required:!1,default:null},columns:{type:Array,required:!0},url:{type:String,required:!0},selectableRows:{type:Boolean,required:!1,default:!1},order:{type:Array,required:!1,default:[{column:0,dir:"asc"}]},advancedSearch:{type:Boolean,required:!1,default:!1},loadDataOnInit:{type:Boolean,required:!1,default:!0},requestQueryParams:{type:Object,required:!1,default:()=>({})},actions:{type:Array,required:!1},clickableRows:{type:Boolean,required:!1,default:!1},hyperlinkStyle:{type:String,required:!1,default:"Link"}},emits:["row-click"],data(){return{searchBarOpen:!1,rows:[],columnSettings:{},searchTerm:"",recordsTotal:0,recordsFiltered:0,selectedRows:[],cardError:null}},watch:{selectedRows:function(e,t){this.selectableRows&&(e.length===this.rows.length&&e.length>0?(this.$refs.selectAllRows.indeterminate=!1,this.$refs.selectAllRows.checked=!0):e.length===0?(this.$refs.selectAllRows.indeterminate=!1,this.$refs.selectAllRows.checked=!1):this.$refs.selectAllRows.indeterminate=!0)}},computed:{firstRecord(){return this.columnSettings.start+1},lastRecord(){return this.columnSettings.start+this.rows.length},currentPage(){return Math.ceil(this.columnSettings.start/this.columnSettings.length)+1},pageCount(){return Math.ceil(this.recordsFiltered/this.columnSettings.length)},lastPageStart(){return(this.pageCount-1)*this.columnSettings.length},columnSortingClasses(){let e=[];if(!this.columnSettings.order)return e;for(let t=0;t<this.columns.length;t++){let r="";for(let i=0;i<this.columnSettings.order.length;i++)this.columnSettings.order[i].column==t&&(r=this.columnSettings.order[i].dir=="asc"?"sorting_asc":"sorting_desc");e.push(r)}return e},pages(){let e=[],t=this.currentPage-2,r=this.currentPage+2;t<1&&(t=1,r=5),r>this.pageCount&&(t=this.pageCount-4,r=this.pageCount),t<1&&(t=1);for(let i=t;i<=r;i++)e.push(i);return e}},methods:{getCellClasses(e,t){const r=[];if(!e.classes)return r;if(typeof e.classes=="string")return r.push(e.classes),r;if(Array.isArray(e.classes)){const i=t[e.data];e.classes.forEach(o=>{if(!o||!o.class)return;let l=o.valueKey?t[o.valueKey]:i;if(typeof l=="string"&&(l=parseFloat(l.replace("%","").trim())),typeof l!="number"||isNaN(l))return;const c=o.min!==void 0?o.min:-1/0,h=o.max!==void 0?o.max:1/0;l>=c&&l<=h&&r.push(o.class)})}return r},handleEmit(e,t){this.$emit(e,t)},refresh(){this.initColumnSettings(),this.searchBarOpen=!1,this.loadDataOnInit?this.loadData():this.rows=[],this.selectedRows=[],this.advancedSearch||(this.$el.querySelector(".filter-input").value=""),this.$el.querySelectorAll(".advanced-filter-input").forEach(e=>{e.value=""})},toggleSearch(){this.advancedSearch||(this.searchBarOpen=!0),this.advancedSearch&&(this.searchBarOpen=!this.searchBarOpen)},clearSearch(){this.searchBarOpen=!1,this.$el.querySelector(".filter-input").value="",this.columnSettings.search.value="",this.loadData()},setAdvancedSearchFilters(){this.columnSettings.columns.forEach((e,t)=>{e.searchable&&(e.search.value=this.$el.querySelector(`input[name="${e.name}"]`).value)}),this.loadData()},loadData(){this.columnSettings.draw++,this.clearSelectedRows();const e={...this.requestQueryParams,...this.columnSettings};rn.get(this.url,{params:e}).then(t=>{if(t.data.error){this.cardError="error loading data. see console for details",console.error(t.data.error);return}this.cardError=null,this.rows=t.data.data,this.recordsTotal=t.data.recordsTotal,this.recordsFiltered=t.data.recordsFiltered}).catch(t=>{this.cardError=t.response.data.message,console.error(t)})},initColumnSettings(){this.columnSettings={draw:0,columns:this.columns.map((e,t)=>({data:e.data,name:e.name,searchable:e.searchable===void 0?!0:e.searchable,sortable:e.sortable===void 0?!0:e.sortable,visible:e.visible===void 0?!0:e.visible,search:{value:"",regex:!1}})),order:this.order,start:0,length:10,search:{value:"",regex:!1}}},setPageLength(e){this.columnSettings.length=e,this.loadData()},setPage(e){e<1||e>this.pageCount||(this.columnSettings.start=(e-1)*this.columnSettings.length,this.loadData())},setSearchTerm(){setTimeout(()=>{this.columnSettings.search.value=this.$el.querySelector(".filter-input").value,this.columnSettings.start=0,this.loadData()},500)},setSorting(e){this.columnSettings.columns[e].sortable&&(this.columnSettings.order[0].column==e?this.columnSettings.order[0].dir=this.columnSettings.order[0].dir=="asc"?"desc":"asc":this.columnSettings.order=[{column:e,dir:"asc"}],this.loadData())},generateLink(e,t){const r=(o,a)=>{if(!a||typeof a!="object")return o;const l=new URLSearchParams(a).toString();return l?`${o}?${l}`:o},i=(o,a)=>{if(!o)return"";let l=o.replace(/\{(\w+)\}/g,(c,h)=>a[h]??"");return l=l.replace(/(^|[^:]):(\w+)/g,(c,h,f)=>`${h}${a[f]??""}`),l};if(typeof e=="string")return i(e,t);if(!e||typeof e!="object")return"";if(e.template){const o={...t||{},...e.params||{}},a=i(e.template,o);return r(a,e.query)}if(e.name){const o=Array.isArray(e.resourceIds)?e.resourceIds.map(l=>t?t[l]:void 0):[];let a=route(e.name,o);return r(a,e.query)}return""},selectAllRows(){this.selectedRows.length==this.rows.length?this.selectedRows=[]:this.selectedRows=this.rows.map(e=>e.id)},clearSelectedRows(){this.selectedRows=[]},filterColumns(e){this.columnSettings.columns.forEach((t,r)=>{t.searchable&&(t.search.value="",e.forEach(i=>{i.name==t.name&&(t.search.value=i.value)}))}),this.loadData()},getSelectedRows(){return this.selectedRows}},mounted(){this.initColumnSettings(),this.loadDataOnInit&&this.loadData()}},Se=e=>(d.pushScopeId("data-v-c63fe957"),e=e(),d.popScopeId(),e),Cc={key:0,class:"card-icon"},Rc={key:0,class:"material-icons"},xc={key:1,class:"material-icons"},Nc={key:1,class:"card-title"},Bc={key:2,class:"card-title text-danger"},Ic={class:"form-group label-floating is-empty"},Fc=Se(()=>d.createElementVNode("i",{class:"material-icons search-icon-left"},"search",-1)),kc=[Se(()=>d.createElementVNode("i",{class:"material-icons"},"close",-1))],Lc={class:"card-actions icons right-top"},Dc={key:0},Mc=Se(()=>d.createElementVNode("i",{class:"material-icons"},"add",-1)),jc=[Se(()=>d.createElementVNode("i",{class:"material-icons"},"search",-1))],Uc={class:"dropdown","data-tippy-content":"Show Entries"},Vc=Se(()=>d.createElementVNode("a",{href:"javascript:void(0)","data-bs-toggle":"dropdown"},[d.createElementVNode("i",{class:"material-icons"},"more_vert")],-1)),$c={class:"dropdown-menu dropdown-menu-right"},qc=[Se(()=>d.createElementVNode("a",{href:"javascript:void(0)"},"10",-1))],Hc=[Se(()=>d.createElementVNode("a",{href:"javascript:void(0)"},"25",-1))],zc=[Se(()=>d.createElementVNode("a",{href:"javascript:void(0)"},"50",-1))],Wc=[Se(()=>d.createElementVNode("a",{href:"javascript:void(0)"},"100",-1))],Gc={class:"card-body"},Jc=["name","placeholder"],Kc=Se(()=>d.createElementVNode("button",{type:"submit",class:"btn btn-primary"},"Meklēt",-1)),Qc={class:"table-responsive"},Xc={class:"dataTables_wrapper no-footer"},Yc={key:0},Zc=["onClick"],eu={key:1,class:"w-25"},tu=["onClick"],ru={key:0},nu=["value"],iu=["href","innerHTML"],ou=["innerHTML"],au={key:1},su=["onClick"],lu={key:0,class:"material-icons"},cu={class:"d-flex justify-content-between align-items-center mt-3"},uu={class:"dataTables_info"},fu={key:0},du={class:"dataTables_paginate paging_simple_numbers user-select-none",id:"document-index-table_paginate"},pu=["onClick"];function hu(e,t,r,i,o,a){const l=d.resolveComponent("Link");return d.openBlock(),d.createElementBlock("div",{class:d.normalizeClass(["card",r.cardClasses])},[d.createElementVNode("header",{class:d.normalizeClass(["card-header",{"card-header-primary":!o.cardError&&r.cardIcon,"card-header-danger":o.cardError&&r.cardIcon,"card-header-icon":r.cardIcon}])},[r.cardIcon?(d.openBlock(),d.createElementBlock("div",Cc,[o.cardError?(d.openBlock(),d.createElementBlock("i",xc,"dangerous")):(d.openBlock(),d.createElementBlock("i",Rc,d.toDisplayString(r.cardIcon),1))])):d.createCommentVNode("",!0),r.cardTitle&&!o.cardError?(d.openBlock(),d.createElementBlock("h4",Nc,d.toDisplayString(r.cardTitle),1)):d.createCommentVNode("",!0),o.cardError?(d.openBlock(),d.createElementBlock("h4",Bc,d.toDisplayString(o.cardError),1)):d.createCommentVNode("",!0),r.advancedSearch?d.createCommentVNode("",!0):(d.openBlock(),d.createElementBlock("div",{key:3,class:d.normalizeClass(["card-search",{open:o.searchBarOpen}])},[d.createElementVNode("div",Ic,[Fc,d.createElementVNode("input",{type:"text",class:"form-control filter-input",placeholder:"Search...",autocomplete:"off",onKeyup:t[0]||(t[0]=(...c)=>a.setSearchTerm&&a.setSearchTerm(...c))},null,32),d.createElementVNode("a",{href:"javascript:void(0)",class:"close-search",onClick:t[1]||(t[1]=(...c)=>a.clearSearch&&a.clearSearch(...c)),"data-tippy-content":"Close"},kc)])],2)),d.createElementVNode("ul",Lc,[d.renderSlot(e.$slots,"actions",{},void 0,!0),r.createLink?(d.openBlock(),d.createElementBlock("li",Dc,[d.createVNode(l,{href:r.createLink,"data-tippy-content":"Create new"},{default:d.withCtx(()=>[Mc]),_:1},8,["href"])])):d.createCommentVNode("",!0),d.createElementVNode("li",null,[d.createElementVNode("a",{href:"javascript:void(0)","data-tippy-content":"Meklēt",onClick:t[2]||(t[2]=(...c)=>a.toggleSearch&&a.toggleSearch(...c))},jc)]),d.createElementVNode("li",Uc,[Vc,d.createElementVNode("ul",$c,[d.createElementVNode("li",{onClick:t[3]||(t[3]=c=>a.setPageLength(10))},qc),d.createElementVNode("li",{onClick:t[4]||(t[4]=c=>a.setPageLength(25))},Hc),d.createElementVNode("li",{onClick:t[5]||(t[5]=c=>a.setPageLength(50))},zc),d.createElementVNode("li",{onClick:t[6]||(t[6]=c=>a.setPageLength(100))},Wc)])])])],2),d.createElementVNode("div",Gc,[d.renderSlot(e.$slots,"default",{},void 0,!0),r.advancedSearch?(d.openBlock(),d.createElementBlock("div",{key:0,class:d.normalizeClass(["toolbar",{open:o.searchBarOpen}])},[d.createElementVNode("form",{onSubmit:t[7]||(t[7]=d.withModifiers((...c)=>a.setAdvancedSearchFilters&&a.setAdvancedSearchFilters(...c),["prevent"]))},[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(r.columns,(c,h)=>(d.openBlock(),d.createElementBlock(d.Fragment,null,[c.searchable!==!1?(d.openBlock(),d.createElementBlock("span",{class:"bmd-form-group",key:h},[d.createElementVNode("input",{name:c.name,class:"form-control advanced-filter-input",placeholder:c.displayName,autocomplete:"off"},null,8,Jc)])):d.createCommentVNode("",!0)],64))),256)),Kc],32)],2)):d.createCommentVNode("",!0),d.createElementVNode("div",Qc,[d.createElementVNode("div",Xc,[d.createElementVNode("table",{class:d.normalizeClass(["table data-table dataTable no-footer",{"table-hover":r.clickableRows}])},[d.createElementVNode("thead",null,[d.createElementVNode("tr",null,[r.selectableRows?(d.openBlock(),d.createElementBlock("th",Yc,[d.createElementVNode("input",{type:"checkbox",onClick:t[8]||(t[8]=(...c)=>a.selectAllRows&&a.selectAllRows(...c)),ref:"selectAllRows"},null,512)])):d.createCommentVNode("",!0),(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(r.columns,(c,h)=>(d.openBlock(),d.createElementBlock(d.Fragment,{key:h},[c.visible!==!1?(d.openBlock(),d.createElementBlock("th",{key:0,class:d.normalizeClass([a.columnSortingClasses[h],c.sortable!==!1?"sorting":""]),onClick:f=>a.setSorting(h),style:d.normalizeStyle(c.width?{width:c.width}:{})},d.toDisplayString(c.displayName),15,Zc)):d.createCommentVNode("",!0)],64))),128)),r.actions?(d.openBlock(),d.createElementBlock("th",eu,"Darbības")):d.createCommentVNode("",!0)])]),d.createElementVNode("tbody",null,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(o.rows,(c,h)=>(d.openBlock(),d.createElementBlock("tr",{key:h,onClick:f=>r.clickableRows?e.$emit("row-click",c):null},[r.selectableRows?(d.openBlock(),d.createElementBlock("td",ru,[d.withDirectives(d.createElementVNode("input",{type:"checkbox",value:c.id,"onUpdate:modelValue":t[9]||(t[9]=f=>o.selectedRows=f)},null,8,nu),[[d.vModelCheckbox,o.selectedRows]])])):d.createCommentVNode("",!0),(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(r.columns,(f,y)=>(d.openBlock(),d.createElementBlock(d.Fragment,{key:y},[f.visible!==!1?(d.openBlock(),d.createElementBlock("td",{key:0,class:d.normalizeClass(a.getCellClasses(f,c))},[f.linkParams&&r.hyperlinkStyle==="Link"?(d.openBlock(),d.createBlock(l,{key:0,href:a.generateLink(f.linkParams,c),innerHTML:c[f.data]},null,8,["href","innerHTML"])):f.linkParams&&r.hyperlinkStyle==="a"?(d.openBlock(),d.createElementBlock("a",{key:1,href:a.generateLink(f.linkParams,c),innerHTML:c[f.data]},null,8,iu)):(d.openBlock(),d.createElementBlock("span",{key:2,innerHTML:c[f.data]},null,8,ou))],2)):d.createCommentVNode("",!0)],64))),128)),r.actions?(d.openBlock(),d.createElementBlock("td",au,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(r.actions,(f,y)=>(d.openBlock(),d.createElementBlock("button",{key:y,class:d.normalizeClass(["btn btn-sm",f.class]),onClick:b=>a.handleEmit(f.emit,c)},[f.icon?(d.openBlock(),d.createElementBlock("i",lu,d.toDisplayString(f.icon),1)):d.createCommentVNode("",!0),d.createTextVNode(" "+d.toDisplayString(f.label),1)],10,su))),128))])):d.createCommentVNode("",!0)],8,tu))),128))])],2),d.createElementVNode("div",cu,[d.createElementVNode("div",uu,[d.createTextVNode(" Rāda "+d.toDisplayString(a.firstRecord)+". līdz "+d.toDisplayString(a.lastRecord)+". no "+d.toDisplayString(o.recordsFiltered)+" ierakstiem ",1),o.recordsFiltered!=o.recordsTotal?(d.openBlock(),d.createElementBlock("span",fu," (kopā "+d.toDisplayString(o.recordsTotal)+" ieraksti) ",1)):d.createCommentVNode("",!0)]),d.createElementVNode("div",du,[d.createElementVNode("a",{class:d.normalizeClass(["paginate_button first user-select-none",{disabled:o.columnSettings.start==0}]),onClick:t[10]||(t[10]=c=>a.setPage(1))},"Pirmā",2),d.createElementVNode("a",{class:d.normalizeClass(["paginate_button previous",{disabled:o.columnSettings.start==0}]),onClick:t[11]||(t[11]=c=>a.setPage(a.currentPage-1))},"Iepriekšējā",2),d.createElementVNode("span",null,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(a.pages,(c,h)=>(d.openBlock(),d.createElementBlock("a",{class:d.normalizeClass(["paginate_button",{current:c==a.currentPage}]),onClick:f=>a.setPage(c)},d.toDisplayString(c),11,pu))),256))]),d.createElementVNode("a",{class:d.normalizeClass(["paginate_button next",{disabled:o.columnSettings.start>=a.lastPageStart}]),onClick:t[12]||(t[12]=c=>a.setPage(a.currentPage+1))},"Nākamā",2),d.createElementVNode("a",{class:d.normalizeClass(["paginate_button last",{disabled:o.columnSettings.start>=a.lastPageStart}]),onClick:t[13]||(t[13]=c=>a.setPage(a.pageCount))},"Pēdējā",2)])])])])])],2)}return Tc(Pc,[["render",hu],["__scopeId","data-v-c63fe957"]])});
|
package/dist/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.toolbar[data-v-
|
|
1
|
+
.toolbar[data-v-c63fe957]:not(.open){display:none}.card .card-heading[data-v-c63fe957]{padding:15px 20px;position:relative;height:65px}.card .card-search[data-v-c63fe957]{position:absolute;top:0;right:0;margin:0;padding:0;height:100%;z-index:15;-webkit-transition:all .2s;-o-transition:all .2s;transition:all .2s;border:0;box-shadow:none;width:100%;display:none;background:#fff}.card .card-search .form-group[data-v-c63fe957]{margin:0;padding:0;height:65px}.card .card-search .search-icon-left[data-v-c63fe957]{left:15px;right:auto}.card .card-search .close-search[data-v-c63fe957],.card .card-search .search-icon-left[data-v-c63fe957]{top:50%;margin-top:-15px;line-height:30px;margin-right:10px;font-size:25px;position:absolute;right:15px;z-index:99}.card .card-search .form-control[data-v-c63fe957]{width:100%;height:100%;position:absolute;border:none;box-shadow:none;left:0;top:0;margin:0;font-size:15px;text-indent:45px;background-color:#eef5f9;background-image:none}.card .card-search .close-search[data-v-c63fe957]{right:15px;left:auto}.card .card-search .search-icon-left[data-v-c63fe957]{top:50%;margin-top:-15px;line-height:30px;margin-right:10px;font-size:25px;position:absolute;right:15px;z-index:99;width:30px}.card .card-search.open[data-v-c63fe957]{display:block}.card-heading ul.card-actions.icons[data-v-c63fe957]{position:absolute;list-style:none;padding:0;margin:0}ul.card-actions.icons li[data-v-c63fe957]{display:inline}.dataTables_wrapper .dataTables_paginate .paginate_button.current[data-v-c63fe957],.dataTables_wrapper .dataTables_paginate .paginate_button.current[data-v-c63fe957]:hover{background:unset;background-color:#00bcd4;border-color:#00bcd4;box-shadow:0 4px 5px #00bcd424,0 1px 10px #00bcd41f,0 2px 4px -1px #00bcd433}.dataTables_wrapper .dataTables_paginate .paginate_button[data-v-c63fe957],.dataTables_wrapper .dataTables_paginate .paginate_button[data-v-c63fe957]:hover{background:unset;border:0;border-color:#00bcd4;border-radius:30px!important;-webkit-transition:all .3s;transition:all .3s;padding:0 11px;margin:0 3px;min-width:30px;height:30px;line-height:30px;color:#999!important;font-weight:400;font-size:12px;text-transform:uppercase;background:transparent;text-align:center}.dataTables_wrapper .dataTables_paginate .paginate_button[data-v-c63fe957]:hover{border:1}.card-header[data-v-c63fe957]:first-child{border-radius:calc(.25rem - 1px) calc(.25rem - 1px) 0 0}.card .card-header[data-v-c63fe957]{border-bottom:none;background:transparent}.card [class*=card-header-][data-v-c63fe957],.card[class*=bg-][data-v-c63fe957]{color:#fff}.card .card-header[data-v-c63fe957]{z-index:3!important}.card [class*=card-header-][data-v-c63fe957]{margin:0 15px;padding:0;position:relative}.card [class*=card-header-] .card-icon[data-v-c63fe957],.card [class*=card-header-] .card-text[data-v-c63fe957]{border-radius:3px;background-color:#999;padding:15px;margin-top:-20px;margin-right:15px;float:left}.card .card-header.card-header-icon i[data-v-c63fe957],.card .card-header.card-header-text i[data-v-c63fe957]{width:33px;height:33px;text-align:center;line-height:33px}.card[data-v-c63fe957]{border:0;margin-bottom:30px;margin-top:30px;border-radius:6px;color:#333;background:#ffffff;width:100%;box-shadow:0 2px 2px #00000024,0 3px 1px -2px #0003,0 1px 5px #0000001f;box-shadow:0 1px 4px #00000024;font-size:.875rem}.card .card-header.card-header-icon .card-title[data-v-c63fe957],.card .card-header.card-header-text .card-title[data-v-c63fe957]{margin-top:15px;color:#3c4858}.card .card-header.card-header-icon h4[data-v-c63fe957],.card .card-header.card-header-text h4[data-v-c63fe957]{font-weight:300}.card .card-header .card-title[data-v-c63fe957]{margin-bottom:3px}.card .card-actions[data-v-c63fe957]{position:absolute;z-index:1;top:-50px;width:calc(100% - 30px);left:17px;right:17px;text-align:center}.card .card-actions[data-v-c63fe957]{text-align:end}.card ul.card-actions.icons[data-v-c63fe957]{position:absolute;list-style:none;padding:0;margin:0;right:10px;top:15px}ul.card-actions.icons.right-top[data-v-c63fe957]{right:10px;top:15px}ul.card-actions.icons li[data-v-c63fe957]{display:inline;width:100%;text-align:unset}.dropdown-menu .dropdown-item[data-v-c63fe957],.dropdown-menu li>a[data-v-c63fe957]{position:relative;width:auto;display:flex;flex-flow:nowrap;align-items:center;color:#333;font-weight:400;text-decoration:none;font-size:.8125rem;border-radius:.125rem;margin:0 .3125rem;transition:all .15s linear;min-width:7rem;padding:.625rem 1.25rem;overflow:hidden;line-height:1.42857143;text-overflow:ellipsis;word-wrap:break-word}.dropdown-menu .dropdown-item[data-v-c63fe957],.dropdown-menu li>a[data-v-c63fe957]{padding-right:1.5rem;padding-left:1.5rem}.dropdown-menu[data-v-c63fe957]{position:absolute;top:100%;left:0;z-index:1000;display:none;float:left;min-width:10rem;padding:.5rem 0;margin:.125rem 0 0;font-size:1rem;color:#212529;text-align:left;list-style:none;background-color:#fff;background-clip:padding-box;border:1px solid rgba(0,0,0,.15);border-radius:.25rem;box-shadow:0 2px 2px #00000024,0 3px 1px -2px #0003,0 1px 5px #0000001f}.dropdown-menu[data-v-c63fe957]{border:0;display:none;padding:.3125rem 0;transform:scale(0);transform-origin:0 0;will-change:transform,opacity;box-shadow:0 2px 5px #00000042}.dropdown-menu[data-v-c63fe957]{margin:0!important}.clickable-rows tbody tr[data-v-c63fe957]{cursor:pointer}
|
package/package.json
CHANGED
|
@@ -86,7 +86,7 @@
|
|
|
86
86
|
</thead>
|
|
87
87
|
<tbody>
|
|
88
88
|
<tr
|
|
89
|
-
v-for="(row, index) in rows"
|
|
89
|
+
v-for="(row, index) in rows"
|
|
90
90
|
:key="index"
|
|
91
91
|
@click="clickableRows ? $emit('row-click', row) : null"
|
|
92
92
|
>
|
|
@@ -94,7 +94,10 @@
|
|
|
94
94
|
<input type="checkbox" :value="row.id" v-model="selectedRows">
|
|
95
95
|
</td>
|
|
96
96
|
<template v-for="(column, index) in columns" :key="index">
|
|
97
|
-
<td
|
|
97
|
+
<td
|
|
98
|
+
v-if="column.visible !== false"
|
|
99
|
+
:class="getCellClasses(column, row)"
|
|
100
|
+
>
|
|
98
101
|
<Link v-if="column.linkParams && hyperlinkStyle === 'Link'" :href="generateLink(column.linkParams, row)"
|
|
99
102
|
v-html="row[column.data]">
|
|
100
103
|
</Link>
|
|
@@ -116,30 +119,30 @@
|
|
|
116
119
|
</tr>
|
|
117
120
|
</tbody>
|
|
118
121
|
</table>
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
122
|
+
<div class="d-flex justify-content-between align-items-center mt-3">
|
|
123
|
+
<div class="dataTables_info">
|
|
124
|
+
Rāda {{ firstRecord }}. līdz {{ lastRecord }}. no {{ recordsFiltered }} ierakstiem
|
|
125
|
+
<span v-if="recordsFiltered != recordsTotal">
|
|
126
|
+
(kopā {{ recordsTotal }} ieraksti)
|
|
127
|
+
</span>
|
|
128
|
+
</div>
|
|
129
|
+
<div class="dataTables_paginate paging_simple_numbers user-select-none"
|
|
130
|
+
id="document-index-table_paginate">
|
|
131
|
+
<a class="paginate_button first user-select-none" :class="{ disabled: columnSettings.start == 0 }"
|
|
132
|
+
@click="setPage(1)">Pirmā</a>
|
|
133
|
+
<a class="paginate_button previous" :class="{ disabled: columnSettings.start == 0 }"
|
|
134
|
+
@click="setPage(currentPage - 1)">Iepriekšējā</a>
|
|
135
|
+
|
|
136
|
+
<span>
|
|
137
|
+
<a v-for="(page, index) in pages" class="paginate_button"
|
|
138
|
+
:class="{ current: page == currentPage }" @click="setPage(page)">{{ page }}</a>
|
|
139
|
+
</span>
|
|
140
|
+
<a class="paginate_button next" :class="{ disabled: columnSettings.start >= lastPageStart }"
|
|
141
|
+
@click="setPage(currentPage + 1)">Nākamā</a>
|
|
142
|
+
<a class="paginate_button last" :class="{ disabled: columnSettings.start >= lastPageStart }"
|
|
143
|
+
@click="setPage(pageCount)">Pēdējā</a>
|
|
144
|
+
</div>
|
|
141
145
|
</div>
|
|
142
|
-
|
|
143
146
|
</div>
|
|
144
147
|
</div>
|
|
145
148
|
</div>
|
|
@@ -322,6 +325,61 @@ export default {
|
|
|
322
325
|
},
|
|
323
326
|
},
|
|
324
327
|
methods: {
|
|
328
|
+
/**
|
|
329
|
+
* Resolve classes for a cell based on column definition and row data.
|
|
330
|
+
*
|
|
331
|
+
* column.classes supports:
|
|
332
|
+
* 1) String => always applied, e.g. "text-end bg-light"
|
|
333
|
+
* 2) Array of rules => [{ min, max, class, valueKey? }]
|
|
334
|
+
* - valueKey (optional) lets you read a different field than column.data
|
|
335
|
+
* - min/max are numeric thresholds (inclusive)
|
|
336
|
+
*/
|
|
337
|
+
getCellClasses(column, row) {
|
|
338
|
+
const classes = [];
|
|
339
|
+
|
|
340
|
+
if (!column.classes) {
|
|
341
|
+
return classes;
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
// Simple string: always apply
|
|
345
|
+
if (typeof column.classes === 'string') {
|
|
346
|
+
classes.push(column.classes);
|
|
347
|
+
return classes;
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
// Array of conditional rules
|
|
351
|
+
if (Array.isArray(column.classes)) {
|
|
352
|
+
const baseValue = row[column.data];
|
|
353
|
+
|
|
354
|
+
column.classes.forEach((rule) => {
|
|
355
|
+
if (!rule || !rule.class) {
|
|
356
|
+
return;
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
// which value to inspect (defaults to column.data)
|
|
360
|
+
const raw = rule.valueKey ? row[rule.valueKey] : baseValue;
|
|
361
|
+
|
|
362
|
+
// try to parse numeric (strip % if needed)
|
|
363
|
+
let num = raw;
|
|
364
|
+
if (typeof num === 'string') {
|
|
365
|
+
num = parseFloat(num.replace('%', '').trim());
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
if (typeof num !== 'number' || isNaN(num)) {
|
|
369
|
+
return;
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
const min = rule.min !== undefined ? rule.min : -Infinity;
|
|
373
|
+
const max = rule.max !== undefined ? rule.max : Infinity;
|
|
374
|
+
|
|
375
|
+
if (num >= min && num <= max) {
|
|
376
|
+
classes.push(rule.class);
|
|
377
|
+
}
|
|
378
|
+
});
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
return classes;
|
|
382
|
+
},
|
|
325
383
|
handleEmit(emit, row) {
|
|
326
384
|
this.$emit(emit, row);
|
|
327
385
|
},
|