@dcodegroup-au/dsg-vue 0.0.31 → 0.0.33
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-BaEuuE3O.cjs → DsgTablePerPage.vue_vue_type_style_index_0_lang-CW51CLZ4.cjs} +1197 -1197
- package/dist/{DsgTablePerPage.vue_vue_type_style_index_0_lang-BDrIBOCO.js → DsgTablePerPage.vue_vue_type_style_index_0_lang-vCgh5rQK.js} +6357 -6340
- package/dist/components/Elements/DsgAlertComponent.vue.d.ts +1 -1
- package/dist/components/Elements/DsgInputSelect.vue.d.ts +37 -4
- package/dist/components/Elements/DsgModal.vue.d.ts +1 -0
- package/dist/components/Table/DsgTable.vue.d.ts +8 -0
- package/dist/dsg-vue.cjs +11 -11
- package/dist/dsg-vue.css +1 -1
- package/dist/dsg-vue.esm.js +3139 -3056
- package/dist/dsg-vue.table.cjs +2 -2
- package/dist/dsg-vue.table.esm.js +234 -223
- package/dist/main.d.ts +62 -6
- package/package.json +20 -20
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { defineComponent as W, mergeModels as
|
|
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-
|
|
1
|
+
import { defineComponent as W, mergeModels as G, useModel as Y, computed as O, withDirectives as oe, createElementBlock as n, openBlock as a, createCommentVNode as k, createElementVNode as m, normalizeClass as F, createVNode as B, Fragment as E, renderList as q, vShow as Se, ref as y, useTemplateRef as ge, useAttrs as Fe, unref as U, withCtx as x, renderSlot as T, toDisplayString as _, createBlock as N, resolveDynamicComponent as Be, normalizeStyle as X, watch as te, onMounted as Me, 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-vCgh5rQK.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
|
-
const Qe = { class: "dsg-table--pagination" }, Ye = ["disabled"],
|
|
5
|
+
const Qe = { class: "dsg-table--pagination" }, Ye = ["disabled"], Ge = ["disabled"], Je = ["onClick", "innerHTML"], Xe = ["onClick", "innerHTML"], Ze = ["disabled"], xe = ["disabled"], fe = /* @__PURE__ */ W({
|
|
6
6
|
__name: "DsgTablePagination",
|
|
7
|
-
props: /* @__PURE__ */
|
|
7
|
+
props: /* @__PURE__ */ G({
|
|
8
8
|
onEachSide: { default: 3 },
|
|
9
9
|
firstPage: { default: 1 },
|
|
10
10
|
showFirstLast: { type: Boolean, default: !0 },
|
|
@@ -16,82 +16,82 @@ const Qe = { class: "dsg-table--pagination" }, Ye = ["disabled"], xe = ["disable
|
|
|
16
16
|
pagination: { default: null },
|
|
17
17
|
paginationModifiers: {}
|
|
18
18
|
}),
|
|
19
|
-
emits: /* @__PURE__ */
|
|
19
|
+
emits: /* @__PURE__ */ G(["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),
|
|
22
|
-
|
|
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), h = 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), w = v, s = (u) => {
|
|
22
|
+
w("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, C) => oe((a(), n("div", Qe, [
|
|
27
27
|
u.showFirstLast ? (a(), n("a", {
|
|
28
28
|
key: 0,
|
|
29
|
-
onClick:
|
|
30
|
-
class: F([[
|
|
31
|
-
disabled:
|
|
29
|
+
onClick: C[0] || (C[0] = (I) => s(u.firstPage)),
|
|
30
|
+
class: F([[h.value ? "disabled" : ""], "dsg-table--pagination-link"]),
|
|
31
|
+
disabled: h.value,
|
|
32
32
|
title: "First",
|
|
33
33
|
"aria-label": "First"
|
|
34
34
|
}, [
|
|
35
|
-
|
|
35
|
+
B(A, {
|
|
36
36
|
icon: u.firstIcon,
|
|
37
37
|
size: "sm"
|
|
38
38
|
}, null, 8, ["icon"])
|
|
39
|
-
], 10, Ye)) :
|
|
40
|
-
|
|
41
|
-
onClick:
|
|
42
|
-
class: F([[
|
|
43
|
-
disabled:
|
|
39
|
+
], 10, Ye)) : k("", !0),
|
|
40
|
+
m("a", {
|
|
41
|
+
onClick: C[1] || (C[1] = (I) => s("prev")),
|
|
42
|
+
class: F([[h.value ? "disabled" : ""], "dsg-table--pagination-link"]),
|
|
43
|
+
disabled: h.value,
|
|
44
44
|
title: "Previous",
|
|
45
45
|
"aria-label": "Previous"
|
|
46
46
|
}, [
|
|
47
|
-
|
|
47
|
+
B(A, {
|
|
48
48
|
icon: u.prevIcon,
|
|
49
49
|
size: "sm"
|
|
50
50
|
}, null, 8, ["icon"])
|
|
51
|
-
], 10,
|
|
52
|
-
H.value ? (a(!0), n(E, { key: 1 }, q(f.value, (I,
|
|
53
|
-
key:
|
|
54
|
-
onClick: (j) => s(
|
|
55
|
-
class: F([[d(
|
|
51
|
+
], 10, Ge),
|
|
52
|
+
H.value ? (a(!0), n(E, { key: 1 }, q(f.value, (I, D) => (a(), n("a", {
|
|
53
|
+
key: D,
|
|
54
|
+
onClick: (j) => s(D + u.firstPage),
|
|
55
|
+
class: F([[d(D + u.firstPage) ? "active" : ""], "dsg-table--pagination-link"]),
|
|
56
56
|
innerHTML: I
|
|
57
|
-
}, null, 10,
|
|
58
|
-
key:
|
|
59
|
-
onClick: (j) => s(r.value +
|
|
60
|
-
class: F([[d(r.value +
|
|
57
|
+
}, null, 10, Je))), 128)) : (a(!0), n(E, { key: 2 }, q(V.value, (I, D) => (a(), n("a", {
|
|
58
|
+
key: D,
|
|
59
|
+
onClick: (j) => s(r.value + D + u.firstPage - 1),
|
|
60
|
+
class: F([[d(r.value + D + u.firstPage - 1) ? "active" : ""], "dsg-table--pagination-link"]),
|
|
61
61
|
innerHTML: r.value + I - 1
|
|
62
|
-
}, null, 10,
|
|
63
|
-
|
|
64
|
-
onClick:
|
|
62
|
+
}, null, 10, Xe))), 128)),
|
|
63
|
+
m("a", {
|
|
64
|
+
onClick: C[2] || (C[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
|
-
|
|
70
|
+
B(A, {
|
|
71
71
|
icon: u.nextIcon,
|
|
72
72
|
size: "sm"
|
|
73
73
|
}, null, 8, ["icon"])
|
|
74
|
-
], 10,
|
|
74
|
+
], 10, Ze),
|
|
75
75
|
u.showFirstLast ? (a(), n("a", {
|
|
76
76
|
key: 3,
|
|
77
|
-
onClick:
|
|
77
|
+
onClick: C[3] || (C[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
|
-
|
|
83
|
+
B(A, {
|
|
84
84
|
icon: u.lastIcon,
|
|
85
85
|
size: "sm"
|
|
86
86
|
}, null, 8, ["icon"])
|
|
87
|
-
], 10,
|
|
87
|
+
], 10, xe)) : k("", !0)
|
|
88
88
|
], 512)), [
|
|
89
89
|
[Se, i.value && b.value > u.firstPage]
|
|
90
90
|
]);
|
|
91
91
|
}
|
|
92
92
|
}), _e = ["innerHTML"], pe = /* @__PURE__ */ W({
|
|
93
93
|
__name: "DsgTablePaginationInfo",
|
|
94
|
-
props: /* @__PURE__ */
|
|
94
|
+
props: /* @__PURE__ */ G({
|
|
95
95
|
infoTemplate: { default: "Displaying {from} to {to} of {total} items" },
|
|
96
96
|
noDataTemplate: { default: "No relevant data" }
|
|
97
97
|
}, {
|
|
@@ -121,8 +121,8 @@ const Qe = { class: "dsg-table--pagination" }, Ye = ["disabled"], xe = ["disable
|
|
|
121
121
|
setup(t, { emit: $ }) {
|
|
122
122
|
const v = y(!1);
|
|
123
123
|
ge("dsgTableActions");
|
|
124
|
-
const i = Fe(), f = y(i.data.rowData?.actions ?? null), b = y(i.data.rowData?.links ?? null),
|
|
125
|
-
switch (
|
|
124
|
+
const i = Fe(), f = y(i.data.rowData?.actions ?? null), b = y(i.data.rowData?.links ?? null), h = y(i.data.rowData ?? null), p = (w) => {
|
|
125
|
+
switch (w) {
|
|
126
126
|
case "edit":
|
|
127
127
|
return "edit-05";
|
|
128
128
|
case "view":
|
|
@@ -134,29 +134,29 @@ const Qe = { class: "dsg-table--pagination" }, Ye = ["disabled"], xe = ["disable
|
|
|
134
134
|
default:
|
|
135
135
|
return "dots-horizontal";
|
|
136
136
|
}
|
|
137
|
-
}, H = (
|
|
137
|
+
}, H = (w, s, d) => {
|
|
138
138
|
switch (s) {
|
|
139
139
|
case "edit":
|
|
140
|
-
r("dsg-table:action-edit", d,
|
|
140
|
+
r("dsg-table:action-edit", d, h.value);
|
|
141
141
|
break;
|
|
142
142
|
case "view":
|
|
143
|
-
r("dsg-table:action-view", d,
|
|
143
|
+
r("dsg-table:action-view", d, h.value);
|
|
144
144
|
break;
|
|
145
145
|
case "delete":
|
|
146
|
-
r("dsg-table:action-delete", d,
|
|
146
|
+
r("dsg-table:action-delete", d, h.value);
|
|
147
147
|
break;
|
|
148
148
|
case "archive":
|
|
149
|
-
r("dsg-table:action-archive", d,
|
|
149
|
+
r("dsg-table:action-archive", d, h.value);
|
|
150
150
|
break;
|
|
151
151
|
}
|
|
152
|
-
}, V = (
|
|
153
|
-
const d =
|
|
154
|
-
r("dsg-table:link-clicked", s, d,
|
|
152
|
+
}, V = (w, s) => {
|
|
153
|
+
const d = w.actionId || w.label.trim().toLowerCase().replace(/[^a-z0-9-]/g, "-").replace(/-+/g, "-");
|
|
154
|
+
r("dsg-table:link-clicked", s, d, h.value);
|
|
155
155
|
}, r = $;
|
|
156
|
-
return (
|
|
157
|
-
|
|
156
|
+
return (w, s) => oe((a(), n("div", et, [
|
|
157
|
+
B(U(Ve), {
|
|
158
158
|
triggers: [],
|
|
159
|
-
placement:
|
|
159
|
+
placement: w.placement,
|
|
160
160
|
"handle-resize": !0,
|
|
161
161
|
strategy: "absolute",
|
|
162
162
|
shown: v.value,
|
|
@@ -164,34 +164,34 @@ const Qe = { class: "dsg-table--pagination" }, Ye = ["disabled"], xe = ["disable
|
|
|
164
164
|
onHide: s[1] || (s[1] = (d) => v.value = !1),
|
|
165
165
|
ref: "floatingVueFilterDropdown"
|
|
166
166
|
}, {
|
|
167
|
-
popper:
|
|
167
|
+
popper: x(() => [
|
|
168
168
|
v.value ? (a(), n("div", at, [
|
|
169
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: (C) => H(d, String(u), C)
|
|
175
175
|
}, [
|
|
176
|
-
|
|
176
|
+
m("div", {
|
|
177
177
|
class: F(["dsg-table--actions-menu-item", String(u)])
|
|
178
178
|
}, [
|
|
179
|
-
|
|
179
|
+
B(A, {
|
|
180
180
|
icon: p(String(u)),
|
|
181
181
|
size: "sm"
|
|
182
182
|
}, null, 8, ["icon"]),
|
|
183
|
-
|
|
183
|
+
m("span", {
|
|
184
184
|
class: "flex-1",
|
|
185
185
|
textContent: _(U(We)(String(u)))
|
|
186
186
|
}, null, 8, st)
|
|
187
187
|
], 2)
|
|
188
|
-
], 8, lt)) :
|
|
188
|
+
], 8, lt)) : k("", !0)
|
|
189
189
|
], 64))), 256)),
|
|
190
|
-
f.value && b.value ? (a(), n("hr", nt)) :
|
|
190
|
+
f.value && b.value ? (a(), n("hr", nt)) : k("", !0),
|
|
191
191
|
b.value ? (a(!0), n(E, { key: 1 }, q(b.value, (d) => (a(), n(E, {
|
|
192
192
|
key: d.label
|
|
193
193
|
}, [
|
|
194
|
-
d.hasOwnProperty("component") ? (a(), N(
|
|
194
|
+
d.hasOwnProperty("component") ? (a(), N(Be(d.component), {
|
|
195
195
|
key: 0,
|
|
196
196
|
quote: U(i).data.data.rowData,
|
|
197
197
|
"row-data": U(i).data.data.rowData
|
|
@@ -206,23 +206,23 @@ const Qe = { class: "dsg-table--pagination" }, Ye = ["disabled"], xe = ["disable
|
|
|
206
206
|
key: 0,
|
|
207
207
|
icon: d.icon,
|
|
208
208
|
size: "sm"
|
|
209
|
-
}, null, 8, ["icon"])) :
|
|
210
|
-
|
|
209
|
+
}, null, 8, ["icon"])) : k("", !0),
|
|
210
|
+
m("span", rt, _(d.label), 1)
|
|
211
211
|
], 10, it))
|
|
212
|
-
], 64))), 128)) :
|
|
213
|
-
])) :
|
|
212
|
+
], 64))), 128)) : k("", !0)
|
|
213
|
+
])) : k("", !0)
|
|
214
214
|
]),
|
|
215
|
-
default:
|
|
216
|
-
|
|
217
|
-
|
|
215
|
+
default: x(() => [
|
|
216
|
+
m("div", tt, [
|
|
217
|
+
m("button", {
|
|
218
218
|
type: "button",
|
|
219
219
|
class: "dsg-table--actions-button",
|
|
220
220
|
"aria-expanded": "false",
|
|
221
221
|
"aria-haspopup": "true",
|
|
222
222
|
onClick: s[0] || (s[0] = (d) => v.value = !v.value)
|
|
223
223
|
}, [
|
|
224
|
-
T(
|
|
225
|
-
|
|
224
|
+
T(w.$slots, "dsg-table-action-button-content", {}, () => [
|
|
225
|
+
B(A, {
|
|
226
226
|
icon: "dots-vertical",
|
|
227
227
|
size: "sm"
|
|
228
228
|
})
|
|
@@ -254,10 +254,10 @@ const Qe = { class: "dsg-table--pagination" }, Ye = ["disabled"], xe = ["disable
|
|
|
254
254
|
const v = y(""), i = $, f = qe((b) => {
|
|
255
255
|
v.value = b, i("dsg-table:term-changed", v.value);
|
|
256
256
|
}, 300);
|
|
257
|
-
return (b,
|
|
258
|
-
|
|
257
|
+
return (b, h) => (a(), n("div", dt, [
|
|
258
|
+
B(Ue, {
|
|
259
259
|
value: v.value,
|
|
260
|
-
"onUpdate:value":
|
|
260
|
+
"onUpdate:value": h[0] || (h[0] = (p) => v.value = p),
|
|
261
261
|
name: b.name,
|
|
262
262
|
id: b.id || b.name,
|
|
263
263
|
placeholder: b.placeholder,
|
|
@@ -270,9 +270,9 @@ const Qe = { class: "dsg-table--pagination" }, Ye = ["disabled"], xe = ["disable
|
|
|
270
270
|
size: "sm",
|
|
271
271
|
icon: "search-sm",
|
|
272
272
|
"icon-clickable": !0,
|
|
273
|
-
onIconClicked:
|
|
274
|
-
onEnterPressed:
|
|
275
|
-
onOnClear:
|
|
273
|
+
onIconClicked: h[1] || (h[1] = (p) => U(f)(p)),
|
|
274
|
+
onEnterPressed: h[2] || (h[2] = (p) => U(f)(p)),
|
|
275
|
+
onOnClear: h[3] || (h[3] = () => U(f)(""))
|
|
276
276
|
}, null, 8, ["value", "name", "id", "placeholder", "disabled", "required", "readonly", "hidden"])
|
|
277
277
|
]));
|
|
278
278
|
}
|
|
@@ -289,7 +289,7 @@ const Qe = { class: "dsg-table--pagination" }, Ye = ["disabled"], xe = ["disable
|
|
|
289
289
|
class: "dsg-table--th-sort-icon"
|
|
290
290
|
}, ft = ["innerHTML"], pt = ["innerHTML"], ye = /* @__PURE__ */ W({
|
|
291
291
|
__name: "DsgTableRowHeader",
|
|
292
|
-
props: /* @__PURE__ */
|
|
292
|
+
props: /* @__PURE__ */ G({
|
|
293
293
|
fields: {},
|
|
294
294
|
scrollVisible: { type: Boolean },
|
|
295
295
|
hasSelectAll: { type: Boolean, default: !1 },
|
|
@@ -303,16 +303,16 @@ const Qe = { class: "dsg-table--pagination" }, Ye = ["disabled"], xe = ["disable
|
|
|
303
303
|
hasSelected: { type: Boolean, default: !1 },
|
|
304
304
|
hasSelectedModifiers: {}
|
|
305
305
|
}),
|
|
306
|
-
emits: /* @__PURE__ */
|
|
306
|
+
emits: /* @__PURE__ */ G(["dsg-table:sort-field", "dsg-table:on-select-all", "dsg-table:on-deselect-all"], ["update:sortField", "update:selectedRows", "update:hasSelected"]),
|
|
307
307
|
setup(t, { emit: $ }) {
|
|
308
|
-
const v = Y(t, "sortField"), i = Y(t, "selectedRows"), f = Y(t, "hasSelected"), b = y("17px"),
|
|
308
|
+
const v = Y(t, "sortField"), i = Y(t, "selectedRows"), f = Y(t, "hasSelected"), b = y("17px"), h = (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 = $, H = (r,
|
|
310
|
+
}, p = $, H = (r, w) => [
|
|
311
311
|
r,
|
|
312
|
-
r + "-" + Ke(String(
|
|
313
|
-
|
|
314
|
-
{ sortable:
|
|
315
|
-
{ "sort-active": v.value?.name ===
|
|
312
|
+
r + "-" + Ke(String(w?.name)),
|
|
313
|
+
w.titleClass || "",
|
|
314
|
+
{ sortable: w.sortable },
|
|
315
|
+
{ "sort-active": v.value?.name === w.name }
|
|
316
316
|
], V = (r) => {
|
|
317
317
|
r.sortable && (v.value = {
|
|
318
318
|
name: String(r?.name),
|
|
@@ -320,23 +320,23 @@ const Qe = { class: "dsg-table--pagination" }, Ye = ["disabled"], xe = ["disable
|
|
|
320
320
|
direction: v.value?.name === r.name && v.value?.direction === "asc" ? "desc" : "asc"
|
|
321
321
|
}, p("dsg-table:sort-field", r));
|
|
322
322
|
};
|
|
323
|
-
return (r,
|
|
323
|
+
return (r, w) => (a(), n("tr", ut, [
|
|
324
324
|
r.hasSelectAll ? (a(), n("th", ct, [
|
|
325
|
-
|
|
325
|
+
B(ve, {
|
|
326
326
|
modelValue: f.value,
|
|
327
327
|
"onUpdate:modelValue": [
|
|
328
|
-
|
|
329
|
-
|
|
328
|
+
w[0] || (w[0] = (s) => f.value = s),
|
|
329
|
+
h
|
|
330
330
|
],
|
|
331
331
|
indeterminate: i.value.length > 0 && i.value.length !== r.tableDataLength
|
|
332
332
|
}, null, 8, ["modelValue", "indeterminate"])
|
|
333
|
-
])) :
|
|
334
|
-
r.showExpandDetail ? (a(), n("th", gt)) :
|
|
333
|
+
])) : k("", !0),
|
|
334
|
+
r.showExpandDetail ? (a(), n("th", gt)) : k("", !0),
|
|
335
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
338
|
class: F(H("dsg-table--th", s)),
|
|
339
|
-
style:
|
|
339
|
+
style: X([{ width: s.width || void 0 }, s.style]),
|
|
340
340
|
title: s.title + (s.sortable ? " Sort" : ""),
|
|
341
341
|
id: "_" + s.name,
|
|
342
342
|
onClick: (u) => V(s),
|
|
@@ -347,37 +347,37 @@ const Qe = { class: "dsg-table--pagination" }, Ye = ["disabled"], xe = ["disable
|
|
|
347
347
|
key: 0,
|
|
348
348
|
class: "dsg-table--th-title",
|
|
349
349
|
innerHTML: s.title
|
|
350
|
-
}, null, 8, ft)) :
|
|
350
|
+
}, null, 8, ft)) : k("", !0),
|
|
351
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
|
+
})) : k("", !0),
|
|
357
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
|
+
})) : k("", !0),
|
|
363
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",
|
|
367
367
|
size: "xs"
|
|
368
|
-
})) :
|
|
368
|
+
})) : k("", !0)
|
|
369
369
|
])) : (a(), n("span", {
|
|
370
370
|
key: 1,
|
|
371
371
|
class: "dsg-table--th-title",
|
|
372
372
|
innerHTML: U(je)(String(s?.title))
|
|
373
373
|
}, null, 8, pt))
|
|
374
|
-
], 14, vt)) :
|
|
374
|
+
], 14, vt)) : k("", !0)
|
|
375
375
|
], 64))), 256)),
|
|
376
376
|
r.scrollVisible ? (a(), n("th", {
|
|
377
377
|
key: 2,
|
|
378
|
-
style:
|
|
378
|
+
style: X({ width: b.value }),
|
|
379
379
|
class: "dsg-table--th-col-gutter"
|
|
380
|
-
}, null, 4)) :
|
|
380
|
+
}, null, 4)) : k("", !0)
|
|
381
381
|
]));
|
|
382
382
|
}
|
|
383
383
|
}), ht = { class: "dsg-table--wrapper" }, mt = ["span"], yt = {
|
|
@@ -386,9 +386,9 @@ const Qe = { class: "dsg-table--pagination" }, Ye = ["disabled"], xe = ["disable
|
|
|
386
386
|
}, kt = ["colspan"], wt = ["colspan"], Pt = ["onClick", "onDblclick", "onMouseover"], $t = {
|
|
387
387
|
key: 0,
|
|
388
388
|
class: "dsg-table--tbody-cell dsg-table--tbody-cell-checkbox"
|
|
389
|
-
},
|
|
389
|
+
}, Ct = ["onClick", "onDblclick", "onContextmenu"], Dt = ["innerHTML"], Tt = ["onClick"], St = ["colspan"], Ft = { key: 2 }, Bt = ["colspan"], Mt = { class: "dsg-table--footer" }, Lt = /* @__PURE__ */ W({
|
|
390
390
|
__name: "DsgTableComponent",
|
|
391
|
-
props: /* @__PURE__ */
|
|
391
|
+
props: /* @__PURE__ */ G({
|
|
392
392
|
fields: { default: () => [] },
|
|
393
393
|
isDraggable: { type: Boolean, default: !1 },
|
|
394
394
|
dragApi: { default: "" },
|
|
@@ -444,7 +444,7 @@ const Qe = { class: "dsg-table--pagination" }, Ye = ["disabled"], xe = ["disable
|
|
|
444
444
|
perPage: { default: 20 },
|
|
445
445
|
perPageModifiers: {}
|
|
446
446
|
}),
|
|
447
|
-
emits: /* @__PURE__ */
|
|
447
|
+
emits: /* @__PURE__ */ G(["dsg-table:loading", "dsg-table:loaded", "dsg-table:load-success", "dsg-table:load-error", "dsg-table:pagination-data", "dsg-table:rows-selected"], ["update:filterParams", "update:perPage"]),
|
|
448
448
|
setup(t, { expose: $, emit: v }) {
|
|
449
449
|
const i = (e) => e.map((o, g) => ({
|
|
450
450
|
field: o.field || "",
|
|
@@ -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),
|
|
461
|
+
})), f = y(i(t.fields)), b = y(t.data), h = y(null), p = y(t.initialPage), H = y("17px"), V = y(!1), r = y({}), w = y(0), s = y(!0), d = y(null), u = y(null), C = Y(t, "filterParams"), I = Y(t, "perPage"), D = y([]), j = y(!1), K = O(() => t.tableHeight != null), Q = O(() => f.value.filter((e) => e.visible).length);
|
|
462
462
|
te(
|
|
463
|
-
() =>
|
|
463
|
+
() => D.value.length,
|
|
464
464
|
(e) => {
|
|
465
465
|
j.value = t.selectable && e > 0;
|
|
466
466
|
},
|
|
@@ -472,46 +472,46 @@ const Qe = { class: "dsg-table--pagination" }, Ye = ["disabled"], xe = ["disable
|
|
|
472
472
|
},
|
|
473
473
|
{ immediate: !0 }
|
|
474
474
|
), te(
|
|
475
|
-
() =>
|
|
475
|
+
() => C.value,
|
|
476
476
|
() => {
|
|
477
|
-
|
|
477
|
+
Z();
|
|
478
478
|
},
|
|
479
479
|
{ deep: !0 }
|
|
480
480
|
), te(
|
|
481
481
|
() => I.value,
|
|
482
482
|
() => {
|
|
483
|
-
|
|
483
|
+
Z();
|
|
484
484
|
}
|
|
485
485
|
);
|
|
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
|
+
D.value.push(e);
|
|
490
490
|
else {
|
|
491
|
-
const o =
|
|
492
|
-
o !== -1 &&
|
|
491
|
+
const o = D.value.findIndex((g) => g[t.trackBy] === e[t.trackBy]);
|
|
492
|
+
o !== -1 && D.value.splice(o, 1);
|
|
493
493
|
}
|
|
494
|
-
z("dsg-table:rows-selected",
|
|
494
|
+
z("dsg-table:rows-selected", D.value);
|
|
495
495
|
}
|
|
496
496
|
}, c = () => {
|
|
497
497
|
t.selectable && (b.value?.forEach((e) => {
|
|
498
498
|
e.selected = !0;
|
|
499
|
-
}),
|
|
500
|
-
},
|
|
499
|
+
}), D.value = b.value?.filter((e) => e.selected) ?? [], z("dsg-table:rows-selected", D.value));
|
|
500
|
+
}, P = () => {
|
|
501
501
|
t.selectable && (b.value?.forEach((e) => {
|
|
502
502
|
e.selected = !1;
|
|
503
|
-
}),
|
|
503
|
+
}), D.value = [], z("dsg-table:rows-selected", D.value));
|
|
504
504
|
}, S = (e) => {
|
|
505
|
-
e === "prev" ? p.value > t.firstPage && p.value-- : e === "next" ? p.value < (
|
|
506
|
-
},
|
|
505
|
+
e === "prev" ? p.value > t.firstPage && p.value-- : e === "next" ? p.value < (h.value?.last_page ?? 0) && p.value++ : e != p.value && e >= t.firstPage && e <= (h.value?.last_page ?? 0) && (p.value = e), Z();
|
|
506
|
+
}, M = () => ({
|
|
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,
|
|
510
510
|
[t.queryParams?.perPage]: I.value
|
|
511
|
-
}),
|
|
511
|
+
}), J = () => {
|
|
512
512
|
u.value && (u.value.abort(), u.value = null);
|
|
513
513
|
}, le = async (e, o) => {
|
|
514
|
-
|
|
514
|
+
J();
|
|
515
515
|
const g = new AbortController();
|
|
516
516
|
if (o.signal = g.signal, u.value = g, t.httpMethod.toLowerCase() === "get")
|
|
517
517
|
return await ce.get(e, o);
|
|
@@ -524,68 +524,68 @@ const Qe = { class: "dsg-table--pagination" }, Ye = ["disabled"], xe = ["disable
|
|
|
524
524
|
const o = t.transform ? t.transform(e.data) : e.data;
|
|
525
525
|
b.value = ne(o, t.dataPath, null), t.selectable && b.value?.forEach((g) => {
|
|
526
526
|
g.selected = g.selected ?? !1;
|
|
527
|
-
}),
|
|
527
|
+
}), h.value = ne(o, t.paginationPath, null) ?? null, w.value = b.value?.length ? b.value[0].order : w, h.value === null && console.warn(
|
|
528
528
|
'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.
|
|
529
529
|
You can explicitly suppress this warning by setting pagination-path="".`
|
|
530
|
-
), z("dsg-table:pagination-data",
|
|
530
|
+
), z("dsg-table:pagination-data", h.value), z("dsg-table:loaded"), s.value = !1;
|
|
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
|
+
}, Z = (e = ie, o = re, g = {}) => {
|
|
534
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
|
-
...
|
|
537
|
+
...M(),
|
|
538
|
+
...C.value
|
|
539
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
543
|
}, $e = (e, o, g, R) => {
|
|
544
|
-
}, De = (e, o, g, R) => {
|
|
545
544
|
}, Ce = (e, o, g, R) => {
|
|
545
|
+
}, De = (e, o, g, R) => {
|
|
546
546
|
}, Te = (e, o, g) => {
|
|
547
547
|
};
|
|
548
|
-
|
|
549
|
-
t.apiMode === !0 &&
|
|
548
|
+
Me(() => {
|
|
549
|
+
t.apiMode === !0 && Z();
|
|
550
550
|
});
|
|
551
551
|
const de = () => {
|
|
552
|
-
t.apiMode && (p.value = t.initialPage,
|
|
552
|
+
t.apiMode && (p.value = t.initialPage, D.value = [], J(), Z());
|
|
553
553
|
};
|
|
554
554
|
return $({
|
|
555
555
|
changePage: S,
|
|
556
556
|
reload: de
|
|
557
557
|
}), (e, o) => (a(), n("div", ht, [
|
|
558
|
-
|
|
558
|
+
m("div", {
|
|
559
559
|
ref: "dsgTableBodyWrapper",
|
|
560
560
|
class: F(["dsg-table-body-wrapper", { "fixed-header": K.value }]),
|
|
561
|
-
style:
|
|
561
|
+
style: X({ height: e.tableHeight || void 0 })
|
|
562
562
|
}, [
|
|
563
|
-
|
|
563
|
+
m("table", {
|
|
564
564
|
class: F(["dsg-table-main", K.value ? "fixed-header" : "", r.value.table, "table-" + e.tableLayout])
|
|
565
565
|
}, [
|
|
566
|
-
|
|
566
|
+
m("colgroup", { span: Q.value }, [
|
|
567
567
|
(a(!0), n(E, null, q(f.value, (g, R) => (a(), n(E, null, [
|
|
568
568
|
g?.visible ? (a(), n("col", {
|
|
569
569
|
key: R,
|
|
570
|
-
style:
|
|
570
|
+
style: X({ width: g.width || void 0 }),
|
|
571
571
|
class: F("dsg-table--col-" + g.name + " " + g.titleClass)
|
|
572
|
-
}, null, 6)) :
|
|
572
|
+
}, null, 6)) : k("", !0)
|
|
573
573
|
], 64))), 256)),
|
|
574
574
|
!K.value && V.value ? (a(), n("col", {
|
|
575
575
|
key: 0,
|
|
576
|
-
style:
|
|
576
|
+
style: X({ width: H.value }),
|
|
577
577
|
class: "dsg-table--col-gutter"
|
|
578
|
-
}, null, 4)) :
|
|
578
|
+
}, null, 4)) : k("", !0)
|
|
579
579
|
], 8, mt),
|
|
580
|
-
|
|
580
|
+
m("thead", {
|
|
581
581
|
class: F([[r.value.thead, { sticky: K.value, "top-0": K.value }], "dsg-table--head"])
|
|
582
582
|
}, [
|
|
583
583
|
T(e.$slots, "tableHeader", { fields: f.value }, () => [
|
|
584
|
-
|
|
584
|
+
B(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": D.value,
|
|
588
|
+
"onUpdate:selectedRows": o[0] || (o[0] = (g) => D.value = g),
|
|
589
589
|
"has-selected": j.value,
|
|
590
590
|
"onUpdate:hasSelected": o[1] || (o[1] = (g) => j.value = g),
|
|
591
591
|
"scroll-visible": V.value,
|
|
@@ -595,74 +595,74 @@ You can explicitly suppress this warning by setting pagination-path="".`
|
|
|
595
595
|
"onUpdate:sortField": o[2] || (o[2] = (g) => d.value = g),
|
|
596
596
|
"onDsgTable:sortField": o[3] || (o[3] = (g) => de()),
|
|
597
597
|
"onDsgTable:onSelectAll": c,
|
|
598
|
-
"onDsgTable:onDeselectAll":
|
|
598
|
+
"onDsgTable:onDeselectAll": P
|
|
599
599
|
}, null, 8, ["fields", "has-select-all", "selected-rows", "has-selected", "scroll-visible", "show-expand-detail", "table-data-length", "sort-field"])
|
|
600
600
|
])
|
|
601
601
|
], 2),
|
|
602
|
-
|
|
602
|
+
m("tbody", {
|
|
603
603
|
class: F(["dsg-table--body", r.value.tbody])
|
|
604
604
|
}, [
|
|
605
605
|
s.value ? (a(), n("tr", yt, [
|
|
606
|
-
|
|
607
|
-
|
|
606
|
+
m("td", { colspan: Q.value }, [
|
|
607
|
+
m("div", {
|
|
608
608
|
"aria-label": "Loading...",
|
|
609
609
|
role: "status",
|
|
610
610
|
class: "flex items-center space-x-3 h-12 w-full justify-center",
|
|
611
611
|
colspan: Q.value
|
|
612
612
|
}, [
|
|
613
613
|
T(e.$slots, "dsg-table-loading", {}, () => [
|
|
614
|
-
|
|
614
|
+
B(A, {
|
|
615
615
|
icon: "loading-02",
|
|
616
616
|
class: "animate-spin"
|
|
617
617
|
}),
|
|
618
|
-
o[4] || (o[4] =
|
|
618
|
+
o[4] || (o[4] = m("span", { class: "text-xs font-medium text-gray-500" }, "Loading...", -1))
|
|
619
619
|
])
|
|
620
620
|
], 8, wt)
|
|
621
621
|
], 8, kt)
|
|
622
622
|
])) : (a(!0), n(E, { key: 1 }, q(b.value, (g, R) => (a(), n(E, { key: R }, [
|
|
623
|
-
|
|
623
|
+
m("tr", {
|
|
624
624
|
class: F(["dsg-table--tbody-row", { odd: R % 2 === 0, even: R % 2 !== 0, "row-selected": g.selected }]),
|
|
625
625
|
onClick: (L) => ke(),
|
|
626
626
|
onDblclick: (L) => we(),
|
|
627
627
|
onMouseover: (L) => Pe()
|
|
628
628
|
}, [
|
|
629
629
|
e.selectable ? (a(), n("td", $t, [
|
|
630
|
-
|
|
630
|
+
B(ve, {
|
|
631
631
|
modelValue: g.selected,
|
|
632
632
|
"onUpdate:modelValue": [(L) => g.selected = L, (L) => l(g)]
|
|
633
633
|
}, null, 8, ["modelValue", "onUpdate:modelValue"])
|
|
634
|
-
])) :
|
|
634
|
+
])) : k("", !0),
|
|
635
635
|
(a(!0), n(E, null, q(f.value, (L, se) => (a(), n(E, { key: se }, [
|
|
636
636
|
L.visible ? (a(), n("td", {
|
|
637
637
|
key: 0,
|
|
638
638
|
class: F(["dsg-table--tbody-cell", L.dataClass]),
|
|
639
|
-
style:
|
|
639
|
+
style: X({ width: L.width || void 0 }),
|
|
640
640
|
onClick: (ue) => $e(),
|
|
641
|
-
onDblclick: (ue) =>
|
|
642
|
-
onContextmenu: (ue) =>
|
|
641
|
+
onDblclick: (ue) => Ce(),
|
|
642
|
+
onContextmenu: (ue) => De()
|
|
643
643
|
}, [
|
|
644
644
|
T(e.$slots, ae(L), {
|
|
645
645
|
rowData: g,
|
|
646
646
|
rowIndex: R,
|
|
647
647
|
rowField: L
|
|
648
648
|
}, () => [
|
|
649
|
-
|
|
649
|
+
m("span", {
|
|
650
650
|
innerHTML: ee(L, g)
|
|
651
|
-
}, null, 8,
|
|
651
|
+
}, null, 8, Dt)
|
|
652
652
|
])
|
|
653
|
-
], 46,
|
|
653
|
+
], 46, Ct)) : k("", !0)
|
|
654
654
|
], 64))), 128))
|
|
655
655
|
], 42, Pt),
|
|
656
656
|
e.hasDetailRow ? (a(), N(Le, {
|
|
657
657
|
key: 0,
|
|
658
658
|
name: e.detailRowTransition
|
|
659
659
|
}, {
|
|
660
|
-
default:
|
|
661
|
-
|
|
660
|
+
default: x(() => [
|
|
661
|
+
m("tr", {
|
|
662
662
|
class: "dsg-table--tbody-detail-row",
|
|
663
663
|
onClick: (L) => Te()
|
|
664
664
|
}, [
|
|
665
|
-
|
|
665
|
+
m("td", { colspan: Q.value }, [
|
|
666
666
|
T(e.$slots, "dsg-table-detail-row", {
|
|
667
667
|
rowData: g,
|
|
668
668
|
rowIndex: R,
|
|
@@ -672,20 +672,20 @@ You can explicitly suppress this warning by setting pagination-path="".`
|
|
|
672
672
|
], 8, Tt)
|
|
673
673
|
]),
|
|
674
674
|
_: 2
|
|
675
|
-
}, 1032, ["name"])) :
|
|
675
|
+
}, 1032, ["name"])) : k("", !0)
|
|
676
676
|
], 64))), 128)),
|
|
677
677
|
!b.value?.length && e.noDataTemplate.length ? (a(), n("tr", Ft, [
|
|
678
|
-
|
|
678
|
+
m("td", {
|
|
679
679
|
colspan: Q.value,
|
|
680
680
|
class: "dsg-table--empty-result"
|
|
681
681
|
}, [
|
|
682
682
|
T(e.$slots, "dsg-table-empty-result", {}, () => [
|
|
683
683
|
Ee(_(e.noDataTemplate), 1)
|
|
684
684
|
])
|
|
685
|
-
], 8,
|
|
686
|
-
])) :
|
|
685
|
+
], 8, Bt)
|
|
686
|
+
])) : k("", !0)
|
|
687
687
|
], 2),
|
|
688
|
-
|
|
688
|
+
m("tfoot", Mt, [
|
|
689
689
|
T(e.$slots, "dsg-table-footer", {
|
|
690
690
|
fields: f.value,
|
|
691
691
|
data: b.value
|
|
@@ -695,10 +695,16 @@ You can explicitly suppress this warning by setting pagination-path="".`
|
|
|
695
695
|
], 6)
|
|
696
696
|
]));
|
|
697
697
|
}
|
|
698
|
-
}), Et = { class: "dsg-table" }, Rt = {
|
|
698
|
+
}), Et = { class: "dsg-table" }, Rt = {
|
|
699
699
|
key: 0,
|
|
700
|
+
class: "dsg-table--pre-header"
|
|
701
|
+
}, Ht = { class: "dsg-table--pre-header-left" }, It = ["textContent"], zt = { class: "dsg-table--pre-header-right" }, At = {
|
|
702
|
+
key: 1,
|
|
700
703
|
class: "dsg-table--search-header"
|
|
701
|
-
}, Vt = { class: "dsg-table--search-top" }, Ot = {
|
|
704
|
+
}, Vt = { class: "dsg-table--search-top" }, Ot = {
|
|
705
|
+
key: 2,
|
|
706
|
+
class: "dsg-table--footer"
|
|
707
|
+
}, Ut = { class: "dsg-table--footer-left" }, qt = { class: "dsg-table--footer-center" }, Nt = { class: "dsg-table--footer-right" }, Wt = /* @__PURE__ */ W({
|
|
702
708
|
__name: "DsgTable",
|
|
703
709
|
props: {
|
|
704
710
|
getUrl: {},
|
|
@@ -711,10 +717,14 @@ You can explicitly suppress this warning by setting pagination-path="".`
|
|
|
711
717
|
title: { default: "" },
|
|
712
718
|
filters: { default: () => {
|
|
713
719
|
} },
|
|
720
|
+
initialFilters: { default: () => ({}) },
|
|
714
721
|
filterEntity: { default: "" },
|
|
715
722
|
filterEndpoint: { default: "" },
|
|
716
723
|
filterSearchEndpoint: { default: "" },
|
|
717
|
-
tableLayout: { default: "fixed" }
|
|
724
|
+
tableLayout: { default: "fixed" },
|
|
725
|
+
data: { default: null },
|
|
726
|
+
hasHeader: { type: Boolean, default: !0 },
|
|
727
|
+
hasFooter: { type: Boolean, default: !0 }
|
|
718
728
|
},
|
|
719
729
|
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
730
|
setup(t, { expose: $, emit: v }) {
|
|
@@ -725,30 +735,30 @@ You can explicitly suppress this warning by setting pagination-path="".`
|
|
|
725
735
|
let l = {};
|
|
726
736
|
return Ne().forEach((c) => {
|
|
727
737
|
if (c.key.startsWith("filter[")) {
|
|
728
|
-
const
|
|
729
|
-
l[`filter[${
|
|
738
|
+
const P = c.key.replace("filter[", "").replace("]", ""), S = c.value;
|
|
739
|
+
l[`filter[${P}]`] = S.join(",");
|
|
730
740
|
}
|
|
731
741
|
}), l;
|
|
732
742
|
} else
|
|
733
743
|
return {};
|
|
734
|
-
},
|
|
735
|
-
|
|
736
|
-
},
|
|
744
|
+
}, h = Re(), p = y(!0), H = y(null), V = y("<p>Showing {from} to {to} of {total}</p>"), r = y(null), w = ge("dsgTable"), s = y({ perPage: 20, change: i }), d = y(20), u = y({ ...b(), ...t.initialFilters }), C = v, I = (l) => {
|
|
745
|
+
w.value?.changePage(l);
|
|
746
|
+
}, D = (l) => {
|
|
737
747
|
r.value = l;
|
|
738
748
|
}, j = ({ data: l }) => {
|
|
739
749
|
H.value = l;
|
|
740
750
|
}, K = () => {
|
|
741
|
-
p.value === !1 &&
|
|
751
|
+
p.value === !1 && w.value?.reload();
|
|
742
752
|
}, Q = (l) => {
|
|
743
|
-
|
|
744
|
-
|
|
753
|
+
w.value?.setData(
|
|
754
|
+
w.value?.tableData.map((c) => c.id === l.id ? l : c)
|
|
745
755
|
);
|
|
746
756
|
}, z = (l) => {
|
|
747
757
|
u.value = l;
|
|
748
758
|
}, ee = (l) => {
|
|
749
|
-
u.value["filter[term]"] = l,
|
|
750
|
-
}, ae = (l, c,
|
|
751
|
-
u.value = { "filter[term]": u.value["filter[term]"], ...l },
|
|
759
|
+
u.value["filter[term]"] = l, C("dsg-table:term-changed", l);
|
|
760
|
+
}, ae = (l, c, P) => {
|
|
761
|
+
u.value = { "filter[term]": u.value["filter[term]"], ...l }, C("dsg-table:filter-updated", u.value, c, P);
|
|
752
762
|
};
|
|
753
763
|
return $({
|
|
754
764
|
reloadTable: K,
|
|
@@ -756,9 +766,9 @@ You can explicitly suppress this warning by setting pagination-path="".`
|
|
|
756
766
|
termChanged: ee,
|
|
757
767
|
setFilters: z
|
|
758
768
|
}), (l, c) => (a(), n("div", Et, [
|
|
759
|
-
|
|
769
|
+
l.hasHeader ? (a(), n("div", Rt, [
|
|
760
770
|
T(l.$slots, "dsg-table--pre-header", {}, () => [
|
|
761
|
-
|
|
771
|
+
m("div", Ht, [
|
|
762
772
|
T(l.$slots, "dsg-table--page-title", {
|
|
763
773
|
data: H.value,
|
|
764
774
|
title: l.title
|
|
@@ -767,40 +777,40 @@ You can explicitly suppress this warning by setting pagination-path="".`
|
|
|
767
777
|
key: 0,
|
|
768
778
|
class: "dsg-table--title",
|
|
769
779
|
textContent: _(l.title)
|
|
770
|
-
}, null, 8, It)) :
|
|
780
|
+
}, null, 8, It)) : k("", !0)
|
|
771
781
|
])
|
|
772
782
|
]),
|
|
773
|
-
|
|
783
|
+
m("div", zt, [
|
|
774
784
|
T(l.$slots, "dsg-table--page-actions", { data: H.value })
|
|
775
785
|
])
|
|
776
786
|
])
|
|
777
|
-
]),
|
|
787
|
+
])) : k("", !0),
|
|
778
788
|
l.displayPaginationInfo ? (a(), n("div", At, [
|
|
779
|
-
|
|
789
|
+
m("div", Vt, [
|
|
780
790
|
T(l.$slots, "dsg-table--search-header", { data: H.value }, () => [
|
|
781
|
-
|
|
791
|
+
B(me, {
|
|
782
792
|
name: "term",
|
|
783
|
-
"onDsgTable:termChanged": c[0] || (c[0] = (
|
|
793
|
+
"onDsgTable:termChanged": c[0] || (c[0] = (P) => ee(P))
|
|
784
794
|
}),
|
|
785
|
-
|
|
795
|
+
B(be, {
|
|
786
796
|
entity: l.filterEntity,
|
|
787
797
|
"filter-endpoint": l.filterEndpoint,
|
|
788
798
|
"search-endpoint": l.filterSearchEndpoint,
|
|
789
799
|
filters: l.filters,
|
|
790
|
-
"onDsgTable:filterUpdated": c[1] || (c[1] = (
|
|
800
|
+
"onDsgTable:filterUpdated": c[1] || (c[1] = (P, S, M) => ae(P, S, M))
|
|
791
801
|
}, null, 8, ["entity", "filter-endpoint", "search-endpoint", "filters"]),
|
|
792
802
|
T(l.$slots, "dsg-table--search-actions", { data: H.value })
|
|
793
803
|
])
|
|
794
804
|
]),
|
|
795
805
|
T(l.$slots, "dsg-table--search-navigation")
|
|
796
|
-
])) :
|
|
797
|
-
|
|
806
|
+
])) : k("", !0),
|
|
807
|
+
B(Lt, {
|
|
798
808
|
ref: "dsgTable",
|
|
799
809
|
"api-url": l.getUrl,
|
|
800
810
|
"filter-params": u.value,
|
|
801
|
-
"onUpdate:filterParams": c[7] || (c[7] = (
|
|
811
|
+
"onUpdate:filterParams": c[7] || (c[7] = (P) => u.value = P),
|
|
802
812
|
"per-page": d.value,
|
|
803
|
-
"onUpdate:perPage": c[8] || (c[8] = (
|
|
813
|
+
"onUpdate:perPage": c[8] || (c[8] = (P) => d.value = P),
|
|
804
814
|
fields: l.fields,
|
|
805
815
|
"load-on-start": l.loadOnStart,
|
|
806
816
|
"pagination-path": "meta",
|
|
@@ -808,45 +818,46 @@ You can explicitly suppress this warning by setting pagination-path="".`
|
|
|
808
818
|
"track-by": l.trackBy,
|
|
809
819
|
"table-layout": l.tableLayout,
|
|
810
820
|
css: { tableWrapper: "border-b" },
|
|
811
|
-
|
|
812
|
-
"onDsgTable:
|
|
813
|
-
"onDsgTable:
|
|
821
|
+
data: l.data,
|
|
822
|
+
"onDsgTable:loading": c[9] || (c[9] = (P) => p.value = !0),
|
|
823
|
+
"onDsgTable:loaded": c[10] || (c[10] = (P) => p.value = !1),
|
|
824
|
+
"onDsgTable:paginationData": D,
|
|
814
825
|
"onDsgTable:loadSuccess": j,
|
|
815
|
-
"onDsgTable:rowsSelected": c[11] || (c[11] = (
|
|
826
|
+
"onDsgTable:rowsSelected": c[11] || (c[11] = (P) => C("dsg-table:rows-selected", P))
|
|
816
827
|
}, He({
|
|
817
|
-
"dsg-field--actions":
|
|
818
|
-
T(l.$slots, "dsg-table-actions", { data:
|
|
828
|
+
"dsg-field--actions": x((P) => [
|
|
829
|
+
T(l.$slots, "dsg-table-actions", { data: P }, () => [
|
|
819
830
|
(a(), N(he, {
|
|
820
|
-
key:
|
|
821
|
-
data:
|
|
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:actionArchive": c[5] || (c[5] = (S,
|
|
826
|
-
"onDsgTable:linkClicked": c[6] || (c[6] = (S,
|
|
831
|
+
key: P.rowIndex,
|
|
832
|
+
data: P,
|
|
833
|
+
"onDsgTable:actionEdit": c[2] || (c[2] = (S, M) => C("dsg-table:action-edit", S, M)),
|
|
834
|
+
"onDsgTable:actionView": c[3] || (c[3] = (S, M) => C("dsg-table:action-view", S, M)),
|
|
835
|
+
"onDsgTable:actionDelete": c[4] || (c[4] = (S, M) => C("dsg-table:action-delete", S, M)),
|
|
836
|
+
"onDsgTable:actionArchive": c[5] || (c[5] = (S, M) => C("dsg-table:action-archive", S, M)),
|
|
837
|
+
"onDsgTable:linkClicked": c[6] || (c[6] = (S, M, J) => C("dsg-table:link-clicked", S, M, J))
|
|
827
838
|
}, null, 8, ["data"]))
|
|
828
839
|
])
|
|
829
840
|
]),
|
|
830
841
|
_: 2
|
|
831
842
|
}, [
|
|
832
|
-
q(U(
|
|
843
|
+
q(U(h), (P, S) => ({
|
|
833
844
|
name: S,
|
|
834
|
-
fn:
|
|
835
|
-
String(S) !== "dsg-field--actions" ? T(l.$slots, S, Ie(ze({ key: 0 }, { rowData:
|
|
845
|
+
fn: x(({ rowData: M, rowField: J, rowIndex: le }) => [
|
|
846
|
+
String(S) !== "dsg-field--actions" ? T(l.$slots, S, Ie(ze({ key: 0 }, { rowData: M, rowField: J, rowIndex: le }))) : k("", !0)
|
|
836
847
|
])
|
|
837
848
|
}))
|
|
838
|
-
]), 1032, ["api-url", "filter-params", "per-page", "fields", "load-on-start", "selectable", "track-by", "table-layout"]),
|
|
839
|
-
|
|
840
|
-
|
|
849
|
+
]), 1032, ["api-url", "filter-params", "per-page", "fields", "load-on-start", "selectable", "track-by", "table-layout", "data"]),
|
|
850
|
+
l.hasFooter ? (a(), n("div", Ot, [
|
|
851
|
+
m("div", Ut, [
|
|
841
852
|
T(l.$slots, "dsg-table--footer-left", {
|
|
842
853
|
data: r.value,
|
|
843
854
|
perPage: s.value
|
|
844
855
|
}, () => [
|
|
845
|
-
|
|
856
|
+
B(pe, {
|
|
846
857
|
"no-data-template": "",
|
|
847
858
|
ref: "paginationInfoStart",
|
|
848
859
|
pagination: r.value,
|
|
849
|
-
"onUpdate:pagination": c[12] || (c[12] = (
|
|
860
|
+
"onUpdate:pagination": c[12] || (c[12] = (P) => r.value = P),
|
|
850
861
|
"info-template": V.value
|
|
851
862
|
}, null, 8, ["pagination", "info-template"]),
|
|
852
863
|
T(l.$slots, "dsg-table--footer-left-extras", {
|
|
@@ -855,7 +866,7 @@ You can explicitly suppress this warning by setting pagination-path="".`
|
|
|
855
866
|
})
|
|
856
867
|
])
|
|
857
868
|
]),
|
|
858
|
-
|
|
869
|
+
m("div", qt, [
|
|
859
870
|
T(l.$slots, "dsg-table--footer-center", {
|
|
860
871
|
data: r.value,
|
|
861
872
|
perPage: s.value
|
|
@@ -866,7 +877,7 @@ You can explicitly suppress this warning by setting pagination-path="".`
|
|
|
866
877
|
})
|
|
867
878
|
])
|
|
868
879
|
]),
|
|
869
|
-
|
|
880
|
+
m("div", Nt, [
|
|
870
881
|
T(l.$slots, "dsg-table--footer-right", {
|
|
871
882
|
data: r.value,
|
|
872
883
|
perPage: s.value
|
|
@@ -875,16 +886,16 @@ You can explicitly suppress this warning by setting pagination-path="".`
|
|
|
875
886
|
key: 0,
|
|
876
887
|
ref: "pagination",
|
|
877
888
|
pagination: r.value,
|
|
878
|
-
"onUpdate:pagination": c[13] || (c[13] = (
|
|
889
|
+
"onUpdate:pagination": c[13] || (c[13] = (P) => r.value = P),
|
|
879
890
|
"onDsgTable:changePage": I
|
|
880
|
-
}, null, 8, ["pagination"])) :
|
|
891
|
+
}, null, 8, ["pagination"])) : k("", !0),
|
|
881
892
|
T(l.$slots, "dsg-table--footer-right-extras", {
|
|
882
893
|
data: r.value,
|
|
883
894
|
perPage: s.value
|
|
884
895
|
})
|
|
885
896
|
])
|
|
886
897
|
])
|
|
887
|
-
])
|
|
898
|
+
])) : k("", !0)
|
|
888
899
|
]));
|
|
889
900
|
}
|
|
890
901
|
}), jt = { class: "dsg-table--per-page" }, Kt = ["value", "textContent"], Qt = /* @__PURE__ */ W({
|
|
@@ -895,7 +906,7 @@ You can explicitly suppress this warning by setting pagination-path="".`
|
|
|
895
906
|
},
|
|
896
907
|
setup(t) {
|
|
897
908
|
return ($, v) => (a(), n("div", jt, [
|
|
898
|
-
oe(
|
|
909
|
+
oe(m("select", {
|
|
899
910
|
"onUpdate:modelValue": v[0] || (v[0] = (i) => $.perPage.perPage = i),
|
|
900
911
|
class: "dsg-table--per-page-select",
|
|
901
912
|
onChange: v[1] || (v[1] = (i) => $.perPage.change($.perPage.perPage))
|
|
@@ -910,23 +921,23 @@ You can explicitly suppress this warning by setting pagination-path="".`
|
|
|
910
921
|
])
|
|
911
922
|
]));
|
|
912
923
|
}
|
|
913
|
-
}), Yt = Wt,
|
|
924
|
+
}), Yt = Wt, Gt = he, Jt = Qt, Xt = be, Zt = fe, xt = pe, _t = me, ea = ye, na = {
|
|
914
925
|
DsgTable: Yt,
|
|
915
|
-
DsgTableActions:
|
|
916
|
-
DsgTablePerPage:
|
|
917
|
-
DsgTableFilter:
|
|
918
|
-
DsgTablePagination:
|
|
919
|
-
DsgTablePaginationInfo:
|
|
926
|
+
DsgTableActions: Gt,
|
|
927
|
+
DsgTablePerPage: Jt,
|
|
928
|
+
DsgTableFilter: Xt,
|
|
929
|
+
DsgTablePagination: Zt,
|
|
930
|
+
DsgTablePaginationInfo: xt,
|
|
920
931
|
DsgTableSearch: _t,
|
|
921
932
|
DsgTableRowHeader: ea
|
|
922
933
|
};
|
|
923
934
|
export {
|
|
924
935
|
Yt as DsgTable,
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
936
|
+
Gt as DsgTableActions,
|
|
937
|
+
Xt as DsgTableFilter,
|
|
938
|
+
Zt as DsgTablePagination,
|
|
939
|
+
xt as DsgTablePaginationInfo,
|
|
940
|
+
Jt as DsgTablePerPage,
|
|
930
941
|
ea as DsgTableRowHeader,
|
|
931
942
|
_t as DsgTableSearch,
|
|
932
943
|
na as default
|