@sulzanoks/vue-datatable 0.2.3 → 0.3.0
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/README.md +69 -0
- package/dist/datatable-card.es.js +184 -154
- package/dist/datatable-card.umd.js +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/src/Components/DatatableCard.vue +55 -8
package/README.md
CHANGED
|
@@ -82,6 +82,75 @@ The DatatableCard component accepts the following props:
|
|
|
82
82
|
- `label` (String, optional): Text to display inside button.
|
|
83
83
|
- `class` (String, optional): CSS class to apply to button.
|
|
84
84
|
|
|
85
|
+
## Link Parameters (`linkParams`)
|
|
86
|
+
|
|
87
|
+
The `generateLink` method now supports **two modes** for building links:
|
|
88
|
+
|
|
89
|
+
### 1. Laravel Route Name (default / original behavior)
|
|
90
|
+
|
|
91
|
+
Use when you want to leverage Laravel named routes via Ziggy’s `route()` helper.
|
|
92
|
+
|
|
93
|
+
```js
|
|
94
|
+
{
|
|
95
|
+
data: 'title',
|
|
96
|
+
linkParams: {
|
|
97
|
+
name: 'users.show', // Laravel route name
|
|
98
|
+
resourceIds: ['id'], // values taken from the row
|
|
99
|
+
query: { tab: 'info' } // optional query params
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
➡️ If `row.id = 5`, this builds:
|
|
105
|
+
```
|
|
106
|
+
/users/5?tab=info
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
### 2. Link Template
|
|
110
|
+
|
|
111
|
+
Use when you want full control over the URL structure without relying on Laravel route names.
|
|
112
|
+
|
|
113
|
+
#### Object Form
|
|
114
|
+
```js
|
|
115
|
+
{
|
|
116
|
+
data: 'title',
|
|
117
|
+
linkParams: {
|
|
118
|
+
template: '/users/{id}/posts/{post_id}',
|
|
119
|
+
params: { post_id: 'latest' }, // override or add interpolation values
|
|
120
|
+
query: { filter: 'active' } // optional query params
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
```
|
|
124
|
+
➡️ If `row.id = 5`, this builds:
|
|
125
|
+
```
|
|
126
|
+
/users/5/posts/latest?filter=active
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
#### String Shorthand
|
|
130
|
+
```js
|
|
131
|
+
{
|
|
132
|
+
data: 'title',
|
|
133
|
+
linkParams: '/users/{id}'
|
|
134
|
+
}
|
|
135
|
+
```
|
|
136
|
+
➡️ If `row.id = 5`, this builds:
|
|
137
|
+
```
|
|
138
|
+
/users/5
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
### Template Placeholders
|
|
142
|
+
|
|
143
|
+
Templates support both styles:
|
|
144
|
+
- `{key}` → `/users/{id}`
|
|
145
|
+
- `:key` → `/users/:id`
|
|
146
|
+
|
|
147
|
+
Both will be replaced with the row’s value (or overridden via `params`).
|
|
148
|
+
|
|
149
|
+
### Notes
|
|
150
|
+
- If both `params` and row values define the same key, `params` takes precedence.
|
|
151
|
+
- Query parameters (`query`) are supported in both modes.
|
|
152
|
+
- If you just need a simple route name, use **mode 1**; if you want custom URLs, use **mode 2**.
|
|
153
|
+
|
|
85
154
|
## Internal Methods
|
|
86
155
|
|
|
87
156
|
These methods are meant to be used by component internally, but maybe you can find use for them
|
|
@@ -21,7 +21,7 @@ const va = Wr("string"), fe = Wr("function"), bo = Wr("number"), zr = (e) => e !
|
|
|
21
21
|
return !1;
|
|
22
22
|
const t = bi(e);
|
|
23
23
|
return (t === null || t === Object.prototype || Object.getPrototypeOf(t) === null) && !(Symbol.toStringTag in e) && !(Symbol.iterator in e);
|
|
24
|
-
}, Sa = Pe("Date"), wa = Pe("File"), _a = Pe("Blob"),
|
|
24
|
+
}, Sa = Pe("Date"), wa = Pe("File"), _a = Pe("Blob"), Aa = Pe("FileList"), Oa = (e) => zr(e) && fe(e.pipe), Ea = (e) => {
|
|
25
25
|
let t;
|
|
26
26
|
return e && (typeof FormData == "function" && e instanceof FormData || fe(e.append) && ((t = Vr(e)) === "formdata" || // detect form-data instance
|
|
27
27
|
t === "object" && fe(e.toString) && e.toString() === "[object FormData]"));
|
|
@@ -110,14 +110,14 @@ const Ca = (e, t, r, { allOwnKeys: i } = {}) => (Yt(t, (o, a) => {
|
|
|
110
110
|
function(r, i, o) {
|
|
111
111
|
return i.toUpperCase() + o;
|
|
112
112
|
}
|
|
113
|
-
), Di = (({ hasOwnProperty: e }) => (t, r) => e.call(t, r))(Object.prototype), Ua = Pe("RegExp"),
|
|
113
|
+
), Di = (({ hasOwnProperty: e }) => (t, r) => e.call(t, r))(Object.prototype), Ua = Pe("RegExp"), Ao = (e, t) => {
|
|
114
114
|
const r = Object.getOwnPropertyDescriptors(e), i = {};
|
|
115
115
|
Yt(r, (o, a) => {
|
|
116
116
|
let l;
|
|
117
117
|
(l = t(o, a, e)) !== !1 && (i[a] = l || o);
|
|
118
118
|
}), Object.defineProperties(e, i);
|
|
119
119
|
}, ka = (e) => {
|
|
120
|
-
|
|
120
|
+
Ao(e, (t, r) => {
|
|
121
121
|
if (fe(e) && ["arguments", "caller", "callee"].indexOf(r) !== -1)
|
|
122
122
|
return !1;
|
|
123
123
|
const i = e[r];
|
|
@@ -139,11 +139,11 @@ const Ca = (e, t, r, { allOwnKeys: i } = {}) => (Yt(t, (o, a) => {
|
|
|
139
139
|
};
|
|
140
140
|
return _t(e) ? i(e) : i(String(e).split(t)), r;
|
|
141
141
|
}, qa = () => {
|
|
142
|
-
}, Ha = (e, t) => (e = +e, Number.isFinite(e) ? e : t), Hn = "abcdefghijklmnopqrstuvwxyz", ji = "0123456789",
|
|
142
|
+
}, Ha = (e, t) => (e = +e, Number.isFinite(e) ? e : t), Hn = "abcdefghijklmnopqrstuvwxyz", ji = "0123456789", Oo = {
|
|
143
143
|
DIGIT: ji,
|
|
144
144
|
ALPHA: Hn,
|
|
145
145
|
ALPHA_DIGIT: Hn + Hn.toUpperCase() + ji
|
|
146
|
-
}, Va = (e = 16, t =
|
|
146
|
+
}, Va = (e = 16, t = Oo.ALPHA_DIGIT) => {
|
|
147
147
|
let r = "";
|
|
148
148
|
const { length: i } = t;
|
|
149
149
|
for (; e--; )
|
|
@@ -187,10 +187,10 @@ const za = (e) => {
|
|
|
187
187
|
isBlob: _a,
|
|
188
188
|
isRegExp: Ua,
|
|
189
189
|
isFunction: fe,
|
|
190
|
-
isStream:
|
|
190
|
+
isStream: Oa,
|
|
191
191
|
isURLSearchParams: Ta,
|
|
192
192
|
isTypedArray: La,
|
|
193
|
-
isFileList:
|
|
193
|
+
isFileList: Aa,
|
|
194
194
|
forEach: Yt,
|
|
195
195
|
merge: ii,
|
|
196
196
|
extend: Ca,
|
|
@@ -208,7 +208,7 @@ const za = (e) => {
|
|
|
208
208
|
hasOwnProperty: Di,
|
|
209
209
|
hasOwnProp: Di,
|
|
210
210
|
// an alias to avoid ESLint no-prototype-builtins detection
|
|
211
|
-
reduceDescriptors:
|
|
211
|
+
reduceDescriptors: Ao,
|
|
212
212
|
freezeMethods: ka,
|
|
213
213
|
toObjectSet: $a,
|
|
214
214
|
toCamelCase: ja,
|
|
@@ -217,7 +217,7 @@ const za = (e) => {
|
|
|
217
217
|
findKey: So,
|
|
218
218
|
global: wo,
|
|
219
219
|
isContextDefined: _o,
|
|
220
|
-
ALPHABET:
|
|
220
|
+
ALPHABET: Oo,
|
|
221
221
|
generateString: Va,
|
|
222
222
|
isSpecCompliantForm: Wa,
|
|
223
223
|
toJSONObject: za,
|
|
@@ -901,7 +901,7 @@ function Hi(e, t) {
|
|
|
901
901
|
h[t ? "download" : "upload"] = !0, e(h);
|
|
902
902
|
};
|
|
903
903
|
}
|
|
904
|
-
const _s = typeof XMLHttpRequest < "u",
|
|
904
|
+
const _s = typeof XMLHttpRequest < "u", As = _s && function(e) {
|
|
905
905
|
return new Promise(function(r, i) {
|
|
906
906
|
let o = e.data;
|
|
907
907
|
const a = De.from(e.headers).normalize(), l = e.responseType;
|
|
@@ -969,7 +969,7 @@ const _s = typeof XMLHttpRequest < "u", Os = _s && function(e) {
|
|
|
969
969
|
});
|
|
970
970
|
}, Lr = {
|
|
971
971
|
http: Ka,
|
|
972
|
-
xhr:
|
|
972
|
+
xhr: As
|
|
973
973
|
};
|
|
974
974
|
m.forEach(Lr, (e, t) => {
|
|
975
975
|
if (e) {
|
|
@@ -1088,14 +1088,14 @@ function gt(e, t) {
|
|
|
1088
1088
|
m.isUndefined(b) && v !== c || (r[h] = b);
|
|
1089
1089
|
}), r;
|
|
1090
1090
|
}
|
|
1091
|
-
const Bo = "1.5.0",
|
|
1091
|
+
const Bo = "1.5.0", Ai = {};
|
|
1092
1092
|
["object", "boolean", "number", "function", "string", "symbol"].forEach((e, t) => {
|
|
1093
|
-
|
|
1093
|
+
Ai[e] = function(i) {
|
|
1094
1094
|
return typeof i === e || "a" + (t < 1 ? "n " : " ") + e;
|
|
1095
1095
|
};
|
|
1096
1096
|
});
|
|
1097
1097
|
const zi = {};
|
|
1098
|
-
|
|
1098
|
+
Ai.transitional = function(t, r, i) {
|
|
1099
1099
|
function o(a, l) {
|
|
1100
1100
|
return "[Axios v" + Bo + "] Transitional option '" + a + "'" + l + (i ? ". " + i : "");
|
|
1101
1101
|
}
|
|
@@ -1113,7 +1113,7 @@ Oi.transitional = function(t, r, i) {
|
|
|
1113
1113
|
)), t ? t(a, l, c) : !0;
|
|
1114
1114
|
};
|
|
1115
1115
|
};
|
|
1116
|
-
function
|
|
1116
|
+
function Os(e, t, r) {
|
|
1117
1117
|
if (typeof e != "object")
|
|
1118
1118
|
throw new L("options must be an object", L.ERR_BAD_OPTION_VALUE);
|
|
1119
1119
|
const i = Object.keys(e);
|
|
@@ -1131,8 +1131,8 @@ function As(e, t, r) {
|
|
|
1131
1131
|
}
|
|
1132
1132
|
}
|
|
1133
1133
|
const ai = {
|
|
1134
|
-
assertOptions:
|
|
1135
|
-
validators:
|
|
1134
|
+
assertOptions: Os,
|
|
1135
|
+
validators: Ai
|
|
1136
1136
|
}, $e = ai.validators;
|
|
1137
1137
|
class Dr {
|
|
1138
1138
|
constructor(t) {
|
|
@@ -1239,7 +1239,7 @@ m.forEach(["post", "put", "patch"], function(t) {
|
|
|
1239
1239
|
Dr.prototype[t] = r(), Dr.prototype[t + "Form"] = r(!0);
|
|
1240
1240
|
});
|
|
1241
1241
|
const Br = Dr;
|
|
1242
|
-
class
|
|
1242
|
+
class Oi {
|
|
1243
1243
|
constructor(t) {
|
|
1244
1244
|
if (typeof t != "function")
|
|
1245
1245
|
throw new TypeError("executor must be a function.");
|
|
@@ -1300,14 +1300,14 @@ class Ai {
|
|
|
1300
1300
|
static source() {
|
|
1301
1301
|
let t;
|
|
1302
1302
|
return {
|
|
1303
|
-
token: new
|
|
1303
|
+
token: new Oi(function(o) {
|
|
1304
1304
|
t = o;
|
|
1305
1305
|
}),
|
|
1306
1306
|
cancel: t
|
|
1307
1307
|
};
|
|
1308
1308
|
}
|
|
1309
1309
|
}
|
|
1310
|
-
const Es =
|
|
1310
|
+
const Es = Oi;
|
|
1311
1311
|
function Ts(e) {
|
|
1312
1312
|
return function(r) {
|
|
1313
1313
|
return e.apply(null, r);
|
|
@@ -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,
|
|
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) {
|
|
1822
1822
|
return e.__proto__;
|
|
1823
1823
|
} : null);
|
|
1824
1824
|
function oo(e, t) {
|
|
@@ -1919,10 +1919,10 @@ var fi = wl, ao = fi.custom, so = Wo(ao) ? ao : null, Nl = function e(t, r, i, o
|
|
|
1919
1919
|
}), co("Map", kr.call(t), $, v);
|
|
1920
1920
|
}
|
|
1921
1921
|
if (Vl(t)) {
|
|
1922
|
-
var
|
|
1922
|
+
var O = [];
|
|
1923
1923
|
return Zi && Zi.call(t, function(oe) {
|
|
1924
|
-
|
|
1925
|
-
}), co("Set", $r.call(t),
|
|
1924
|
+
O.push(b(oe, t));
|
|
1925
|
+
}), co("Set", $r.call(t), O, v);
|
|
1926
1926
|
}
|
|
1927
1927
|
if (ql(t))
|
|
1928
1928
|
return Zn("WeakMap");
|
|
@@ -2165,7 +2165,7 @@ function Tr(e, t) {
|
|
|
2165
2165
|
Ho.call(e, a[f]) && i.push("[" + t(a[f]) + "]: " + t(e[a[f]], e));
|
|
2166
2166
|
return i;
|
|
2167
2167
|
}
|
|
2168
|
-
var xi = Ti,
|
|
2168
|
+
var xi = Ti, At = vl, Ql = Nl, Xl = xi("%TypeError%"), Pr = xi("%WeakMap%", !0), Cr = xi("%Map%", !0), Yl = At("WeakMap.prototype.get", !0), Zl = At("WeakMap.prototype.set", !0), ec = At("WeakMap.prototype.has", !0), tc = At("Map.prototype.get", !0), rc = At("Map.prototype.set", !0), nc = At("Map.prototype.has", !0), Ni = function(e, t) {
|
|
2169
2169
|
for (var r = e, i; (i = r.next) !== null; r = i)
|
|
2170
2170
|
if (i.key === t)
|
|
2171
2171
|
return r.next = i.next, i.next = e.next, e.next = i, i;
|
|
@@ -2357,7 +2357,7 @@ var xi = Ti, Ot = 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
|
-
},
|
|
2360
|
+
}, Ac = Date.prototype.toISOString, fo = Kt.default, te = {
|
|
2361
2361
|
addQueryPrefix: !1,
|
|
2362
2362
|
allowDots: !1,
|
|
2363
2363
|
charset: "utf-8",
|
|
@@ -2371,11 +2371,11 @@ var xi = Ti, Ot = vl, Ql = Nl, Xl = xi("%TypeError%"), Pr = xi("%WeakMap%", !0),
|
|
|
2371
2371
|
// deprecated
|
|
2372
2372
|
indices: !1,
|
|
2373
2373
|
serializeDate: function(t) {
|
|
2374
|
-
return
|
|
2374
|
+
return Ac.call(t);
|
|
2375
2375
|
},
|
|
2376
2376
|
skipNulls: !1,
|
|
2377
2377
|
strictNullHandling: !1
|
|
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, b, S, d, g, _) {
|
|
2381
2381
|
for (var w = t, P = _, N = 0, C = !1; (P = P.get(ri)) !== void 0 && !C; ) {
|
|
@@ -2394,10 +2394,10 @@ var xi = Ti, Ot = vl, Ql = Nl, Xl = xi("%TypeError%"), Pr = xi("%WeakMap%", !0),
|
|
|
2394
2394
|
return c && !d ? c(r, te.encoder, g, "key", b) : r;
|
|
2395
2395
|
w = "";
|
|
2396
2396
|
}
|
|
2397
|
-
if (
|
|
2397
|
+
if (Oc(w) || Mr.isBuffer(w)) {
|
|
2398
2398
|
if (c) {
|
|
2399
|
-
var
|
|
2400
|
-
return [S(
|
|
2399
|
+
var O = d ? r : c(r, te.encoder, g, "key", b);
|
|
2400
|
+
return [S(O) + "=" + S(c(w, te.encoder, g, "value", b))];
|
|
2401
2401
|
}
|
|
2402
2402
|
return [S(r) + "=" + S(String(w))];
|
|
2403
2403
|
}
|
|
@@ -2727,32 +2727,32 @@ var xi = Ti, Ot = vl, Ql = Nl, Xl = xi("%TypeError%"), Pr = xi("%WeakMap%", !0),
|
|
|
2727
2727
|
}(), p = function() {
|
|
2728
2728
|
var d = ["Webkit", "O", "Moz", "ms"], g = {};
|
|
2729
2729
|
function _(C) {
|
|
2730
|
-
return C.replace(/^-ms-/, "ms-").replace(/-([\da-z])/gi, function($,
|
|
2731
|
-
return
|
|
2730
|
+
return C.replace(/^-ms-/, "ms-").replace(/-([\da-z])/gi, function($, O) {
|
|
2731
|
+
return O.toUpperCase();
|
|
2732
2732
|
});
|
|
2733
2733
|
}
|
|
2734
2734
|
function w(C) {
|
|
2735
2735
|
var $ = document.body.style;
|
|
2736
2736
|
if (C in $)
|
|
2737
2737
|
return C;
|
|
2738
|
-
for (var
|
|
2739
|
-
if (j = d[
|
|
2738
|
+
for (var O = d.length, T = C.charAt(0).toUpperCase() + C.slice(1), j; O--; )
|
|
2739
|
+
if (j = d[O] + T, j in $)
|
|
2740
2740
|
return j;
|
|
2741
2741
|
return C;
|
|
2742
2742
|
}
|
|
2743
2743
|
function P(C) {
|
|
2744
2744
|
return C = _(C), g[C] || (g[C] = w(C));
|
|
2745
2745
|
}
|
|
2746
|
-
function N(C, $,
|
|
2747
|
-
$ = P($), C.style[$] =
|
|
2746
|
+
function N(C, $, O) {
|
|
2747
|
+
$ = P($), C.style[$] = O;
|
|
2748
2748
|
}
|
|
2749
2749
|
return function(C, $) {
|
|
2750
|
-
var
|
|
2751
|
-
if (
|
|
2750
|
+
var O = arguments, T, j;
|
|
2751
|
+
if (O.length == 2)
|
|
2752
2752
|
for (T in $)
|
|
2753
2753
|
j = $[T], j !== void 0 && $.hasOwnProperty(T) && N(C, T, j);
|
|
2754
2754
|
else
|
|
2755
|
-
N(C,
|
|
2755
|
+
N(C, O[1], O[2]);
|
|
2756
2756
|
};
|
|
2757
2757
|
}();
|
|
2758
2758
|
function f(d, g) {
|
|
@@ -2948,8 +2948,8 @@ var yo = typeof window > "u", Kc = class {
|
|
|
2948
2948
|
}, queryStringArrayFormat: P = "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 [
|
|
2952
|
-
N = ht(
|
|
2951
|
+
let [O, T] = na(t, N, r, P);
|
|
2952
|
+
N = ht(O), r = T;
|
|
2953
2953
|
}
|
|
2954
2954
|
let C = { url: N, method: t, data: r, replace: i, preserveScroll: o, preserveState: a, only: l, headers: c, errorBag: p, forceFormData: f, queryStringArrayFormat: P, cancelled: !1, completed: !1, interrupted: !1 };
|
|
2955
2955
|
if (v(C) === !1 || !$c(C))
|
|
@@ -2958,40 +2958,40 @@ var yo = typeof window > "u", Kc = class {
|
|
|
2958
2958
|
let $ = this.createVisitId();
|
|
2959
2959
|
this.activeVisit = { ...C, onCancelToken: h, onBefore: v, onStart: b, onProgress: S, onFinish: d, onCancel: g, onSuccess: _, onError: w, queryStringArrayFormat: P, cancelToken: new AbortController() }, h({ cancel: () => {
|
|
2960
2960
|
this.activeVisit && this.cancelVisit(this.activeVisit, { cancelled: !0 });
|
|
2961
|
-
} }), zc(C), b(C), 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: (
|
|
2962
|
-
r instanceof FormData && (
|
|
2963
|
-
} }).then((
|
|
2961
|
+
} }), zc(C), b(C), 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
|
+
r instanceof FormData && (O.percentage = O.progress ? Math.round(O.progress * 100) : 0, Wc(O), S(O));
|
|
2963
|
+
} }).then((O) => {
|
|
2964
2964
|
var X;
|
|
2965
|
-
if (!this.isInertiaResponse(
|
|
2966
|
-
return Promise.reject({ response:
|
|
2967
|
-
let T =
|
|
2965
|
+
if (!this.isInertiaResponse(O))
|
|
2966
|
+
return Promise.reject({ response: O });
|
|
2967
|
+
let T = O.data;
|
|
2968
2968
|
l.length && T.component === this.page.component && (T.props = { ...this.page.props, ...T.props }), o = this.resolvePreserveOption(o, T), a = this.resolvePreserveOption(a, T), a && ((X = window.history.state) != null && X.rememberedState) && T.component === this.page.component && (T.rememberedState = window.history.state.rememberedState);
|
|
2969
2969
|
let j = N, Q = ht(T.url);
|
|
2970
2970
|
return j.hash && !Q.hash && zt(j).href === Q.href && (Q.hash = j.hash, T.url = Q.href), this.setPage(T, { visitId: $, replace: i, preserveScroll: o, preserveState: a });
|
|
2971
2971
|
}).then(() => {
|
|
2972
|
-
let
|
|
2973
|
-
if (Object.keys(
|
|
2974
|
-
let T = p ?
|
|
2972
|
+
let O = this.page.props.errors || {};
|
|
2973
|
+
if (Object.keys(O).length > 0) {
|
|
2974
|
+
let T = p ? O[p] ? O[p] : {} : O;
|
|
2975
2975
|
return qc(T), w(T);
|
|
2976
2976
|
}
|
|
2977
2977
|
return Gc(this.page), _(this.page);
|
|
2978
|
-
}).catch((
|
|
2979
|
-
if (this.isInertiaResponse(
|
|
2980
|
-
return this.setPage(
|
|
2981
|
-
if (this.isLocationVisitResponse(
|
|
2982
|
-
let T = ht(
|
|
2978
|
+
}).catch((O) => {
|
|
2979
|
+
if (this.isInertiaResponse(O.response))
|
|
2980
|
+
return this.setPage(O.response.data, { visitId: $ });
|
|
2981
|
+
if (this.isLocationVisitResponse(O.response)) {
|
|
2982
|
+
let T = ht(O.response.headers["x-inertia-location"]), j = N;
|
|
2983
2983
|
j.hash && !T.hash && zt(j).href === T.href && (T.hash = j.hash), this.locationVisit(T, o === !0);
|
|
2984
|
-
} else if (
|
|
2985
|
-
Vc(
|
|
2984
|
+
} else if (O.response)
|
|
2985
|
+
Vc(O.response) && Jc.show(O.response.data);
|
|
2986
2986
|
else
|
|
2987
|
-
return Promise.reject(
|
|
2987
|
+
return Promise.reject(O);
|
|
2988
2988
|
}).then(() => {
|
|
2989
2989
|
this.activeVisit && this.finishVisit(this.activeVisit);
|
|
2990
|
-
}).catch((
|
|
2991
|
-
if (!li.isCancel(
|
|
2992
|
-
let T = Hc(
|
|
2990
|
+
}).catch((O) => {
|
|
2991
|
+
if (!li.isCancel(O)) {
|
|
2992
|
+
let T = Hc(O);
|
|
2993
2993
|
if (this.activeVisit && this.finishVisit(this.activeVisit), T)
|
|
2994
|
-
return Promise.reject(
|
|
2994
|
+
return Promise.reject(O);
|
|
2995
2995
|
}
|
|
2996
2996
|
});
|
|
2997
2997
|
}
|
|
@@ -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]", b = "[object Map]", S = "[object Number]", d = "[object Object]", g = "[object Promise]", _ = "[object RegExp]", w = "[object Set]", P = "[object String]", N = "[object Symbol]", C = "[object WeakMap]", $ = "[object ArrayBuffer]",
|
|
3130
|
-
U[a] = U[l] = U[$] = 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]", b = "[object Map]", S = "[object Number]", d = "[object Object]", g = "[object Promise]", _ = "[object RegExp]", w = "[object Set]", P = "[object String]", N = "[object Symbol]", C = "[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]", Se = /[\\^$.*+?()[\]{}|]/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[b] = U[S] = U[d] = U[_] = U[w] = U[P] = U[N] = U[V] = U[oe] = U[pe] = U[Re] = !0, U[f] = U[h] = U[C] = !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;
|
|
@@ -3145,9 +3145,9 @@ qr.exports;
|
|
|
3145
3145
|
n[E + u] = s[u];
|
|
3146
3146
|
return n;
|
|
3147
3147
|
}
|
|
3148
|
-
function
|
|
3149
|
-
var E = -1,
|
|
3150
|
-
for (y &&
|
|
3148
|
+
function Ot(n, s, u, y) {
|
|
3149
|
+
var E = -1, A = n ? n.length : 0;
|
|
3150
|
+
for (y && A && (u = n[++E]); ++E < A; )
|
|
3151
3151
|
u = s(u, n[E], E, n);
|
|
3152
3152
|
return u;
|
|
3153
3153
|
}
|
|
@@ -3292,7 +3292,7 @@ qr.exports;
|
|
|
3292
3292
|
function _n(n) {
|
|
3293
3293
|
return this.__data__.has(n);
|
|
3294
3294
|
}
|
|
3295
|
-
function
|
|
3295
|
+
function An(n, s) {
|
|
3296
3296
|
var u = this.__data__;
|
|
3297
3297
|
if (u instanceof J) {
|
|
3298
3298
|
var y = u.__data__;
|
|
@@ -3302,11 +3302,11 @@ qr.exports;
|
|
|
3302
3302
|
}
|
|
3303
3303
|
return u.set(n, s), this;
|
|
3304
3304
|
}
|
|
3305
|
-
ae.prototype.clear = bn, ae.prototype.delete = Sn, ae.prototype.get = wn, ae.prototype.has = _n, ae.prototype.set =
|
|
3305
|
+
ae.prototype.clear = bn, ae.prototype.delete = Sn, ae.prototype.get = wn, ae.prototype.has = _n, ae.prototype.set = An;
|
|
3306
3306
|
function st(n, s) {
|
|
3307
3307
|
var u = kt(n) || ut(n) ? Et(n.length, String) : [], y = u.length, E = !!y;
|
|
3308
|
-
for (var
|
|
3309
|
-
(s || we.call(n,
|
|
3308
|
+
for (var A in n)
|
|
3309
|
+
(s || we.call(n, A)) && !(E && (A == "length" || Dn(A, y))) && u.push(A);
|
|
3310
3310
|
return u;
|
|
3311
3311
|
}
|
|
3312
3312
|
function yr(n, s, u) {
|
|
@@ -3322,11 +3322,11 @@ qr.exports;
|
|
|
3322
3322
|
function _e(n, s) {
|
|
3323
3323
|
return n && Ut(s, qt(s), n);
|
|
3324
3324
|
}
|
|
3325
|
-
function Dt(n, s, u, y, E,
|
|
3325
|
+
function Dt(n, s, u, y, E, A, I) {
|
|
3326
3326
|
var F;
|
|
3327
|
-
if (y && (F =
|
|
3327
|
+
if (y && (F = A ? y(n, E, A, I) : y(n)), F !== void 0)
|
|
3328
3328
|
return F;
|
|
3329
|
-
if (!
|
|
3329
|
+
if (!Oe(n))
|
|
3330
3330
|
return n;
|
|
3331
3331
|
var q = kt(n);
|
|
3332
3332
|
if (q) {
|
|
@@ -3336,14 +3336,14 @@ qr.exports;
|
|
|
3336
3336
|
var D = Ie(n), Z = D == h || D == v;
|
|
3337
3337
|
if (wr(n))
|
|
3338
3338
|
return ct(n, s);
|
|
3339
|
-
if (D == d || D == a || Z && !
|
|
3339
|
+
if (D == d || D == a || Z && !A) {
|
|
3340
3340
|
if (Tt(n))
|
|
3341
|
-
return
|
|
3342
|
-
if (F =
|
|
3341
|
+
return A ? n : {};
|
|
3342
|
+
if (F = Ae(Z ? {} : n), !s)
|
|
3343
3343
|
return Fn(n, _e(F, n));
|
|
3344
3344
|
} else {
|
|
3345
3345
|
if (!U[D])
|
|
3346
|
-
return
|
|
3346
|
+
return A ? n : {};
|
|
3347
3347
|
F = Mn(n, D, Dt, s);
|
|
3348
3348
|
}
|
|
3349
3349
|
}
|
|
@@ -3357,8 +3357,8 @@ qr.exports;
|
|
|
3357
3357
|
W && (K = ee, ee = n[K]), yr(F, K, Dt(ee, s, u, y, K, n, I));
|
|
3358
3358
|
}), F;
|
|
3359
3359
|
}
|
|
3360
|
-
function
|
|
3361
|
-
return
|
|
3360
|
+
function On(n) {
|
|
3361
|
+
return Oe(n) ? ur(n) : {};
|
|
3362
3362
|
}
|
|
3363
3363
|
function En(n, s, u) {
|
|
3364
3364
|
var y = s(n);
|
|
@@ -3368,7 +3368,7 @@ qr.exports;
|
|
|
3368
3368
|
return rt.call(n);
|
|
3369
3369
|
}
|
|
3370
3370
|
function Pn(n) {
|
|
3371
|
-
if (!
|
|
3371
|
+
if (!Oe(n) || Un(n))
|
|
3372
3372
|
return !1;
|
|
3373
3373
|
var s = $t(n) || Tt(n) ? nn : Qr;
|
|
3374
3374
|
return s.test(ne(n));
|
|
@@ -3397,7 +3397,7 @@ qr.exports;
|
|
|
3397
3397
|
}
|
|
3398
3398
|
function mr(n, s, u) {
|
|
3399
3399
|
var y = s ? u(ar(n), !0) : ar(n);
|
|
3400
|
-
return
|
|
3400
|
+
return Ot(y, en, new n.constructor());
|
|
3401
3401
|
}
|
|
3402
3402
|
function gr(n) {
|
|
3403
3403
|
var s = new n.constructor(n.source, Kr.exec(n));
|
|
@@ -3405,7 +3405,7 @@ qr.exports;
|
|
|
3405
3405
|
}
|
|
3406
3406
|
function Rn(n, s, u) {
|
|
3407
3407
|
var y = s ? u(sr(n), !0) : sr(n);
|
|
3408
|
-
return
|
|
3408
|
+
return Ot(y, ye, new n.constructor());
|
|
3409
3409
|
}
|
|
3410
3410
|
function xn(n) {
|
|
3411
3411
|
return pr ? Object(pr.call(n)) : {};
|
|
@@ -3422,7 +3422,7 @@ qr.exports;
|
|
|
3422
3422
|
}
|
|
3423
3423
|
function Ut(n, s, u, y) {
|
|
3424
3424
|
u || (u = {});
|
|
3425
|
-
for (var E = -1,
|
|
3425
|
+
for (var E = -1, A = s.length; ++E < A; ) {
|
|
3426
3426
|
var I = s[E], F = y ? y(u[I], n[I], I, u, n) : void 0;
|
|
3427
3427
|
yr(u, I, F === void 0 ? n[I] : F);
|
|
3428
3428
|
}
|
|
@@ -3443,12 +3443,12 @@ 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))) !=
|
|
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
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) {
|
|
3450
3450
|
case It:
|
|
3451
|
-
return
|
|
3451
|
+
return O;
|
|
3452
3452
|
case Je:
|
|
3453
3453
|
return b;
|
|
3454
3454
|
case Ft:
|
|
@@ -3464,8 +3464,8 @@ qr.exports;
|
|
|
3464
3464
|
var s = n.length, u = n.constructor(s);
|
|
3465
3465
|
return s && typeof n[0] == "string" && we.call(n, "index") && (u.index = n.index, u.input = n.input), u;
|
|
3466
3466
|
}
|
|
3467
|
-
function
|
|
3468
|
-
return typeof n.constructor == "function" && !vr(n) ?
|
|
3467
|
+
function Ae(n) {
|
|
3468
|
+
return typeof n.constructor == "function" && !vr(n) ? On(ce(n)) : {};
|
|
3469
3469
|
}
|
|
3470
3470
|
function Mn(n, s, u, y) {
|
|
3471
3471
|
var E = n.constructor;
|
|
@@ -3475,7 +3475,7 @@ qr.exports;
|
|
|
3475
3475
|
case c:
|
|
3476
3476
|
case p:
|
|
3477
3477
|
return new E(+n);
|
|
3478
|
-
case
|
|
3478
|
+
case O:
|
|
3479
3479
|
return Ke(n, y);
|
|
3480
3480
|
case T:
|
|
3481
3481
|
case j:
|
|
@@ -3541,21 +3541,21 @@ qr.exports;
|
|
|
3541
3541
|
return n != null && _r(n.length) && !$t(n);
|
|
3542
3542
|
}
|
|
3543
3543
|
function kn(n) {
|
|
3544
|
-
return
|
|
3544
|
+
return Ar(n) && ft(n);
|
|
3545
3545
|
}
|
|
3546
3546
|
var wr = it || qn;
|
|
3547
3547
|
function $t(n) {
|
|
3548
|
-
var s =
|
|
3548
|
+
var s = Oe(n) ? rt.call(n) : "";
|
|
3549
3549
|
return s == h || s == v;
|
|
3550
3550
|
}
|
|
3551
3551
|
function _r(n) {
|
|
3552
3552
|
return typeof n == "number" && n > -1 && n % 1 == 0 && n <= o;
|
|
3553
3553
|
}
|
|
3554
|
-
function
|
|
3554
|
+
function Oe(n) {
|
|
3555
3555
|
var s = typeof n;
|
|
3556
3556
|
return !!n && (s == "object" || s == "function");
|
|
3557
3557
|
}
|
|
3558
|
-
function
|
|
3558
|
+
function Ar(n) {
|
|
3559
3559
|
return !!n && typeof n == "object";
|
|
3560
3560
|
}
|
|
3561
3561
|
function qt(n) {
|
|
@@ -3573,20 +3573,20 @@ 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]", b = "[object Error]", S = "[object Function]", d = "[object GeneratorFunction]", g = "[object Map]", _ = "[object Number]", w = "[object Null]", P = "[object Object]", N = "[object Promise]", C = "[object Proxy]", $ = "[object RegExp]",
|
|
3577
|
-
k[oe] = k[pe] = k[Re] = k[Se] = k[Kr] = k[Qr] = k[Xr] = k[U] = k[Yr] = !0, k[c] = k[p] = k[de] = k[h] = k[V] = k[v] = k[b] = k[S] = k[g] = k[_] = k[P] = k[$] = k[
|
|
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,
|
|
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]", b = "[object Error]", S = "[object Function]", d = "[object GeneratorFunction]", g = "[object Map]", _ = "[object Number]", w = "[object Null]", P = "[object Object]", N = "[object Promise]", C = "[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]", Se = "[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[Se] = k[Kr] = k[Qr] = k[Xr] = k[U] = k[Yr] = !0, k[c] = k[p] = k[de] = k[h] = k[V] = k[v] = k[b] = k[S] = k[g] = k[_] = k[P] = k[$] = k[O] = k[T] = k[X] = !1;
|
|
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");
|
|
3581
3581
|
} catch {
|
|
3582
3582
|
}
|
|
3583
3583
|
}(), Tt = or && or.isTypedArray;
|
|
3584
3584
|
function ar(n, s) {
|
|
3585
|
-
for (var u = -1, y = n == null ? 0 : n.length, E = 0,
|
|
3585
|
+
for (var u = -1, y = n == null ? 0 : n.length, E = 0, A = []; ++u < y; ) {
|
|
3586
3586
|
var I = n[u];
|
|
3587
|
-
s(I, u, n) && (
|
|
3587
|
+
s(I, u, n) && (A[E++] = I);
|
|
3588
3588
|
}
|
|
3589
|
-
return
|
|
3589
|
+
return A;
|
|
3590
3590
|
}
|
|
3591
3591
|
function Pt(n, s) {
|
|
3592
3592
|
for (var u = -1, y = s.length, E = n.length; ++u < y; )
|
|
@@ -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 =
|
|
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;
|
|
3643
3643
|
for (this.clear(); ++s < u; ) {
|
|
@@ -3722,11 +3722,11 @@ Hr.exports;
|
|
|
3722
3722
|
function _n(n) {
|
|
3723
3723
|
return ge(this, n).has(n);
|
|
3724
3724
|
}
|
|
3725
|
-
function
|
|
3725
|
+
function An(n, s) {
|
|
3726
3726
|
var u = ge(this, n), y = u.size;
|
|
3727
3727
|
return u.set(n, s), this.size += u.size == y ? 0 : 1, this;
|
|
3728
3728
|
}
|
|
3729
|
-
ae.prototype.clear = bn, ae.prototype.delete = Sn, ae.prototype.get = wn, ae.prototype.has = _n, ae.prototype.set =
|
|
3729
|
+
ae.prototype.clear = bn, ae.prototype.delete = Sn, ae.prototype.get = wn, ae.prototype.has = _n, ae.prototype.set = An;
|
|
3730
3730
|
function st(n) {
|
|
3731
3731
|
var s = -1, u = n == null ? 0 : n.length;
|
|
3732
3732
|
for (this.__data__ = new ae(); ++s < u; )
|
|
@@ -3746,7 +3746,7 @@ Hr.exports;
|
|
|
3746
3746
|
function Dt() {
|
|
3747
3747
|
this.__data__ = new Y(), this.size = 0;
|
|
3748
3748
|
}
|
|
3749
|
-
function
|
|
3749
|
+
function On(n) {
|
|
3750
3750
|
var s = this.__data__, u = s.delete(n);
|
|
3751
3751
|
return this.size = s.size, u;
|
|
3752
3752
|
}
|
|
@@ -3766,14 +3766,14 @@ Hr.exports;
|
|
|
3766
3766
|
}
|
|
3767
3767
|
return u.set(n, s), this.size = u.size, this;
|
|
3768
3768
|
}
|
|
3769
|
-
_e.prototype.clear = Dt, _e.prototype.delete =
|
|
3769
|
+
_e.prototype.clear = Dt, _e.prototype.delete = On, _e.prototype.get = En, _e.prototype.has = Tn, _e.prototype.set = Pn;
|
|
3770
3770
|
function Cn(n, s) {
|
|
3771
|
-
var u = ut(n), y = !u && Sr(n), E = !u && !y && ft(n),
|
|
3771
|
+
var u = ut(n), y = !u && Sr(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
3773
|
(s || ce.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.
|
|
3777
3777
|
Mn(D, q))) && F.push(D);
|
|
3778
3778
|
return F;
|
|
3779
3779
|
}
|
|
@@ -3791,13 +3791,13 @@ Hr.exports;
|
|
|
3791
3791
|
return n == null ? n === void 0 ? Q : w : me && me in Object(n) ? Ie(n) : vr(n);
|
|
3792
3792
|
}
|
|
3793
3793
|
function mr(n) {
|
|
3794
|
-
return
|
|
3794
|
+
return Oe(n) && Ke(n) == c;
|
|
3795
3795
|
}
|
|
3796
3796
|
function gr(n, s, u, y, E) {
|
|
3797
|
-
return n === s ? !0 : n == null || s == null || !
|
|
3797
|
+
return n === s ? !0 : n == null || s == null || !Oe(n) && !Oe(s) ? n !== n && s !== s : Rn(n, s, u, y, gr, E);
|
|
3798
3798
|
}
|
|
3799
|
-
function Rn(n, s, u, y, E,
|
|
3800
|
-
var I = ut(n), F = ut(s), q = I ? p :
|
|
3799
|
+
function Rn(n, s, u, y, E, A) {
|
|
3800
|
+
var I = ut(n), F = ut(s), q = I ? p : Ae(n), D = F ? p : Ae(s);
|
|
3801
3801
|
q = q == c ? P : q, D = D == c ? P : D;
|
|
3802
3802
|
var Z = q == P, se = D == P, W = q == D;
|
|
3803
3803
|
if (W && ft(n)) {
|
|
@@ -3806,15 +3806,15 @@ Hr.exports;
|
|
|
3806
3806
|
I = !0, Z = !1;
|
|
3807
3807
|
}
|
|
3808
3808
|
if (W && !Z)
|
|
3809
|
-
return
|
|
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
3811
|
var ee = Z && ce.call(n, "__wrapped__"), K = se && ce.call(s, "__wrapped__");
|
|
3812
3812
|
if (ee || K) {
|
|
3813
3813
|
var ke = ee ? n.value() : n, Fe = K ? s.value() : s;
|
|
3814
|
-
return
|
|
3814
|
+
return A || (A = new _e()), E(ke, Fe, u, y, A);
|
|
3815
3815
|
}
|
|
3816
3816
|
}
|
|
3817
|
-
return W ? (
|
|
3817
|
+
return W ? (A || (A = new _e()), Ln(n, s, u, y, E, A)) : !1;
|
|
3818
3818
|
}
|
|
3819
3819
|
function xn(n) {
|
|
3820
3820
|
if (!_r(n) || jn(n))
|
|
@@ -3823,7 +3823,7 @@ Hr.exports;
|
|
|
3823
3823
|
return s.test(ne(n));
|
|
3824
3824
|
}
|
|
3825
3825
|
function Nn(n) {
|
|
3826
|
-
return
|
|
3826
|
+
return Oe(n) && $t(n.length) && !!k[Ke(n)];
|
|
3827
3827
|
}
|
|
3828
3828
|
function In(n) {
|
|
3829
3829
|
if (!Un(n))
|
|
@@ -3833,18 +3833,18 @@ Hr.exports;
|
|
|
3833
3833
|
ce.call(n, u) && u != "constructor" && s.push(u);
|
|
3834
3834
|
return s;
|
|
3835
3835
|
}
|
|
3836
|
-
function Ut(n, s, u, y, E,
|
|
3836
|
+
function Ut(n, s, u, y, E, A) {
|
|
3837
3837
|
var I = u & o, F = n.length, q = s.length;
|
|
3838
3838
|
if (F != q && !(I && q > F))
|
|
3839
3839
|
return !1;
|
|
3840
|
-
var D =
|
|
3841
|
-
if (D &&
|
|
3840
|
+
var D = A.get(n);
|
|
3841
|
+
if (D && A.get(s))
|
|
3842
3842
|
return D == s;
|
|
3843
3843
|
var Z = -1, se = !0, W = u & a ? new st() : void 0;
|
|
3844
|
-
for (
|
|
3844
|
+
for (A.set(n, s), A.set(s, n); ++Z < F; ) {
|
|
3845
3845
|
var ee = n[Z], K = s[Z];
|
|
3846
3846
|
if (y)
|
|
3847
|
-
var ke = I ? y(K, ee, Z, s, n,
|
|
3847
|
+
var ke = I ? y(K, ee, Z, s, n, A) : y(ee, K, Z, n, s, A);
|
|
3848
3848
|
if (ke !== void 0) {
|
|
3849
3849
|
if (ke)
|
|
3850
3850
|
continue;
|
|
@@ -3853,27 +3853,27 @@ Hr.exports;
|
|
|
3853
3853
|
}
|
|
3854
3854
|
if (W) {
|
|
3855
3855
|
if (!sr(s, function(Fe, Xe) {
|
|
3856
|
-
if (!tt(W, Xe) && (ee === Fe || E(ee, Fe, u, y,
|
|
3856
|
+
if (!tt(W, Xe) && (ee === Fe || E(ee, Fe, u, y, A)))
|
|
3857
3857
|
return W.push(Xe);
|
|
3858
3858
|
})) {
|
|
3859
3859
|
se = !1;
|
|
3860
3860
|
break;
|
|
3861
3861
|
}
|
|
3862
|
-
} else if (!(ee === K || E(ee, K, u, y,
|
|
3862
|
+
} else if (!(ee === K || E(ee, K, u, y, A))) {
|
|
3863
3863
|
se = !1;
|
|
3864
3864
|
break;
|
|
3865
3865
|
}
|
|
3866
3866
|
}
|
|
3867
|
-
return
|
|
3867
|
+
return A.delete(n), A.delete(s), se;
|
|
3868
3868
|
}
|
|
3869
|
-
function Fn(n, s, u, y, E,
|
|
3869
|
+
function Fn(n, s, u, y, E, A, I) {
|
|
3870
3870
|
switch (u) {
|
|
3871
3871
|
case V:
|
|
3872
3872
|
if (n.byteLength != s.byteLength || n.byteOffset != s.byteOffset)
|
|
3873
3873
|
return !1;
|
|
3874
3874
|
n = n.buffer, s = s.buffer;
|
|
3875
3875
|
case de:
|
|
3876
|
-
return !(n.byteLength != s.byteLength || !
|
|
3876
|
+
return !(n.byteLength != s.byteLength || !A(new dr(n), new dr(s)));
|
|
3877
3877
|
case h:
|
|
3878
3878
|
case v:
|
|
3879
3879
|
case _:
|
|
@@ -3885,7 +3885,7 @@ Hr.exports;
|
|
|
3885
3885
|
return n == s + "";
|
|
3886
3886
|
case g:
|
|
3887
3887
|
var F = lr;
|
|
3888
|
-
case
|
|
3888
|
+
case O:
|
|
3889
3889
|
var q = y & o;
|
|
3890
3890
|
if (F || (F = we), n.size != s.size && !q)
|
|
3891
3891
|
return !1;
|
|
@@ -3893,7 +3893,7 @@ Hr.exports;
|
|
|
3893
3893
|
if (D)
|
|
3894
3894
|
return D == s;
|
|
3895
3895
|
y |= a, I.set(n, s);
|
|
3896
|
-
var Z = Ut(F(n), F(s), y, E,
|
|
3896
|
+
var Z = Ut(F(n), F(s), y, E, A, I);
|
|
3897
3897
|
return I.delete(n), Z;
|
|
3898
3898
|
case j:
|
|
3899
3899
|
if (Mt)
|
|
@@ -3901,7 +3901,7 @@ Hr.exports;
|
|
|
3901
3901
|
}
|
|
3902
3902
|
return !1;
|
|
3903
3903
|
}
|
|
3904
|
-
function Ln(n, s, u, y, E,
|
|
3904
|
+
function Ln(n, s, u, y, E, A) {
|
|
3905
3905
|
var I = u & o, F = Qe(n), q = F.length, D = Qe(s), Z = D.length;
|
|
3906
3906
|
if (q != Z && !I)
|
|
3907
3907
|
return !1;
|
|
@@ -3910,27 +3910,27 @@ Hr.exports;
|
|
|
3910
3910
|
if (!(I ? W in s : ce.call(s, W)))
|
|
3911
3911
|
return !1;
|
|
3912
3912
|
}
|
|
3913
|
-
var ee =
|
|
3914
|
-
if (ee &&
|
|
3913
|
+
var ee = A.get(n);
|
|
3914
|
+
if (ee && A.get(s))
|
|
3915
3915
|
return ee == s;
|
|
3916
3916
|
var K = !0;
|
|
3917
|
-
|
|
3917
|
+
A.set(n, s), A.set(s, n);
|
|
3918
3918
|
for (var ke = I; ++se < q; ) {
|
|
3919
3919
|
W = F[se];
|
|
3920
3920
|
var Fe = n[W], Xe = s[W];
|
|
3921
3921
|
if (y)
|
|
3922
|
-
var Fi = I ? y(Xe, Fe, W, s, n,
|
|
3923
|
-
if (!(Fi === void 0 ? Fe === Xe || E(Fe, Xe, u, y,
|
|
3922
|
+
var Fi = I ? y(Xe, Fe, W, s, n, A) : y(Fe, Xe, W, n, s, A);
|
|
3923
|
+
if (!(Fi === void 0 ? Fe === Xe || E(Fe, Xe, u, y, A) : Fi)) {
|
|
3924
3924
|
K = !1;
|
|
3925
3925
|
break;
|
|
3926
3926
|
}
|
|
3927
3927
|
ke || (ke = W == "constructor");
|
|
3928
3928
|
}
|
|
3929
3929
|
if (K && !ke) {
|
|
3930
|
-
var
|
|
3931
|
-
|
|
3930
|
+
var Or = n.constructor, Er = s.constructor;
|
|
3931
|
+
Or != Er && "constructor" in n && "constructor" in s && !(typeof Or == "function" && Or instanceof Or && typeof Er == "function" && Er instanceof Er) && (K = !1);
|
|
3932
3932
|
}
|
|
3933
|
-
return
|
|
3933
|
+
return A.delete(n), A.delete(s), K;
|
|
3934
3934
|
}
|
|
3935
3935
|
function Qe(n) {
|
|
3936
3936
|
return jt(n, qt, Bn);
|
|
@@ -3957,8 +3957,8 @@ Hr.exports;
|
|
|
3957
3957
|
return n == null ? [] : (n = Object(n), ar(at(n), function(s) {
|
|
3958
3958
|
return ot.call(n, s);
|
|
3959
3959
|
}));
|
|
3960
|
-
} : $n,
|
|
3961
|
-
(It &&
|
|
3960
|
+
} : $n, Ae = Ke;
|
|
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
3962
|
var s = Ke(n), u = s == P ? n.constructor : void 0, y = u ? ne(u) : "";
|
|
3963
3963
|
if (y)
|
|
3964
3964
|
switch (y) {
|
|
@@ -3969,7 +3969,7 @@ Hr.exports;
|
|
|
3969
3969
|
case an:
|
|
3970
3970
|
return N;
|
|
3971
3971
|
case sn:
|
|
3972
|
-
return
|
|
3972
|
+
return O;
|
|
3973
3973
|
case ln:
|
|
3974
3974
|
return X;
|
|
3975
3975
|
}
|
|
@@ -4011,7 +4011,7 @@ Hr.exports;
|
|
|
4011
4011
|
var Sr = mr(function() {
|
|
4012
4012
|
return arguments;
|
|
4013
4013
|
}()) ? mr : function(n) {
|
|
4014
|
-
return
|
|
4014
|
+
return Oe(n) && ce.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);
|
|
@@ -4033,10 +4033,10 @@ Hr.exports;
|
|
|
4033
4033
|
var s = typeof n;
|
|
4034
4034
|
return n != null && (s == "object" || s == "function");
|
|
4035
4035
|
}
|
|
4036
|
-
function
|
|
4036
|
+
function Oe(n) {
|
|
4037
4037
|
return n != null && typeof n == "object";
|
|
4038
4038
|
}
|
|
4039
|
-
var
|
|
4039
|
+
var Ar = Tt ? rn(Tt) : Nn;
|
|
4040
4040
|
function qt(n) {
|
|
4041
4041
|
return kt(n) ? Cn(n) : In(n);
|
|
4042
4042
|
}
|
|
@@ -4334,13 +4334,43 @@ const tu = (e, t) => {
|
|
|
4334
4334
|
}
|
|
4335
4335
|
], this.loadData());
|
|
4336
4336
|
},
|
|
4337
|
+
/**
|
|
4338
|
+
* Build a link for a cell. Supports either:
|
|
4339
|
+
* 1) Laravel route name (via Ziggy `route()`) — provide `{ name, resourceIds?, query? }`
|
|
4340
|
+
* 2) Link template string — provide `{ template, params?, query? }` OR pass the template directly as a string.
|
|
4341
|
+
*
|
|
4342
|
+
* Notes
|
|
4343
|
+
* - `resourceIds` is an array of row keys (in order) used for `route(name, [...])`.
|
|
4344
|
+
* - `template` supports placeholders like `/users/{id}/posts/{post_id}` or `/users/:id`.
|
|
4345
|
+
* - `params` (optional) lets you override/augment values used to interpolate the template.
|
|
4346
|
+
* - `query` (optional) is appended as a query string for both modes.
|
|
4347
|
+
*/
|
|
4337
4348
|
generateLink(e, t) {
|
|
4338
|
-
|
|
4339
|
-
|
|
4340
|
-
|
|
4341
|
-
|
|
4342
|
-
|
|
4343
|
-
|
|
4349
|
+
const r = (o, a) => {
|
|
4350
|
+
if (!a || typeof a != "object")
|
|
4351
|
+
return o;
|
|
4352
|
+
const l = new URLSearchParams(a).toString();
|
|
4353
|
+
return l ? `${o}?${l}` : o;
|
|
4354
|
+
}, i = (o, a) => {
|
|
4355
|
+
if (!o)
|
|
4356
|
+
return "";
|
|
4357
|
+
let l = o.replace(/\{(\w+)\}/g, (c, p) => a[p] ?? "");
|
|
4358
|
+
return l = l.replace(/(^|[^:]):(\w+)/g, (c, p, f) => `${p}${a[f] ?? ""}`), l;
|
|
4359
|
+
};
|
|
4360
|
+
if (typeof e == "string")
|
|
4361
|
+
return i(e, t);
|
|
4362
|
+
if (!e || typeof e != "object")
|
|
4363
|
+
return "";
|
|
4364
|
+
if (e.template) {
|
|
4365
|
+
const o = { ...t || {}, ...e.params || {} }, a = i(e.template, o);
|
|
4366
|
+
return r(a, e.query);
|
|
4367
|
+
}
|
|
4368
|
+
if (e.name) {
|
|
4369
|
+
const o = Array.isArray(e.resourceIds) ? e.resourceIds.map((l) => t ? t[l] : void 0) : [];
|
|
4370
|
+
let a = route(e.name, o);
|
|
4371
|
+
return r(a, e.query);
|
|
4372
|
+
}
|
|
4373
|
+
return "";
|
|
4344
4374
|
},
|
|
4345
4375
|
selectAllRows() {
|
|
4346
4376
|
this.selectedRows.length == this.rows.length ? this.selectedRows = [] : this.selectedRows = this.rows.map((e) => e.id);
|
|
@@ -4362,7 +4392,7 @@ const tu = (e, t) => {
|
|
|
4362
4392
|
mounted() {
|
|
4363
4393
|
this.initColumnSettings(), this.loadDataOnInit && this.loadData();
|
|
4364
4394
|
}
|
|
4365
|
-
}, Ce = (e) => (pa("data-v-
|
|
4395
|
+
}, Ce = (e) => (pa("data-v-bbf666f6"), e = e(), ha(), e), nu = {
|
|
4366
4396
|
key: 0,
|
|
4367
4397
|
class: "card-icon"
|
|
4368
4398
|
}, iu = {
|
|
@@ -4391,10 +4421,10 @@ const tu = (e, t) => {
|
|
|
4391
4421
|
/* @__PURE__ */ R("i", { class: "material-icons" }, "more_vert")
|
|
4392
4422
|
], -1)), bu = { class: "dropdown-menu dropdown-menu-right" }, Su = /* @__PURE__ */ Ce(() => /* @__PURE__ */ R("a", { href: "javascript:void(0)" }, "10", -1)), wu = [
|
|
4393
4423
|
Su
|
|
4394
|
-
], _u = /* @__PURE__ */ Ce(() => /* @__PURE__ */ R("a", { href: "javascript:void(0)" }, "25", -1)),
|
|
4424
|
+
], _u = /* @__PURE__ */ Ce(() => /* @__PURE__ */ R("a", { href: "javascript:void(0)" }, "25", -1)), Au = [
|
|
4395
4425
|
_u
|
|
4396
|
-
],
|
|
4397
|
-
|
|
4426
|
+
], Ou = /* @__PURE__ */ Ce(() => /* @__PURE__ */ R("a", { href: "javascript:void(0)" }, "50", -1)), Eu = [
|
|
4427
|
+
Ou
|
|
4398
4428
|
], Tu = /* @__PURE__ */ Ce(() => /* @__PURE__ */ R("a", { href: "javascript:void(0)" }, "100", -1)), Pu = [
|
|
4399
4429
|
Tu
|
|
4400
4430
|
], Cu = { class: "card-body" }, Ru = ["name", "placeholder"], xu = /* @__PURE__ */ Ce(() => /* @__PURE__ */ R("button", {
|
|
@@ -4472,7 +4502,7 @@ function Ju(e, t, r, i, o, a) {
|
|
|
4472
4502
|
}, wu),
|
|
4473
4503
|
R("li", {
|
|
4474
4504
|
onClick: t[4] || (t[4] = (c) => a.setPageLength(25))
|
|
4475
|
-
},
|
|
4505
|
+
}, Au),
|
|
4476
4506
|
R("li", {
|
|
4477
4507
|
onClick: t[5] || (t[5] = (c) => a.setPageLength(50))
|
|
4478
4508
|
}, Eu),
|
|
@@ -4605,7 +4635,7 @@ function Ju(e, t, r, i, o, a) {
|
|
|
4605
4635
|
])
|
|
4606
4636
|
], 2);
|
|
4607
4637
|
}
|
|
4608
|
-
const Qu = /* @__PURE__ */ tu(ru, [["render", Ju], ["__scopeId", "data-v-
|
|
4638
|
+
const Qu = /* @__PURE__ */ tu(ru, [["render", Ju], ["__scopeId", "data-v-bbf666f6"]]);
|
|
4609
4639
|
export {
|
|
4610
4640
|
Qu as default
|
|
4611
4641
|
};
|
|
@@ -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){let r=[];e.resourceIds.forEach(o=>{r.push(t[o])});let i=route(e.name,r);return e.query&&(i+="?"+new URLSearchParams(e.query).toString()),i},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-0b60868f"),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-0b60868f"]])});
|
|
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"]])});
|
package/dist/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.toolbar[data-v-
|
|
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}
|
package/package.json
CHANGED
|
@@ -456,18 +456,65 @@ export default {
|
|
|
456
456
|
}
|
|
457
457
|
this.loadData();
|
|
458
458
|
},
|
|
459
|
+
/**
|
|
460
|
+
* Build a link for a cell. Supports either:
|
|
461
|
+
* 1) Laravel route name (via Ziggy `route()`) — provide `{ name, resourceIds?, query? }`
|
|
462
|
+
* 2) Link template string — provide `{ template, params?, query? }` OR pass the template directly as a string.
|
|
463
|
+
*
|
|
464
|
+
* Notes
|
|
465
|
+
* - `resourceIds` is an array of row keys (in order) used for `route(name, [...])`.
|
|
466
|
+
* - `template` supports placeholders like `/users/{id}/posts/{post_id}` or `/users/:id`.
|
|
467
|
+
* - `params` (optional) lets you override/augment values used to interpolate the template.
|
|
468
|
+
* - `query` (optional) is appended as a query string for both modes.
|
|
469
|
+
*/
|
|
459
470
|
generateLink(linkParams, row) {
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
471
|
+
// Helper: append query object as `?a=1&b=2`
|
|
472
|
+
const appendQuery = (href, query) => {
|
|
473
|
+
if (!query || typeof query !== 'object') return href;
|
|
474
|
+
const qs = new URLSearchParams(query).toString();
|
|
475
|
+
return qs ? `${href}?${qs}` : href;
|
|
476
|
+
};
|
|
477
|
+
|
|
478
|
+
// Helper: interpolate `{key}` and `:key` tokens from row/params
|
|
479
|
+
const interpolate = (tpl, ctx) => {
|
|
480
|
+
if (!tpl) return '';
|
|
481
|
+
// {key}
|
|
482
|
+
let out = tpl.replace(/\{(\w+)\}/g, (_, k) => (ctx[k] ?? ''));
|
|
483
|
+
// :key (avoid matching protocol like http://)
|
|
484
|
+
out = out.replace(/(^|[^:]):(\w+)/g, (m, prefix, k) => `${prefix}${ctx[k] ?? ''}`);
|
|
485
|
+
return out;
|
|
486
|
+
};
|
|
487
|
+
|
|
488
|
+
// String shorthand => treat as a template
|
|
489
|
+
if (typeof linkParams === 'string') {
|
|
490
|
+
const href = interpolate(linkParams, row);
|
|
491
|
+
return href; // no query in shorthand; use object form if you need query
|
|
492
|
+
}
|
|
464
493
|
|
|
465
|
-
|
|
494
|
+
// Safety
|
|
495
|
+
if (!linkParams || typeof linkParams !== 'object') return '';
|
|
466
496
|
|
|
467
|
-
|
|
468
|
-
|
|
497
|
+
// Template mode
|
|
498
|
+
if (linkParams.template) {
|
|
499
|
+
// Merge row first, then allow explicit overrides via params
|
|
500
|
+
const ctx = { ...(row || {}), ...(linkParams.params || {}) };
|
|
501
|
+
const href = interpolate(linkParams.template, ctx);
|
|
502
|
+
return appendQuery(href, linkParams.query);
|
|
469
503
|
}
|
|
470
|
-
|
|
504
|
+
|
|
505
|
+
// Route name mode (default/back-compat)
|
|
506
|
+
if (linkParams.name) {
|
|
507
|
+
const ids = Array.isArray(linkParams.resourceIds)
|
|
508
|
+
? linkParams.resourceIds.map((key) => (row ? row[key] : undefined))
|
|
509
|
+
: [];
|
|
510
|
+
|
|
511
|
+
// `route` comes from Ziggy; assume it is globally available as in your existing codebase
|
|
512
|
+
let href = route(linkParams.name, ids);
|
|
513
|
+
return appendQuery(href, linkParams.query);
|
|
514
|
+
}
|
|
515
|
+
|
|
516
|
+
// Nothing to build
|
|
517
|
+
return '';
|
|
471
518
|
},
|
|
472
519
|
selectAllRows() {
|
|
473
520
|
if (this.selectedRows.length == this.rows.length) {
|