@dcodegroup-au/dsg-vue 1.0.12-next → 1.0.14-next
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{DsgTablePerPage.vue_vue_type_style_index_0_lang-o48o8k1B.js → DsgTablePerPage.vue_vue_type_style_index_0_lang-B--bn0YD.js} +11338 -11405
- package/dist/{DsgTablePerPage.vue_vue_type_style_index_0_lang-CX6n9ht7.cjs → DsgTablePerPage.vue_vue_type_style_index_0_lang-E5pN5GOj.cjs} +1212 -1201
- package/dist/components/Elements/DsgCheckboxGroup.vue.d.ts +2 -0
- package/dist/components/Elements/DsgDropdown.vue.d.ts +146 -194
- package/dist/components/Table/DsgTableActions.vue.d.ts +140 -140
- package/dist/components/Table/DsgTableFilter.vue.d.ts +146 -194
- package/dist/dsg-vue.cjs +14 -25
- package/dist/dsg-vue.css +1 -1
- package/dist/dsg-vue.esm.js +2875 -3107
- package/dist/dsg-vue.table.cjs +2 -2
- package/dist/dsg-vue.table.esm.js +78 -78
- package/dist/main.d.ts +280 -280
- package/dist/table.d.ts +280 -280
- package/package.json +10 -10
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { defineComponent as Z, useModel as ae, computed as W, withDirectives as Ie, openBlock as s, createElementBlock as d, normalizeClass as L, createVNode as V, createCommentVNode as m, createElementVNode as C, Fragment as q, renderList as Y, vShow as gt, mergeModels as le, ref as P, useTemplateRef as We, unref as G, withCtx as ne, renderSlot as E, toDisplayString as ve, createBlock as K, resolveDynamicComponent as vt, onMounted as qe, normalizeStyle as N, mergeProps as
|
|
2
|
-
import { _ as O,
|
|
1
|
+
import { defineComponent as Z, useModel as ae, computed as W, withDirectives as Ie, openBlock as s, createElementBlock as d, normalizeClass as L, createVNode as V, createCommentVNode as m, createElementVNode as C, Fragment as q, renderList as Y, vShow as gt, mergeModels as le, ref as P, useTemplateRef as We, unref as G, withCtx as ne, renderSlot as E, toDisplayString as ve, createBlock as K, resolveDynamicComponent as vt, onMounted as qe, normalizeStyle as N, mergeProps as De, watch as ie, onUnmounted as bt, withModifiers as ft, Transition as ht, createTextVNode as mt, useSlots as wt, createSlots as yt, normalizeProps as kt, guardReactiveProps as pt, nextTick as He } from "vue";
|
|
2
|
+
import { _ as O, D as Pt, v as Ct, f as Dt, u as St, b as ze, a as Ae, m as Oe, n as Ue, j as Ne, p as xt, k as $t } from "./DsgTablePerPage.vue_vue_type_style_index_0_lang-B--bn0YD.js";
|
|
3
3
|
import { ucfirst as Tt, ucwords as Ve, toSnakeCase as Rt } from "./dsg-vue.helpers-string.esm.js";
|
|
4
4
|
import { data_get as Ce } from "./dsg-vue.helpers-object.esm.js";
|
|
5
5
|
import { isEmpty as Mt } from "./dsg-vue.helpers.esm.js";
|
|
@@ -19,7 +19,7 @@ const Et = { class: "dsg-table-pagination" }, Bt = ["disabled"], Lt = ["disabled
|
|
|
19
19
|
}),
|
|
20
20
|
emits: /* @__PURE__ */ le(["dsg-table:change-page"], ["update:pagination"]),
|
|
21
21
|
setup(e, { expose: B, emit: h }) {
|
|
22
|
-
const u = ae(e, "pagination"),
|
|
22
|
+
const u = ae(e, "pagination"), D = W(() => u.value === null ? 0 : u.value?.last_page - e.firstPage + 1), H = W(() => u.value === null ? 0 : u.value?.last_page), f = W(() => u.value === null ? !1 : u.value?.current_page === e.firstPage), g = W(() => u.value === null ? !1 : u.value?.current_page === H.value), A = W(() => D.value < e.onEachSide * 2 + 4), $ = W(() => e.onEachSide * 2 + 1), x = W(() => !u.value || u.value?.current_page <= e.onEachSide ? 1 : u.value?.current_page >= D.value - e.onEachSide ? D.value - e.onEachSide * 2 : u.value?.current_page - e.onEachSide), w = h, a = (R) => {
|
|
23
23
|
w("dsg-table:change-page", R);
|
|
24
24
|
}, T = (R) => R === u.value?.current_page;
|
|
25
25
|
return B({
|
|
@@ -50,16 +50,16 @@ const Et = { class: "dsg-table-pagination" }, Bt = ["disabled"], Lt = ["disabled
|
|
|
50
50
|
size: "sm"
|
|
51
51
|
}, null, 8, ["icon"])
|
|
52
52
|
], 10, Lt),
|
|
53
|
-
A.value ? (s(!0), d(q, { key: 1 }, Y(
|
|
53
|
+
A.value ? (s(!0), d(q, { key: 1 }, Y(D.value, (p, I) => (s(), d("a", {
|
|
54
54
|
key: I,
|
|
55
55
|
onClick: (se) => a(I + e.firstPage),
|
|
56
56
|
class: L(["dsg-table-pagination__link", { "dsg-table-pagination__link--active": T(I + e.firstPage) }]),
|
|
57
57
|
innerHTML: p
|
|
58
58
|
}, null, 10, Ft))), 128)) : (s(!0), d(q, { key: 2 }, Y($.value, (p, I) => (s(), d("a", {
|
|
59
59
|
key: I,
|
|
60
|
-
onClick: (se) => a(
|
|
61
|
-
class: L(["dsg-table-pagination__link", { "dsg-table-pagination__link--active": T(
|
|
62
|
-
innerHTML:
|
|
60
|
+
onClick: (se) => a(x.value + I + e.firstPage - 1),
|
|
61
|
+
class: L(["dsg-table-pagination__link", { "dsg-table-pagination__link--active": T(x.value + I + e.firstPage - 1) }]),
|
|
62
|
+
innerHTML: x.value + p - 1
|
|
63
63
|
}, null, 10, Ht))), 128)),
|
|
64
64
|
C("a", {
|
|
65
65
|
onClick: k[2] || (k[2] = (p) => a("next")),
|
|
@@ -102,7 +102,7 @@ const Et = { class: "dsg-table-pagination" }, Bt = ["disabled"], Lt = ["disabled
|
|
|
102
102
|
emits: ["update:pagination"],
|
|
103
103
|
setup(e) {
|
|
104
104
|
const B = ae(e, "pagination"), h = W(() => B.value == null || B.value.total == 0 ? e.noDataTemplate : e.infoTemplate.replace("{from}", (B.value?.from || 0).toString()).replace("{to}", (B.value?.to || 0).toString()).replace("{total}", (B.value?.total || 0).toString()));
|
|
105
|
-
return (u,
|
|
105
|
+
return (u, D) => (s(), d("div", {
|
|
106
106
|
class: "dsg-table-pagination-info",
|
|
107
107
|
innerHTML: h.value
|
|
108
108
|
}, null, 8, Vt));
|
|
@@ -124,8 +124,8 @@ const Et = { class: "dsg-table-pagination" }, Bt = ["disabled"], Lt = ["disabled
|
|
|
124
124
|
setup(e, { emit: B }) {
|
|
125
125
|
const h = P(!1);
|
|
126
126
|
We("dsgTableActions");
|
|
127
|
-
const u = W(() => e.data?.rowData ?? null),
|
|
128
|
-
switch (
|
|
127
|
+
const u = W(() => e.data?.rowData ?? null), D = W(() => u.value?.actions ?? null), H = W(() => u.value?.links ?? null), f = (x) => {
|
|
128
|
+
switch (x) {
|
|
129
129
|
case "edit":
|
|
130
130
|
return "edit-05";
|
|
131
131
|
case "view":
|
|
@@ -137,7 +137,7 @@ const Et = { class: "dsg-table-pagination" }, Bt = ["disabled"], Lt = ["disabled
|
|
|
137
137
|
default:
|
|
138
138
|
return "dots-horizontal";
|
|
139
139
|
}
|
|
140
|
-
}, g = (
|
|
140
|
+
}, g = (x, w, a) => {
|
|
141
141
|
switch (w) {
|
|
142
142
|
case "edit":
|
|
143
143
|
$("dsg-table:action-edit", a, u.value);
|
|
@@ -152,11 +152,11 @@ const Et = { class: "dsg-table-pagination" }, Bt = ["disabled"], Lt = ["disabled
|
|
|
152
152
|
$("dsg-table:action-archive", a, u.value);
|
|
153
153
|
break;
|
|
154
154
|
}
|
|
155
|
-
}, A = (
|
|
156
|
-
const a =
|
|
155
|
+
}, A = (x, w) => {
|
|
156
|
+
const a = x.actionId || x.label.trim().toLowerCase().replace(/[^a-z0-9-]/g, "-").replace(/-+/g, "-");
|
|
157
157
|
$("dsg-table:link-clicked", w, a, u.value);
|
|
158
158
|
}, $ = B;
|
|
159
|
-
return (
|
|
159
|
+
return (x, w) => Ie((s(), d("div", It, [
|
|
160
160
|
V(G(Pt), {
|
|
161
161
|
triggers: [],
|
|
162
162
|
placement: e.placement,
|
|
@@ -169,7 +169,7 @@ const Et = { class: "dsg-table-pagination" }, Bt = ["disabled"], Lt = ["disabled
|
|
|
169
169
|
}, {
|
|
170
170
|
popper: ne(() => [
|
|
171
171
|
h.value ? (s(), d("div", qt, [
|
|
172
|
-
(s(!0), d(q, null, Y(
|
|
172
|
+
(s(!0), d(q, null, Y(D.value, (a, T) => (s(), d(q, null, [
|
|
173
173
|
["edit", "view", "delete", "archive"].includes(String(T)) ? (s(), d("a", {
|
|
174
174
|
key: T,
|
|
175
175
|
href: a?.link,
|
|
@@ -190,7 +190,7 @@ const Et = { class: "dsg-table-pagination" }, Bt = ["disabled"], Lt = ["disabled
|
|
|
190
190
|
], 2)
|
|
191
191
|
], 8, zt)) : m("", !0)
|
|
192
192
|
], 64))), 256)),
|
|
193
|
-
|
|
193
|
+
D.value && H.value ? (s(), d("hr", Nt)) : m("", !0),
|
|
194
194
|
H.value ? (s(!0), d(q, { key: 1 }, Y(H.value, (a) => (s(), d(q, {
|
|
195
195
|
key: a.label
|
|
196
196
|
}, [
|
|
@@ -224,7 +224,7 @@ const Et = { class: "dsg-table-pagination" }, Bt = ["disabled"], Lt = ["disabled
|
|
|
224
224
|
"aria-haspopup": "true",
|
|
225
225
|
onClick: w[0] || (w[0] = (a) => h.value = !h.value)
|
|
226
226
|
}, [
|
|
227
|
-
E(
|
|
227
|
+
E(x.$slots, "dsg-table-action-button-content", {}, () => [
|
|
228
228
|
V(O, {
|
|
229
229
|
icon: "dots-vertical",
|
|
230
230
|
size: "sm"
|
|
@@ -260,7 +260,7 @@ const Et = { class: "dsg-table-pagination" }, Bt = ["disabled"], Lt = ["disabled
|
|
|
260
260
|
const f = new URL(window.location.href).searchParams.get("term");
|
|
261
261
|
f && (h.value = f, u("dsg-table:term-changed", f));
|
|
262
262
|
});
|
|
263
|
-
const u = B,
|
|
263
|
+
const u = B, D = St((H) => {
|
|
264
264
|
if (h.value = H, e.replaceState) {
|
|
265
265
|
const f = new URL(window.location.href);
|
|
266
266
|
h.value ? f.searchParams.set("term", h.value) : f.searchParams.delete("term"), window.history.pushState({}, "", f.toString());
|
|
@@ -268,7 +268,7 @@ const Et = { class: "dsg-table-pagination" }, Bt = ["disabled"], Lt = ["disabled
|
|
|
268
268
|
u("dsg-table:term-changed", h.value);
|
|
269
269
|
}, 300);
|
|
270
270
|
return (H, f) => (s(), d("div", Yt, [
|
|
271
|
-
V(
|
|
271
|
+
V(Dt, {
|
|
272
272
|
modelValue: h.value,
|
|
273
273
|
"onUpdate:modelValue": f[0] || (f[0] = (g) => h.value = g),
|
|
274
274
|
name: e.name,
|
|
@@ -283,9 +283,9 @@ const Et = { class: "dsg-table-pagination" }, Bt = ["disabled"], Lt = ["disabled
|
|
|
283
283
|
size: "sm",
|
|
284
284
|
icon: "search-sm",
|
|
285
285
|
"icon-clickable": !0,
|
|
286
|
-
onIconClicked: f[1] || (f[1] = (g) => G(
|
|
287
|
-
onEnterPressed: f[2] || (f[2] = (g) => G(
|
|
288
|
-
onOnClear: f[3] || (f[3] = () => G(
|
|
286
|
+
onIconClicked: f[1] || (f[1] = (g) => G(D)(g)),
|
|
287
|
+
onEnterPressed: f[2] || (f[2] = (g) => G(D)(g)),
|
|
288
|
+
onOnClear: f[3] || (f[3] = () => G(D)(""))
|
|
289
289
|
}, null, 8, ["modelValue", "name", "id", "placeholder", "disabled", "required", "readonly", "hidden"])
|
|
290
290
|
]));
|
|
291
291
|
}
|
|
@@ -312,22 +312,22 @@ const Et = { class: "dsg-table-pagination" }, Bt = ["disabled"], Lt = ["disabled
|
|
|
312
312
|
}),
|
|
313
313
|
emits: /* @__PURE__ */ le(["dsg-table:sort-field", "dsg-table:on-select-all", "dsg-table:on-deselect-all"], ["update:sortField", "update:selectedRows", "update:hasSelected"]),
|
|
314
314
|
setup(e, { emit: B }) {
|
|
315
|
-
const h = ae(e, "sortField"), u = ae(e, "selectedRows"),
|
|
316
|
-
|
|
317
|
-
}, g = B, A = (
|
|
318
|
-
|
|
319
|
-
|
|
315
|
+
const h = ae(e, "sortField"), u = ae(e, "selectedRows"), D = ae(e, "hasSelected"), H = P("17px"), f = (x) => {
|
|
316
|
+
D.value && u.value.length > 0 && u.value.length !== e.tableDataLength ? (D.value = !0, g("dsg-table:on-select-all")) : !D.value && u.value.length === 0 ? (D.value = !1, g("dsg-table:on-select-all")) : g("dsg-table:on-deselect-all");
|
|
317
|
+
}, g = B, A = (x, w) => [
|
|
318
|
+
x,
|
|
319
|
+
x + "-" + Rt(String(w?.name)),
|
|
320
320
|
w.titleClass || "",
|
|
321
321
|
{ "dsg-table-row-header__row--sortable": w.sortable },
|
|
322
322
|
{ "dsg-table-row-header__row--sort-active": h.value?.name === w.name }
|
|
323
|
-
], $ = (
|
|
324
|
-
|
|
325
|
-
name: String(
|
|
326
|
-
field: String(
|
|
327
|
-
direction: h.value?.name ===
|
|
328
|
-
}, g("dsg-table:sort-field",
|
|
323
|
+
], $ = (x) => {
|
|
324
|
+
x.sortable && (h.value = {
|
|
325
|
+
name: String(x?.name),
|
|
326
|
+
field: String(x?.sortField),
|
|
327
|
+
direction: h.value?.name === x.name && h.value?.direction === "asc" ? "desc" : "asc"
|
|
328
|
+
}, g("dsg-table:sort-field", x));
|
|
329
329
|
};
|
|
330
|
-
return (
|
|
330
|
+
return (x, w) => (s(), d("tr", Gt, [
|
|
331
331
|
e.hasSelectAll ? (s(), d("th", {
|
|
332
332
|
key: 0,
|
|
333
333
|
class: "dsg-table-row-header__row dsg-table-row-header__row--checkbox",
|
|
@@ -335,9 +335,9 @@ const Et = { class: "dsg-table-pagination" }, Bt = ["disabled"], Lt = ["disabled
|
|
|
335
335
|
scope: "col"
|
|
336
336
|
}, [
|
|
337
337
|
V(ze, {
|
|
338
|
-
modelValue:
|
|
338
|
+
modelValue: D.value,
|
|
339
339
|
"onUpdate:modelValue": [
|
|
340
|
-
w[0] || (w[0] = (a) =>
|
|
340
|
+
w[0] || (w[0] = (a) => D.value = a),
|
|
341
341
|
f
|
|
342
342
|
],
|
|
343
343
|
indeterminate: u.value.length > 0 && u.value.length !== e.tableDataLength
|
|
@@ -360,7 +360,7 @@ const Et = { class: "dsg-table-pagination" }, Bt = ["disabled"], Lt = ["disabled
|
|
|
360
360
|
scope: "col"
|
|
361
361
|
}, [
|
|
362
362
|
a.sortable ? (s(), d("div", Xt, [
|
|
363
|
-
a.tooltip ? (s(), K(Ae,
|
|
363
|
+
a.tooltip ? (s(), K(Ae, De({
|
|
364
364
|
key: 0,
|
|
365
365
|
ref_for: !0
|
|
366
366
|
}, a.tooltip, { class: "dsg-table-row-header__tooltip" }), {
|
|
@@ -402,7 +402,7 @@ const Et = { class: "dsg-table-pagination" }, Bt = ["disabled"], Lt = ["disabled
|
|
|
402
402
|
size: "xs"
|
|
403
403
|
})) : m("", !0)
|
|
404
404
|
])) : (s(), d(q, { key: 1 }, [
|
|
405
|
-
a.tooltip ? (s(), K(Ae,
|
|
405
|
+
a.tooltip ? (s(), K(Ae, De({
|
|
406
406
|
key: 0,
|
|
407
407
|
ref_for: !0
|
|
408
408
|
}, a.tooltip, { class: "dsg-table-row-header__tooltip" }), {
|
|
@@ -520,13 +520,13 @@ const Et = { class: "dsg-table-pagination" }, Bt = ["disabled"], Lt = ["disabled
|
|
|
520
520
|
formatter: l.formatter || null,
|
|
521
521
|
tooltip: l.tooltip ?? null,
|
|
522
522
|
$_index: n
|
|
523
|
-
})),
|
|
523
|
+
})), D = () => {
|
|
524
524
|
if (!e.apiMode) return null;
|
|
525
525
|
const l = Oe().find((n) => n.key === e.queryParams.sort);
|
|
526
526
|
if (l && l.value.length > 0) {
|
|
527
|
-
const n = l.value[0], v = n.startsWith("-"), c = v ? n.substring(1) : n,
|
|
528
|
-
return
|
|
529
|
-
name: String(
|
|
527
|
+
const n = l.value[0], v = n.startsWith("-"), c = v ? n.substring(1) : n, S = e.fields.find((Q) => Q.sortField === c || Q.name === c || Q.field === c);
|
|
528
|
+
return S ? {
|
|
529
|
+
name: String(S.name || S.field),
|
|
530
530
|
field: c,
|
|
531
531
|
direction: v ? "desc" : "asc"
|
|
532
532
|
} : {
|
|
@@ -546,7 +546,7 @@ const Et = { class: "dsg-table-pagination" }, Bt = ["disabled"], Lt = ["disabled
|
|
|
546
546
|
const n = `${t.pathname}${l.toString() ? "?" + l.toString() : ""}`;
|
|
547
547
|
window.history.pushState({}, "", n);
|
|
548
548
|
}
|
|
549
|
-
}, f = P(u(e.fields)), g = P(e.data), A = P(null), $ = P(e.initialPage),
|
|
549
|
+
}, f = P(u(e.fields)), g = P(e.data), A = P(null), $ = P(e.initialPage), x = P("17px"), w = P(!1), a = P({}), T = P(0), R = P(!0), k = P(D()), p = P(null), I = P(0), se = ae(e, "filterParams"), re = ae(e, "perPage"), M = P([]), oe = P(!1), z = P(/* @__PURE__ */ new Set()), U = P(null), j = P(null), J = P(!1), _ = W(() => e.tableHeight != null), ee = W(() => {
|
|
550
550
|
let t = f.value.filter((l) => l.visible).length;
|
|
551
551
|
return e.selectable && t++, e.hasDetailRow && e.expandableRows && t++, t;
|
|
552
552
|
}), be = W(() => {
|
|
@@ -602,10 +602,10 @@ const Et = { class: "dsg-table-pagination" }, Bt = ["disabled"], Lt = ["disabled
|
|
|
602
602
|
let v = {};
|
|
603
603
|
if (typeof e.rowClass == "function") {
|
|
604
604
|
const c = e.rowClass(t, l);
|
|
605
|
-
typeof c == "string" ? c.split(" ").forEach((
|
|
606
|
-
|
|
607
|
-
}) : Array.isArray(c) ? c.forEach((
|
|
608
|
-
typeof
|
|
605
|
+
typeof c == "string" ? c.split(" ").forEach((S) => {
|
|
606
|
+
S.trim() && (v[S.trim()] = !0);
|
|
607
|
+
}) : Array.isArray(c) ? c.forEach((S) => {
|
|
608
|
+
typeof S == "string" && S.trim() && (v[S.trim()] = !0);
|
|
609
609
|
}) : typeof c == "object" && c !== null && (v = c);
|
|
610
610
|
} else typeof e.rowClass == "string" && e.rowClass.split(" ").forEach((c) => {
|
|
611
611
|
c.trim() && (v[c.trim()] = !0);
|
|
@@ -638,15 +638,15 @@ const Et = { class: "dsg-table-pagination" }, Bt = ["disabled"], Lt = ["disabled
|
|
|
638
638
|
}, r = (t, l, n) => {
|
|
639
639
|
if (e.selectable && t.shiftKey && U.value !== null) {
|
|
640
640
|
t.stopPropagation(), t.preventDefault();
|
|
641
|
-
const v = Math.min(U.value, n), c = Math.max(U.value, n),
|
|
641
|
+
const v = Math.min(U.value, n), c = Math.max(U.value, n), S = !l.selected;
|
|
642
642
|
for (let Q = v; Q <= c; Q++) {
|
|
643
643
|
if (Q === U.value) continue;
|
|
644
644
|
const de = g.value?.[Q];
|
|
645
645
|
if (de) {
|
|
646
646
|
const Le = de.selected;
|
|
647
|
-
if (de.selected =
|
|
647
|
+
if (de.selected = S, S && !Le)
|
|
648
648
|
M.value.push(de);
|
|
649
|
-
else if (!
|
|
649
|
+
else if (!S && Le) {
|
|
650
650
|
const Fe = M.value.findIndex((ct) => ct[e.trackBy] === de[e.trackBy]);
|
|
651
651
|
Fe !== -1 && M.value.splice(Fe, 1);
|
|
652
652
|
}
|
|
@@ -677,21 +677,21 @@ const Et = { class: "dsg-table-pagination" }, Bt = ["disabled"], Lt = ["disabled
|
|
|
677
677
|
[e.queryParams?.order]: k.value?.direction,
|
|
678
678
|
[e.queryParams?.page]: $.value,
|
|
679
679
|
[e.queryParams?.perPage]: re.value
|
|
680
|
-
}),
|
|
680
|
+
}), Se = () => {
|
|
681
681
|
p.value && (p.value.abort(), p.value = null);
|
|
682
682
|
}, et = (t, l) => {
|
|
683
|
-
|
|
683
|
+
Se(), I.value++;
|
|
684
684
|
const n = I.value, v = new AbortController();
|
|
685
685
|
return l.signal = v.signal, p.value = v, (e.httpMethod.toLowerCase() === "get" ? Ue.get(t, l) : (() => {
|
|
686
|
-
const
|
|
687
|
-
return delete l.params, Ue.post(t,
|
|
686
|
+
const S = l.params;
|
|
687
|
+
return delete l.params, Ue.post(t, S, l);
|
|
688
688
|
})()).then(
|
|
689
|
-
(
|
|
690
|
-
(
|
|
691
|
-
throw
|
|
689
|
+
(S) => ({ ...S, _requestId: n, _apiUrl: t }),
|
|
690
|
+
(S) => {
|
|
691
|
+
throw S.name === "AbortError" || S.code === "ERR_CANCELED" ? { ...S, _requestId: n, _cancelled: !0 } : { ...S, _requestId: n };
|
|
692
692
|
}
|
|
693
693
|
);
|
|
694
|
-
},
|
|
694
|
+
}, xe = (t) => {
|
|
695
695
|
if (t._requestId && t._requestId !== I.value || t._apiUrl && t._apiUrl !== e.apiUrl)
|
|
696
696
|
return;
|
|
697
697
|
F("dsg-table:load-success", t);
|
|
@@ -714,8 +714,8 @@ You can explicitly suppress this warning by setting pagination-path="".`
|
|
|
714
714
|
ge(t), R.value = !1;
|
|
715
715
|
} else
|
|
716
716
|
ge(e.data), R.value = !1;
|
|
717
|
-
}, te = (t =
|
|
718
|
-
const v = t ||
|
|
717
|
+
}, te = (t = xe, l = $e, n = {}) => {
|
|
718
|
+
const v = t || xe, c = l || $e;
|
|
719
719
|
if (!e.apiMode) {
|
|
720
720
|
Te();
|
|
721
721
|
return;
|
|
@@ -723,7 +723,7 @@ You can explicitly suppress this warning by setting pagination-path="".`
|
|
|
723
723
|
return R.value = !0, F("dsg-table:loading", R.value), e.httpOptions.params = {
|
|
724
724
|
..._e(),
|
|
725
725
|
...se.value
|
|
726
|
-
}, et(e.apiUrl, e.httpOptions).then(v).catch((
|
|
726
|
+
}, et(e.apiUrl, e.httpOptions).then(v).catch((S) => c(S));
|
|
727
727
|
}, tt = (t, l, n) => {
|
|
728
728
|
F("dsg-table:row-clicked", t, l, n);
|
|
729
729
|
}, at = (t, l, n) => {
|
|
@@ -755,7 +755,7 @@ You can explicitly suppress this warning by setting pagination-path="".`
|
|
|
755
755
|
e.selectable && (document.removeEventListener("keydown", Re), document.removeEventListener("keyup", Me), window.removeEventListener("blur", Ee));
|
|
756
756
|
});
|
|
757
757
|
const Be = () => {
|
|
758
|
-
e.apiMode && (M.value = [],
|
|
758
|
+
e.apiMode && (M.value = [], Se(), te());
|
|
759
759
|
};
|
|
760
760
|
return B({
|
|
761
761
|
changePage: Ze,
|
|
@@ -811,7 +811,7 @@ You can explicitly suppress this warning by setting pagination-path="".`
|
|
|
811
811
|
], 64))), 256)),
|
|
812
812
|
!_.value && w.value ? (s(), d("col", {
|
|
813
813
|
key: 2,
|
|
814
|
-
style: N({ width:
|
|
814
|
+
style: N({ width: x.value }),
|
|
815
815
|
class: "dsg-table-component__col-gutter"
|
|
816
816
|
}, null, 4)) : m("", !0)
|
|
817
817
|
], 8, aa),
|
|
@@ -900,7 +900,7 @@ You can explicitly suppress this warning by setting pagination-path="".`
|
|
|
900
900
|
})
|
|
901
901
|
], 10, da)
|
|
902
902
|
], 4)) : m("", !0),
|
|
903
|
-
(s(!0), d(q, null, Y(f.value, (c,
|
|
903
|
+
(s(!0), d(q, null, Y(f.value, (c, S) => (s(), d(q, { key: S }, [
|
|
904
904
|
c.visible ? (s(), d("td", {
|
|
905
905
|
key: 0,
|
|
906
906
|
class: L(["dsg-table-component__cell", c.dataClass]),
|
|
@@ -971,11 +971,11 @@ You can explicitly suppress this warning by setting pagination-path="".`
|
|
|
971
971
|
key: 1,
|
|
972
972
|
class: "dsg-table__search-header",
|
|
973
973
|
ref: "dsgTableSearchHeaderEl"
|
|
974
|
-
}, Ca = { class: "dsg-table__search-top" },
|
|
974
|
+
}, Ca = { class: "dsg-table__search-top" }, Da = {
|
|
975
975
|
key: 2,
|
|
976
976
|
class: "dsg-table__footer",
|
|
977
977
|
ref: "dsgTableFooterEl"
|
|
978
|
-
},
|
|
978
|
+
}, Sa = { class: "dsg-table__footer-left" }, xa = { class: "dsg-table__footer-center" }, $a = { class: "dsg-table__footer-right" }, Ta = /* @__PURE__ */ Z({
|
|
979
979
|
__name: "DsgTable",
|
|
980
980
|
props: {
|
|
981
981
|
getUrl: {},
|
|
@@ -1027,11 +1027,11 @@ You can explicitly suppress this warning by setting pagination-path="".`
|
|
|
1027
1027
|
setup(e, { expose: B, emit: h }) {
|
|
1028
1028
|
const u = (o) => {
|
|
1029
1029
|
R.value = o;
|
|
1030
|
-
},
|
|
1031
|
-
if (
|
|
1030
|
+
}, D = P(e.apiMode && !!(e.filterEntity || e.filterEndpoint || e.getUrl)), H = () => {
|
|
1031
|
+
if (D.value) {
|
|
1032
1032
|
let o = {};
|
|
1033
1033
|
return Oe().forEach((i) => {
|
|
1034
|
-
const r =
|
|
1034
|
+
const r = xt(i.key);
|
|
1035
1035
|
if (!r)
|
|
1036
1036
|
return;
|
|
1037
1037
|
const b = o[`filter[${r}]`], y = i.value.join(",");
|
|
@@ -1042,7 +1042,7 @@ You can explicitly suppress this warning by setting pagination-path="".`
|
|
|
1042
1042
|
}, f = W(() => ({
|
|
1043
1043
|
...e.css,
|
|
1044
1044
|
tableWrapper: "border-b " + (e.css?.tableWrapper || "")
|
|
1045
|
-
})), g = wt(), A = P(!0), $ = P(null),
|
|
1045
|
+
})), g = wt(), A = P(!0), $ = P(null), x = P("<p>Showing {from} to {to} of {total}</p>"), w = P(null), a = We("dsgTable"), T = P({ perPage: e.perPage, change: u }), R = P(e.perPage), k = P({ ...H(), ...e.initialFilters }), p = h, I = (o) => {
|
|
1046
1046
|
a.value?.changePage(o);
|
|
1047
1047
|
}, se = (o) => {
|
|
1048
1048
|
w.value = o;
|
|
@@ -1179,7 +1179,7 @@ You can explicitly suppress this warning by setting pagination-path="".`
|
|
|
1179
1179
|
css: f.value,
|
|
1180
1180
|
data: e.data,
|
|
1181
1181
|
"row-class": e.rowClass,
|
|
1182
|
-
"api-mode":
|
|
1182
|
+
"api-mode": D.value,
|
|
1183
1183
|
"replace-state": e.replaceState,
|
|
1184
1184
|
"replace-strategy": e.replaceStrategy,
|
|
1185
1185
|
"has-detail-row": e.hasDetailRow,
|
|
@@ -1221,8 +1221,8 @@ You can explicitly suppress this warning by setting pagination-path="".`
|
|
|
1221
1221
|
])
|
|
1222
1222
|
}))
|
|
1223
1223
|
]), 1032, ["api-url", "filter-params", "per-page", "fields", "load-on-start", "pagination-path", "selectable", "selectable-column-width", "expandable-column-width", "shift-select-highlight", "selected-row-highlight", "track-by", "table-layout", "css", "data", "row-class", "api-mode", "replace-state", "replace-strategy", "has-detail-row", "expandable-rows", "expand-multiple", "show-expand-detail", "detail-row-transition", "detail-row-options"]),
|
|
1224
|
-
e.hasFooter ? (s(), d("div",
|
|
1225
|
-
C("div",
|
|
1224
|
+
e.hasFooter ? (s(), d("div", Da, [
|
|
1225
|
+
C("div", Sa, [
|
|
1226
1226
|
E(o.$slots, "dsg-table--footer-left", {
|
|
1227
1227
|
data: w.value,
|
|
1228
1228
|
perPage: T.value
|
|
@@ -1232,7 +1232,7 @@ You can explicitly suppress this warning by setting pagination-path="".`
|
|
|
1232
1232
|
ref: "paginationInfoStart",
|
|
1233
1233
|
pagination: w.value,
|
|
1234
1234
|
"onUpdate:pagination": i[18] || (i[18] = (r) => w.value = r),
|
|
1235
|
-
"info-template":
|
|
1235
|
+
"info-template": x.value
|
|
1236
1236
|
}, null, 8, ["pagination", "info-template"])) : m("", !0),
|
|
1237
1237
|
E(o.$slots, "dsg-table--footer-left-extras", {
|
|
1238
1238
|
data: w.value,
|
|
@@ -1240,7 +1240,7 @@ You can explicitly suppress this warning by setting pagination-path="".`
|
|
|
1240
1240
|
})
|
|
1241
1241
|
])
|
|
1242
1242
|
]),
|
|
1243
|
-
C("div",
|
|
1243
|
+
C("div", xa, [
|
|
1244
1244
|
E(o.$slots, "dsg-table--footer-center", {
|
|
1245
1245
|
data: w.value,
|
|
1246
1246
|
perPage: T.value
|
|
@@ -1256,7 +1256,7 @@ You can explicitly suppress this warning by setting pagination-path="".`
|
|
|
1256
1256
|
data: w.value,
|
|
1257
1257
|
perPage: T.value
|
|
1258
1258
|
}, () => [
|
|
1259
|
-
A.value === !1 && e.displayPaginationInfo ? (s(), K(Ke,
|
|
1259
|
+
A.value === !1 && e.displayPaginationInfo ? (s(), K(Ke, De({
|
|
1260
1260
|
key: 0,
|
|
1261
1261
|
ref: "pagination",
|
|
1262
1262
|
pagination: w.value,
|
|
@@ -1285,10 +1285,10 @@ You can explicitly suppress this warning by setting pagination-path="".`
|
|
|
1285
1285
|
perPage: {}
|
|
1286
1286
|
},
|
|
1287
1287
|
setup(e) {
|
|
1288
|
-
const B = (u) => e.perPageOptions.find((
|
|
1288
|
+
const B = (u) => e.perPageOptions.find((D) => D.label === u), h = (u) => {
|
|
1289
1289
|
e.perPage.perPage = u.label, e.perPage.change(u.label);
|
|
1290
1290
|
};
|
|
1291
|
-
return (u,
|
|
1291
|
+
return (u, D) => (s(), d("div", Ra, [
|
|
1292
1292
|
V($t, {
|
|
1293
1293
|
modelValue: B(e.perPage.perPage),
|
|
1294
1294
|
"onUpdate:modelValue": h,
|