@dcodegroup-au/dsg-vue 0.1.6 → 0.1.9
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-DEG12JOR.cjs → DsgTablePerPage.vue_vue_type_style_index_0_lang-Bvq72aow.cjs} +7 -7
- package/dist/{DsgTablePerPage.vue_vue_type_style_index_0_lang-Dj3jH6bn.js → DsgTablePerPage.vue_vue_type_style_index_0_lang-DdAom65o.js} +958 -953
- package/dist/components/Elements/DsgButton.vue.d.ts +4 -4
- package/dist/components/Elements/DsgCheckbox.vue.d.ts +2 -2
- package/dist/components/Elements/DsgDropdown.vue.d.ts +4 -4
- package/dist/components/Elements/DsgIconSelect.vue.d.ts +64 -0
- package/dist/components/Elements/DsgInputSelect.vue.d.ts +2 -2
- package/dist/components/Elements/ElementComponents.d.ts +2 -1
- package/dist/components/Table/DsgTable.vue.d.ts +7 -2
- package/dist/components/Table/DsgTableComponent.vue.d.ts +1 -0
- package/dist/dsg-vue.cjs +11 -11
- package/dist/dsg-vue.css +1 -1
- package/dist/dsg-vue.esm.js +4654 -4474
- package/dist/dsg-vue.table.cjs +2 -2
- package/dist/dsg-vue.table.esm.js +122 -116
- package/dist/main.d.ts +92 -22
- package/dist/table.d.ts +12 -2
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { defineComponent as W, mergeModels as G, useModel as Y, computed as V, withDirectives as
|
|
2
|
-
import { _ as O, k as Ue, v as qe, f as Ne, u as We, c as fe, e as ve, i as pe, j as je } from "./DsgTablePerPage.vue_vue_type_style_index_0_lang-
|
|
1
|
+
import { defineComponent as W, mergeModels as G, useModel as Y, computed as V, withDirectives as de, createElementBlock as o, openBlock as l, createCommentVNode as P, createElementVNode as k, normalizeClass as E, createVNode as R, Fragment as H, renderList as q, vShow as Le, ref as w, useTemplateRef as be, useAttrs as Be, unref as U, withCtx as Z, renderSlot as L, toDisplayString as x, createBlock as N, resolveDynamicComponent as Me, normalizeStyle as J, watch as te, onMounted as Ee, Transition as Re, createTextVNode as He, useSlots as Ae, createSlots as Ie, normalizeProps as ze, mergeProps as Ve, vModelSelect as Oe } from "vue";
|
|
2
|
+
import { _ as O, k as Ue, v as qe, f as Ne, u as We, c as fe, e as ve, i as pe, j as je } from "./DsgTablePerPage.vue_vue_type_style_index_0_lang-DdAom65o.js";
|
|
3
3
|
import { ucfirst as Ke, ucwords as Qe, toSnakeCase as Ye } from "./dsg-vue.helpers-string.esm.js";
|
|
4
|
-
import { data_get as
|
|
4
|
+
import { data_get as re } from "./dsg-vue.helpers-object.esm.js";
|
|
5
5
|
const Ge = { class: "dsg-table--pagination" }, Je = ["disabled"], Xe = ["disabled"], Ze = ["onClick", "innerHTML"], xe = ["onClick", "innerHTML"], _e = ["disabled"], et = ["disabled"], he = /* @__PURE__ */ W({
|
|
6
6
|
__name: "DsgTablePagination",
|
|
7
7
|
props: /* @__PURE__ */ G({
|
|
@@ -23,10 +23,10 @@ const Ge = { class: "dsg-table--pagination" }, Je = ["disabled"], Xe = ["disable
|
|
|
23
23
|
}, r = (v) => v === d.value?.current_page;
|
|
24
24
|
return $({
|
|
25
25
|
loadPage: s
|
|
26
|
-
}), (v,
|
|
26
|
+
}), (v, S) => de((l(), o("div", Ge, [
|
|
27
27
|
v.showFirstLast ? (l(), o("a", {
|
|
28
28
|
key: 0,
|
|
29
|
-
onClick:
|
|
29
|
+
onClick: S[0] || (S[0] = (C) => s(v.firstPage)),
|
|
30
30
|
class: E([[m.value ? "disabled" : ""], "dsg-table--pagination-link"]),
|
|
31
31
|
disabled: m.value,
|
|
32
32
|
title: "First",
|
|
@@ -38,7 +38,7 @@ const Ge = { class: "dsg-table--pagination" }, Je = ["disabled"], Xe = ["disable
|
|
|
38
38
|
}, null, 8, ["icon"])
|
|
39
39
|
], 10, Je)) : P("", !0),
|
|
40
40
|
k("a", {
|
|
41
|
-
onClick:
|
|
41
|
+
onClick: S[1] || (S[1] = (C) => s("prev")),
|
|
42
42
|
class: E([[m.value ? "disabled" : ""], "dsg-table--pagination-link"]),
|
|
43
43
|
disabled: m.value,
|
|
44
44
|
title: "Previous",
|
|
@@ -61,7 +61,7 @@ const Ge = { class: "dsg-table--pagination" }, Je = ["disabled"], Xe = ["disable
|
|
|
61
61
|
innerHTML: h.value + C - 1
|
|
62
62
|
}, null, 10, xe))), 128)),
|
|
63
63
|
k("a", {
|
|
64
|
-
onClick:
|
|
64
|
+
onClick: S[2] || (S[2] = (C) => s("next")),
|
|
65
65
|
class: E([[y.value ? "disabled" : ""], "dsg-table--pagination-link"]),
|
|
66
66
|
disabled: y.value,
|
|
67
67
|
title: "Next",
|
|
@@ -74,7 +74,7 @@ const Ge = { class: "dsg-table--pagination" }, Je = ["disabled"], Xe = ["disable
|
|
|
74
74
|
], 10, _e),
|
|
75
75
|
v.showFirstLast ? (l(), o("a", {
|
|
76
76
|
key: 3,
|
|
77
|
-
onClick:
|
|
77
|
+
onClick: S[3] || (S[3] = (C) => s(c.value)),
|
|
78
78
|
class: E([[y.value ? "disabled" : ""], "dsg-table--pagination-link"]),
|
|
79
79
|
disabled: y.value,
|
|
80
80
|
title: "Last",
|
|
@@ -86,7 +86,7 @@ const Ge = { class: "dsg-table--pagination" }, Je = ["disabled"], Xe = ["disable
|
|
|
86
86
|
}, null, 8, ["icon"])
|
|
87
87
|
], 10, et)) : P("", !0)
|
|
88
88
|
], 512)), [
|
|
89
|
-
[
|
|
89
|
+
[Le, d.value && c.value > v.firstPage]
|
|
90
90
|
]);
|
|
91
91
|
}
|
|
92
92
|
}), tt = ["innerHTML"], me = /* @__PURE__ */ W({
|
|
@@ -121,7 +121,7 @@ const Ge = { class: "dsg-table--pagination" }, Je = ["disabled"], Xe = ["disable
|
|
|
121
121
|
setup(t, { emit: $ }) {
|
|
122
122
|
const b = w(!1);
|
|
123
123
|
be("dsgTableActions");
|
|
124
|
-
const d =
|
|
124
|
+
const d = Be(), p = w(d.data.rowData?.actions ?? null), c = w(d.data.rowData?.links ?? null), m = w(d.data.rowData ?? null), y = (f) => {
|
|
125
125
|
switch (f) {
|
|
126
126
|
case "edit":
|
|
127
127
|
return "edit-05";
|
|
@@ -153,7 +153,7 @@ const Ge = { class: "dsg-table--pagination" }, Je = ["disabled"], Xe = ["disable
|
|
|
153
153
|
const r = f.actionId || f.label.trim().toLowerCase().replace(/[^a-z0-9-]/g, "-").replace(/-+/g, "-");
|
|
154
154
|
h("dsg-table:link-clicked", s, r, m.value);
|
|
155
155
|
}, h = $;
|
|
156
|
-
return (f, s) =>
|
|
156
|
+
return (f, s) => de((l(), o("div", at, [
|
|
157
157
|
R(U(Ue), {
|
|
158
158
|
triggers: [],
|
|
159
159
|
placement: f.placement,
|
|
@@ -171,7 +171,7 @@ const Ge = { class: "dsg-table--pagination" }, Je = ["disabled"], Xe = ["disable
|
|
|
171
171
|
key: v,
|
|
172
172
|
href: p.value?.link,
|
|
173
173
|
target: p.value?.target || "_self",
|
|
174
|
-
onClick: (
|
|
174
|
+
onClick: (S) => z(r, String(v), S)
|
|
175
175
|
}, [
|
|
176
176
|
k("div", {
|
|
177
177
|
class: E(["dsg-table--actions-menu-item", String(v)])
|
|
@@ -191,7 +191,7 @@ const Ge = { class: "dsg-table--pagination" }, Je = ["disabled"], Xe = ["disable
|
|
|
191
191
|
c.value ? (l(!0), o(H, { key: 1 }, q(c.value, (r) => (l(), o(H, {
|
|
192
192
|
key: r.label
|
|
193
193
|
}, [
|
|
194
|
-
r.hasOwnProperty("component") ? (l(), N(
|
|
194
|
+
r.hasOwnProperty("component") ? (l(), N(Me(r.component), {
|
|
195
195
|
key: 0,
|
|
196
196
|
quote: U(d).data.data.rowData,
|
|
197
197
|
"row-data": U(d).data.data.rowData
|
|
@@ -221,7 +221,7 @@ const Ge = { class: "dsg-table--pagination" }, Je = ["disabled"], Xe = ["disable
|
|
|
221
221
|
"aria-haspopup": "true",
|
|
222
222
|
onClick: s[0] || (s[0] = (r) => b.value = !b.value)
|
|
223
223
|
}, [
|
|
224
|
-
|
|
224
|
+
L(f.$slots, "dsg-table-action-button-content", {}, () => [
|
|
225
225
|
R(O, {
|
|
226
226
|
icon: "dots-vertical",
|
|
227
227
|
size: "sm"
|
|
@@ -386,7 +386,7 @@ const Ge = { class: "dsg-table--pagination" }, Je = ["disabled"], Xe = ["disable
|
|
|
386
386
|
}, Pt = ["colspan"], Dt = ["colspan"], $t = ["onClick", "onDblclick", "onMouseover"], Ct = {
|
|
387
387
|
key: 0,
|
|
388
388
|
class: "dsg-table--tbody-cell dsg-table--tbody-cell-checkbox"
|
|
389
|
-
}, Tt = ["onClick", "onDblclick", "onContextmenu"], St = ["innerHTML"], Ft = ["onClick"],
|
|
389
|
+
}, Tt = ["onClick", "onDblclick", "onContextmenu"], St = ["innerHTML"], Ft = ["onClick"], Lt = ["colspan"], Bt = { key: 2 }, Mt = ["colspan"], Et = { class: "dsg-table--footer" }, Rt = /* @__PURE__ */ W({
|
|
390
390
|
__name: "DsgTableComponent",
|
|
391
391
|
props: /* @__PURE__ */ G({
|
|
392
392
|
fields: { default: () => [] },
|
|
@@ -458,32 +458,32 @@ const Ge = { class: "dsg-table--pagination" }, Je = ["disabled"], Xe = ["disable
|
|
|
458
458
|
sortable: n.sortField,
|
|
459
459
|
formatter: n.formatter || null,
|
|
460
460
|
$_index: u
|
|
461
|
-
})), p = w(d(t.fields)), c = w(t.data), m = w(null), y = w(t.initialPage), z = w("17px"), A = w(!1), h = w({}), f = w(0), s = w(!0), r = w(null), v = w(null),
|
|
462
|
-
|
|
461
|
+
})), p = w(d(t.fields)), c = w(t.data), m = w(null), y = w(t.initialPage), z = w("17px"), A = w(!1), h = w({}), f = w(0), s = w(!0), r = w(null), v = w(null), S = Y(t, "filterParams"), C = Y(t, "perPage"), T = w([]), j = w(!1), K = V(() => t.tableHeight != null), Q = V(() => p.value.filter((e) => e.visible).length);
|
|
462
|
+
te(
|
|
463
463
|
() => T.value.length,
|
|
464
464
|
(e) => {
|
|
465
465
|
j.value = t.selectable && e > 0;
|
|
466
466
|
},
|
|
467
467
|
{ immediate: !0 }
|
|
468
|
-
),
|
|
468
|
+
), te(
|
|
469
469
|
() => t.fields,
|
|
470
470
|
(e) => {
|
|
471
471
|
p.value = d(e);
|
|
472
472
|
},
|
|
473
473
|
{ immediate: !0 }
|
|
474
|
-
),
|
|
475
|
-
() =>
|
|
474
|
+
), te(
|
|
475
|
+
() => S.value,
|
|
476
476
|
() => {
|
|
477
477
|
X();
|
|
478
478
|
},
|
|
479
479
|
{ deep: !0 }
|
|
480
|
-
),
|
|
480
|
+
), te(
|
|
481
481
|
() => C.value,
|
|
482
482
|
() => {
|
|
483
483
|
X();
|
|
484
484
|
}
|
|
485
485
|
);
|
|
486
|
-
const I = b,
|
|
486
|
+
const I = b, ae = (e, n) => e.formatter && typeof e.formatter == "function" ? e.formatter(e, n) : re(n, String(e?.name), ""), le = (e) => "dsg-field--" + e.name?.toLowerCase().replaceAll(/[_ ]/g, "-"), se = (e) => {
|
|
487
487
|
if (t.selectable) {
|
|
488
488
|
if (e.selected)
|
|
489
489
|
T.value.push(e);
|
|
@@ -493,75 +493,78 @@ const Ge = { class: "dsg-table--pagination" }, Je = ["disabled"], Xe = ["disable
|
|
|
493
493
|
}
|
|
494
494
|
I("dsg-table:rows-selected", T.value);
|
|
495
495
|
}
|
|
496
|
-
},
|
|
496
|
+
}, ne = () => {
|
|
497
497
|
t.selectable && (c.value?.forEach((e) => {
|
|
498
498
|
e.selected = !0;
|
|
499
499
|
}), T.value = c.value?.filter((e) => e.selected) ?? [], I("dsg-table:rows-selected", T.value));
|
|
500
|
-
},
|
|
500
|
+
}, _ = () => {
|
|
501
501
|
t.selectable && (c.value?.forEach((e) => {
|
|
502
502
|
e.selected = !1;
|
|
503
503
|
}), T.value = [], I("dsg-table:rows-selected", T.value));
|
|
504
|
-
},
|
|
504
|
+
}, oe = (e) => {
|
|
505
505
|
c.value = Array.isArray(e) ? e : [], t.selectable && c.value.forEach((n) => {
|
|
506
506
|
n.selected = n.selected ?? !1;
|
|
507
507
|
});
|
|
508
|
-
},
|
|
508
|
+
}, a = () => c.value ?? [], i = (e) => {
|
|
509
509
|
e === "prev" ? y.value > t.firstPage && y.value-- : e === "next" ? y.value < (m.value?.last_page ?? 0) && y.value++ : e != y.value && e >= t.firstPage && e <= (m.value?.last_page ?? 0) && (y.value = e), X();
|
|
510
|
-
},
|
|
510
|
+
}, g = () => ({
|
|
511
511
|
[t.queryParams?.sort]: r.value ? (r.value?.direction === "desc" ? "-" : "") + r.value?.field : void 0,
|
|
512
512
|
[t.queryParams?.order]: r.value?.direction,
|
|
513
513
|
[t.queryParams?.page]: y.value,
|
|
514
514
|
[t.queryParams?.perPage]: C.value
|
|
515
|
-
}),
|
|
515
|
+
}), D = () => {
|
|
516
516
|
v.value && (v.value.abort(), v.value = null);
|
|
517
|
-
},
|
|
518
|
-
|
|
517
|
+
}, F = async (e, n) => {
|
|
518
|
+
D();
|
|
519
519
|
const u = new AbortController();
|
|
520
520
|
if (n.signal = u.signal, v.value = u, t.httpMethod.toLowerCase() === "get")
|
|
521
521
|
return await ve.get(e, n);
|
|
522
522
|
{
|
|
523
|
-
const
|
|
524
|
-
return delete n.params, await ve.post(e,
|
|
523
|
+
const M = n.params;
|
|
524
|
+
return delete n.params, await ve.post(e, M, n);
|
|
525
525
|
}
|
|
526
|
-
},
|
|
526
|
+
}, ee = (e) => {
|
|
527
527
|
I("dsg-table:load-success", e);
|
|
528
528
|
const n = t.transform ? t.transform(e.data) : e.data;
|
|
529
|
-
c.value =
|
|
529
|
+
c.value = re(n, t.dataPath, null), t.selectable && c.value?.forEach((u) => {
|
|
530
530
|
u.selected = u.selected ?? !1;
|
|
531
|
-
}), m.value =
|
|
531
|
+
}), m.value = re(n, t.paginationPath, null) ?? null, f.value = c.value?.length ? c.value[0].order : f, m.value === null && console.warn(
|
|
532
532
|
'DsgTable: pagination-path "' + t.paginationPath + `" not found. It looks like the data returned from the server does not have pagination information or you may have set it incorrectly.
|
|
533
533
|
You can explicitly suppress this warning by setting pagination-path="".`
|
|
534
534
|
), I("dsg-table:pagination-data", m.value), y.value > (m.value?.to || 0) && (y.value = t.initialPage), I("dsg-table:loaded"), s.value = !1;
|
|
535
535
|
}, ue = (e) => {
|
|
536
536
|
console.error("load-error", e), I("dsg-table:load-error", e), I("dsg-table:loaded"), s.value = !1;
|
|
537
|
-
}, X = (e =
|
|
538
|
-
const
|
|
537
|
+
}, X = (e = ee, n = ue, u = {}) => {
|
|
538
|
+
const M = e || ee, B = n || ue;
|
|
539
539
|
if (t.apiMode)
|
|
540
540
|
return s.value = !0, I("dsg-table:loading", s.value), t.httpOptions.params = {
|
|
541
|
-
...
|
|
542
|
-
...
|
|
543
|
-
},
|
|
541
|
+
...g(),
|
|
542
|
+
...S.value
|
|
543
|
+
}, F(t.apiUrl, t.httpOptions).then(M).catch((ie) => B(ie));
|
|
544
544
|
}, Pe = (e, n, u) => {
|
|
545
545
|
I("dsg-table:row-clicked", e, n, u);
|
|
546
546
|
}, De = (e, n, u) => {
|
|
547
547
|
I("dsg-table:row-dblclick", e, n, u);
|
|
548
548
|
}, $e = (e, n, u) => {
|
|
549
|
-
}, Ce = (e, n, u,
|
|
550
|
-
}, Te = (e, n, u,
|
|
551
|
-
}, Se = (e, n, u,
|
|
549
|
+
}, Ce = (e, n, u, M) => {
|
|
550
|
+
}, Te = (e, n, u, M) => {
|
|
551
|
+
}, Se = (e, n, u, M) => {
|
|
552
552
|
}, Fe = (e, n, u) => {
|
|
553
553
|
};
|
|
554
554
|
Ee(() => {
|
|
555
555
|
t.apiMode === !0 && X();
|
|
556
556
|
});
|
|
557
557
|
const ce = () => {
|
|
558
|
-
t.apiMode && (T.value = [],
|
|
558
|
+
t.apiMode && (T.value = [], D(), X());
|
|
559
559
|
};
|
|
560
560
|
return $({
|
|
561
|
-
changePage:
|
|
561
|
+
changePage: i,
|
|
562
562
|
reload: ce,
|
|
563
|
-
getData:
|
|
564
|
-
setData:
|
|
563
|
+
getData: a,
|
|
564
|
+
setData: oe,
|
|
565
|
+
setLoading: (e) => {
|
|
566
|
+
s.value = e, I("dsg-table:loading", s.value);
|
|
567
|
+
}
|
|
565
568
|
}), (e, n) => (l(), o("div", yt, [
|
|
566
569
|
k("div", {
|
|
567
570
|
ref: "dsgTableBodyWrapper",
|
|
@@ -572,9 +575,9 @@ You can explicitly suppress this warning by setting pagination-path="".`
|
|
|
572
575
|
class: E(["dsg-table-main", K.value ? "fixed-header" : "", h.value.table, "table-" + e.tableLayout])
|
|
573
576
|
}, [
|
|
574
577
|
k("colgroup", { span: Q.value }, [
|
|
575
|
-
(l(!0), o(H, null, q(p.value, (u,
|
|
578
|
+
(l(!0), o(H, null, q(p.value, (u, M) => (l(), o(H, null, [
|
|
576
579
|
u?.visible ? (l(), o("col", {
|
|
577
|
-
key:
|
|
580
|
+
key: M,
|
|
578
581
|
style: J({ width: u.width || void 0 }),
|
|
579
582
|
class: E("dsg-table--col-" + u.name + " " + u.titleClass)
|
|
580
583
|
}, null, 6)) : P("", !0)
|
|
@@ -588,7 +591,7 @@ You can explicitly suppress this warning by setting pagination-path="".`
|
|
|
588
591
|
k("thead", {
|
|
589
592
|
class: E([[h.value.thead, { sticky: K.value, "top-0": K.value }], "dsg-table--head"])
|
|
590
593
|
}, [
|
|
591
|
-
|
|
594
|
+
L(e.$slots, "tableHeader", { fields: p.value }, () => [
|
|
592
595
|
R(we, {
|
|
593
596
|
fields: p.value,
|
|
594
597
|
"has-select-all": e.selectable,
|
|
@@ -602,8 +605,8 @@ You can explicitly suppress this warning by setting pagination-path="".`
|
|
|
602
605
|
"sort-field": r.value,
|
|
603
606
|
"onUpdate:sortField": n[2] || (n[2] = (u) => r.value = u),
|
|
604
607
|
"onDsgTable:sortField": n[3] || (n[3] = (u) => ce()),
|
|
605
|
-
"onDsgTable:onSelectAll":
|
|
606
|
-
"onDsgTable:onDeselectAll":
|
|
608
|
+
"onDsgTable:onSelectAll": ne,
|
|
609
|
+
"onDsgTable:onDeselectAll": _
|
|
607
610
|
}, null, 8, ["fields", "has-select-all", "selected-rows", "has-selected", "scroll-visible", "show-expand-detail", "table-data-length", "sort-field"])
|
|
608
611
|
])
|
|
609
612
|
], 2),
|
|
@@ -618,7 +621,7 @@ You can explicitly suppress this warning by setting pagination-path="".`
|
|
|
618
621
|
class: "flex items-center space-x-3 h-12 w-full justify-center",
|
|
619
622
|
colspan: Q.value
|
|
620
623
|
}, [
|
|
621
|
-
|
|
624
|
+
L(e.$slots, "dsg-table-loading", {}, () => [
|
|
622
625
|
R(O, {
|
|
623
626
|
icon: "loading-02",
|
|
624
627
|
class: "animate-spin"
|
|
@@ -627,35 +630,35 @@ You can explicitly suppress this warning by setting pagination-path="".`
|
|
|
627
630
|
])
|
|
628
631
|
], 8, Dt)
|
|
629
632
|
], 8, Pt)
|
|
630
|
-
])) : (l(!0), o(H, { key: 1 }, q(c.value, (u,
|
|
633
|
+
])) : (l(!0), o(H, { key: 1 }, q(c.value, (u, M) => (l(), o(H, { key: M }, [
|
|
631
634
|
k("tr", {
|
|
632
|
-
class: E(["dsg-table--tbody-row", { odd:
|
|
633
|
-
onClick: (
|
|
634
|
-
onDblclick: (
|
|
635
|
-
onMouseover: (
|
|
635
|
+
class: E(["dsg-table--tbody-row", { odd: M % 2 === 0, even: M % 2 !== 0, "row-selected": u.selected }]),
|
|
636
|
+
onClick: (B) => Pe(B, M, u),
|
|
637
|
+
onDblclick: (B) => De(B, M, u),
|
|
638
|
+
onMouseover: (B) => $e()
|
|
636
639
|
}, [
|
|
637
640
|
e.selectable ? (l(), o("td", Ct, [
|
|
638
641
|
R(fe, {
|
|
639
642
|
modelValue: u.selected,
|
|
640
|
-
"onUpdate:modelValue": [(
|
|
643
|
+
"onUpdate:modelValue": [(B) => u.selected = B, (B) => se(u)]
|
|
641
644
|
}, null, 8, ["modelValue", "onUpdate:modelValue"])
|
|
642
645
|
])) : P("", !0),
|
|
643
|
-
(l(!0), o(H, null, q(p.value, (
|
|
644
|
-
|
|
646
|
+
(l(!0), o(H, null, q(p.value, (B, ie) => (l(), o(H, { key: ie }, [
|
|
647
|
+
B.visible ? (l(), o("td", {
|
|
645
648
|
key: 0,
|
|
646
|
-
class: E(["dsg-table--tbody-cell",
|
|
647
|
-
style: J({ width:
|
|
649
|
+
class: E(["dsg-table--tbody-cell", B.dataClass]),
|
|
650
|
+
style: J({ width: B.width || void 0 }),
|
|
648
651
|
onClick: (ge) => Ce(),
|
|
649
652
|
onDblclick: (ge) => Te(),
|
|
650
653
|
onContextmenu: (ge) => Se()
|
|
651
654
|
}, [
|
|
652
|
-
|
|
655
|
+
L(e.$slots, le(B), {
|
|
653
656
|
rowData: u,
|
|
654
|
-
rowIndex:
|
|
655
|
-
rowField:
|
|
657
|
+
rowIndex: M,
|
|
658
|
+
rowField: B
|
|
656
659
|
}, () => [
|
|
657
660
|
k("span", {
|
|
658
|
-
innerHTML:
|
|
661
|
+
innerHTML: ae(B, u)
|
|
659
662
|
}, null, 8, St)
|
|
660
663
|
])
|
|
661
664
|
], 46, Tt)) : P("", !0)
|
|
@@ -668,33 +671,33 @@ You can explicitly suppress this warning by setting pagination-path="".`
|
|
|
668
671
|
default: Z(() => [
|
|
669
672
|
k("tr", {
|
|
670
673
|
class: "dsg-table--tbody-detail-row",
|
|
671
|
-
onClick: (
|
|
674
|
+
onClick: (B) => Fe()
|
|
672
675
|
}, [
|
|
673
676
|
k("td", { colspan: Q.value }, [
|
|
674
|
-
|
|
677
|
+
L(e.$slots, "dsg-table-detail-row", {
|
|
675
678
|
rowData: u,
|
|
676
|
-
rowIndex:
|
|
679
|
+
rowIndex: M,
|
|
677
680
|
options: e.detailRowOptions
|
|
678
681
|
})
|
|
679
|
-
], 8,
|
|
682
|
+
], 8, Lt)
|
|
680
683
|
], 8, Ft)
|
|
681
684
|
]),
|
|
682
685
|
_: 2
|
|
683
686
|
}, 1032, ["name"])) : P("", !0)
|
|
684
687
|
], 64))), 128)),
|
|
685
|
-
!s.value && !c.value?.length && e.noDataTemplate.length ? (l(), o("tr",
|
|
688
|
+
!s.value && !c.value?.length && e.noDataTemplate.length ? (l(), o("tr", Bt, [
|
|
686
689
|
k("td", {
|
|
687
690
|
colspan: Q.value,
|
|
688
691
|
class: "dsg-table--empty-result"
|
|
689
692
|
}, [
|
|
690
|
-
|
|
693
|
+
L(e.$slots, "dsg-table-empty-result", {}, () => [
|
|
691
694
|
He(x(e.noDataTemplate), 1)
|
|
692
695
|
])
|
|
693
|
-
], 8,
|
|
696
|
+
], 8, Mt)
|
|
694
697
|
])) : P("", !0)
|
|
695
698
|
], 2),
|
|
696
699
|
k("tfoot", Et, [
|
|
697
|
-
|
|
700
|
+
L(e.$slots, "dsg-table-footer", {
|
|
698
701
|
fields: p.value,
|
|
699
702
|
data: c.value
|
|
700
703
|
})
|
|
@@ -755,7 +758,7 @@ You can explicitly suppress this warning by setting pagination-path="".`
|
|
|
755
758
|
}, m = V(() => ({
|
|
756
759
|
...t.css,
|
|
757
760
|
tableWrapper: "border-b " + (t.css?.tableWrapper || "")
|
|
758
|
-
})), y = Ae(), z = w(!0), A = w(null), h = w("<p>Showing {from} to {to} of {total}</p>"), f = w(null), s = be("dsgTable"), r = w({ perPage: 20, change: d }), v = w(20),
|
|
761
|
+
})), y = Ae(), z = w(!0), A = w(null), h = w("<p>Showing {from} to {to} of {total}</p>"), f = w(null), s = be("dsgTable"), r = w({ perPage: 20, change: d }), v = w(20), S = w({ ...c(), ...t.initialFilters }), C = b, T = (a) => {
|
|
759
762
|
s.value?.changePage(a);
|
|
760
763
|
}, j = (a) => {
|
|
761
764
|
f.value = a;
|
|
@@ -764,33 +767,36 @@ You can explicitly suppress this warning by setting pagination-path="".`
|
|
|
764
767
|
}, Q = () => {
|
|
765
768
|
z.value === !1 && s.value?.reload();
|
|
766
769
|
}, I = (a) => {
|
|
770
|
+
s.value?.setLoading(a);
|
|
771
|
+
}, ae = (a) => {
|
|
767
772
|
const i = s.value?.getData?.() ?? [];
|
|
768
773
|
s.value?.setData(i.map((g) => g.id === a.id ? a : g));
|
|
769
|
-
},
|
|
774
|
+
}, le = (a) => {
|
|
770
775
|
const i = s.value?.getData?.() ?? [];
|
|
771
776
|
s.value?.setData([...i, a]);
|
|
772
|
-
},
|
|
777
|
+
}, se = (a) => {
|
|
773
778
|
const i = s.value?.getData?.() ?? [];
|
|
774
779
|
s.value?.setData(i.filter((g) => g.id !== a.id));
|
|
775
|
-
},
|
|
776
|
-
|
|
780
|
+
}, ne = (a) => {
|
|
781
|
+
S.value = a;
|
|
777
782
|
}, _ = (a) => {
|
|
778
|
-
|
|
779
|
-
},
|
|
780
|
-
|
|
783
|
+
S.value["filter[term]"] = a, C("dsg-table:term-changed", a);
|
|
784
|
+
}, oe = (a, i, g) => {
|
|
785
|
+
S.value = { "filter[term]": S.value["filter[term]"], ...a }, C("dsg-table:filter-updated", S.value, i, g);
|
|
781
786
|
};
|
|
782
787
|
return $({
|
|
783
788
|
reloadTable: Q,
|
|
784
|
-
updateRowTable:
|
|
785
|
-
addRowTable:
|
|
786
|
-
deleteRowTable:
|
|
789
|
+
updateRowTable: ae,
|
|
790
|
+
addRowTable: le,
|
|
791
|
+
deleteRowTable: se,
|
|
787
792
|
termChanged: _,
|
|
788
|
-
setFilters:
|
|
793
|
+
setFilters: ne,
|
|
794
|
+
setLoading: I
|
|
789
795
|
}), (a, i) => (l(), o("div", Ht, [
|
|
790
796
|
a.hasHeader ? (l(), o("div", At, [
|
|
791
|
-
|
|
797
|
+
L(a.$slots, "dsg-table--pre-header", {}, () => [
|
|
792
798
|
k("div", It, [
|
|
793
|
-
|
|
799
|
+
L(a.$slots, "dsg-table--page-title", {
|
|
794
800
|
data: A.value,
|
|
795
801
|
title: a.title
|
|
796
802
|
}, () => [
|
|
@@ -802,13 +808,13 @@ You can explicitly suppress this warning by setting pagination-path="".`
|
|
|
802
808
|
])
|
|
803
809
|
]),
|
|
804
810
|
k("div", Vt, [
|
|
805
|
-
|
|
811
|
+
L(a.$slots, "dsg-table--page-actions", { data: A.value })
|
|
806
812
|
])
|
|
807
813
|
])
|
|
808
814
|
])) : P("", !0),
|
|
809
815
|
a.displayPaginationInfo ? (l(), o("div", Ot, [
|
|
810
816
|
k("div", Ut, [
|
|
811
|
-
|
|
817
|
+
L(a.$slots, "dsg-table--search-header", { data: A.value }, () => [
|
|
812
818
|
R(ke, {
|
|
813
819
|
name: "term",
|
|
814
820
|
"onDsgTable:termChanged": i[0] || (i[0] = (g) => _(g))
|
|
@@ -818,18 +824,18 @@ You can explicitly suppress this warning by setting pagination-path="".`
|
|
|
818
824
|
"filter-endpoint": a.filterEndpoint,
|
|
819
825
|
"search-endpoint": a.filterSearchEndpoint,
|
|
820
826
|
filters: a.filters,
|
|
821
|
-
"onDsgTable:filterUpdated": i[1] || (i[1] = (g, D,
|
|
827
|
+
"onDsgTable:filterUpdated": i[1] || (i[1] = (g, D, F) => oe(g, D, F))
|
|
822
828
|
}, null, 8, ["entity", "filter-endpoint", "search-endpoint", "filters"]),
|
|
823
|
-
|
|
829
|
+
L(a.$slots, "dsg-table--search-actions", { data: A.value })
|
|
824
830
|
])
|
|
825
831
|
]),
|
|
826
|
-
|
|
832
|
+
L(a.$slots, "dsg-table--search-navigation")
|
|
827
833
|
], 512)) : P("", !0),
|
|
828
834
|
R(Rt, {
|
|
829
835
|
ref: "dsgTable",
|
|
830
836
|
"api-url": a.getUrl,
|
|
831
|
-
"filter-params":
|
|
832
|
-
"onUpdate:filterParams": i[7] || (i[7] = (g) =>
|
|
837
|
+
"filter-params": S.value,
|
|
838
|
+
"onUpdate:filterParams": i[7] || (i[7] = (g) => S.value = g),
|
|
833
839
|
"per-page": v.value,
|
|
834
840
|
"onUpdate:perPage": i[8] || (i[8] = (g) => v.value = g),
|
|
835
841
|
fields: a.fields,
|
|
@@ -845,20 +851,20 @@ You can explicitly suppress this warning by setting pagination-path="".`
|
|
|
845
851
|
"onDsgTable:paginationData": j,
|
|
846
852
|
"onDsgTable:loadSuccess": K,
|
|
847
853
|
"onDsgTable:rowsSelected": i[11] || (i[11] = (g) => C("dsg-table:rows-selected", g)),
|
|
848
|
-
"onDsgTable:rowClicked": i[12] || (i[12] = (g, D,
|
|
849
|
-
"onDsgTable:rowHover": i[13] || (i[13] = (g, D,
|
|
850
|
-
"onDsgTable:rowDblclick": i[14] || (i[14] = (g, D,
|
|
854
|
+
"onDsgTable:rowClicked": i[12] || (i[12] = (g, D, F) => C("dsg-table:row-clicked", g, D, F)),
|
|
855
|
+
"onDsgTable:rowHover": i[13] || (i[13] = (g, D, F) => C("dsg-table:row-hover", g, D, F)),
|
|
856
|
+
"onDsgTable:rowDblclick": i[14] || (i[14] = (g, D, F) => C("dsg-table:row-dblclick", g, D, F))
|
|
851
857
|
}, Ie({
|
|
852
858
|
"dsg-field--actions": Z((g) => [
|
|
853
|
-
|
|
859
|
+
L(a.$slots, "dsg-table-actions", { data: g }, () => [
|
|
854
860
|
(l(), N(ye, {
|
|
855
861
|
key: g.rowIndex,
|
|
856
862
|
data: g,
|
|
857
|
-
"onDsgTable:actionEdit": i[2] || (i[2] = (D,
|
|
858
|
-
"onDsgTable:actionView": i[3] || (i[3] = (D,
|
|
859
|
-
"onDsgTable:actionDelete": i[4] || (i[4] = (D,
|
|
860
|
-
"onDsgTable:actionArchive": i[5] || (i[5] = (D,
|
|
861
|
-
"onDsgTable:linkClicked": i[6] || (i[6] = (D,
|
|
863
|
+
"onDsgTable:actionEdit": i[2] || (i[2] = (D, F) => C("dsg-table:action-edit", D, F)),
|
|
864
|
+
"onDsgTable:actionView": i[3] || (i[3] = (D, F) => C("dsg-table:action-view", D, F)),
|
|
865
|
+
"onDsgTable:actionDelete": i[4] || (i[4] = (D, F) => C("dsg-table:action-delete", D, F)),
|
|
866
|
+
"onDsgTable:actionArchive": i[5] || (i[5] = (D, F) => C("dsg-table:action-archive", D, F)),
|
|
867
|
+
"onDsgTable:linkClicked": i[6] || (i[6] = (D, F, ee) => C("dsg-table:link-clicked", D, F, ee))
|
|
862
868
|
}, null, 8, ["data"]))
|
|
863
869
|
])
|
|
864
870
|
]),
|
|
@@ -866,14 +872,14 @@ You can explicitly suppress this warning by setting pagination-path="".`
|
|
|
866
872
|
}, [
|
|
867
873
|
q(U(y), (g, D) => ({
|
|
868
874
|
name: D,
|
|
869
|
-
fn: Z((
|
|
870
|
-
String(D) !== "dsg-field--actions" ?
|
|
875
|
+
fn: Z((F) => [
|
|
876
|
+
String(D) !== "dsg-field--actions" ? L(a.$slots, D, ze(Ve({ key: 0 }, F))) : P("", !0)
|
|
871
877
|
])
|
|
872
878
|
}))
|
|
873
879
|
]), 1032, ["api-url", "filter-params", "per-page", "fields", "load-on-start", "selectable", "track-by", "table-layout", "css", "data"]),
|
|
874
880
|
a.hasFooter ? (l(), o("div", qt, [
|
|
875
881
|
k("div", Nt, [
|
|
876
|
-
|
|
882
|
+
L(a.$slots, "dsg-table--footer-left", {
|
|
877
883
|
data: f.value,
|
|
878
884
|
perPage: r.value
|
|
879
885
|
}, () => [
|
|
@@ -883,25 +889,25 @@ You can explicitly suppress this warning by setting pagination-path="".`
|
|
|
883
889
|
"onUpdate:pagination": i[15] || (i[15] = (g) => f.value = g),
|
|
884
890
|
"info-template": h.value
|
|
885
891
|
}, null, 8, ["pagination", "info-template"]),
|
|
886
|
-
|
|
892
|
+
L(a.$slots, "dsg-table--footer-left-extras", {
|
|
887
893
|
data: f.value,
|
|
888
894
|
perPage: r.value
|
|
889
895
|
})
|
|
890
896
|
])
|
|
891
897
|
]),
|
|
892
898
|
k("div", Wt, [
|
|
893
|
-
|
|
899
|
+
L(a.$slots, "dsg-table--footer-center", {
|
|
894
900
|
data: f.value,
|
|
895
901
|
perPage: r.value
|
|
896
902
|
}, () => [
|
|
897
|
-
|
|
903
|
+
L(a.$slots, "dsg-table--footer-center-extras", {
|
|
898
904
|
data: f.value,
|
|
899
905
|
perPage: r.value
|
|
900
906
|
})
|
|
901
907
|
])
|
|
902
908
|
]),
|
|
903
909
|
k("div", jt, [
|
|
904
|
-
|
|
910
|
+
L(a.$slots, "dsg-table--footer-right", {
|
|
905
911
|
data: f.value,
|
|
906
912
|
perPage: r.value
|
|
907
913
|
}, () => [
|
|
@@ -912,7 +918,7 @@ You can explicitly suppress this warning by setting pagination-path="".`
|
|
|
912
918
|
"onUpdate:pagination": i[16] || (i[16] = (g) => f.value = g),
|
|
913
919
|
"onDsgTable:changePage": T
|
|
914
920
|
}, null, 8, ["pagination"])) : P("", !0),
|
|
915
|
-
|
|
921
|
+
L(a.$slots, "dsg-table--footer-right-extras", {
|
|
916
922
|
data: f.value,
|
|
917
923
|
perPage: r.value
|
|
918
924
|
})
|
|
@@ -929,7 +935,7 @@ You can explicitly suppress this warning by setting pagination-path="".`
|
|
|
929
935
|
},
|
|
930
936
|
setup(t) {
|
|
931
937
|
return ($, b) => (l(), o("div", Qt, [
|
|
932
|
-
|
|
938
|
+
de(k("select", {
|
|
933
939
|
"onUpdate:modelValue": b[0] || (b[0] = (d) => $.perPage.perPage = d),
|
|
934
940
|
class: "dsg-table--per-page-select",
|
|
935
941
|
onChange: b[1] || (b[1] = (d) => $.perPage.change($.perPage.perPage))
|
|
@@ -944,7 +950,7 @@ You can explicitly suppress this warning by setting pagination-path="".`
|
|
|
944
950
|
])
|
|
945
951
|
]));
|
|
946
952
|
}
|
|
947
|
-
}), Jt = Kt, Xt = ye, Zt = Gt, xt = pe, _t = he, ea = me, ta = ke, aa = we,
|
|
953
|
+
}), Jt = Kt, Xt = ye, Zt = Gt, xt = pe, _t = he, ea = me, ta = ke, aa = we, ra = {
|
|
948
954
|
DsgTable: Jt,
|
|
949
955
|
DsgTableActions: Xt,
|
|
950
956
|
DsgTablePerPage: Zt,
|
|
@@ -963,5 +969,5 @@ export {
|
|
|
963
969
|
Zt as DsgTablePerPage,
|
|
964
970
|
aa as DsgTableRowHeader,
|
|
965
971
|
ta as DsgTableSearch,
|
|
966
|
-
|
|
972
|
+
ra as default
|
|
967
973
|
};
|