@dcodegroup-au/dsg-vue 0.0.28 → 0.0.31
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/components/Elements/DsgBarcodeScanner.vue.d.ts +19 -0
- package/dist/components/Elements/DsgCard.vue.d.ts +28 -0
- package/dist/components/Elements/DsgCardContainer.vue.d.ts +29 -0
- package/dist/components/Elements/DsgCheckbox.vue.d.ts +1 -1
- package/dist/components/Elements/DsgInputNumber.vue.d.ts +27 -0
- package/dist/components/Elements/DsgInputSelect.vue.d.ts +2 -2
- package/dist/components/Elements/DsgProgress.vue.d.ts +7 -0
- package/dist/components/Elements/ElementComponents.d.ts +6 -1
- package/dist/components/Navigation/DsgTab.vue.d.ts +1 -0
- package/dist/components/Table/DsgTable.vue.d.ts +2 -0
- package/dist/dsg-vue.cjs +21 -2
- package/dist/dsg-vue.css +1 -1
- package/dist/dsg-vue.esm.js +21071 -2230
- package/dist/dsg-vue.table.cjs +2 -2
- package/dist/dsg-vue.table.esm.js +115 -114
- package/dist/main.d.ts +104 -10
- package/dist/table.d.ts +10 -0
- package/package.json +2 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { defineComponent as W, mergeModels as x, useModel as Y, computed as O, withDirectives as oe, createElementBlock as n, openBlock as a, createCommentVNode as P, createElementVNode as h, normalizeClass as F, createVNode as M, Fragment as
|
|
2
|
-
import { _ as
|
|
1
|
+
import { defineComponent as W, mergeModels as x, useModel as Y, computed as O, withDirectives as oe, createElementBlock as n, openBlock as a, createCommentVNode as P, createElementVNode as h, normalizeClass as F, createVNode as M, Fragment as E, renderList as q, vShow as Se, ref as y, useTemplateRef as ge, useAttrs as Fe, unref as U, withCtx as Z, renderSlot as T, toDisplayString as _, createBlock as N, resolveDynamicComponent as Me, normalizeStyle as J, watch as te, onMounted as Be, Transition as Le, createTextVNode as Ee, useSlots as Re, createSlots as He, normalizeProps as Ie, mergeProps as ze, vModelSelect as Ae } from "vue";
|
|
2
|
+
import { _ as A, k as Ve, v as Oe, g as Ue, u as qe, c as ve, e as ce, i as be, j as Ne } from "./DsgTablePerPage.vue_vue_type_style_index_0_lang-BDrIBOCO.js";
|
|
3
3
|
import { ucfirst as We, ucwords as je, toSnakeCase as Ke } from "./dsg-vue.helpers-string.esm.js";
|
|
4
4
|
import { data_get as ne } from "./dsg-vue.helpers-object.esm.js";
|
|
5
5
|
const Qe = { class: "dsg-table--pagination" }, Ye = ["disabled"], xe = ["disabled"], Ge = ["onClick", "innerHTML"], Je = ["onClick", "innerHTML"], Xe = ["disabled"], Ze = ["disabled"], fe = /* @__PURE__ */ W({
|
|
@@ -18,69 +18,69 @@ const Qe = { class: "dsg-table--pagination" }, Ye = ["disabled"], xe = ["disable
|
|
|
18
18
|
}),
|
|
19
19
|
emits: /* @__PURE__ */ x(["dsg-table:change-page"], ["update:pagination"]),
|
|
20
20
|
setup(t, { expose: $, emit: v }) {
|
|
21
|
-
const i = Y(t, "pagination"), f = O(() => i.value === null ? 0 : i.value?.last_page - t.firstPage + 1), b = O(() => i.value === null ? 0 : i.value?.last_page), m = O(() => i.value === null ? !1 : i.value?.current_page === t.firstPage), p = O(() => i.value === null ? !1 : i.value?.current_page === b.value),
|
|
21
|
+
const i = Y(t, "pagination"), f = O(() => i.value === null ? 0 : i.value?.last_page - t.firstPage + 1), b = O(() => i.value === null ? 0 : i.value?.last_page), m = O(() => i.value === null ? !1 : i.value?.current_page === t.firstPage), p = O(() => i.value === null ? !1 : i.value?.current_page === b.value), H = O(() => f.value < t.onEachSide * 2 + 4), V = O(() => t.onEachSide * 2 + 1), r = O(() => !i.value || i.value?.current_page <= t.onEachSide ? 1 : i.value?.current_page >= f.value - t.onEachSide ? f.value - t.onEachSide * 2 : i.value?.current_page - t.onEachSide), k = v, s = (u) => {
|
|
22
22
|
k("dsg-table:change-page", u);
|
|
23
23
|
}, d = (u) => u === i.value?.current_page;
|
|
24
24
|
return $({
|
|
25
25
|
loadPage: s
|
|
26
|
-
}), (u,
|
|
26
|
+
}), (u, D) => oe((a(), n("div", Qe, [
|
|
27
27
|
u.showFirstLast ? (a(), n("a", {
|
|
28
28
|
key: 0,
|
|
29
|
-
onClick:
|
|
29
|
+
onClick: D[0] || (D[0] = (I) => s(u.firstPage)),
|
|
30
30
|
class: F([[m.value ? "disabled" : ""], "dsg-table--pagination-link"]),
|
|
31
31
|
disabled: m.value,
|
|
32
32
|
title: "First",
|
|
33
33
|
"aria-label": "First"
|
|
34
34
|
}, [
|
|
35
|
-
M(
|
|
35
|
+
M(A, {
|
|
36
36
|
icon: u.firstIcon,
|
|
37
37
|
size: "sm"
|
|
38
38
|
}, null, 8, ["icon"])
|
|
39
39
|
], 10, Ye)) : P("", !0),
|
|
40
40
|
h("a", {
|
|
41
|
-
onClick:
|
|
41
|
+
onClick: D[1] || (D[1] = (I) => s("prev")),
|
|
42
42
|
class: F([[m.value ? "disabled" : ""], "dsg-table--pagination-link"]),
|
|
43
43
|
disabled: m.value,
|
|
44
44
|
title: "Previous",
|
|
45
45
|
"aria-label": "Previous"
|
|
46
46
|
}, [
|
|
47
|
-
M(
|
|
47
|
+
M(A, {
|
|
48
48
|
icon: u.prevIcon,
|
|
49
49
|
size: "sm"
|
|
50
50
|
}, null, 8, ["icon"])
|
|
51
51
|
], 10, xe),
|
|
52
|
-
|
|
53
|
-
key:
|
|
54
|
-
onClick: (j) => s(
|
|
55
|
-
class: F([[d(
|
|
52
|
+
H.value ? (a(!0), n(E, { key: 1 }, q(f.value, (I, C) => (a(), n("a", {
|
|
53
|
+
key: C,
|
|
54
|
+
onClick: (j) => s(C + u.firstPage),
|
|
55
|
+
class: F([[d(C + u.firstPage) ? "active" : ""], "dsg-table--pagination-link"]),
|
|
56
56
|
innerHTML: I
|
|
57
|
-
}, null, 10, Ge))), 128)) : (a(!0), n(
|
|
58
|
-
key:
|
|
59
|
-
onClick: (j) => s(r.value +
|
|
60
|
-
class: F([[d(r.value +
|
|
57
|
+
}, null, 10, Ge))), 128)) : (a(!0), n(E, { key: 2 }, q(V.value, (I, C) => (a(), n("a", {
|
|
58
|
+
key: C,
|
|
59
|
+
onClick: (j) => s(r.value + C + u.firstPage - 1),
|
|
60
|
+
class: F([[d(r.value + C + u.firstPage - 1) ? "active" : ""], "dsg-table--pagination-link"]),
|
|
61
61
|
innerHTML: r.value + I - 1
|
|
62
62
|
}, null, 10, Je))), 128)),
|
|
63
63
|
h("a", {
|
|
64
|
-
onClick:
|
|
64
|
+
onClick: D[2] || (D[2] = (I) => s("next")),
|
|
65
65
|
class: F([[p.value ? "disabled" : ""], "dsg-table--pagination-link"]),
|
|
66
66
|
disabled: p.value,
|
|
67
67
|
title: "Next",
|
|
68
68
|
"aria-label": "Next"
|
|
69
69
|
}, [
|
|
70
|
-
M(
|
|
70
|
+
M(A, {
|
|
71
71
|
icon: u.nextIcon,
|
|
72
72
|
size: "sm"
|
|
73
73
|
}, null, 8, ["icon"])
|
|
74
74
|
], 10, Xe),
|
|
75
75
|
u.showFirstLast ? (a(), n("a", {
|
|
76
76
|
key: 3,
|
|
77
|
-
onClick:
|
|
77
|
+
onClick: D[3] || (D[3] = (I) => s(b.value)),
|
|
78
78
|
class: F([[p.value ? "disabled" : ""], "dsg-table--pagination-link"]),
|
|
79
79
|
disabled: p.value,
|
|
80
80
|
title: "Last",
|
|
81
81
|
"aria-label": "Last"
|
|
82
82
|
}, [
|
|
83
|
-
M(
|
|
83
|
+
M(A, {
|
|
84
84
|
icon: u.lastIcon,
|
|
85
85
|
size: "sm"
|
|
86
86
|
}, null, 8, ["icon"])
|
|
@@ -134,7 +134,7 @@ const Qe = { class: "dsg-table--pagination" }, Ye = ["disabled"], xe = ["disable
|
|
|
134
134
|
default:
|
|
135
135
|
return "dots-horizontal";
|
|
136
136
|
}
|
|
137
|
-
},
|
|
137
|
+
}, H = (k, s, d) => {
|
|
138
138
|
switch (s) {
|
|
139
139
|
case "edit":
|
|
140
140
|
r("dsg-table:action-edit", d, m.value);
|
|
@@ -149,12 +149,12 @@ const Qe = { class: "dsg-table--pagination" }, Ye = ["disabled"], xe = ["disable
|
|
|
149
149
|
r("dsg-table:action-archive", d, m.value);
|
|
150
150
|
break;
|
|
151
151
|
}
|
|
152
|
-
},
|
|
152
|
+
}, V = (k, s) => {
|
|
153
153
|
const d = k.actionId || k.label.trim().toLowerCase().replace(/[^a-z0-9-]/g, "-").replace(/-+/g, "-");
|
|
154
154
|
r("dsg-table:link-clicked", s, d, m.value);
|
|
155
155
|
}, r = $;
|
|
156
156
|
return (k, s) => oe((a(), n("div", et, [
|
|
157
|
-
M(U(
|
|
157
|
+
M(U(Ve), {
|
|
158
158
|
triggers: [],
|
|
159
159
|
placement: k.placement,
|
|
160
160
|
"handle-resize": !0,
|
|
@@ -166,17 +166,17 @@ const Qe = { class: "dsg-table--pagination" }, Ye = ["disabled"], xe = ["disable
|
|
|
166
166
|
}, {
|
|
167
167
|
popper: Z(() => [
|
|
168
168
|
v.value ? (a(), n("div", at, [
|
|
169
|
-
(a(!0), n(
|
|
169
|
+
(a(!0), n(E, null, q(f.value, (d, u) => (a(), n(E, null, [
|
|
170
170
|
["edit", "view", "delete", "archive"].includes(String(u)) ? (a(), n("a", {
|
|
171
171
|
key: u,
|
|
172
172
|
href: f.value?.link,
|
|
173
173
|
target: f.value?.target || "_self",
|
|
174
|
-
onClick: (
|
|
174
|
+
onClick: (D) => H(d, String(u), D)
|
|
175
175
|
}, [
|
|
176
176
|
h("div", {
|
|
177
177
|
class: F(["dsg-table--actions-menu-item", String(u)])
|
|
178
178
|
}, [
|
|
179
|
-
M(
|
|
179
|
+
M(A, {
|
|
180
180
|
icon: p(String(u)),
|
|
181
181
|
size: "sm"
|
|
182
182
|
}, null, 8, ["icon"]),
|
|
@@ -188,7 +188,7 @@ const Qe = { class: "dsg-table--pagination" }, Ye = ["disabled"], xe = ["disable
|
|
|
188
188
|
], 8, lt)) : P("", !0)
|
|
189
189
|
], 64))), 256)),
|
|
190
190
|
f.value && b.value ? (a(), n("hr", nt)) : P("", !0),
|
|
191
|
-
b.value ? (a(!0), n(
|
|
191
|
+
b.value ? (a(!0), n(E, { key: 1 }, q(b.value, (d) => (a(), n(E, {
|
|
192
192
|
key: d.label
|
|
193
193
|
}, [
|
|
194
194
|
d.hasOwnProperty("component") ? (a(), N(Me(d.component), {
|
|
@@ -200,9 +200,9 @@ const Qe = { class: "dsg-table--pagination" }, Ye = ["disabled"], xe = ["disable
|
|
|
200
200
|
href: d.link,
|
|
201
201
|
target: d.target || "_self",
|
|
202
202
|
class: F(["dsg-table--actions-menu-item", d.class]),
|
|
203
|
-
onClick: (u) =>
|
|
203
|
+
onClick: (u) => V(d, u)
|
|
204
204
|
}, [
|
|
205
|
-
d.icon ? (a(), N(
|
|
205
|
+
d.icon ? (a(), N(A, {
|
|
206
206
|
key: 0,
|
|
207
207
|
icon: d.icon,
|
|
208
208
|
size: "sm"
|
|
@@ -222,7 +222,7 @@ const Qe = { class: "dsg-table--pagination" }, Ye = ["disabled"], xe = ["disable
|
|
|
222
222
|
onClick: s[0] || (s[0] = (d) => v.value = !v.value)
|
|
223
223
|
}, [
|
|
224
224
|
T(k.$slots, "dsg-table-action-button-content", {}, () => [
|
|
225
|
-
M(
|
|
225
|
+
M(A, {
|
|
226
226
|
icon: "dots-vertical",
|
|
227
227
|
size: "sm"
|
|
228
228
|
})
|
|
@@ -307,13 +307,13 @@ const Qe = { class: "dsg-table--pagination" }, Ye = ["disabled"], xe = ["disable
|
|
|
307
307
|
setup(t, { emit: $ }) {
|
|
308
308
|
const v = Y(t, "sortField"), i = Y(t, "selectedRows"), f = Y(t, "hasSelected"), b = y("17px"), m = (r) => {
|
|
309
309
|
f.value && i.value.length > 0 && i.value.length !== t.tableDataLength ? (f.value = !0, p("dsg-table:on-select-all")) : !f.value && i.value.length === 0 ? (f.value = !1, p("dsg-table:on-select-all")) : p("dsg-table:on-deselect-all");
|
|
310
|
-
}, p = $,
|
|
310
|
+
}, p = $, H = (r, k) => [
|
|
311
311
|
r,
|
|
312
312
|
r + "-" + Ke(String(k?.name)),
|
|
313
313
|
k.titleClass || "",
|
|
314
314
|
{ sortable: k.sortable },
|
|
315
315
|
{ "sort-active": v.value?.name === k.name }
|
|
316
|
-
],
|
|
316
|
+
], V = (r) => {
|
|
317
317
|
r.sortable && (v.value = {
|
|
318
318
|
name: String(r?.name),
|
|
319
319
|
field: String(r?.sortField),
|
|
@@ -332,14 +332,14 @@ const Qe = { class: "dsg-table--pagination" }, Ye = ["disabled"], xe = ["disable
|
|
|
332
332
|
}, null, 8, ["modelValue", "indeterminate"])
|
|
333
333
|
])) : P("", !0),
|
|
334
334
|
r.showExpandDetail ? (a(), n("th", gt)) : P("", !0),
|
|
335
|
-
(a(!0), n(
|
|
335
|
+
(a(!0), n(E, null, q(r.fields, (s, d) => (a(), n(E, null, [
|
|
336
336
|
s?.visible ? (a(), n("th", {
|
|
337
337
|
key: d,
|
|
338
|
-
class: F(
|
|
338
|
+
class: F(H("dsg-table--th", s)),
|
|
339
339
|
style: J([{ width: s.width || void 0 }, s.style]),
|
|
340
340
|
title: s.title + (s.sortable ? " Sort" : ""),
|
|
341
341
|
id: "_" + s.name,
|
|
342
|
-
onClick: (u) =>
|
|
342
|
+
onClick: (u) => V(s),
|
|
343
343
|
scope: "col"
|
|
344
344
|
}, [
|
|
345
345
|
s.sortable ? (a(), n("div", bt, [
|
|
@@ -348,19 +348,19 @@ const Qe = { class: "dsg-table--pagination" }, Ye = ["disabled"], xe = ["disable
|
|
|
348
348
|
class: "dsg-table--th-title",
|
|
349
349
|
innerHTML: s.title
|
|
350
350
|
}, null, 8, ft)) : P("", !0),
|
|
351
|
-
s.sortable && v.value?.name !== s.name ? (a(), N(
|
|
351
|
+
s.sortable && v.value?.name !== s.name ? (a(), N(A, {
|
|
352
352
|
key: 1,
|
|
353
353
|
icon: "chevron-selector-vertical",
|
|
354
354
|
class: "inline-flex",
|
|
355
355
|
size: "xs"
|
|
356
356
|
})) : P("", !0),
|
|
357
|
-
s.sortable && v.value?.name === s.name && v.value?.direction === "asc" ? (a(), N(
|
|
357
|
+
s.sortable && v.value?.name === s.name && v.value?.direction === "asc" ? (a(), N(A, {
|
|
358
358
|
key: 2,
|
|
359
359
|
icon: "chevron-down",
|
|
360
360
|
class: "inline-flex",
|
|
361
361
|
size: "xs"
|
|
362
362
|
})) : P("", !0),
|
|
363
|
-
s.sortable && v.value?.name === s.name && v.value?.direction === "desc" ? (a(), N(
|
|
363
|
+
s.sortable && v.value?.name === s.name && v.value?.direction === "desc" ? (a(), N(A, {
|
|
364
364
|
key: 3,
|
|
365
365
|
icon: "chevron-up",
|
|
366
366
|
class: "inline-flex",
|
|
@@ -458,9 +458,9 @@ const Qe = { class: "dsg-table--pagination" }, Ye = ["disabled"], xe = ["disable
|
|
|
458
458
|
sortable: o.sortField,
|
|
459
459
|
formatter: o.formatter || null,
|
|
460
460
|
$_index: g
|
|
461
|
-
})), f = y(i(t.fields)), b = y(t.data), m = y(null), p = y(t.initialPage),
|
|
461
|
+
})), f = y(i(t.fields)), b = y(t.data), m = y(null), p = y(t.initialPage), H = y("17px"), V = y(!1), r = y({}), k = y(0), s = y(!0), d = y(null), u = y(null), D = Y(t, "filterParams"), I = Y(t, "perPage"), C = y([]), j = y(!1), K = O(() => t.tableHeight != null), Q = O(() => f.value.filter((e) => e.visible).length);
|
|
462
462
|
te(
|
|
463
|
-
() =>
|
|
463
|
+
() => C.value.length,
|
|
464
464
|
(e) => {
|
|
465
465
|
j.value = t.selectable && e > 0;
|
|
466
466
|
},
|
|
@@ -472,7 +472,7 @@ const Qe = { class: "dsg-table--pagination" }, Ye = ["disabled"], xe = ["disable
|
|
|
472
472
|
},
|
|
473
473
|
{ immediate: !0 }
|
|
474
474
|
), te(
|
|
475
|
-
() =>
|
|
475
|
+
() => D.value,
|
|
476
476
|
() => {
|
|
477
477
|
X();
|
|
478
478
|
},
|
|
@@ -486,24 +486,24 @@ const Qe = { class: "dsg-table--pagination" }, Ye = ["disabled"], xe = ["disable
|
|
|
486
486
|
const z = v, ee = (e, o) => e.formatter && typeof e.formatter == "function" ? e.formatter(e, o) : ne(o, String(e?.name), ""), ae = (e) => "dsg-field--" + e.name?.toLowerCase().replaceAll(/[_ ]/g, "-"), l = (e) => {
|
|
487
487
|
if (t.selectable) {
|
|
488
488
|
if (e.selected)
|
|
489
|
-
|
|
489
|
+
C.value.push(e);
|
|
490
490
|
else {
|
|
491
|
-
const o =
|
|
492
|
-
o !== -1 &&
|
|
491
|
+
const o = C.value.findIndex((g) => g[t.trackBy] === e[t.trackBy]);
|
|
492
|
+
o !== -1 && C.value.splice(o, 1);
|
|
493
493
|
}
|
|
494
|
-
z("dsg-table:rows-selected",
|
|
494
|
+
z("dsg-table:rows-selected", C.value);
|
|
495
495
|
}
|
|
496
496
|
}, c = () => {
|
|
497
497
|
t.selectable && (b.value?.forEach((e) => {
|
|
498
498
|
e.selected = !0;
|
|
499
|
-
}),
|
|
499
|
+
}), C.value = b.value?.filter((e) => e.selected) ?? [], z("dsg-table:rows-selected", C.value));
|
|
500
500
|
}, w = () => {
|
|
501
501
|
t.selectable && (b.value?.forEach((e) => {
|
|
502
502
|
e.selected = !1;
|
|
503
|
-
}),
|
|
503
|
+
}), C.value = [], z("dsg-table:rows-selected", C.value));
|
|
504
504
|
}, S = (e) => {
|
|
505
505
|
e === "prev" ? p.value > t.firstPage && p.value-- : e === "next" ? p.value < (m.value?.last_page ?? 0) && p.value++ : e != p.value && e >= t.firstPage && e <= (m.value?.last_page ?? 0) && (p.value = e), X();
|
|
506
|
-
},
|
|
506
|
+
}, B = () => ({
|
|
507
507
|
[t.queryParams?.sort]: d.value ? (d.value?.direction === "desc" ? "-" : "") + d.value?.field : void 0,
|
|
508
508
|
[t.queryParams?.order]: d.value?.direction,
|
|
509
509
|
[t.queryParams?.page]: p.value,
|
|
@@ -516,8 +516,8 @@ const Qe = { class: "dsg-table--pagination" }, Ye = ["disabled"], xe = ["disable
|
|
|
516
516
|
if (o.signal = g.signal, u.value = g, t.httpMethod.toLowerCase() === "get")
|
|
517
517
|
return await ce.get(e, o);
|
|
518
518
|
{
|
|
519
|
-
const
|
|
520
|
-
return delete o.params, await ce.post(e,
|
|
519
|
+
const R = o.params;
|
|
520
|
+
return delete o.params, await ce.post(e, R, o);
|
|
521
521
|
}
|
|
522
522
|
}, ie = (e) => {
|
|
523
523
|
z("dsg-table:load-success", e);
|
|
@@ -531,25 +531,25 @@ You can explicitly suppress this warning by setting pagination-path="".`
|
|
|
531
531
|
}, re = (e) => {
|
|
532
532
|
console.error("load-error", e), z("dsg-table:load-error", e), z("dsg-table:loaded"), s.value = !1;
|
|
533
533
|
}, X = (e = ie, o = re, g = {}) => {
|
|
534
|
-
const
|
|
534
|
+
const R = e || ie, L = o || re;
|
|
535
535
|
if (t.apiMode)
|
|
536
536
|
return s.value = !0, z("dsg-table:loading", s.value), t.httpOptions.params = {
|
|
537
|
-
...
|
|
538
|
-
...
|
|
539
|
-
}, le(t.apiUrl, t.httpOptions).then(
|
|
537
|
+
...B(),
|
|
538
|
+
...D.value
|
|
539
|
+
}, le(t.apiUrl, t.httpOptions).then(R).catch((se) => L(se));
|
|
540
540
|
}, ke = (e, o, g) => {
|
|
541
541
|
}, we = (e, o, g) => {
|
|
542
542
|
}, Pe = (e, o, g) => {
|
|
543
|
-
}, $e = (e, o, g,
|
|
544
|
-
}, De = (e, o, g,
|
|
545
|
-
}, Ce = (e, o, g,
|
|
543
|
+
}, $e = (e, o, g, R) => {
|
|
544
|
+
}, De = (e, o, g, R) => {
|
|
545
|
+
}, Ce = (e, o, g, R) => {
|
|
546
546
|
}, Te = (e, o, g) => {
|
|
547
547
|
};
|
|
548
548
|
Be(() => {
|
|
549
549
|
t.apiMode === !0 && X();
|
|
550
550
|
});
|
|
551
551
|
const de = () => {
|
|
552
|
-
t.apiMode && (p.value = t.initialPage,
|
|
552
|
+
t.apiMode && (p.value = t.initialPage, C.value = [], G(), X());
|
|
553
553
|
};
|
|
554
554
|
return $({
|
|
555
555
|
changePage: S,
|
|
@@ -564,16 +564,16 @@ You can explicitly suppress this warning by setting pagination-path="".`
|
|
|
564
564
|
class: F(["dsg-table-main", K.value ? "fixed-header" : "", r.value.table, "table-" + e.tableLayout])
|
|
565
565
|
}, [
|
|
566
566
|
h("colgroup", { span: Q.value }, [
|
|
567
|
-
(a(!0), n(
|
|
567
|
+
(a(!0), n(E, null, q(f.value, (g, R) => (a(), n(E, null, [
|
|
568
568
|
g?.visible ? (a(), n("col", {
|
|
569
|
-
key:
|
|
569
|
+
key: R,
|
|
570
570
|
style: J({ width: g.width || void 0 }),
|
|
571
571
|
class: F("dsg-table--col-" + g.name + " " + g.titleClass)
|
|
572
572
|
}, null, 6)) : P("", !0)
|
|
573
573
|
], 64))), 256)),
|
|
574
|
-
!K.value &&
|
|
574
|
+
!K.value && V.value ? (a(), n("col", {
|
|
575
575
|
key: 0,
|
|
576
|
-
style: J({ width:
|
|
576
|
+
style: J({ width: H.value }),
|
|
577
577
|
class: "dsg-table--col-gutter"
|
|
578
578
|
}, null, 4)) : P("", !0)
|
|
579
579
|
], 8, mt),
|
|
@@ -584,11 +584,11 @@ You can explicitly suppress this warning by setting pagination-path="".`
|
|
|
584
584
|
M(ye, {
|
|
585
585
|
fields: f.value,
|
|
586
586
|
"has-select-all": e.selectable,
|
|
587
|
-
"selected-rows":
|
|
588
|
-
"onUpdate:selectedRows": o[0] || (o[0] = (g) =>
|
|
587
|
+
"selected-rows": C.value,
|
|
588
|
+
"onUpdate:selectedRows": o[0] || (o[0] = (g) => C.value = g),
|
|
589
589
|
"has-selected": j.value,
|
|
590
590
|
"onUpdate:hasSelected": o[1] || (o[1] = (g) => j.value = g),
|
|
591
|
-
"scroll-visible":
|
|
591
|
+
"scroll-visible": V.value,
|
|
592
592
|
"show-expand-detail": e.hasDetailRow && e.showExpandDetail,
|
|
593
593
|
"table-data-length": b.value?.length,
|
|
594
594
|
"sort-field": d.value,
|
|
@@ -611,7 +611,7 @@ You can explicitly suppress this warning by setting pagination-path="".`
|
|
|
611
611
|
colspan: Q.value
|
|
612
612
|
}, [
|
|
613
613
|
T(e.$slots, "dsg-table-loading", {}, () => [
|
|
614
|
-
M(
|
|
614
|
+
M(A, {
|
|
615
615
|
icon: "loading-02",
|
|
616
616
|
class: "animate-spin"
|
|
617
617
|
}),
|
|
@@ -619,35 +619,35 @@ You can explicitly suppress this warning by setting pagination-path="".`
|
|
|
619
619
|
])
|
|
620
620
|
], 8, wt)
|
|
621
621
|
], 8, kt)
|
|
622
|
-
])) : (a(!0), n(
|
|
622
|
+
])) : (a(!0), n(E, { key: 1 }, q(b.value, (g, R) => (a(), n(E, { key: R }, [
|
|
623
623
|
h("tr", {
|
|
624
|
-
class: F(["dsg-table--tbody-row", { odd:
|
|
625
|
-
onClick: (
|
|
626
|
-
onDblclick: (
|
|
627
|
-
onMouseover: (
|
|
624
|
+
class: F(["dsg-table--tbody-row", { odd: R % 2 === 0, even: R % 2 !== 0, "row-selected": g.selected }]),
|
|
625
|
+
onClick: (L) => ke(),
|
|
626
|
+
onDblclick: (L) => we(),
|
|
627
|
+
onMouseover: (L) => Pe()
|
|
628
628
|
}, [
|
|
629
629
|
e.selectable ? (a(), n("td", $t, [
|
|
630
630
|
M(ve, {
|
|
631
631
|
modelValue: g.selected,
|
|
632
|
-
"onUpdate:modelValue": [(
|
|
632
|
+
"onUpdate:modelValue": [(L) => g.selected = L, (L) => l(g)]
|
|
633
633
|
}, null, 8, ["modelValue", "onUpdate:modelValue"])
|
|
634
634
|
])) : P("", !0),
|
|
635
|
-
(a(!0), n(
|
|
636
|
-
|
|
635
|
+
(a(!0), n(E, null, q(f.value, (L, se) => (a(), n(E, { key: se }, [
|
|
636
|
+
L.visible ? (a(), n("td", {
|
|
637
637
|
key: 0,
|
|
638
|
-
class: F(["dsg-table--tbody-cell",
|
|
639
|
-
style: J({ width:
|
|
638
|
+
class: F(["dsg-table--tbody-cell", L.dataClass]),
|
|
639
|
+
style: J({ width: L.width || void 0 }),
|
|
640
640
|
onClick: (ue) => $e(),
|
|
641
641
|
onDblclick: (ue) => De(),
|
|
642
642
|
onContextmenu: (ue) => Ce()
|
|
643
643
|
}, [
|
|
644
|
-
T(e.$slots, ae(
|
|
644
|
+
T(e.$slots, ae(L), {
|
|
645
645
|
rowData: g,
|
|
646
|
-
rowIndex:
|
|
647
|
-
rowField:
|
|
646
|
+
rowIndex: R,
|
|
647
|
+
rowField: L
|
|
648
648
|
}, () => [
|
|
649
649
|
h("span", {
|
|
650
|
-
innerHTML: ee(
|
|
650
|
+
innerHTML: ee(L, g)
|
|
651
651
|
}, null, 8, Ct)
|
|
652
652
|
])
|
|
653
653
|
], 46, Dt)) : P("", !0)
|
|
@@ -660,12 +660,12 @@ You can explicitly suppress this warning by setting pagination-path="".`
|
|
|
660
660
|
default: Z(() => [
|
|
661
661
|
h("tr", {
|
|
662
662
|
class: "dsg-table--tbody-detail-row",
|
|
663
|
-
onClick: (
|
|
663
|
+
onClick: (L) => Te()
|
|
664
664
|
}, [
|
|
665
665
|
h("td", { colspan: Q.value }, [
|
|
666
666
|
T(e.$slots, "dsg-table-detail-row", {
|
|
667
667
|
rowData: g,
|
|
668
|
-
rowIndex:
|
|
668
|
+
rowIndex: R,
|
|
669
669
|
options: e.detailRowOptions
|
|
670
670
|
})
|
|
671
671
|
], 8, St)
|
|
@@ -695,10 +695,10 @@ You can explicitly suppress this warning by setting pagination-path="".`
|
|
|
695
695
|
], 6)
|
|
696
696
|
]));
|
|
697
697
|
}
|
|
698
|
-
}), Et = { class: "dsg-table" }, Rt = { class: "dsg-table--pre-header" }, Ht = { class: "dsg-table--pre-header-left" }, It = ["textContent"], zt = { class: "dsg-table--pre-header-right" },
|
|
698
|
+
}), Et = { class: "dsg-table" }, Rt = { class: "dsg-table--pre-header" }, Ht = { class: "dsg-table--pre-header-left" }, It = ["textContent"], zt = { class: "dsg-table--pre-header-right" }, At = {
|
|
699
699
|
key: 0,
|
|
700
700
|
class: "dsg-table--search-header"
|
|
701
|
-
},
|
|
701
|
+
}, Vt = { class: "dsg-table--search-top" }, Ot = { class: "dsg-table--footer" }, Ut = { class: "dsg-table--footer-left" }, qt = { class: "dsg-table--footer-center" }, Nt = { class: "dsg-table--footer-right" }, Wt = /* @__PURE__ */ W({
|
|
702
702
|
__name: "DsgTable",
|
|
703
703
|
props: {
|
|
704
704
|
getUrl: {},
|
|
@@ -716,7 +716,7 @@ You can explicitly suppress this warning by setting pagination-path="".`
|
|
|
716
716
|
filterSearchEndpoint: { default: "" },
|
|
717
717
|
tableLayout: { default: "fixed" }
|
|
718
718
|
},
|
|
719
|
-
emits: ["dsg-table:action-edit", "dsg-table:action-view", "dsg-table:action-delete", "dsg-table:link-clicked", "dsg-table:rows-selected", "dsg-table:filter-updated", "dsg-table:term-changed"],
|
|
719
|
+
emits: ["dsg-table:action-edit", "dsg-table:action-view", "dsg-table:action-delete", "dsg-table:action-archive", "dsg-table:link-clicked", "dsg-table:rows-selected", "dsg-table:filter-updated", "dsg-table:term-changed"],
|
|
720
720
|
setup(t, { expose: $, emit: v }) {
|
|
721
721
|
const i = (l) => {
|
|
722
722
|
d.value = l;
|
|
@@ -731,12 +731,12 @@ You can explicitly suppress this warning by setting pagination-path="".`
|
|
|
731
731
|
}), l;
|
|
732
732
|
} else
|
|
733
733
|
return {};
|
|
734
|
-
}, m = Re(), p = y(!0),
|
|
734
|
+
}, m = Re(), p = y(!0), H = y(null), V = y("<p>Showing {from} to {to} of {total}</p>"), r = y(null), k = ge("dsgTable"), s = y({ perPage: 20, change: i }), d = y(20), u = y(b()), D = v, I = (l) => {
|
|
735
735
|
k.value?.changePage(l);
|
|
736
|
-
},
|
|
736
|
+
}, C = (l) => {
|
|
737
737
|
r.value = l;
|
|
738
738
|
}, j = ({ data: l }) => {
|
|
739
|
-
|
|
739
|
+
H.value = l;
|
|
740
740
|
}, K = () => {
|
|
741
741
|
p.value === !1 && k.value?.reload();
|
|
742
742
|
}, Q = (l) => {
|
|
@@ -746,9 +746,9 @@ You can explicitly suppress this warning by setting pagination-path="".`
|
|
|
746
746
|
}, z = (l) => {
|
|
747
747
|
u.value = l;
|
|
748
748
|
}, ee = (l) => {
|
|
749
|
-
u.value["filter[term]"] = l,
|
|
749
|
+
u.value["filter[term]"] = l, D("dsg-table:term-changed", l);
|
|
750
750
|
}, ae = (l, c, w) => {
|
|
751
|
-
u.value = { "filter[term]": u.value["filter[term]"], ...l },
|
|
751
|
+
u.value = { "filter[term]": u.value["filter[term]"], ...l }, D("dsg-table:filter-updated", u.value, c, w);
|
|
752
752
|
};
|
|
753
753
|
return $({
|
|
754
754
|
reloadTable: K,
|
|
@@ -760,7 +760,7 @@ You can explicitly suppress this warning by setting pagination-path="".`
|
|
|
760
760
|
T(l.$slots, "dsg-table--pre-header", {}, () => [
|
|
761
761
|
h("div", Ht, [
|
|
762
762
|
T(l.$slots, "dsg-table--page-title", {
|
|
763
|
-
data:
|
|
763
|
+
data: H.value,
|
|
764
764
|
title: l.title
|
|
765
765
|
}, () => [
|
|
766
766
|
l.title.length > 0 ? (a(), n("h1", {
|
|
@@ -771,13 +771,13 @@ You can explicitly suppress this warning by setting pagination-path="".`
|
|
|
771
771
|
])
|
|
772
772
|
]),
|
|
773
773
|
h("div", zt, [
|
|
774
|
-
T(l.$slots, "dsg-table--page-actions", { data:
|
|
774
|
+
T(l.$slots, "dsg-table--page-actions", { data: H.value })
|
|
775
775
|
])
|
|
776
776
|
])
|
|
777
777
|
]),
|
|
778
|
-
l.displayPaginationInfo ? (a(), n("div",
|
|
779
|
-
h("div",
|
|
780
|
-
T(l.$slots, "dsg-table--search-header", { data:
|
|
778
|
+
l.displayPaginationInfo ? (a(), n("div", At, [
|
|
779
|
+
h("div", Vt, [
|
|
780
|
+
T(l.$slots, "dsg-table--search-header", { data: H.value }, () => [
|
|
781
781
|
M(me, {
|
|
782
782
|
name: "term",
|
|
783
783
|
"onDsgTable:termChanged": c[0] || (c[0] = (w) => ee(w))
|
|
@@ -787,9 +787,9 @@ You can explicitly suppress this warning by setting pagination-path="".`
|
|
|
787
787
|
"filter-endpoint": l.filterEndpoint,
|
|
788
788
|
"search-endpoint": l.filterSearchEndpoint,
|
|
789
789
|
filters: l.filters,
|
|
790
|
-
"onDsgTable:filterUpdated": c[1] || (c[1] = (w, S,
|
|
790
|
+
"onDsgTable:filterUpdated": c[1] || (c[1] = (w, S, B) => ae(w, S, B))
|
|
791
791
|
}, null, 8, ["entity", "filter-endpoint", "search-endpoint", "filters"]),
|
|
792
|
-
T(l.$slots, "dsg-table--search-actions", { data:
|
|
792
|
+
T(l.$slots, "dsg-table--search-actions", { data: H.value })
|
|
793
793
|
])
|
|
794
794
|
]),
|
|
795
795
|
T(l.$slots, "dsg-table--search-navigation")
|
|
@@ -798,9 +798,9 @@ You can explicitly suppress this warning by setting pagination-path="".`
|
|
|
798
798
|
ref: "dsgTable",
|
|
799
799
|
"api-url": l.getUrl,
|
|
800
800
|
"filter-params": u.value,
|
|
801
|
-
"onUpdate:filterParams": c[
|
|
801
|
+
"onUpdate:filterParams": c[7] || (c[7] = (w) => u.value = w),
|
|
802
802
|
"per-page": d.value,
|
|
803
|
-
"onUpdate:perPage": c[
|
|
803
|
+
"onUpdate:perPage": c[8] || (c[8] = (w) => d.value = w),
|
|
804
804
|
fields: l.fields,
|
|
805
805
|
"load-on-start": l.loadOnStart,
|
|
806
806
|
"pagination-path": "meta",
|
|
@@ -808,21 +808,22 @@ You can explicitly suppress this warning by setting pagination-path="".`
|
|
|
808
808
|
"track-by": l.trackBy,
|
|
809
809
|
"table-layout": l.tableLayout,
|
|
810
810
|
css: { tableWrapper: "border-b" },
|
|
811
|
-
"onDsgTable:loading": c[
|
|
812
|
-
"onDsgTable:loaded": c[
|
|
813
|
-
"onDsgTable:paginationData":
|
|
811
|
+
"onDsgTable:loading": c[9] || (c[9] = (w) => p.value = !0),
|
|
812
|
+
"onDsgTable:loaded": c[10] || (c[10] = (w) => p.value = !1),
|
|
813
|
+
"onDsgTable:paginationData": C,
|
|
814
814
|
"onDsgTable:loadSuccess": j,
|
|
815
|
-
"onDsgTable:rowsSelected": c[
|
|
815
|
+
"onDsgTable:rowsSelected": c[11] || (c[11] = (w) => D("dsg-table:rows-selected", w))
|
|
816
816
|
}, He({
|
|
817
817
|
"dsg-field--actions": Z((w) => [
|
|
818
818
|
T(l.$slots, "dsg-table-actions", { data: w }, () => [
|
|
819
819
|
(a(), N(he, {
|
|
820
820
|
key: w.rowIndex,
|
|
821
821
|
data: w,
|
|
822
|
-
"onDsgTable:actionEdit": c[2] || (c[2] = (S,
|
|
823
|
-
"onDsgTable:actionView": c[3] || (c[3] = (S,
|
|
824
|
-
"onDsgTable:actionDelete": c[4] || (c[4] = (S,
|
|
825
|
-
"onDsgTable:
|
|
822
|
+
"onDsgTable:actionEdit": c[2] || (c[2] = (S, B) => D("dsg-table:action-edit", S, B)),
|
|
823
|
+
"onDsgTable:actionView": c[3] || (c[3] = (S, B) => D("dsg-table:action-view", S, B)),
|
|
824
|
+
"onDsgTable:actionDelete": c[4] || (c[4] = (S, B) => D("dsg-table:action-delete", S, B)),
|
|
825
|
+
"onDsgTable:actionArchive": c[5] || (c[5] = (S, B) => D("dsg-table:action-archive", S, B)),
|
|
826
|
+
"onDsgTable:linkClicked": c[6] || (c[6] = (S, B, G) => D("dsg-table:link-clicked", S, B, G))
|
|
826
827
|
}, null, 8, ["data"]))
|
|
827
828
|
])
|
|
828
829
|
]),
|
|
@@ -830,8 +831,8 @@ You can explicitly suppress this warning by setting pagination-path="".`
|
|
|
830
831
|
}, [
|
|
831
832
|
q(U(m), (w, S) => ({
|
|
832
833
|
name: S,
|
|
833
|
-
fn: Z(({ rowData:
|
|
834
|
-
String(S) !== "dsg-field--actions" ? T(l.$slots, S, Ie(ze({ key: 0 }, { rowData:
|
|
834
|
+
fn: Z(({ rowData: B, rowField: G, rowIndex: le }) => [
|
|
835
|
+
String(S) !== "dsg-field--actions" ? T(l.$slots, S, Ie(ze({ key: 0 }, { rowData: B, rowField: G, rowIndex: le }))) : P("", !0)
|
|
835
836
|
])
|
|
836
837
|
}))
|
|
837
838
|
]), 1032, ["api-url", "filter-params", "per-page", "fields", "load-on-start", "selectable", "track-by", "table-layout"]),
|
|
@@ -845,8 +846,8 @@ You can explicitly suppress this warning by setting pagination-path="".`
|
|
|
845
846
|
"no-data-template": "",
|
|
846
847
|
ref: "paginationInfoStart",
|
|
847
848
|
pagination: r.value,
|
|
848
|
-
"onUpdate:pagination": c[
|
|
849
|
-
"info-template":
|
|
849
|
+
"onUpdate:pagination": c[12] || (c[12] = (w) => r.value = w),
|
|
850
|
+
"info-template": V.value
|
|
850
851
|
}, null, 8, ["pagination", "info-template"]),
|
|
851
852
|
T(l.$slots, "dsg-table--footer-left-extras", {
|
|
852
853
|
data: r.value,
|
|
@@ -874,7 +875,7 @@ You can explicitly suppress this warning by setting pagination-path="".`
|
|
|
874
875
|
key: 0,
|
|
875
876
|
ref: "pagination",
|
|
876
877
|
pagination: r.value,
|
|
877
|
-
"onUpdate:pagination": c[
|
|
878
|
+
"onUpdate:pagination": c[13] || (c[13] = (w) => r.value = w),
|
|
878
879
|
"onDsgTable:changePage": I
|
|
879
880
|
}, null, 8, ["pagination"])) : P("", !0),
|
|
880
881
|
T(l.$slots, "dsg-table--footer-right-extras", {
|
|
@@ -899,13 +900,13 @@ You can explicitly suppress this warning by setting pagination-path="".`
|
|
|
899
900
|
class: "dsg-table--per-page-select",
|
|
900
901
|
onChange: v[1] || (v[1] = (i) => $.perPage.change($.perPage.perPage))
|
|
901
902
|
}, [
|
|
902
|
-
(a(!0), n(
|
|
903
|
+
(a(!0), n(E, null, q($.perPageOptions, (i) => (a(), n("option", {
|
|
903
904
|
key: i,
|
|
904
905
|
value: i,
|
|
905
906
|
textContent: _(i)
|
|
906
907
|
}, null, 8, Kt))), 128))
|
|
907
908
|
], 544), [
|
|
908
|
-
[
|
|
909
|
+
[Ae, $.perPage.perPage]
|
|
909
910
|
])
|
|
910
911
|
]));
|
|
911
912
|
}
|