@sulzanoks/vue-datatable 0.3.0 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -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 B, createElementBlock as M, normalizeClass as ue, createElementVNode as R, 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";
1
+ import { ref as gi, shallowRef as ia, defineComponent as vi, markRaw as Li, h as Nr, resolveComponent as oa, openBlock as B, createElementBlock as M, normalizeClass as ue, createElementVNode as R, toDisplayString as ve, createCommentVNode as te, 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);
@@ -1818,7 +1818,7 @@ const bl = {}, Sl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineP
1818
1818
  __proto__: null,
1819
1819
  default: bl
1820
1820
  }, Symbol.toStringTag, { value: "Module" })), wl = /* @__PURE__ */ xs(Sl);
1821
- var Pi = typeof Map == "function" && Map.prototype, Qn = Object.getOwnPropertyDescriptor && Pi ? Object.getOwnPropertyDescriptor(Map.prototype, "size") : null, kr = Pi && Qn && typeof Qn.get == "function" ? Qn.get : null, Yi = Pi && Map.prototype.forEach, Ci = typeof Set == "function" && Set.prototype, Xn = Object.getOwnPropertyDescriptor && Ci ? Object.getOwnPropertyDescriptor(Set.prototype, "size") : null, $r = Ci && Xn && typeof Xn.get == "function" ? Xn.get : null, Zi = Ci && Set.prototype.forEach, _l = typeof WeakMap == "function" && WeakMap.prototype, Gt = _l ? WeakMap.prototype.has : null, Al = typeof WeakSet == "function" && WeakSet.prototype, Jt = Al ? WeakSet.prototype.has : null, Ol = typeof WeakRef == "function" && WeakRef.prototype, eo = Ol ? WeakRef.prototype.deref : null, El = Boolean.prototype.valueOf, Tl = Object.prototype.toString, Pl = Function.prototype.toString, Cl = String.prototype.match, Ri = String.prototype.slice, He = String.prototype.replace, Rl = String.prototype.toUpperCase, to = String.prototype.toLowerCase, qo = RegExp.prototype.test, ro = Array.prototype.concat, Te = Array.prototype.join, xl = Array.prototype.slice, no = Math.floor, ci = typeof BigInt == "function" ? BigInt.prototype.valueOf : null, Yn = Object.getOwnPropertySymbols, ui = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? Symbol.prototype.toString : null, St = typeof Symbol == "function" && typeof Symbol.iterator == "object", re = typeof Symbol == "function" && Symbol.toStringTag && (typeof Symbol.toStringTag === St || "symbol") ? Symbol.toStringTag : null, Ho = Object.prototype.propertyIsEnumerable, io = (typeof Reflect == "function" ? Reflect.getPrototypeOf : Object.getPrototypeOf) || ([].__proto__ === Array.prototype ? function(e) {
1821
+ var Pi = typeof Map == "function" && Map.prototype, Qn = Object.getOwnPropertyDescriptor && Pi ? Object.getOwnPropertyDescriptor(Map.prototype, "size") : null, kr = Pi && Qn && typeof Qn.get == "function" ? Qn.get : null, Yi = Pi && Map.prototype.forEach, Ci = typeof Set == "function" && Set.prototype, Xn = Object.getOwnPropertyDescriptor && Ci ? Object.getOwnPropertyDescriptor(Set.prototype, "size") : null, $r = Ci && Xn && typeof Xn.get == "function" ? Xn.get : null, Zi = Ci && Set.prototype.forEach, _l = typeof WeakMap == "function" && WeakMap.prototype, Gt = _l ? WeakMap.prototype.has : null, Al = typeof WeakSet == "function" && WeakSet.prototype, Jt = Al ? WeakSet.prototype.has : null, Ol = typeof WeakRef == "function" && WeakRef.prototype, eo = Ol ? WeakRef.prototype.deref : null, El = Boolean.prototype.valueOf, Tl = Object.prototype.toString, Pl = Function.prototype.toString, Cl = String.prototype.match, Ri = String.prototype.slice, He = String.prototype.replace, Rl = String.prototype.toUpperCase, to = String.prototype.toLowerCase, qo = RegExp.prototype.test, ro = Array.prototype.concat, Te = Array.prototype.join, xl = Array.prototype.slice, no = Math.floor, ci = typeof BigInt == "function" ? BigInt.prototype.valueOf : null, Yn = Object.getOwnPropertySymbols, ui = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? Symbol.prototype.toString : null, St = typeof Symbol == "function" && typeof Symbol.iterator == "object", ne = typeof Symbol == "function" && Symbol.toStringTag && (typeof Symbol.toStringTag === St || "symbol") ? Symbol.toStringTag : null, Ho = Object.prototype.propertyIsEnumerable, io = (typeof Reflect == "function" ? Reflect.getPrototypeOf : Object.getPrototypeOf) || ([].__proto__ === Array.prototype ? function(e) {
1822
1822
  return e.__proto__;
1823
1823
  } : null);
1824
1824
  function oo(e, t) {
@@ -1939,7 +1939,7 @@ var fi = wl, ao = fi.custom, so = Wo(ao) ? ao : null, Nl = function e(t, r, i, o
1939
1939
  if (Bl(t))
1940
1940
  return Vt(b(String(t)));
1941
1941
  if (!Fl(t) && !lo(t)) {
1942
- var T = Tr(t, b), j = io ? io(t) === Object.prototype : t instanceof Object || t.constructor === Object, Q = t instanceof Object ? "" : "null prototype", X = !j && re && Object(t) === t && re in t ? Ri.call(Ve(t), 8, -1) : Q ? "Object" : "", de = j || typeof t.constructor != "function" ? "" : t.constructor.name ? t.constructor.name + " " : "", V = de + (X || Q ? "[" + Te.call(ro.call([], X || [], Q || []), ": ") + "] " : "");
1942
+ var T = Tr(t, b), j = io ? io(t) === Object.prototype : t instanceof Object || t.constructor === Object, Q = t instanceof Object ? "" : "null prototype", X = !j && ne && Object(t) === t && ne in t ? Ri.call(Ve(t), 8, -1) : Q ? "Object" : "", de = j || typeof t.constructor != "function" ? "" : t.constructor.name ? t.constructor.name + " " : "", V = de + (X || Q ? "[" + Te.call(ro.call([], X || [], Q || []), ": ") + "] " : "");
1943
1943
  return T.length === 0 ? V + "{}" : v ? V + "{" + pi(T, v) + "}" : V + "{ " + Te.call(T, ", ") + " }";
1944
1944
  }
1945
1945
  return String(t);
@@ -1952,25 +1952,25 @@ function Il(e) {
1952
1952
  return He.call(String(e), /"/g, """);
1953
1953
  }
1954
1954
  function di(e) {
1955
- return Ve(e) === "[object Array]" && (!re || !(typeof e == "object" && re in e));
1955
+ return Ve(e) === "[object Array]" && (!ne || !(typeof e == "object" && ne in e));
1956
1956
  }
1957
1957
  function Fl(e) {
1958
- return Ve(e) === "[object Date]" && (!re || !(typeof e == "object" && re in e));
1958
+ return Ve(e) === "[object Date]" && (!ne || !(typeof e == "object" && ne in e));
1959
1959
  }
1960
1960
  function lo(e) {
1961
- return Ve(e) === "[object RegExp]" && (!re || !(typeof e == "object" && re in e));
1961
+ return Ve(e) === "[object RegExp]" && (!ne || !(typeof e == "object" && ne in e));
1962
1962
  }
1963
1963
  function Ll(e) {
1964
- return Ve(e) === "[object Error]" && (!re || !(typeof e == "object" && re in e));
1964
+ return Ve(e) === "[object Error]" && (!ne || !(typeof e == "object" && ne in e));
1965
1965
  }
1966
1966
  function Bl(e) {
1967
- return Ve(e) === "[object String]" && (!re || !(typeof e == "object" && re in e));
1967
+ return Ve(e) === "[object String]" && (!ne || !(typeof e == "object" && ne in e));
1968
1968
  }
1969
1969
  function Ml(e) {
1970
- return Ve(e) === "[object Number]" && (!re || !(typeof e == "object" && re in e));
1970
+ return Ve(e) === "[object Number]" && (!ne || !(typeof e == "object" && ne in e));
1971
1971
  }
1972
1972
  function Dl(e) {
1973
- return Ve(e) === "[object Boolean]" && (!re || !(typeof e == "object" && re in e));
1973
+ return Ve(e) === "[object Boolean]" && (!ne || !(typeof e == "object" && ne in e));
1974
1974
  }
1975
1975
  function Wo(e) {
1976
1976
  if (St)
@@ -2357,7 +2357,7 @@ var xi = Ti, At = vl, Ql = Nl, Xl = xi("%TypeError%"), Pr = xi("%WeakMap%", !0),
2357
2357
  }
2358
2358
  }, Be = Array.isArray, _c = Array.prototype.push, Xo = function(e, t) {
2359
2359
  _c.apply(e, Be(t) ? t : [t]);
2360
- }, Ac = Date.prototype.toISOString, fo = Kt.default, te = {
2360
+ }, Ac = Date.prototype.toISOString, fo = Kt.default, re = {
2361
2361
  addQueryPrefix: !1,
2362
2362
  allowDots: !1,
2363
2363
  charset: "utf-8",
@@ -2391,13 +2391,13 @@ var xi = Ti, At = vl, Ql = Nl, Xl = xi("%TypeError%"), Pr = xi("%WeakMap%", !0),
2391
2391
  return Se instanceof Date ? v(Se) : Se;
2392
2392
  })), w === null) {
2393
2393
  if (a)
2394
- return c && !d ? c(r, te.encoder, g, "key", b) : r;
2394
+ return c && !d ? c(r, re.encoder, g, "key", b) : r;
2395
2395
  w = "";
2396
2396
  }
2397
2397
  if (Oc(w) || Mr.isBuffer(w)) {
2398
2398
  if (c) {
2399
- var O = d ? r : c(r, te.encoder, g, "key", b);
2400
- return [S(O) + "=" + S(c(w, te.encoder, g, "value", b))];
2399
+ var O = d ? r : c(r, re.encoder, g, "key", b);
2400
+ return [S(O) + "=" + S(c(w, re.encoder, g, "value", b))];
2401
2401
  }
2402
2402
  return [S(r) + "=" + S(String(w))];
2403
2403
  }
@@ -2442,10 +2442,10 @@ var xi = Ti, At = vl, Ql = Nl, Xl = xi("%TypeError%"), Pr = xi("%WeakMap%", !0),
2442
2442
  return T;
2443
2443
  }, Tc = function(t) {
2444
2444
  if (!t)
2445
- return te;
2445
+ return re;
2446
2446
  if (t.encoder !== null && typeof t.encoder < "u" && typeof t.encoder != "function")
2447
2447
  throw new TypeError("Encoder has to be a function.");
2448
- var r = t.charset || te.charset;
2448
+ var r = t.charset || re.charset;
2449
2449
  if (typeof t.charset < "u" && t.charset !== "utf-8" && t.charset !== "iso-8859-1")
2450
2450
  throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");
2451
2451
  var i = Kt.default;
@@ -2454,23 +2454,23 @@ var xi = Ti, At = vl, Ql = Nl, Xl = xi("%TypeError%"), Pr = xi("%WeakMap%", !0),
2454
2454
  throw new TypeError("Unknown format option provided.");
2455
2455
  i = t.format;
2456
2456
  }
2457
- var o = Kt.formatters[i], a = te.filter;
2457
+ var o = Kt.formatters[i], a = re.filter;
2458
2458
  return (typeof t.filter == "function" || Be(t.filter)) && (a = t.filter), {
2459
- addQueryPrefix: typeof t.addQueryPrefix == "boolean" ? t.addQueryPrefix : te.addQueryPrefix,
2460
- allowDots: typeof t.allowDots > "u" ? te.allowDots : !!t.allowDots,
2459
+ addQueryPrefix: typeof t.addQueryPrefix == "boolean" ? t.addQueryPrefix : re.addQueryPrefix,
2460
+ allowDots: typeof t.allowDots > "u" ? re.allowDots : !!t.allowDots,
2461
2461
  charset: r,
2462
- charsetSentinel: typeof t.charsetSentinel == "boolean" ? t.charsetSentinel : te.charsetSentinel,
2463
- delimiter: typeof t.delimiter > "u" ? te.delimiter : t.delimiter,
2464
- encode: typeof t.encode == "boolean" ? t.encode : te.encode,
2465
- encoder: typeof t.encoder == "function" ? t.encoder : te.encoder,
2466
- encodeValuesOnly: typeof t.encodeValuesOnly == "boolean" ? t.encodeValuesOnly : te.encodeValuesOnly,
2462
+ charsetSentinel: typeof t.charsetSentinel == "boolean" ? t.charsetSentinel : re.charsetSentinel,
2463
+ delimiter: typeof t.delimiter > "u" ? re.delimiter : t.delimiter,
2464
+ encode: typeof t.encode == "boolean" ? t.encode : re.encode,
2465
+ encoder: typeof t.encoder == "function" ? t.encoder : re.encoder,
2466
+ encodeValuesOnly: typeof t.encodeValuesOnly == "boolean" ? t.encodeValuesOnly : re.encodeValuesOnly,
2467
2467
  filter: a,
2468
2468
  format: i,
2469
2469
  formatter: o,
2470
- serializeDate: typeof t.serializeDate == "function" ? t.serializeDate : te.serializeDate,
2471
- skipNulls: typeof t.skipNulls == "boolean" ? t.skipNulls : te.skipNulls,
2470
+ serializeDate: typeof t.serializeDate == "function" ? t.serializeDate : re.serializeDate,
2471
+ skipNulls: typeof t.skipNulls == "boolean" ? t.skipNulls : re.skipNulls,
2472
2472
  sort: typeof t.sort == "function" ? t.sort : null,
2473
- strictNullHandling: typeof t.strictNullHandling == "boolean" ? t.strictNullHandling : te.strictNullHandling
2473
+ strictNullHandling: typeof t.strictNullHandling == "boolean" ? t.strictNullHandling : re.strictNullHandling
2474
2474
  };
2475
2475
  }, Pc = function(e, t) {
2476
2476
  var r = e, i = Tc(t), o, a;
@@ -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(Se, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
3193
- ), We = rr ? he.Buffer : void 0, nt = he.Symbol, Rt = he.Uint8Array, ce = 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;
3193
+ ), We = rr ? he.Buffer : void 0, nt = he.Symbol, Rt = he.Uint8Array, ce = 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 = ie(ot), Je = ie(ze), Ft = ie(me), Lt = ie(at), Bt = ie(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; ) {
@@ -3371,7 +3371,7 @@ qr.exports;
3371
3371
  if (!Oe(n) || Un(n))
3372
3372
  return !1;
3373
3373
  var s = $t(n) || Tt(n) ? nn : Qr;
3374
- return s.test(ne(n));
3374
+ return s.test(ie(n));
3375
3375
  }
3376
3376
  function Cn(n) {
3377
3377
  if (!vr(n))
@@ -3444,7 +3444,7 @@ qr.exports;
3444
3444
  }
3445
3445
  var Ne = xt ? Pt(xt, Object) : $n, Ie = Tn;
3446
3446
  (ot && Ie(new ot(new ArrayBuffer(1))) != O || ze && Ie(new ze()) != b || me && Ie(me.resolve()) != g || at && Ie(new at()) != w || Nt && Ie(new Nt()) != C) && (Ie = function(n) {
3447
- var s = rt.call(n), u = s == d ? n.constructor : void 0, y = u ? ne(u) : void 0;
3447
+ var s = rt.call(n), u = s == d ? n.constructor : void 0, y = u ? ie(u) : void 0;
3448
3448
  if (y)
3449
3449
  switch (y) {
3450
3450
  case It:
@@ -3514,7 +3514,7 @@ qr.exports;
3514
3514
  var s = n && n.constructor, u = typeof s == "function" && s.prototype || tt;
3515
3515
  return n === u;
3516
3516
  }
3517
- function ne(n) {
3517
+ function ie(n) {
3518
3518
  if (n != null) {
3519
3519
  try {
3520
3520
  return cr.call(n);
@@ -3637,7 +3637,7 @@ Hr.exports;
3637
3637
  return n ? "Symbol(src)_1." + n : "";
3638
3638
  }(), fr = We.toString, on = RegExp(
3639
3639
  "^" + Rt.call(ce).replace(Zr, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
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;
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 = ie(It), xe = ie(Je), an = ie(Ft), sn = ie(Lt), ln = ie(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;
3643
3643
  for (this.clear(); ++s < u; ) {
@@ -3820,7 +3820,7 @@ Hr.exports;
3820
3820
  if (!_r(n) || jn(n))
3821
3821
  return !1;
3822
3822
  var s = wr(n) ? on : he;
3823
- return s.test(ne(n));
3823
+ return s.test(ie(n));
3824
3824
  }
3825
3825
  function Nn(n) {
3826
3826
  return Oe(n) && $t(n.length) && !!k[Ke(n)];
@@ -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 == P ? n.constructor : void 0, y = u ? ne(u) : "";
3962
+ var s = Ke(n), u = s == P ? n.constructor : void 0, y = u ? ie(u) : "";
3963
3963
  if (y)
3964
3964
  switch (y) {
3965
3965
  case pr:
@@ -3992,7 +3992,7 @@ Hr.exports;
3992
3992
  function vr(n) {
3993
3993
  return fr.call(n);
3994
3994
  }
3995
- function ne(n) {
3995
+ function ie(n) {
3996
3996
  if (n != null) {
3997
3997
  try {
3998
3998
  return Rt.call(n);
@@ -4199,6 +4199,12 @@ const tu = (e, t) => {
4199
4199
  type: Boolean,
4200
4200
  required: !1,
4201
4201
  default: !1
4202
+ },
4203
+ hyperlinkStyle: {
4204
+ // either Link or a tag
4205
+ type: String,
4206
+ required: !1,
4207
+ default: "Link"
4202
4208
  }
4203
4209
  },
4204
4210
  emits: ["row-click"],
@@ -4392,7 +4398,7 @@ const tu = (e, t) => {
4392
4398
  mounted() {
4393
4399
  this.initColumnSettings(), this.loadDataOnInit && this.loadData();
4394
4400
  }
4395
- }, Ce = (e) => (pa("data-v-bbf666f6"), e = e(), ha(), e), nu = {
4401
+ }, Ce = (e) => (pa("data-v-e17bf3d3"), e = e(), ha(), e), nu = {
4396
4402
  key: 0,
4397
4403
  class: "card-icon"
4398
4404
  }, iu = {
@@ -4433,7 +4439,7 @@ const tu = (e, t) => {
4433
4439
  }, "Meklēt", -1)), Nu = { class: "table-responsive" }, Iu = { class: "dataTables_wrapper no-footer" }, Fu = { key: 0 }, Lu = ["onClick"], Bu = {
4434
4440
  key: 1,
4435
4441
  class: "w-25"
4436
- }, Mu = ["onClick"], Du = { key: 0 }, ju = ["value"], Uu = { key: 0 }, ku = ["innerHTML"], $u = { key: 1 }, qu = ["onClick"], Hu = {
4442
+ }, Mu = ["onClick"], Du = { key: 0 }, ju = ["value"], Uu = { key: 0 }, ku = ["href", "innerHTML"], $u = { key: 1 }, qu = ["onClick"], Hu = {
4437
4443
  key: 0,
4438
4444
  class: "material-icons"
4439
4445
  }, Vu = { class: "dataTables_info" }, Wu = { key: 0 }, zu = {
@@ -4450,10 +4456,10 @@ function Ju(e, t, r, i, o, a) {
4450
4456
  }, [
4451
4457
  r.cardIcon ? (B(), M("div", nu, [
4452
4458
  o.cardError ? (B(), M("i", ou, "dangerous")) : (B(), M("i", iu, ve(r.cardIcon), 1))
4453
- ])) : ie("", !0),
4454
- r.cardTitle && !o.cardError ? (B(), M("h4", au, ve(r.cardTitle), 1)) : ie("", !0),
4455
- o.cardError ? (B(), M("h4", su, ve(o.cardError), 1)) : ie("", !0),
4456
- r.advancedSearch ? ie("", !0) : (B(), M("div", {
4459
+ ])) : te("", !0),
4460
+ r.cardTitle && !o.cardError ? (B(), M("h4", au, ve(r.cardTitle), 1)) : te("", !0),
4461
+ o.cardError ? (B(), M("h4", su, ve(o.cardError), 1)) : te("", !0),
4462
+ r.advancedSearch ? te("", !0) : (B(), M("div", {
4457
4463
  key: 3,
4458
4464
  class: ue(["card-search", { open: o.searchBarOpen }])
4459
4465
  }, [
@@ -4486,7 +4492,7 @@ function Ju(e, t, r, i, o, a) {
4486
4492
  ]),
4487
4493
  _: 1
4488
4494
  }, 8, ["href"])
4489
- ])) : ie("", !0),
4495
+ ])) : te("", !0),
4490
4496
  R("li", null, [
4491
4497
  R("a", {
4492
4498
  href: "javascript:void(0)",
@@ -4533,11 +4539,11 @@ function Ju(e, t, r, i, o, a) {
4533
4539
  placeholder: c.displayName,
4534
4540
  autocomplete: "off"
4535
4541
  }, null, 8, Ru)
4536
- ])) : ie("", !0)
4542
+ ])) : te("", !0)
4537
4543
  ], 64))), 256)),
4538
4544
  xu
4539
4545
  ], 32)
4540
- ], 2)) : ie("", !0),
4546
+ ], 2)) : te("", !0),
4541
4547
  R("div", Nu, [
4542
4548
  R("div", Iu, [
4543
4549
  R("table", {
@@ -4551,16 +4557,16 @@ function Ju(e, t, r, i, o, a) {
4551
4557
  onClick: t[8] || (t[8] = (...c) => a.selectAllRows && a.selectAllRows(...c)),
4552
4558
  ref: "selectAllRows"
4553
4559
  }, null, 512)
4554
- ])) : ie("", !0),
4560
+ ])) : te("", !0),
4555
4561
  (B(!0), M(Le, null, dt(r.columns, (c, p) => (B(), M(Le, { key: p }, [
4556
4562
  c.visible !== !1 ? (B(), M("th", {
4557
4563
  key: 0,
4558
4564
  class: ue([a.columnSortingClasses[p], c.sortable !== !1 ? "sorting" : ""]),
4559
4565
  onClick: (f) => a.setSorting(p),
4560
4566
  style: ca(c.width ? { width: c.width } : {})
4561
- }, ve(c.displayName), 15, Lu)) : ie("", !0)
4567
+ }, ve(c.displayName), 15, Lu)) : te("", !0)
4562
4568
  ], 64))), 128)),
4563
- r.actions ? (B(), M("th", Bu, "Darbības")) : ie("", !0)
4569
+ r.actions ? (B(), M("th", Bu, "Darbības")) : te("", !0)
4564
4570
  ])
4565
4571
  ]),
4566
4572
  R("tbody", null, [
@@ -4576,18 +4582,19 @@ function Ju(e, t, r, i, o, a) {
4576
4582
  }, null, 8, ju), [
4577
4583
  [fa, o.selectedRows]
4578
4584
  ])
4579
- ])) : ie("", !0),
4585
+ ])) : te("", !0),
4580
4586
  (B(!0), M(Le, null, dt(r.columns, (f, h) => (B(), M(Le, { key: h }, [
4581
4587
  f.visible !== !1 ? (B(), M("td", Uu, [
4582
- f.linkParams ? (B(), da(l, {
4588
+ f.linkParams && r.hyperlinkStyle === "Link" ? (B(), da(l, {
4583
4589
  key: 0,
4584
4590
  href: a.generateLink(f.linkParams, c),
4585
4591
  innerHTML: c[f.data]
4586
- }, null, 8, ["href", "innerHTML"])) : (B(), M("span", {
4592
+ }, null, 8, ["href", "innerHTML"])) : f.linkParams ? (B(), M("a", {
4587
4593
  key: 1,
4594
+ href: a.generateLink(f.linkParams, c),
4588
4595
  innerHTML: c[f.data]
4589
- }, null, 8, ku))
4590
- ])) : ie("", !0)
4596
+ }, null, 8, ku)) : te("", !0)
4597
+ ])) : te("", !0)
4591
4598
  ], 64))), 128)),
4592
4599
  r.actions ? (B(), M("td", $u, [
4593
4600
  (B(!0), M(Le, null, dt(r.actions, (f, h) => (B(), M("button", {
@@ -4595,16 +4602,16 @@ function Ju(e, t, r, i, o, a) {
4595
4602
  class: ue(["btn btn-sm", f.class]),
4596
4603
  onClick: (v) => a.handleEmit(f.emit, c)
4597
4604
  }, [
4598
- f.icon ? (B(), M("i", Hu, ve(f.icon), 1)) : ie("", !0),
4605
+ f.icon ? (B(), M("i", Hu, ve(f.icon), 1)) : te("", !0),
4599
4606
  Mi(" " + ve(f.label), 1)
4600
4607
  ], 10, qu))), 128))
4601
- ])) : ie("", !0)
4608
+ ])) : te("", !0)
4602
4609
  ], 8, Mu))), 128))
4603
4610
  ])
4604
4611
  ], 2),
4605
4612
  R("div", Vu, [
4606
4613
  Mi(" Rāda " + ve(a.firstRecord) + ". līdz " + ve(a.lastRecord) + ". no " + ve(o.recordsFiltered) + " ierakstiem ", 1),
4607
- o.recordsFiltered != o.recordsTotal ? (B(), M("span", Wu, " (kopā " + ve(o.recordsTotal) + " ieraksti) ", 1)) : ie("", !0)
4614
+ o.recordsFiltered != o.recordsTotal ? (B(), M("span", Wu, " (kopā " + ve(o.recordsTotal) + " ieraksti) ", 1)) : te("", !0)
4608
4615
  ]),
4609
4616
  R("div", zu, [
4610
4617
  R("a", {
@@ -4635,7 +4642,7 @@ function Ju(e, t, r, i, o, a) {
4635
4642
  ])
4636
4643
  ], 2);
4637
4644
  }
4638
- const Qu = /* @__PURE__ */ tu(ru, [["render", Ju], ["__scopeId", "data-v-bbf666f6"]]);
4645
+ const Qu = /* @__PURE__ */ tu(ru, [["render", Ju], ["__scopeId", "data-v-e17bf3d3"]]);
4639
4646
  export {
4640
4647
  Qu as default
4641
4648
  };
@@ -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 bu="",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}},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-bbf666f6"),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=["innerHTML"],au={key:1},su=["onClick"],lu={key:0,class:"material-icons"},cu={class:"dataTables_info"},uu={key:0},fu={class:"dataTables_paginate paging_simple_numbers user-select-none",id:"document-index-table_paginate"},du=["onClick"];function pu(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?(d.openBlock(),d.createBlock(l,{key:0,href:a.generateLink(f.linkParams,c),innerHTML:c[f.data]},null,8,["href","innerHTML"])):(d.openBlock(),d.createElementBlock("span",{key:1,innerHTML:c[f.data]},null,8,ou))])):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.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",uu," (kopā "+d.toDisplayString(o.recordsTotal)+" ieraksti) ",1)):d.createCommentVNode("",!0)]),d.createElementVNode("div",fu,[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,du))),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",pu],["__scopeId","data-v-bbf666f6"]])});
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 bu="",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-e17bf3d3"),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={key:1},su=["onClick"],lu={key:0,class:"material-icons"},cu={class:"dataTables_info"},uu={key:0},fu={class:"dataTables_paginate paging_simple_numbers user-select-none",id:"document-index-table_paginate"},du=["onClick"];function pu(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?(d.openBlock(),d.createElementBlock("a",{key:1,href:a.generateLink(f.linkParams,c),innerHTML:c[f.data]},null,8,ou)):d.createCommentVNode("",!0)])):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.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",uu," (kopā "+d.toDisplayString(o.recordsTotal)+" ieraksti) ",1)):d.createCommentVNode("",!0)]),d.createElementVNode("div",fu,[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,du))),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",pu],["__scopeId","data-v-e17bf3d3"]])});
package/dist/style.css CHANGED
@@ -1 +1 @@
1
- .toolbar[data-v-bbf666f6]:not(.open){display:none}.card .card-heading[data-v-bbf666f6]{padding:15px 20px;position:relative;height:65px}.card .card-search[data-v-bbf666f6]{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-bbf666f6]{margin:0;padding:0;height:65px}.card .card-search .search-icon-left[data-v-bbf666f6]{left:15px;right:auto}.card .card-search .close-search[data-v-bbf666f6],.card .card-search .search-icon-left[data-v-bbf666f6]{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-bbf666f6]{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-bbf666f6]{right:15px;left:auto}.card .card-search .search-icon-left[data-v-bbf666f6]{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-bbf666f6]{display:block}.card-heading ul.card-actions.icons[data-v-bbf666f6]{position:absolute;list-style:none;padding:0;margin:0}ul.card-actions.icons li[data-v-bbf666f6]{display:inline}.dataTables_wrapper .dataTables_paginate .paginate_button.current[data-v-bbf666f6],.dataTables_wrapper .dataTables_paginate .paginate_button.current[data-v-bbf666f6]: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-bbf666f6],.dataTables_wrapper .dataTables_paginate .paginate_button[data-v-bbf666f6]: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-bbf666f6]:hover{border:1}.card-header[data-v-bbf666f6]:first-child{border-radius:calc(.25rem - 1px) calc(.25rem - 1px) 0 0}.card .card-header[data-v-bbf666f6]{border-bottom:none;background:transparent}.card [class*=card-header-][data-v-bbf666f6],.card[class*=bg-][data-v-bbf666f6]{color:#fff}.card .card-header[data-v-bbf666f6]{z-index:3!important}.card [class*=card-header-][data-v-bbf666f6]{margin:0 15px;padding:0;position:relative}.card .card-header-primary .card-icon[data-v-bbf666f6],.card .card-header-primary .card-text[data-v-bbf666f6],.card .card-header-primary[data-v-bbf666f6]:not(.card-header-icon):not(.card-header-text),.card.bg-primary[data-v-bbf666f6],.card.card-rotate.bg-primary .front[data-v-bbf666f6],.card.card-rotate.bg-primary .back[data-v-bbf666f6]{background:linear-gradient(60deg,#ab47bc,#8e24aa)}.card .card-header-primary .card-icon[data-v-bbf666f6],.card .card-header-primary[data-v-bbf666f6]:not(.card-header-icon):not(.card-header-text),.card .card-header-primary .card-text[data-v-bbf666f6]{box-shadow:0 4px 20px #00000024,0 7px 10px -5px #9c27b066}.card [class*=card-header-] .card-icon[data-v-bbf666f6],.card [class*=card-header-] .card-text[data-v-bbf666f6]{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-bbf666f6],.card .card-header.card-header-text i[data-v-bbf666f6]{width:33px;height:33px;text-align:center;line-height:33px}.card[data-v-bbf666f6]{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-bbf666f6],.card .card-header.card-header-text .card-title[data-v-bbf666f6]{margin-top:15px;color:#3c4858}.card .card-header.card-header-icon h4[data-v-bbf666f6],.card .card-header.card-header-text h4[data-v-bbf666f6]{font-weight:300}.card .card-header .card-title[data-v-bbf666f6]{margin-bottom:3px}.card .card-actions[data-v-bbf666f6]{position:absolute;z-index:1;top:-50px;width:calc(100% - 30px);left:17px;right:17px;text-align:center}.card .card-actions[data-v-bbf666f6]{text-align:end}.card ul.card-actions.icons[data-v-bbf666f6]{position:absolute;list-style:none;padding:0;margin:0;right:10px;top:15px}ul.card-actions.icons.right-top[data-v-bbf666f6]{right:10px;top:15px}ul.card-actions.icons li[data-v-bbf666f6]{display:inline;width:100%;text-align:unset}.dropdown-menu .dropdown-item[data-v-bbf666f6],.dropdown-menu li>a[data-v-bbf666f6]{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-bbf666f6]:hover,.dropdown-menu .dropdown-item[data-v-bbf666f6]:focus,.dropdown-menu a[data-v-bbf666f6]:hover,.dropdown-menu a[data-v-bbf666f6]:focus,.dropdown-menu a[data-v-bbf666f6]:active{box-shadow:0 4px 20px #00000024,0 7px 10px -5px #9c27b066;background-color:#9c27b0;color:#fff}.dropdown-menu .dropdown-item[data-v-bbf666f6],.dropdown-menu li>a[data-v-bbf666f6]{padding-right:1.5rem;padding-left:1.5rem}.dropdown-menu[data-v-bbf666f6]{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-bbf666f6]{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-bbf666f6]{margin:0!important}.clickable-rows tbody tr[data-v-bbf666f6]{cursor:pointer}
1
+ .toolbar[data-v-e17bf3d3]:not(.open){display:none}.card .card-heading[data-v-e17bf3d3]{padding:15px 20px;position:relative;height:65px}.card .card-search[data-v-e17bf3d3]{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-e17bf3d3]{margin:0;padding:0;height:65px}.card .card-search .search-icon-left[data-v-e17bf3d3]{left:15px;right:auto}.card .card-search .close-search[data-v-e17bf3d3],.card .card-search .search-icon-left[data-v-e17bf3d3]{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-e17bf3d3]{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-e17bf3d3]{right:15px;left:auto}.card .card-search .search-icon-left[data-v-e17bf3d3]{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-e17bf3d3]{display:block}.card-heading ul.card-actions.icons[data-v-e17bf3d3]{position:absolute;list-style:none;padding:0;margin:0}ul.card-actions.icons li[data-v-e17bf3d3]{display:inline}.dataTables_wrapper .dataTables_paginate .paginate_button.current[data-v-e17bf3d3],.dataTables_wrapper .dataTables_paginate .paginate_button.current[data-v-e17bf3d3]: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-e17bf3d3],.dataTables_wrapper .dataTables_paginate .paginate_button[data-v-e17bf3d3]: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-e17bf3d3]:hover{border:1}.card-header[data-v-e17bf3d3]:first-child{border-radius:calc(.25rem - 1px) calc(.25rem - 1px) 0 0}.card .card-header[data-v-e17bf3d3]{border-bottom:none;background:transparent}.card [class*=card-header-][data-v-e17bf3d3],.card[class*=bg-][data-v-e17bf3d3]{color:#fff}.card .card-header[data-v-e17bf3d3]{z-index:3!important}.card [class*=card-header-][data-v-e17bf3d3]{margin:0 15px;padding:0;position:relative}.card .card-header-primary .card-icon[data-v-e17bf3d3],.card .card-header-primary .card-text[data-v-e17bf3d3],.card .card-header-primary[data-v-e17bf3d3]:not(.card-header-icon):not(.card-header-text),.card.bg-primary[data-v-e17bf3d3],.card.card-rotate.bg-primary .front[data-v-e17bf3d3],.card.card-rotate.bg-primary .back[data-v-e17bf3d3]{background:linear-gradient(60deg,#ab47bc,#8e24aa)}.card .card-header-primary .card-icon[data-v-e17bf3d3],.card .card-header-primary[data-v-e17bf3d3]:not(.card-header-icon):not(.card-header-text),.card .card-header-primary .card-text[data-v-e17bf3d3]{box-shadow:0 4px 20px #00000024,0 7px 10px -5px #9c27b066}.card [class*=card-header-] .card-icon[data-v-e17bf3d3],.card [class*=card-header-] .card-text[data-v-e17bf3d3]{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-e17bf3d3],.card .card-header.card-header-text i[data-v-e17bf3d3]{width:33px;height:33px;text-align:center;line-height:33px}.card[data-v-e17bf3d3]{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-e17bf3d3],.card .card-header.card-header-text .card-title[data-v-e17bf3d3]{margin-top:15px;color:#3c4858}.card .card-header.card-header-icon h4[data-v-e17bf3d3],.card .card-header.card-header-text h4[data-v-e17bf3d3]{font-weight:300}.card .card-header .card-title[data-v-e17bf3d3]{margin-bottom:3px}.card .card-actions[data-v-e17bf3d3]{position:absolute;z-index:1;top:-50px;width:calc(100% - 30px);left:17px;right:17px;text-align:center}.card .card-actions[data-v-e17bf3d3]{text-align:end}.card ul.card-actions.icons[data-v-e17bf3d3]{position:absolute;list-style:none;padding:0;margin:0;right:10px;top:15px}ul.card-actions.icons.right-top[data-v-e17bf3d3]{right:10px;top:15px}ul.card-actions.icons li[data-v-e17bf3d3]{display:inline;width:100%;text-align:unset}.dropdown-menu .dropdown-item[data-v-e17bf3d3],.dropdown-menu li>a[data-v-e17bf3d3]{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-e17bf3d3]:hover,.dropdown-menu .dropdown-item[data-v-e17bf3d3]:focus,.dropdown-menu a[data-v-e17bf3d3]:hover,.dropdown-menu a[data-v-e17bf3d3]:focus,.dropdown-menu a[data-v-e17bf3d3]:active{box-shadow:0 4px 20px #00000024,0 7px 10px -5px #9c27b066;background-color:#9c27b0;color:#fff}.dropdown-menu .dropdown-item[data-v-e17bf3d3],.dropdown-menu li>a[data-v-e17bf3d3]{padding-right:1.5rem;padding-left:1.5rem}.dropdown-menu[data-v-e17bf3d3]{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-e17bf3d3]{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-e17bf3d3]{margin:0!important}.clickable-rows tbody tr[data-v-e17bf3d3]{cursor:pointer}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sulzanoks/vue-datatable",
3
- "version": "0.3.0",
3
+ "version": "0.3.1",
4
4
  "private": false,
5
5
  "main": "./src/index.js",
6
6
  "module": "./dist/datatable-card.es.js",
@@ -95,10 +95,11 @@
95
95
  </td>
96
96
  <template v-for="(column, index) in columns" :key="index">
97
97
  <td v-if="column.visible !== false">
98
- <Link v-if="column.linkParams" :href="generateLink(column.linkParams, row)"
98
+ <Link v-if="column.linkParams && hyperlinkStyle === 'Link'" :href="generateLink(column.linkParams, row)"
99
99
  v-html="row[column.data]">
100
100
  </Link>
101
- <span v-else v-html="row[column.data]"></span>
101
+ <a v-else-if="column.linkParams" :href="generateLink(column.linkParams, row)"
102
+ v-html="row[column.data]"></a>
102
103
  </td>
103
104
  </template>
104
105
  <td v-if="actions">
@@ -226,6 +227,12 @@ export default {
226
227
  required: false,
227
228
  default: false,
228
229
  },
230
+ hyperlinkStyle: {
231
+ // either Link or a tag
232
+ type: String,
233
+ required: false,
234
+ default: 'Link',
235
+ },
229
236
  },
230
237
  emits: ['row-click'],
231
238
  data() {