@dcodegroup-au/dsg-vue 0.0.27 → 0.0.28
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/Table/DsgTableActions.vue.d.ts +2 -0
- package/dist/dsg-vue.css +1 -1
- package/dist/dsg-vue.table.cjs +2 -2
- package/dist/dsg-vue.table.esm.js +218 -213
- package/dist/table.d.ts +10 -0
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
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
|
|
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 L, 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 Ve } from "vue";
|
|
2
2
|
import { _ as V, k as Ae, 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";
|
|
@@ -18,75 +18,75 @@ 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), R = O(() => f.value < t.onEachSide * 2 + 4), A = 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 = (
|
|
22
|
-
k("dsg-table:change-page",
|
|
23
|
-
},
|
|
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), R = O(() => f.value < t.onEachSide * 2 + 4), A = 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
|
+
k("dsg-table:change-page", u);
|
|
23
|
+
}, d = (u) => u === i.value?.current_page;
|
|
24
24
|
return $({
|
|
25
25
|
loadPage: s
|
|
26
|
-
}), (
|
|
27
|
-
|
|
26
|
+
}), (u, C) => oe((a(), n("div", Qe, [
|
|
27
|
+
u.showFirstLast ? (a(), n("a", {
|
|
28
28
|
key: 0,
|
|
29
|
-
onClick: C[0] || (C[0] = (I) => s(
|
|
30
|
-
class:
|
|
29
|
+
onClick: C[0] || (C[0] = (I) => s(u.firstPage)),
|
|
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
|
-
|
|
36
|
-
icon:
|
|
35
|
+
M(V, {
|
|
36
|
+
icon: u.firstIcon,
|
|
37
37
|
size: "sm"
|
|
38
38
|
}, null, 8, ["icon"])
|
|
39
39
|
], 10, Ye)) : P("", !0),
|
|
40
40
|
h("a", {
|
|
41
41
|
onClick: C[1] || (C[1] = (I) => s("prev")),
|
|
42
|
-
class:
|
|
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
|
-
|
|
48
|
-
icon:
|
|
47
|
+
M(V, {
|
|
48
|
+
icon: u.prevIcon,
|
|
49
49
|
size: "sm"
|
|
50
50
|
}, null, 8, ["icon"])
|
|
51
51
|
], 10, xe),
|
|
52
52
|
R.value ? (a(!0), n(L, { key: 1 }, q(f.value, (I, D) => (a(), n("a", {
|
|
53
53
|
key: D,
|
|
54
|
-
onClick: (j) => s(D +
|
|
55
|
-
class:
|
|
54
|
+
onClick: (j) => s(D + u.firstPage),
|
|
55
|
+
class: F([[d(D + u.firstPage) ? "active" : ""], "dsg-table--pagination-link"]),
|
|
56
56
|
innerHTML: I
|
|
57
57
|
}, null, 10, Ge))), 128)) : (a(!0), n(L, { key: 2 }, q(A.value, (I, D) => (a(), n("a", {
|
|
58
58
|
key: D,
|
|
59
|
-
onClick: (j) => s(r.value + D +
|
|
60
|
-
class:
|
|
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
62
|
}, null, 10, Je))), 128)),
|
|
63
63
|
h("a", {
|
|
64
64
|
onClick: C[2] || (C[2] = (I) => s("next")),
|
|
65
|
-
class:
|
|
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
|
-
|
|
71
|
-
icon:
|
|
70
|
+
M(V, {
|
|
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
77
|
onClick: C[3] || (C[3] = (I) => s(b.value)),
|
|
78
|
-
class:
|
|
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
|
-
|
|
84
|
-
icon:
|
|
83
|
+
M(V, {
|
|
84
|
+
icon: u.lastIcon,
|
|
85
85
|
size: "sm"
|
|
86
86
|
}, null, 8, ["icon"])
|
|
87
87
|
], 10, Ze)) : P("", !0)
|
|
88
88
|
], 512)), [
|
|
89
|
-
[Se, i.value && b.value >
|
|
89
|
+
[Se, i.value && b.value > u.firstPage]
|
|
90
90
|
]);
|
|
91
91
|
}
|
|
92
92
|
}), _e = ["innerHTML"], pe = /* @__PURE__ */ W({
|
|
@@ -112,12 +112,12 @@ const Qe = { class: "dsg-table--pagination" }, Ye = ["disabled"], xe = ["disable
|
|
|
112
112
|
}, tt = { class: "dsg-table--action-trigger" }, at = {
|
|
113
113
|
key: 0,
|
|
114
114
|
class: "dsg-table--actions-menu-wrapper"
|
|
115
|
-
}, lt = ["href", "target", "onClick"], st = ["textContent"], nt = { key: 0 }, ot = ["href", "target", "onClick"],
|
|
115
|
+
}, lt = ["href", "target", "onClick"], st = ["textContent"], nt = { key: 0 }, ot = { key: 1 }, it = ["href", "target", "onClick"], rt = { class: "flex-1" }, he = /* @__PURE__ */ W({
|
|
116
116
|
__name: "DsgTableActions",
|
|
117
117
|
props: {
|
|
118
118
|
placement: { default: "auto" }
|
|
119
119
|
},
|
|
120
|
-
emits: ["dsg-table:action-edit", "dsg-table:action-view", "dsg-table:action-delete", "dsg-table:link-clicked"],
|
|
120
|
+
emits: ["dsg-table:action-edit", "dsg-table:action-view", "dsg-table:action-delete", "dsg-table:action-archive", "dsg-table:link-clicked"],
|
|
121
121
|
setup(t, { emit: $ }) {
|
|
122
122
|
const v = y(!1);
|
|
123
123
|
ge("dsgTableActions");
|
|
@@ -129,81 +129,86 @@ const Qe = { class: "dsg-table--pagination" }, Ye = ["disabled"], xe = ["disable
|
|
|
129
129
|
return "eye";
|
|
130
130
|
case "delete":
|
|
131
131
|
return "trash-01";
|
|
132
|
+
case "archive":
|
|
133
|
+
return "eye-off";
|
|
132
134
|
default:
|
|
133
135
|
return "dots-horizontal";
|
|
134
136
|
}
|
|
135
|
-
}, R = (k, s,
|
|
137
|
+
}, R = (k, s, d) => {
|
|
136
138
|
switch (s) {
|
|
137
139
|
case "edit":
|
|
138
|
-
r("dsg-table:action-edit",
|
|
140
|
+
r("dsg-table:action-edit", d, m.value);
|
|
139
141
|
break;
|
|
140
142
|
case "view":
|
|
141
|
-
r("dsg-table:action-view",
|
|
143
|
+
r("dsg-table:action-view", d, m.value);
|
|
142
144
|
break;
|
|
143
145
|
case "delete":
|
|
144
|
-
r("dsg-table:action-delete",
|
|
146
|
+
r("dsg-table:action-delete", d, m.value);
|
|
147
|
+
break;
|
|
148
|
+
case "archive":
|
|
149
|
+
r("dsg-table:action-archive", d, m.value);
|
|
145
150
|
break;
|
|
146
151
|
}
|
|
147
152
|
}, A = (k, s) => {
|
|
148
|
-
const
|
|
149
|
-
r("dsg-table:link-clicked", s,
|
|
153
|
+
const d = k.actionId || k.label.trim().toLowerCase().replace(/[^a-z0-9-]/g, "-").replace(/-+/g, "-");
|
|
154
|
+
r("dsg-table:link-clicked", s, d, m.value);
|
|
150
155
|
}, r = $;
|
|
151
156
|
return (k, s) => oe((a(), n("div", et, [
|
|
152
|
-
|
|
157
|
+
M(U(Ae), {
|
|
153
158
|
triggers: [],
|
|
154
159
|
placement: k.placement,
|
|
155
160
|
"handle-resize": !0,
|
|
156
161
|
strategy: "absolute",
|
|
157
162
|
shown: v.value,
|
|
158
163
|
class: "dsg-table--actions__popper",
|
|
159
|
-
onHide: s[1] || (s[1] = (
|
|
164
|
+
onHide: s[1] || (s[1] = (d) => v.value = !1),
|
|
160
165
|
ref: "floatingVueFilterDropdown"
|
|
161
166
|
}, {
|
|
162
167
|
popper: Z(() => [
|
|
163
168
|
v.value ? (a(), n("div", at, [
|
|
164
|
-
(a(!0), n(L, null, q(f.value, (
|
|
165
|
-
["edit", "view", "delete"].includes(String(
|
|
166
|
-
key:
|
|
169
|
+
(a(!0), n(L, null, q(f.value, (d, u) => (a(), n(L, null, [
|
|
170
|
+
["edit", "view", "delete", "archive"].includes(String(u)) ? (a(), n("a", {
|
|
171
|
+
key: u,
|
|
167
172
|
href: f.value?.link,
|
|
168
173
|
target: f.value?.target || "_self",
|
|
169
|
-
onClick: (C) => R(
|
|
174
|
+
onClick: (C) => R(d, String(u), C)
|
|
170
175
|
}, [
|
|
171
176
|
h("div", {
|
|
172
|
-
class:
|
|
177
|
+
class: F(["dsg-table--actions-menu-item", String(u)])
|
|
173
178
|
}, [
|
|
174
|
-
|
|
175
|
-
icon: p(String(
|
|
179
|
+
M(V, {
|
|
180
|
+
icon: p(String(u)),
|
|
176
181
|
size: "sm"
|
|
177
182
|
}, null, 8, ["icon"]),
|
|
178
183
|
h("span", {
|
|
179
184
|
class: "flex-1",
|
|
180
|
-
textContent: _(U(We)(String(
|
|
185
|
+
textContent: _(U(We)(String(u)))
|
|
181
186
|
}, null, 8, st)
|
|
182
187
|
], 2)
|
|
183
188
|
], 8, lt)) : P("", !0)
|
|
184
189
|
], 64))), 256)),
|
|
185
190
|
f.value && b.value ? (a(), n("hr", nt)) : P("", !0),
|
|
186
|
-
b.value ? (a(!0), n(L, { key: 1 }, q(b.value, (
|
|
187
|
-
key:
|
|
191
|
+
b.value ? (a(!0), n(L, { key: 1 }, q(b.value, (d) => (a(), n(L, {
|
|
192
|
+
key: d.label
|
|
188
193
|
}, [
|
|
189
|
-
|
|
194
|
+
d.hasOwnProperty("component") ? (a(), N(Me(d.component), {
|
|
190
195
|
key: 0,
|
|
191
196
|
quote: U(i).data.data.rowData,
|
|
192
197
|
"row-data": U(i).data.data.rowData
|
|
193
|
-
}, null, 8, ["quote", "row-data"])) :
|
|
194
|
-
|
|
195
|
-
href:
|
|
196
|
-
target:
|
|
197
|
-
class: "dsg-table--actions-menu-item",
|
|
198
|
-
onClick: (
|
|
198
|
+
}, null, 8, ["quote", "row-data"])) : d.hasOwnProperty("type") && d.type == "break" ? (a(), n("hr", ot)) : (a(), n("a", {
|
|
199
|
+
key: 2,
|
|
200
|
+
href: d.link,
|
|
201
|
+
target: d.target || "_self",
|
|
202
|
+
class: F(["dsg-table--actions-menu-item", d.class]),
|
|
203
|
+
onClick: (u) => A(d, u)
|
|
199
204
|
}, [
|
|
200
|
-
|
|
205
|
+
d.icon ? (a(), N(V, {
|
|
201
206
|
key: 0,
|
|
202
|
-
icon:
|
|
207
|
+
icon: d.icon,
|
|
203
208
|
size: "sm"
|
|
204
209
|
}, null, 8, ["icon"])) : P("", !0),
|
|
205
|
-
h("span",
|
|
206
|
-
],
|
|
210
|
+
h("span", rt, _(d.label), 1)
|
|
211
|
+
], 10, it))
|
|
207
212
|
], 64))), 128)) : P("", !0)
|
|
208
213
|
])) : P("", !0)
|
|
209
214
|
]),
|
|
@@ -214,10 +219,10 @@ const Qe = { class: "dsg-table--pagination" }, Ye = ["disabled"], xe = ["disable
|
|
|
214
219
|
class: "dsg-table--actions-button",
|
|
215
220
|
"aria-expanded": "false",
|
|
216
221
|
"aria-haspopup": "true",
|
|
217
|
-
onClick: s[0] || (s[0] = (
|
|
222
|
+
onClick: s[0] || (s[0] = (d) => v.value = !v.value)
|
|
218
223
|
}, [
|
|
219
224
|
T(k.$slots, "dsg-table-action-button-content", {}, () => [
|
|
220
|
-
|
|
225
|
+
M(V, {
|
|
221
226
|
icon: "dots-vertical",
|
|
222
227
|
size: "sm"
|
|
223
228
|
})
|
|
@@ -231,7 +236,7 @@ const Qe = { class: "dsg-table--pagination" }, Ye = ["disabled"], xe = ["disable
|
|
|
231
236
|
[U(Oe), () => v.value = !1]
|
|
232
237
|
]);
|
|
233
238
|
}
|
|
234
|
-
}),
|
|
239
|
+
}), dt = { class: "dsg-table--search" }, me = /* @__PURE__ */ W({
|
|
235
240
|
__name: "DsgTableSearch",
|
|
236
241
|
props: {
|
|
237
242
|
name: {},
|
|
@@ -249,8 +254,8 @@ const Qe = { class: "dsg-table--pagination" }, Ye = ["disabled"], xe = ["disable
|
|
|
249
254
|
const v = y(""), i = $, f = qe((b) => {
|
|
250
255
|
v.value = b, i("dsg-table:term-changed", v.value);
|
|
251
256
|
}, 300);
|
|
252
|
-
return (b, m) => (a(), n("div",
|
|
253
|
-
|
|
257
|
+
return (b, m) => (a(), n("div", dt, [
|
|
258
|
+
M(Ue, {
|
|
254
259
|
value: v.value,
|
|
255
260
|
"onUpdate:value": m[0] || (m[0] = (p) => v.value = p),
|
|
256
261
|
name: b.name,
|
|
@@ -271,18 +276,18 @@ const Qe = { class: "dsg-table--pagination" }, Ye = ["disabled"], xe = ["disable
|
|
|
271
276
|
}, null, 8, ["value", "name", "id", "placeholder", "disabled", "required", "readonly", "hidden"])
|
|
272
277
|
]));
|
|
273
278
|
}
|
|
274
|
-
}),
|
|
279
|
+
}), ut = { class: "dsg-table--header-row" }, ct = {
|
|
275
280
|
key: 0,
|
|
276
281
|
class: "dsg-table--th dsg-table--th-checkbox",
|
|
277
282
|
scope: "col"
|
|
278
|
-
},
|
|
283
|
+
}, gt = {
|
|
279
284
|
key: 1,
|
|
280
285
|
class: "dsg-table--th dsg-table--th-expand-detail",
|
|
281
286
|
scope: "col"
|
|
282
|
-
},
|
|
287
|
+
}, vt = ["title", "id", "onClick"], bt = {
|
|
283
288
|
key: 0,
|
|
284
289
|
class: "dsg-table--th-sort-icon"
|
|
285
|
-
},
|
|
290
|
+
}, ft = ["innerHTML"], pt = ["innerHTML"], ye = /* @__PURE__ */ W({
|
|
286
291
|
__name: "DsgTableRowHeader",
|
|
287
292
|
props: /* @__PURE__ */ x({
|
|
288
293
|
fields: {},
|
|
@@ -315,9 +320,9 @@ const Qe = { class: "dsg-table--pagination" }, Ye = ["disabled"], xe = ["disable
|
|
|
315
320
|
direction: v.value?.name === r.name && v.value?.direction === "asc" ? "desc" : "asc"
|
|
316
321
|
}, p("dsg-table:sort-field", r));
|
|
317
322
|
};
|
|
318
|
-
return (r, k) => (a(), n("tr",
|
|
319
|
-
r.hasSelectAll ? (a(), n("th",
|
|
320
|
-
|
|
323
|
+
return (r, k) => (a(), n("tr", ut, [
|
|
324
|
+
r.hasSelectAll ? (a(), n("th", ct, [
|
|
325
|
+
M(ve, {
|
|
321
326
|
modelValue: f.value,
|
|
322
327
|
"onUpdate:modelValue": [
|
|
323
328
|
k[0] || (k[0] = (s) => f.value = s),
|
|
@@ -326,23 +331,23 @@ const Qe = { class: "dsg-table--pagination" }, Ye = ["disabled"], xe = ["disable
|
|
|
326
331
|
indeterminate: i.value.length > 0 && i.value.length !== r.tableDataLength
|
|
327
332
|
}, null, 8, ["modelValue", "indeterminate"])
|
|
328
333
|
])) : P("", !0),
|
|
329
|
-
r.showExpandDetail ? (a(), n("th",
|
|
330
|
-
(a(!0), n(L, null, q(r.fields, (s,
|
|
334
|
+
r.showExpandDetail ? (a(), n("th", gt)) : P("", !0),
|
|
335
|
+
(a(!0), n(L, null, q(r.fields, (s, d) => (a(), n(L, null, [
|
|
331
336
|
s?.visible ? (a(), n("th", {
|
|
332
|
-
key:
|
|
333
|
-
class:
|
|
337
|
+
key: d,
|
|
338
|
+
class: F(R("dsg-table--th", s)),
|
|
334
339
|
style: J([{ width: s.width || void 0 }, s.style]),
|
|
335
340
|
title: s.title + (s.sortable ? " Sort" : ""),
|
|
336
341
|
id: "_" + s.name,
|
|
337
|
-
onClick: (
|
|
342
|
+
onClick: (u) => A(s),
|
|
338
343
|
scope: "col"
|
|
339
344
|
}, [
|
|
340
|
-
s.sortable ? (a(), n("div",
|
|
345
|
+
s.sortable ? (a(), n("div", bt, [
|
|
341
346
|
s.title ? (a(), n("span", {
|
|
342
347
|
key: 0,
|
|
343
348
|
class: "dsg-table--th-title",
|
|
344
349
|
innerHTML: s.title
|
|
345
|
-
}, null, 8,
|
|
350
|
+
}, null, 8, ft)) : P("", !0),
|
|
346
351
|
s.sortable && v.value?.name !== s.name ? (a(), N(V, {
|
|
347
352
|
key: 1,
|
|
348
353
|
icon: "chevron-selector-vertical",
|
|
@@ -365,8 +370,8 @@ const Qe = { class: "dsg-table--pagination" }, Ye = ["disabled"], xe = ["disable
|
|
|
365
370
|
key: 1,
|
|
366
371
|
class: "dsg-table--th-title",
|
|
367
372
|
innerHTML: U(je)(String(s?.title))
|
|
368
|
-
}, null, 8,
|
|
369
|
-
], 14,
|
|
373
|
+
}, null, 8, pt))
|
|
374
|
+
], 14, vt)) : P("", !0)
|
|
370
375
|
], 64))), 256)),
|
|
371
376
|
r.scrollVisible ? (a(), n("th", {
|
|
372
377
|
key: 2,
|
|
@@ -375,13 +380,13 @@ const Qe = { class: "dsg-table--pagination" }, Ye = ["disabled"], xe = ["disable
|
|
|
375
380
|
}, null, 4)) : P("", !0)
|
|
376
381
|
]));
|
|
377
382
|
}
|
|
378
|
-
}),
|
|
383
|
+
}), ht = { class: "dsg-table--wrapper" }, mt = ["span"], yt = {
|
|
379
384
|
key: 0,
|
|
380
385
|
class: "dsg-table--loading"
|
|
381
|
-
},
|
|
386
|
+
}, kt = ["colspan"], wt = ["colspan"], Pt = ["onClick", "onDblclick", "onMouseover"], $t = {
|
|
382
387
|
key: 0,
|
|
383
388
|
class: "dsg-table--tbody-cell dsg-table--tbody-cell-checkbox"
|
|
384
|
-
},
|
|
389
|
+
}, Dt = ["onClick", "onDblclick", "onContextmenu"], Ct = ["innerHTML"], Tt = ["onClick"], St = ["colspan"], Ft = { key: 2 }, Mt = ["colspan"], Bt = { class: "dsg-table--footer" }, Lt = /* @__PURE__ */ W({
|
|
385
390
|
__name: "DsgTableComponent",
|
|
386
391
|
props: /* @__PURE__ */ x({
|
|
387
392
|
fields: { default: () => [] },
|
|
@@ -441,7 +446,7 @@ const Qe = { class: "dsg-table--pagination" }, Ye = ["disabled"], xe = ["disable
|
|
|
441
446
|
}),
|
|
442
447
|
emits: /* @__PURE__ */ x(["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"]),
|
|
443
448
|
setup(t, { expose: $, emit: v }) {
|
|
444
|
-
const i = (e) => e.map((o,
|
|
449
|
+
const i = (e) => e.map((o, g) => ({
|
|
445
450
|
field: o.field || "",
|
|
446
451
|
title: o.title || "",
|
|
447
452
|
name: o.name || "",
|
|
@@ -452,8 +457,8 @@ const Qe = { class: "dsg-table--pagination" }, Ye = ["disabled"], xe = ["disable
|
|
|
452
457
|
sortField: o.sortField || null,
|
|
453
458
|
sortable: o.sortField,
|
|
454
459
|
formatter: o.formatter || null,
|
|
455
|
-
$_index:
|
|
456
|
-
})), f = y(i(t.fields)), b = y(t.data), m = y(null), p = y(t.initialPage), R = y("17px"), A = y(!1), r = y({}), k = y(0), s = y(!0),
|
|
460
|
+
$_index: g
|
|
461
|
+
})), f = y(i(t.fields)), b = y(t.data), m = y(null), p = y(t.initialPage), R = y("17px"), A = y(!1), r = y({}), k = 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);
|
|
457
462
|
te(
|
|
458
463
|
() => D.value.length,
|
|
459
464
|
(e) => {
|
|
@@ -483,12 +488,12 @@ const Qe = { class: "dsg-table--pagination" }, Ye = ["disabled"], xe = ["disable
|
|
|
483
488
|
if (e.selected)
|
|
484
489
|
D.value.push(e);
|
|
485
490
|
else {
|
|
486
|
-
const o = D.value.findIndex((
|
|
491
|
+
const o = D.value.findIndex((g) => g[t.trackBy] === e[t.trackBy]);
|
|
487
492
|
o !== -1 && D.value.splice(o, 1);
|
|
488
493
|
}
|
|
489
494
|
z("dsg-table:rows-selected", D.value);
|
|
490
495
|
}
|
|
491
|
-
},
|
|
496
|
+
}, c = () => {
|
|
492
497
|
t.selectable && (b.value?.forEach((e) => {
|
|
493
498
|
e.selected = !0;
|
|
494
499
|
}), D.value = b.value?.filter((e) => e.selected) ?? [], z("dsg-table:rows-selected", D.value));
|
|
@@ -499,16 +504,16 @@ const Qe = { class: "dsg-table--pagination" }, Ye = ["disabled"], xe = ["disable
|
|
|
499
504
|
}, S = (e) => {
|
|
500
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();
|
|
501
506
|
}, H = () => ({
|
|
502
|
-
[t.queryParams?.sort]:
|
|
503
|
-
[t.queryParams?.order]:
|
|
507
|
+
[t.queryParams?.sort]: d.value ? (d.value?.direction === "desc" ? "-" : "") + d.value?.field : void 0,
|
|
508
|
+
[t.queryParams?.order]: d.value?.direction,
|
|
504
509
|
[t.queryParams?.page]: p.value,
|
|
505
510
|
[t.queryParams?.perPage]: I.value
|
|
506
511
|
}), G = () => {
|
|
507
|
-
|
|
512
|
+
u.value && (u.value.abort(), u.value = null);
|
|
508
513
|
}, le = async (e, o) => {
|
|
509
514
|
G();
|
|
510
|
-
const
|
|
511
|
-
if (o.signal =
|
|
515
|
+
const g = new AbortController();
|
|
516
|
+
if (o.signal = g.signal, u.value = g, t.httpMethod.toLowerCase() === "get")
|
|
512
517
|
return await ce.get(e, o);
|
|
513
518
|
{
|
|
514
519
|
const E = o.params;
|
|
@@ -517,28 +522,28 @@ const Qe = { class: "dsg-table--pagination" }, Ye = ["disabled"], xe = ["disable
|
|
|
517
522
|
}, ie = (e) => {
|
|
518
523
|
z("dsg-table:load-success", e);
|
|
519
524
|
const o = t.transform ? t.transform(e.data) : e.data;
|
|
520
|
-
b.value = ne(o, t.dataPath, null), t.selectable && b.value?.forEach((
|
|
521
|
-
|
|
525
|
+
b.value = ne(o, t.dataPath, null), t.selectable && b.value?.forEach((g) => {
|
|
526
|
+
g.selected = g.selected ?? !1;
|
|
522
527
|
}), m.value = ne(o, t.paginationPath, null) ?? null, k.value = b.value?.length ? b.value[0].order : k, m.value === null && console.warn(
|
|
523
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.
|
|
524
529
|
You can explicitly suppress this warning by setting pagination-path="".`
|
|
525
530
|
), z("dsg-table:pagination-data", m.value), z("dsg-table:loaded"), s.value = !1;
|
|
526
531
|
}, re = (e) => {
|
|
527
532
|
console.error("load-error", e), z("dsg-table:load-error", e), z("dsg-table:loaded"), s.value = !1;
|
|
528
|
-
}, X = (e = ie, o = re,
|
|
529
|
-
const E = e || ie,
|
|
533
|
+
}, X = (e = ie, o = re, g = {}) => {
|
|
534
|
+
const E = e || ie, B = o || re;
|
|
530
535
|
if (t.apiMode)
|
|
531
536
|
return s.value = !0, z("dsg-table:loading", s.value), t.httpOptions.params = {
|
|
532
537
|
...H(),
|
|
533
538
|
...C.value
|
|
534
|
-
}, le(t.apiUrl, t.httpOptions).then(E).catch((se) =>
|
|
535
|
-
}, ke = (e, o,
|
|
536
|
-
}, we = (e, o,
|
|
537
|
-
}, Pe = (e, o,
|
|
538
|
-
}, $e = (e, o,
|
|
539
|
-
}, De = (e, o,
|
|
540
|
-
}, Ce = (e, o,
|
|
541
|
-
}, Te = (e, o,
|
|
539
|
+
}, le(t.apiUrl, t.httpOptions).then(E).catch((se) => B(se));
|
|
540
|
+
}, ke = (e, o, g) => {
|
|
541
|
+
}, we = (e, o, g) => {
|
|
542
|
+
}, Pe = (e, o, g) => {
|
|
543
|
+
}, $e = (e, o, g, E) => {
|
|
544
|
+
}, De = (e, o, g, E) => {
|
|
545
|
+
}, Ce = (e, o, g, E) => {
|
|
546
|
+
}, Te = (e, o, g) => {
|
|
542
547
|
};
|
|
543
548
|
Be(() => {
|
|
544
549
|
t.apiMode === !0 && X();
|
|
@@ -549,21 +554,21 @@ You can explicitly suppress this warning by setting pagination-path="".`
|
|
|
549
554
|
return $({
|
|
550
555
|
changePage: S,
|
|
551
556
|
reload: de
|
|
552
|
-
}), (e, o) => (a(), n("div",
|
|
557
|
+
}), (e, o) => (a(), n("div", ht, [
|
|
553
558
|
h("div", {
|
|
554
559
|
ref: "dsgTableBodyWrapper",
|
|
555
|
-
class:
|
|
560
|
+
class: F(["dsg-table-body-wrapper", { "fixed-header": K.value }]),
|
|
556
561
|
style: J({ height: e.tableHeight || void 0 })
|
|
557
562
|
}, [
|
|
558
563
|
h("table", {
|
|
559
|
-
class:
|
|
564
|
+
class: F(["dsg-table-main", K.value ? "fixed-header" : "", r.value.table, "table-" + e.tableLayout])
|
|
560
565
|
}, [
|
|
561
566
|
h("colgroup", { span: Q.value }, [
|
|
562
|
-
(a(!0), n(L, null, q(f.value, (
|
|
563
|
-
|
|
567
|
+
(a(!0), n(L, null, q(f.value, (g, E) => (a(), n(L, null, [
|
|
568
|
+
g?.visible ? (a(), n("col", {
|
|
564
569
|
key: E,
|
|
565
|
-
style: J({ width:
|
|
566
|
-
class:
|
|
570
|
+
style: J({ width: g.width || void 0 }),
|
|
571
|
+
class: F("dsg-table--col-" + g.name + " " + g.titleClass)
|
|
567
572
|
}, null, 6)) : P("", !0)
|
|
568
573
|
], 64))), 256)),
|
|
569
574
|
!K.value && A.value ? (a(), n("col", {
|
|
@@ -571,33 +576,33 @@ You can explicitly suppress this warning by setting pagination-path="".`
|
|
|
571
576
|
style: J({ width: R.value }),
|
|
572
577
|
class: "dsg-table--col-gutter"
|
|
573
578
|
}, null, 4)) : P("", !0)
|
|
574
|
-
], 8,
|
|
579
|
+
], 8, mt),
|
|
575
580
|
h("thead", {
|
|
576
|
-
class:
|
|
581
|
+
class: F([[r.value.thead, { sticky: K.value, "top-0": K.value }], "dsg-table--head"])
|
|
577
582
|
}, [
|
|
578
583
|
T(e.$slots, "tableHeader", { fields: f.value }, () => [
|
|
579
|
-
|
|
584
|
+
M(ye, {
|
|
580
585
|
fields: f.value,
|
|
581
586
|
"has-select-all": e.selectable,
|
|
582
587
|
"selected-rows": D.value,
|
|
583
|
-
"onUpdate:selectedRows": o[0] || (o[0] = (
|
|
588
|
+
"onUpdate:selectedRows": o[0] || (o[0] = (g) => D.value = g),
|
|
584
589
|
"has-selected": j.value,
|
|
585
|
-
"onUpdate:hasSelected": o[1] || (o[1] = (
|
|
590
|
+
"onUpdate:hasSelected": o[1] || (o[1] = (g) => j.value = g),
|
|
586
591
|
"scroll-visible": A.value,
|
|
587
592
|
"show-expand-detail": e.hasDetailRow && e.showExpandDetail,
|
|
588
593
|
"table-data-length": b.value?.length,
|
|
589
|
-
"sort-field":
|
|
590
|
-
"onUpdate:sortField": o[2] || (o[2] = (
|
|
591
|
-
"onDsgTable:sortField": o[3] || (o[3] = (
|
|
592
|
-
"onDsgTable:onSelectAll":
|
|
594
|
+
"sort-field": d.value,
|
|
595
|
+
"onUpdate:sortField": o[2] || (o[2] = (g) => d.value = g),
|
|
596
|
+
"onDsgTable:sortField": o[3] || (o[3] = (g) => de()),
|
|
597
|
+
"onDsgTable:onSelectAll": c,
|
|
593
598
|
"onDsgTable:onDeselectAll": w
|
|
594
599
|
}, null, 8, ["fields", "has-select-all", "selected-rows", "has-selected", "scroll-visible", "show-expand-detail", "table-data-length", "sort-field"])
|
|
595
600
|
])
|
|
596
601
|
], 2),
|
|
597
602
|
h("tbody", {
|
|
598
|
-
class:
|
|
603
|
+
class: F(["dsg-table--body", r.value.tbody])
|
|
599
604
|
}, [
|
|
600
|
-
s.value ? (a(), n("tr",
|
|
605
|
+
s.value ? (a(), n("tr", yt, [
|
|
601
606
|
h("td", { colspan: Q.value }, [
|
|
602
607
|
h("div", {
|
|
603
608
|
"aria-label": "Loading...",
|
|
@@ -606,48 +611,48 @@ You can explicitly suppress this warning by setting pagination-path="".`
|
|
|
606
611
|
colspan: Q.value
|
|
607
612
|
}, [
|
|
608
613
|
T(e.$slots, "dsg-table-loading", {}, () => [
|
|
609
|
-
|
|
614
|
+
M(V, {
|
|
610
615
|
icon: "loading-02",
|
|
611
616
|
class: "animate-spin"
|
|
612
617
|
}),
|
|
613
618
|
o[4] || (o[4] = h("span", { class: "text-xs font-medium text-gray-500" }, "Loading...", -1))
|
|
614
619
|
])
|
|
615
|
-
], 8,
|
|
616
|
-
], 8,
|
|
617
|
-
])) : (a(!0), n(L, { key: 1 }, q(b.value, (
|
|
620
|
+
], 8, wt)
|
|
621
|
+
], 8, kt)
|
|
622
|
+
])) : (a(!0), n(L, { key: 1 }, q(b.value, (g, E) => (a(), n(L, { key: E }, [
|
|
618
623
|
h("tr", {
|
|
619
|
-
class:
|
|
620
|
-
onClick: (
|
|
621
|
-
onDblclick: (
|
|
622
|
-
onMouseover: (
|
|
624
|
+
class: F(["dsg-table--tbody-row", { odd: E % 2 === 0, even: E % 2 !== 0, "row-selected": g.selected }]),
|
|
625
|
+
onClick: (B) => ke(),
|
|
626
|
+
onDblclick: (B) => we(),
|
|
627
|
+
onMouseover: (B) => Pe()
|
|
623
628
|
}, [
|
|
624
|
-
e.selectable ? (a(), n("td",
|
|
625
|
-
|
|
626
|
-
modelValue:
|
|
627
|
-
"onUpdate:modelValue": [(
|
|
629
|
+
e.selectable ? (a(), n("td", $t, [
|
|
630
|
+
M(ve, {
|
|
631
|
+
modelValue: g.selected,
|
|
632
|
+
"onUpdate:modelValue": [(B) => g.selected = B, (B) => l(g)]
|
|
628
633
|
}, null, 8, ["modelValue", "onUpdate:modelValue"])
|
|
629
634
|
])) : P("", !0),
|
|
630
|
-
(a(!0), n(L, null, q(f.value, (
|
|
631
|
-
|
|
635
|
+
(a(!0), n(L, null, q(f.value, (B, se) => (a(), n(L, { key: se }, [
|
|
636
|
+
B.visible ? (a(), n("td", {
|
|
632
637
|
key: 0,
|
|
633
|
-
class:
|
|
634
|
-
style: J({ width:
|
|
638
|
+
class: F(["dsg-table--tbody-cell", B.dataClass]),
|
|
639
|
+
style: J({ width: B.width || void 0 }),
|
|
635
640
|
onClick: (ue) => $e(),
|
|
636
641
|
onDblclick: (ue) => De(),
|
|
637
642
|
onContextmenu: (ue) => Ce()
|
|
638
643
|
}, [
|
|
639
|
-
T(e.$slots, ae(
|
|
640
|
-
rowData:
|
|
644
|
+
T(e.$slots, ae(B), {
|
|
645
|
+
rowData: g,
|
|
641
646
|
rowIndex: E,
|
|
642
|
-
rowField:
|
|
647
|
+
rowField: B
|
|
643
648
|
}, () => [
|
|
644
649
|
h("span", {
|
|
645
|
-
innerHTML: ee(
|
|
646
|
-
}, null, 8,
|
|
650
|
+
innerHTML: ee(B, g)
|
|
651
|
+
}, null, 8, Ct)
|
|
647
652
|
])
|
|
648
|
-
], 46,
|
|
653
|
+
], 46, Dt)) : P("", !0)
|
|
649
654
|
], 64))), 128))
|
|
650
|
-
], 42,
|
|
655
|
+
], 42, Pt),
|
|
651
656
|
e.hasDetailRow ? (a(), N(Le, {
|
|
652
657
|
key: 0,
|
|
653
658
|
name: e.detailRowTransition
|
|
@@ -655,21 +660,21 @@ You can explicitly suppress this warning by setting pagination-path="".`
|
|
|
655
660
|
default: Z(() => [
|
|
656
661
|
h("tr", {
|
|
657
662
|
class: "dsg-table--tbody-detail-row",
|
|
658
|
-
onClick: (
|
|
663
|
+
onClick: (B) => Te()
|
|
659
664
|
}, [
|
|
660
665
|
h("td", { colspan: Q.value }, [
|
|
661
666
|
T(e.$slots, "dsg-table-detail-row", {
|
|
662
|
-
rowData:
|
|
667
|
+
rowData: g,
|
|
663
668
|
rowIndex: E,
|
|
664
669
|
options: e.detailRowOptions
|
|
665
670
|
})
|
|
666
|
-
], 8,
|
|
667
|
-
], 8,
|
|
671
|
+
], 8, St)
|
|
672
|
+
], 8, Tt)
|
|
668
673
|
]),
|
|
669
674
|
_: 2
|
|
670
675
|
}, 1032, ["name"])) : P("", !0)
|
|
671
676
|
], 64))), 128)),
|
|
672
|
-
!b.value?.length && e.noDataTemplate.length ? (a(), n("tr",
|
|
677
|
+
!b.value?.length && e.noDataTemplate.length ? (a(), n("tr", Ft, [
|
|
673
678
|
h("td", {
|
|
674
679
|
colspan: Q.value,
|
|
675
680
|
class: "dsg-table--empty-result"
|
|
@@ -677,10 +682,10 @@ You can explicitly suppress this warning by setting pagination-path="".`
|
|
|
677
682
|
T(e.$slots, "dsg-table-empty-result", {}, () => [
|
|
678
683
|
Ee(_(e.noDataTemplate), 1)
|
|
679
684
|
])
|
|
680
|
-
], 8,
|
|
685
|
+
], 8, Mt)
|
|
681
686
|
])) : P("", !0)
|
|
682
687
|
], 2),
|
|
683
|
-
h("tfoot",
|
|
688
|
+
h("tfoot", Bt, [
|
|
684
689
|
T(e.$slots, "dsg-table-footer", {
|
|
685
690
|
fields: f.value,
|
|
686
691
|
data: b.value
|
|
@@ -690,10 +695,10 @@ You can explicitly suppress this warning by setting pagination-path="".`
|
|
|
690
695
|
], 6)
|
|
691
696
|
]));
|
|
692
697
|
}
|
|
693
|
-
}),
|
|
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" }, Vt = {
|
|
694
699
|
key: 0,
|
|
695
700
|
class: "dsg-table--search-header"
|
|
696
|
-
},
|
|
701
|
+
}, At = { 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({
|
|
697
702
|
__name: "DsgTable",
|
|
698
703
|
props: {
|
|
699
704
|
getUrl: {},
|
|
@@ -714,19 +719,19 @@ You can explicitly suppress this warning by setting pagination-path="".`
|
|
|
714
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"],
|
|
715
720
|
setup(t, { expose: $, emit: v }) {
|
|
716
721
|
const i = (l) => {
|
|
717
|
-
|
|
722
|
+
d.value = l;
|
|
718
723
|
}, f = y(!!(t.filterEntity || t.filterEndpoint)), b = () => {
|
|
719
724
|
if (f.value) {
|
|
720
725
|
let l = {};
|
|
721
|
-
return Ne().forEach((
|
|
722
|
-
if (
|
|
723
|
-
const w =
|
|
726
|
+
return Ne().forEach((c) => {
|
|
727
|
+
if (c.key.startsWith("filter[")) {
|
|
728
|
+
const w = c.key.replace("filter[", "").replace("]", ""), S = c.value;
|
|
724
729
|
l[`filter[${w}]`] = S.join(",");
|
|
725
730
|
}
|
|
726
731
|
}), l;
|
|
727
732
|
} else
|
|
728
733
|
return {};
|
|
729
|
-
}, m = Re(), p = y(!0), R = y(null), A = y("<p>Showing {from} to {to} of {total}</p>"), r = y(null), k = ge("dsgTable"), s = y({ perPage: 20, change: i }),
|
|
734
|
+
}, m = Re(), p = y(!0), R = y(null), A = 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()), C = v, I = (l) => {
|
|
730
735
|
k.value?.changePage(l);
|
|
731
736
|
}, D = (l) => {
|
|
732
737
|
r.value = l;
|
|
@@ -736,24 +741,24 @@ You can explicitly suppress this warning by setting pagination-path="".`
|
|
|
736
741
|
p.value === !1 && k.value?.reload();
|
|
737
742
|
}, Q = (l) => {
|
|
738
743
|
k.value?.setData(
|
|
739
|
-
k.value?.tableData.map((
|
|
744
|
+
k.value?.tableData.map((c) => c.id === l.id ? l : c)
|
|
740
745
|
);
|
|
741
746
|
}, z = (l) => {
|
|
742
|
-
|
|
747
|
+
u.value = l;
|
|
743
748
|
}, ee = (l) => {
|
|
744
|
-
|
|
745
|
-
}, ae = (l,
|
|
746
|
-
|
|
749
|
+
u.value["filter[term]"] = l, C("dsg-table:term-changed", l);
|
|
750
|
+
}, ae = (l, c, w) => {
|
|
751
|
+
u.value = { "filter[term]": u.value["filter[term]"], ...l }, C("dsg-table:filter-updated", u.value, c, w);
|
|
747
752
|
};
|
|
748
753
|
return $({
|
|
749
754
|
reloadTable: K,
|
|
750
755
|
updateRowTable: Q,
|
|
751
756
|
termChanged: ee,
|
|
752
757
|
setFilters: z
|
|
753
|
-
}), (l,
|
|
754
|
-
h("div",
|
|
758
|
+
}), (l, c) => (a(), n("div", Et, [
|
|
759
|
+
h("div", Rt, [
|
|
755
760
|
T(l.$slots, "dsg-table--pre-header", {}, () => [
|
|
756
|
-
h("div",
|
|
761
|
+
h("div", Ht, [
|
|
757
762
|
T(l.$slots, "dsg-table--page-title", {
|
|
758
763
|
data: R.value,
|
|
759
764
|
title: l.title
|
|
@@ -762,40 +767,40 @@ You can explicitly suppress this warning by setting pagination-path="".`
|
|
|
762
767
|
key: 0,
|
|
763
768
|
class: "dsg-table--title",
|
|
764
769
|
textContent: _(l.title)
|
|
765
|
-
}, null, 8,
|
|
770
|
+
}, null, 8, It)) : P("", !0)
|
|
766
771
|
])
|
|
767
772
|
]),
|
|
768
|
-
h("div",
|
|
773
|
+
h("div", zt, [
|
|
769
774
|
T(l.$slots, "dsg-table--page-actions", { data: R.value })
|
|
770
775
|
])
|
|
771
776
|
])
|
|
772
777
|
]),
|
|
773
|
-
l.displayPaginationInfo ? (a(), n("div",
|
|
774
|
-
h("div",
|
|
778
|
+
l.displayPaginationInfo ? (a(), n("div", Vt, [
|
|
779
|
+
h("div", At, [
|
|
775
780
|
T(l.$slots, "dsg-table--search-header", { data: R.value }, () => [
|
|
776
|
-
|
|
781
|
+
M(me, {
|
|
777
782
|
name: "term",
|
|
778
|
-
"onDsgTable:termChanged":
|
|
783
|
+
"onDsgTable:termChanged": c[0] || (c[0] = (w) => ee(w))
|
|
779
784
|
}),
|
|
780
|
-
|
|
785
|
+
M(be, {
|
|
781
786
|
entity: l.filterEntity,
|
|
782
787
|
"filter-endpoint": l.filterEndpoint,
|
|
783
788
|
"search-endpoint": l.filterSearchEndpoint,
|
|
784
789
|
filters: l.filters,
|
|
785
|
-
"onDsgTable:filterUpdated":
|
|
790
|
+
"onDsgTable:filterUpdated": c[1] || (c[1] = (w, S, H) => ae(w, S, H))
|
|
786
791
|
}, null, 8, ["entity", "filter-endpoint", "search-endpoint", "filters"]),
|
|
787
792
|
T(l.$slots, "dsg-table--search-actions", { data: R.value })
|
|
788
793
|
])
|
|
789
794
|
]),
|
|
790
795
|
T(l.$slots, "dsg-table--search-navigation")
|
|
791
796
|
])) : P("", !0),
|
|
792
|
-
|
|
797
|
+
M(Lt, {
|
|
793
798
|
ref: "dsgTable",
|
|
794
799
|
"api-url": l.getUrl,
|
|
795
|
-
"filter-params":
|
|
796
|
-
"onUpdate:filterParams":
|
|
797
|
-
"per-page":
|
|
798
|
-
"onUpdate:perPage":
|
|
800
|
+
"filter-params": u.value,
|
|
801
|
+
"onUpdate:filterParams": c[6] || (c[6] = (w) => u.value = w),
|
|
802
|
+
"per-page": d.value,
|
|
803
|
+
"onUpdate:perPage": c[7] || (c[7] = (w) => d.value = w),
|
|
799
804
|
fields: l.fields,
|
|
800
805
|
"load-on-start": l.loadOnStart,
|
|
801
806
|
"pagination-path": "meta",
|
|
@@ -803,21 +808,21 @@ You can explicitly suppress this warning by setting pagination-path="".`
|
|
|
803
808
|
"track-by": l.trackBy,
|
|
804
809
|
"table-layout": l.tableLayout,
|
|
805
810
|
css: { tableWrapper: "border-b" },
|
|
806
|
-
"onDsgTable:loading":
|
|
807
|
-
"onDsgTable:loaded":
|
|
811
|
+
"onDsgTable:loading": c[8] || (c[8] = (w) => p.value = !0),
|
|
812
|
+
"onDsgTable:loaded": c[9] || (c[9] = (w) => p.value = !1),
|
|
808
813
|
"onDsgTable:paginationData": D,
|
|
809
814
|
"onDsgTable:loadSuccess": j,
|
|
810
|
-
"onDsgTable:rowsSelected":
|
|
815
|
+
"onDsgTable:rowsSelected": c[10] || (c[10] = (w) => C("dsg-table:rows-selected", w))
|
|
811
816
|
}, He({
|
|
812
817
|
"dsg-field--actions": Z((w) => [
|
|
813
818
|
T(l.$slots, "dsg-table-actions", { data: w }, () => [
|
|
814
819
|
(a(), N(he, {
|
|
815
820
|
key: w.rowIndex,
|
|
816
821
|
data: w,
|
|
817
|
-
"onDsgTable:actionEdit":
|
|
818
|
-
"onDsgTable:actionView":
|
|
819
|
-
"onDsgTable:actionDelete":
|
|
820
|
-
"onDsgTable:linkClicked":
|
|
822
|
+
"onDsgTable:actionEdit": c[2] || (c[2] = (S, H) => C("dsg-table:action-edit", S, H)),
|
|
823
|
+
"onDsgTable:actionView": c[3] || (c[3] = (S, H) => C("dsg-table:action-view", S, H)),
|
|
824
|
+
"onDsgTable:actionDelete": c[4] || (c[4] = (S, H) => C("dsg-table:action-delete", S, H)),
|
|
825
|
+
"onDsgTable:linkClicked": c[5] || (c[5] = (S, H, G) => C("dsg-table:link-clicked", S, H, G))
|
|
821
826
|
}, null, 8, ["data"]))
|
|
822
827
|
])
|
|
823
828
|
]),
|
|
@@ -830,17 +835,17 @@ You can explicitly suppress this warning by setting pagination-path="".`
|
|
|
830
835
|
])
|
|
831
836
|
}))
|
|
832
837
|
]), 1032, ["api-url", "filter-params", "per-page", "fields", "load-on-start", "selectable", "track-by", "table-layout"]),
|
|
833
|
-
h("div",
|
|
834
|
-
h("div",
|
|
838
|
+
h("div", Ot, [
|
|
839
|
+
h("div", Ut, [
|
|
835
840
|
T(l.$slots, "dsg-table--footer-left", {
|
|
836
841
|
data: r.value,
|
|
837
842
|
perPage: s.value
|
|
838
843
|
}, () => [
|
|
839
|
-
|
|
844
|
+
M(pe, {
|
|
840
845
|
"no-data-template": "",
|
|
841
846
|
ref: "paginationInfoStart",
|
|
842
847
|
pagination: r.value,
|
|
843
|
-
"onUpdate:pagination":
|
|
848
|
+
"onUpdate:pagination": c[11] || (c[11] = (w) => r.value = w),
|
|
844
849
|
"info-template": A.value
|
|
845
850
|
}, null, 8, ["pagination", "info-template"]),
|
|
846
851
|
T(l.$slots, "dsg-table--footer-left-extras", {
|
|
@@ -849,7 +854,7 @@ You can explicitly suppress this warning by setting pagination-path="".`
|
|
|
849
854
|
})
|
|
850
855
|
])
|
|
851
856
|
]),
|
|
852
|
-
h("div",
|
|
857
|
+
h("div", qt, [
|
|
853
858
|
T(l.$slots, "dsg-table--footer-center", {
|
|
854
859
|
data: r.value,
|
|
855
860
|
perPage: s.value
|
|
@@ -860,7 +865,7 @@ You can explicitly suppress this warning by setting pagination-path="".`
|
|
|
860
865
|
})
|
|
861
866
|
])
|
|
862
867
|
]),
|
|
863
|
-
h("div",
|
|
868
|
+
h("div", Nt, [
|
|
864
869
|
T(l.$slots, "dsg-table--footer-right", {
|
|
865
870
|
data: r.value,
|
|
866
871
|
perPage: s.value
|
|
@@ -869,7 +874,7 @@ You can explicitly suppress this warning by setting pagination-path="".`
|
|
|
869
874
|
key: 0,
|
|
870
875
|
ref: "pagination",
|
|
871
876
|
pagination: r.value,
|
|
872
|
-
"onUpdate:pagination":
|
|
877
|
+
"onUpdate:pagination": c[12] || (c[12] = (w) => r.value = w),
|
|
873
878
|
"onDsgTable:changePage": I
|
|
874
879
|
}, null, 8, ["pagination"])) : P("", !0),
|
|
875
880
|
T(l.$slots, "dsg-table--footer-right-extras", {
|
|
@@ -881,14 +886,14 @@ You can explicitly suppress this warning by setting pagination-path="".`
|
|
|
881
886
|
])
|
|
882
887
|
]));
|
|
883
888
|
}
|
|
884
|
-
}),
|
|
889
|
+
}), jt = { class: "dsg-table--per-page" }, Kt = ["value", "textContent"], Qt = /* @__PURE__ */ W({
|
|
885
890
|
__name: "DsgTablePerPage",
|
|
886
891
|
props: {
|
|
887
892
|
perPageOptions: { default: () => [10, 20, 30, 50, 100] },
|
|
888
893
|
perPage: {}
|
|
889
894
|
},
|
|
890
895
|
setup(t) {
|
|
891
|
-
return ($, v) => (a(), n("div",
|
|
896
|
+
return ($, v) => (a(), n("div", jt, [
|
|
892
897
|
oe(h("select", {
|
|
893
898
|
"onUpdate:modelValue": v[0] || (v[0] = (i) => $.perPage.perPage = i),
|
|
894
899
|
class: "dsg-table--per-page-select",
|
|
@@ -898,30 +903,30 @@ You can explicitly suppress this warning by setting pagination-path="".`
|
|
|
898
903
|
key: i,
|
|
899
904
|
value: i,
|
|
900
905
|
textContent: _(i)
|
|
901
|
-
}, null, 8,
|
|
906
|
+
}, null, 8, Kt))), 128))
|
|
902
907
|
], 544), [
|
|
903
908
|
[Ve, $.perPage.perPage]
|
|
904
909
|
])
|
|
905
910
|
]));
|
|
906
911
|
}
|
|
907
|
-
}),
|
|
908
|
-
DsgTable:
|
|
909
|
-
DsgTableActions:
|
|
910
|
-
DsgTablePerPage:
|
|
911
|
-
DsgTableFilter:
|
|
912
|
-
DsgTablePagination:
|
|
913
|
-
DsgTablePaginationInfo:
|
|
914
|
-
DsgTableSearch:
|
|
915
|
-
DsgTableRowHeader:
|
|
912
|
+
}), Yt = Wt, xt = he, Gt = Qt, Jt = be, Xt = fe, Zt = pe, _t = me, ea = ye, na = {
|
|
913
|
+
DsgTable: Yt,
|
|
914
|
+
DsgTableActions: xt,
|
|
915
|
+
DsgTablePerPage: Gt,
|
|
916
|
+
DsgTableFilter: Jt,
|
|
917
|
+
DsgTablePagination: Xt,
|
|
918
|
+
DsgTablePaginationInfo: Zt,
|
|
919
|
+
DsgTableSearch: _t,
|
|
920
|
+
DsgTableRowHeader: ea
|
|
916
921
|
};
|
|
917
922
|
export {
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
923
|
+
Yt as DsgTable,
|
|
924
|
+
xt as DsgTableActions,
|
|
925
|
+
Jt as DsgTableFilter,
|
|
926
|
+
Xt as DsgTablePagination,
|
|
927
|
+
Zt as DsgTablePaginationInfo,
|
|
928
|
+
Gt as DsgTablePerPage,
|
|
929
|
+
ea as DsgTableRowHeader,
|
|
930
|
+
_t as DsgTableSearch,
|
|
931
|
+
na as default
|
|
927
932
|
};
|