@dcodegroup-au/dsg-vue 1.0.8-next → 1.0.9-next
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Table/DsgTable.vue.d.ts +20 -2
- package/dist/components/Table/DsgTableComponent.vue.d.ts +6 -0
- package/dist/components/Table/DsgTableRowHeader.vue.d.ts +2 -0
- package/dist/dsg-vue.table.cjs +2 -2
- package/dist/dsg-vue.table.esm.js +518 -484
- package/dist/table.d.ts +26 -2
- package/package.json +1 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { _ as
|
|
3
|
-
import { ucfirst as
|
|
4
|
-
import { data_get as
|
|
5
|
-
import { isEmpty as
|
|
6
|
-
const
|
|
1
|
+
import { defineComponent as Z, useModel as ae, computed as W, withDirectives as Ie, openBlock as s, createElementBlock as d, normalizeClass as L, createVNode as V, createCommentVNode as m, createElementVNode as C, Fragment as q, renderList as Y, vShow as gt, mergeModels as le, ref as P, useTemplateRef as We, unref as G, withCtx as ne, renderSlot as E, toDisplayString as ve, createBlock as K, resolveDynamicComponent as vt, onMounted as qe, normalizeStyle as N, mergeProps as be, watch as ie, onUnmounted as bt, withModifiers as ft, Transition as ht, createTextVNode as mt, useSlots as wt, createSlots as yt, normalizeProps as kt, nextTick as He } from "vue";
|
|
2
|
+
import { _ as O, k as pt, v as Pt, e as Ct, u as St, c as ze, b as Ae, l as Oe, m as Ue, h as Ne, p as xt, i as Dt } from "./DsgTablePerPage.vue_vue_type_style_index_0_lang-CaBn8JMp.js";
|
|
3
|
+
import { ucfirst as $t, ucwords as Ve, toSnakeCase as Tt } from "./dsg-vue.helpers-string.esm.js";
|
|
4
|
+
import { data_get as Se } from "./dsg-vue.helpers-object.esm.js";
|
|
5
|
+
import { isEmpty as Rt } from "./dsg-vue.helpers.esm.js";
|
|
6
|
+
const Mt = { class: "dsg-table-pagination" }, Et = ["disabled"], Bt = ["disabled"], Lt = ["onClick", "innerHTML"], Ft = ["onClick", "innerHTML"], Ht = ["disabled"], At = ["disabled"], Ke = /* @__PURE__ */ Z({
|
|
7
7
|
__name: "DsgTablePagination",
|
|
8
8
|
props: /* @__PURE__ */ le({
|
|
9
9
|
onEachSide: { default: 3 },
|
|
@@ -18,79 +18,79 @@ const Tt = { class: "dsg-table-pagination" }, Rt = ["disabled"], Mt = ["disabled
|
|
|
18
18
|
paginationModifiers: {}
|
|
19
19
|
}),
|
|
20
20
|
emits: /* @__PURE__ */ le(["dsg-table:change-page"], ["update:pagination"]),
|
|
21
|
-
setup(e, { expose:
|
|
22
|
-
const u = ae(e, "pagination"), S =
|
|
21
|
+
setup(e, { expose: B, emit: h }) {
|
|
22
|
+
const u = ae(e, "pagination"), S = W(() => u.value === null ? 0 : u.value?.last_page - e.firstPage + 1), H = W(() => u.value === null ? 0 : u.value?.last_page), f = W(() => u.value === null ? !1 : u.value?.current_page === e.firstPage), g = W(() => u.value === null ? !1 : u.value?.current_page === H.value), A = W(() => S.value < e.onEachSide * 2 + 4), $ = W(() => e.onEachSide * 2 + 1), D = W(() => !u.value || u.value?.current_page <= e.onEachSide ? 1 : u.value?.current_page >= S.value - e.onEachSide ? S.value - e.onEachSide * 2 : u.value?.current_page - e.onEachSide), w = h, a = (R) => {
|
|
23
23
|
w("dsg-table:change-page", R);
|
|
24
24
|
}, T = (R) => R === u.value?.current_page;
|
|
25
|
-
return
|
|
25
|
+
return B({
|
|
26
26
|
loadPage: a
|
|
27
|
-
}), (R, k) =>
|
|
27
|
+
}), (R, k) => Ie((s(), d("div", Mt, [
|
|
28
28
|
e.showFirstLast ? (s(), d("a", {
|
|
29
29
|
key: 0,
|
|
30
30
|
onClick: k[0] || (k[0] = (p) => a(e.firstPage)),
|
|
31
|
-
class: L(["dsg-table-pagination__link", { "dsg-table-pagination__link--disabled":
|
|
32
|
-
disabled:
|
|
31
|
+
class: L(["dsg-table-pagination__link", { "dsg-table-pagination__link--disabled": f.value }]),
|
|
32
|
+
disabled: f.value,
|
|
33
33
|
title: "First",
|
|
34
34
|
"aria-label": "First"
|
|
35
35
|
}, [
|
|
36
|
-
|
|
36
|
+
V(O, {
|
|
37
37
|
icon: e.firstIcon,
|
|
38
38
|
size: "sm"
|
|
39
39
|
}, null, 8, ["icon"])
|
|
40
|
-
], 10,
|
|
41
|
-
|
|
40
|
+
], 10, Et)) : m("", !0),
|
|
41
|
+
C("a", {
|
|
42
42
|
onClick: k[1] || (k[1] = (p) => a("prev")),
|
|
43
|
-
class: L(["dsg-table-pagination__link", { "dsg-table-pagination__link--disabled":
|
|
44
|
-
disabled:
|
|
43
|
+
class: L(["dsg-table-pagination__link", { "dsg-table-pagination__link--disabled": f.value }]),
|
|
44
|
+
disabled: f.value,
|
|
45
45
|
title: "Previous",
|
|
46
46
|
"aria-label": "Previous"
|
|
47
47
|
}, [
|
|
48
|
-
|
|
48
|
+
V(O, {
|
|
49
49
|
icon: e.prevIcon,
|
|
50
50
|
size: "sm"
|
|
51
51
|
}, null, 8, ["icon"])
|
|
52
|
-
], 10,
|
|
53
|
-
|
|
52
|
+
], 10, Bt),
|
|
53
|
+
A.value ? (s(!0), d(q, { key: 1 }, Y(S.value, (p, I) => (s(), d("a", {
|
|
54
54
|
key: I,
|
|
55
55
|
onClick: (se) => a(I + e.firstPage),
|
|
56
56
|
class: L(["dsg-table-pagination__link", { "dsg-table-pagination__link--active": T(I + e.firstPage) }]),
|
|
57
57
|
innerHTML: p
|
|
58
|
-
}, null, 10,
|
|
58
|
+
}, null, 10, Lt))), 128)) : (s(!0), d(q, { key: 2 }, Y($.value, (p, I) => (s(), d("a", {
|
|
59
59
|
key: I,
|
|
60
|
-
onClick: (se) => a(
|
|
61
|
-
class: L(["dsg-table-pagination__link", { "dsg-table-pagination__link--active": T(
|
|
62
|
-
innerHTML:
|
|
63
|
-
}, null, 10,
|
|
64
|
-
|
|
60
|
+
onClick: (se) => a(D.value + I + e.firstPage - 1),
|
|
61
|
+
class: L(["dsg-table-pagination__link", { "dsg-table-pagination__link--active": T(D.value + I + e.firstPage - 1) }]),
|
|
62
|
+
innerHTML: D.value + p - 1
|
|
63
|
+
}, null, 10, Ft))), 128)),
|
|
64
|
+
C("a", {
|
|
65
65
|
onClick: k[2] || (k[2] = (p) => a("next")),
|
|
66
66
|
class: L(["dsg-table-pagination__link", { "dsg-table-pagination__link--disabled": g.value }]),
|
|
67
67
|
disabled: g.value,
|
|
68
68
|
title: "Next",
|
|
69
69
|
"aria-label": "Next"
|
|
70
70
|
}, [
|
|
71
|
-
|
|
71
|
+
V(O, {
|
|
72
72
|
icon: e.nextIcon,
|
|
73
73
|
size: "sm"
|
|
74
74
|
}, null, 8, ["icon"])
|
|
75
|
-
], 10,
|
|
75
|
+
], 10, Ht),
|
|
76
76
|
e.showFirstLast ? (s(), d("a", {
|
|
77
77
|
key: 3,
|
|
78
|
-
onClick: k[3] || (k[3] = (p) => a(
|
|
78
|
+
onClick: k[3] || (k[3] = (p) => a(H.value)),
|
|
79
79
|
class: L(["dsg-table-pagination__link", { "dsg-table-pagination__link--disabled": g.value }]),
|
|
80
80
|
disabled: g.value,
|
|
81
81
|
title: "Last",
|
|
82
82
|
"aria-label": "Last"
|
|
83
83
|
}, [
|
|
84
|
-
|
|
84
|
+
V(O, {
|
|
85
85
|
icon: e.lastIcon,
|
|
86
86
|
size: "sm"
|
|
87
87
|
}, null, 8, ["icon"])
|
|
88
|
-
], 10,
|
|
88
|
+
], 10, At)) : m("", !0)
|
|
89
89
|
], 512)), [
|
|
90
|
-
[
|
|
90
|
+
[gt, u.value && H.value > e.firstPage]
|
|
91
91
|
]);
|
|
92
92
|
}
|
|
93
|
-
}),
|
|
93
|
+
}), Ut = ["innerHTML"], je = /* @__PURE__ */ Z({
|
|
94
94
|
__name: "DsgTablePaginationInfo",
|
|
95
95
|
props: /* @__PURE__ */ le({
|
|
96
96
|
infoTemplate: { default: "Displaying {from} to {to} of {total} items" },
|
|
@@ -101,19 +101,19 @@ const Tt = { class: "dsg-table-pagination" }, Rt = ["disabled"], Mt = ["disabled
|
|
|
101
101
|
}),
|
|
102
102
|
emits: ["update:pagination"],
|
|
103
103
|
setup(e) {
|
|
104
|
-
const
|
|
104
|
+
const B = ae(e, "pagination"), h = W(() => B.value == null || B.value.total == 0 ? e.noDataTemplate : e.infoTemplate.replace("{from}", (B.value?.from || 0).toString()).replace("{to}", (B.value?.to || 0).toString()).replace("{total}", (B.value?.total || 0).toString()));
|
|
105
105
|
return (u, S) => (s(), d("div", {
|
|
106
106
|
class: "dsg-table-pagination-info",
|
|
107
107
|
innerHTML: h.value
|
|
108
|
-
}, null, 8,
|
|
108
|
+
}, null, 8, Ut));
|
|
109
109
|
}
|
|
110
|
-
}),
|
|
110
|
+
}), Vt = {
|
|
111
111
|
class: "dsg-table-actions",
|
|
112
112
|
ref: "dsgTableActions"
|
|
113
|
-
},
|
|
113
|
+
}, It = { class: "dsg-table-action__trigger" }, Wt = {
|
|
114
114
|
key: 0,
|
|
115
115
|
class: "dsg-table-actions__menu-wrapper"
|
|
116
|
-
},
|
|
116
|
+
}, qt = ["href", "target", "onClick"], zt = ["textContent"], Ot = { key: 0 }, Nt = { key: 1 }, Kt = ["href", "target", "onClick"], jt = { class: "flex-1" }, Qe = /* @__PURE__ */ Z({
|
|
117
117
|
__name: "DsgTableActions",
|
|
118
118
|
props: {
|
|
119
119
|
placement: { default: "auto" },
|
|
@@ -121,11 +121,11 @@ const Tt = { class: "dsg-table-pagination" }, Rt = ["disabled"], Mt = ["disabled
|
|
|
121
121
|
} }
|
|
122
122
|
},
|
|
123
123
|
emits: ["dsg-table:action-edit", "dsg-table:action-view", "dsg-table:action-delete", "dsg-table:action-archive", "dsg-table:link-clicked"],
|
|
124
|
-
setup(e, { emit:
|
|
124
|
+
setup(e, { emit: B }) {
|
|
125
125
|
const h = P(!1);
|
|
126
|
-
|
|
127
|
-
const u =
|
|
128
|
-
switch (
|
|
126
|
+
We("dsgTableActions");
|
|
127
|
+
const u = W(() => e.data?.rowData ?? null), S = W(() => u.value?.actions ?? null), H = W(() => u.value?.links ?? null), f = (D) => {
|
|
128
|
+
switch (D) {
|
|
129
129
|
case "edit":
|
|
130
130
|
return "edit-05";
|
|
131
131
|
case "view":
|
|
@@ -137,27 +137,27 @@ const Tt = { class: "dsg-table-pagination" }, Rt = ["disabled"], Mt = ["disabled
|
|
|
137
137
|
default:
|
|
138
138
|
return "dots-horizontal";
|
|
139
139
|
}
|
|
140
|
-
}, g = (
|
|
140
|
+
}, g = (D, w, a) => {
|
|
141
141
|
switch (w) {
|
|
142
142
|
case "edit":
|
|
143
|
-
|
|
143
|
+
$("dsg-table:action-edit", a, u.value);
|
|
144
144
|
break;
|
|
145
145
|
case "view":
|
|
146
|
-
|
|
146
|
+
$("dsg-table:action-view", a, u.value);
|
|
147
147
|
break;
|
|
148
148
|
case "delete":
|
|
149
|
-
|
|
149
|
+
$("dsg-table:action-delete", a, u.value);
|
|
150
150
|
break;
|
|
151
151
|
case "archive":
|
|
152
|
-
|
|
152
|
+
$("dsg-table:action-archive", a, u.value);
|
|
153
153
|
break;
|
|
154
154
|
}
|
|
155
|
-
},
|
|
156
|
-
const a =
|
|
157
|
-
|
|
158
|
-
},
|
|
159
|
-
return (
|
|
160
|
-
|
|
155
|
+
}, A = (D, w) => {
|
|
156
|
+
const a = D.actionId || D.label.trim().toLowerCase().replace(/[^a-z0-9-]/g, "-").replace(/-+/g, "-");
|
|
157
|
+
$("dsg-table:link-clicked", w, a, u.value);
|
|
158
|
+
}, $ = B;
|
|
159
|
+
return (D, w) => Ie((s(), d("div", Vt, [
|
|
160
|
+
V(G(pt), {
|
|
161
161
|
triggers: [],
|
|
162
162
|
placement: e.placement,
|
|
163
163
|
"handle-resize": !0,
|
|
@@ -168,64 +168,64 @@ const Tt = { class: "dsg-table-pagination" }, Rt = ["disabled"], Mt = ["disabled
|
|
|
168
168
|
ref: "floatingVueFilterDropdown"
|
|
169
169
|
}, {
|
|
170
170
|
popper: ne(() => [
|
|
171
|
-
h.value ? (s(), d("div",
|
|
172
|
-
(s(!0), d(
|
|
171
|
+
h.value ? (s(), d("div", Wt, [
|
|
172
|
+
(s(!0), d(q, null, Y(S.value, (a, T) => (s(), d(q, null, [
|
|
173
173
|
["edit", "view", "delete", "archive"].includes(String(T)) ? (s(), d("a", {
|
|
174
174
|
key: T,
|
|
175
175
|
href: a?.link,
|
|
176
176
|
target: a?.target || "_self",
|
|
177
177
|
onClick: (R) => g(a, String(T), R)
|
|
178
178
|
}, [
|
|
179
|
-
|
|
179
|
+
C("div", {
|
|
180
180
|
class: L(["dsg-table-actions__menu-item", `dsg-table-actions__menu-item--${String(T)}`])
|
|
181
181
|
}, [
|
|
182
|
-
|
|
183
|
-
icon:
|
|
182
|
+
V(O, {
|
|
183
|
+
icon: f(String(T)),
|
|
184
184
|
size: "sm"
|
|
185
185
|
}, null, 8, ["icon"]),
|
|
186
|
-
|
|
186
|
+
C("span", {
|
|
187
187
|
class: "dsg-table-actions__menu-item-id",
|
|
188
|
-
textContent: ve(a?.label ||
|
|
189
|
-
}, null, 8,
|
|
188
|
+
textContent: ve(a?.label || G($t)(String(T)))
|
|
189
|
+
}, null, 8, zt)
|
|
190
190
|
], 2)
|
|
191
|
-
], 8,
|
|
191
|
+
], 8, qt)) : m("", !0)
|
|
192
192
|
], 64))), 256)),
|
|
193
|
-
S.value &&
|
|
194
|
-
|
|
193
|
+
S.value && H.value ? (s(), d("hr", Ot)) : m("", !0),
|
|
194
|
+
H.value ? (s(!0), d(q, { key: 1 }, Y(H.value, (a) => (s(), d(q, {
|
|
195
195
|
key: a.label
|
|
196
196
|
}, [
|
|
197
|
-
a.hasOwnProperty("component") ? (s(),
|
|
197
|
+
a.hasOwnProperty("component") ? (s(), K(vt(a.component), {
|
|
198
198
|
key: 0,
|
|
199
199
|
quote: u.value,
|
|
200
200
|
"row-data": u.value
|
|
201
|
-
}, null, 8, ["quote", "row-data"])) : a.hasOwnProperty("type") && a.type == "break" ? (s(), d("hr",
|
|
201
|
+
}, null, 8, ["quote", "row-data"])) : a.hasOwnProperty("type") && a.type == "break" ? (s(), d("hr", Nt)) : (s(), d("a", {
|
|
202
202
|
key: 2,
|
|
203
203
|
href: a.link,
|
|
204
204
|
target: a.target || "_self",
|
|
205
205
|
class: L(["dsg-table-actions__menu-item", a.class]),
|
|
206
|
-
onClick: (T) =>
|
|
206
|
+
onClick: (T) => A(a, T)
|
|
207
207
|
}, [
|
|
208
|
-
a.icon ? (s(),
|
|
208
|
+
a.icon ? (s(), K(O, {
|
|
209
209
|
key: 0,
|
|
210
210
|
icon: a.icon,
|
|
211
211
|
size: "sm"
|
|
212
|
-
}, null, 8, ["icon"])) :
|
|
213
|
-
|
|
214
|
-
], 10,
|
|
215
|
-
], 64))), 128)) :
|
|
216
|
-
])) :
|
|
212
|
+
}, null, 8, ["icon"])) : m("", !0),
|
|
213
|
+
C("span", jt, ve(a.label), 1)
|
|
214
|
+
], 10, Kt))
|
|
215
|
+
], 64))), 128)) : m("", !0)
|
|
216
|
+
])) : m("", !0)
|
|
217
217
|
]),
|
|
218
218
|
default: ne(() => [
|
|
219
|
-
|
|
220
|
-
|
|
219
|
+
C("div", It, [
|
|
220
|
+
C("button", {
|
|
221
221
|
type: "button",
|
|
222
222
|
class: "dsg-table-actions__button",
|
|
223
223
|
"aria-expanded": "false",
|
|
224
224
|
"aria-haspopup": "true",
|
|
225
225
|
onClick: w[0] || (w[0] = (a) => h.value = !h.value)
|
|
226
226
|
}, [
|
|
227
|
-
|
|
228
|
-
|
|
227
|
+
E(D.$slots, "dsg-table-action-button-content", {}, () => [
|
|
228
|
+
V(O, {
|
|
229
229
|
icon: "dots-vertical",
|
|
230
230
|
size: "sm"
|
|
231
231
|
})
|
|
@@ -236,10 +236,10 @@ const Tt = { class: "dsg-table-pagination" }, Rt = ["disabled"], Mt = ["disabled
|
|
|
236
236
|
_: 3
|
|
237
237
|
}, 8, ["placement", "shown"])
|
|
238
238
|
])), [
|
|
239
|
-
[
|
|
239
|
+
[G(Pt), () => h.value = !1]
|
|
240
240
|
]);
|
|
241
241
|
}
|
|
242
|
-
}),
|
|
242
|
+
}), Qt = { class: "dsg-table-search" }, Ye = /* @__PURE__ */ Z({
|
|
243
243
|
__name: "DsgTableSearch",
|
|
244
244
|
props: {
|
|
245
245
|
name: {},
|
|
@@ -254,23 +254,23 @@ const Tt = { class: "dsg-table-pagination" }, Rt = ["disabled"], Mt = ["disabled
|
|
|
254
254
|
replaceState: { type: Boolean, default: !0 }
|
|
255
255
|
},
|
|
256
256
|
emits: ["dsg-table:term-changed"],
|
|
257
|
-
setup(e, { emit:
|
|
257
|
+
setup(e, { emit: B }) {
|
|
258
258
|
const h = P("");
|
|
259
|
-
|
|
260
|
-
const
|
|
261
|
-
|
|
259
|
+
qe(() => {
|
|
260
|
+
const f = new URL(window.location.href).searchParams.get("term");
|
|
261
|
+
f && (h.value = f, u("dsg-table:term-changed", f));
|
|
262
262
|
});
|
|
263
|
-
const u =
|
|
264
|
-
if (h.value =
|
|
265
|
-
const
|
|
266
|
-
h.value ?
|
|
263
|
+
const u = B, S = St((H) => {
|
|
264
|
+
if (h.value = H, e.replaceState) {
|
|
265
|
+
const f = new URL(window.location.href);
|
|
266
|
+
h.value ? f.searchParams.set("term", h.value) : f.searchParams.delete("term"), window.history.pushState({}, "", f.toString());
|
|
267
267
|
}
|
|
268
268
|
u("dsg-table:term-changed", h.value);
|
|
269
269
|
}, 300);
|
|
270
|
-
return (
|
|
271
|
-
|
|
270
|
+
return (H, f) => (s(), d("div", Qt, [
|
|
271
|
+
V(Ct, {
|
|
272
272
|
modelValue: h.value,
|
|
273
|
-
"onUpdate:modelValue":
|
|
273
|
+
"onUpdate:modelValue": f[0] || (f[0] = (g) => h.value = g),
|
|
274
274
|
name: e.name,
|
|
275
275
|
id: e.id || e.name,
|
|
276
276
|
placeholder: e.placeholder,
|
|
@@ -283,31 +283,25 @@ const Tt = { class: "dsg-table-pagination" }, Rt = ["disabled"], Mt = ["disabled
|
|
|
283
283
|
size: "sm",
|
|
284
284
|
icon: "search-sm",
|
|
285
285
|
"icon-clickable": !0,
|
|
286
|
-
onIconClicked:
|
|
287
|
-
onEnterPressed:
|
|
288
|
-
onOnClear:
|
|
286
|
+
onIconClicked: f[1] || (f[1] = (g) => G(S)(g)),
|
|
287
|
+
onEnterPressed: f[2] || (f[2] = (g) => G(S)(g)),
|
|
288
|
+
onOnClear: f[3] || (f[3] = () => G(S)(""))
|
|
289
289
|
}, null, 8, ["modelValue", "name", "id", "placeholder", "disabled", "required", "readonly", "hidden"])
|
|
290
290
|
]));
|
|
291
291
|
}
|
|
292
|
-
}),
|
|
293
|
-
key: 0,
|
|
294
|
-
class: "dsg-table-row-header__row dsg-table-row-header__row--checkbox",
|
|
295
|
-
scope: "col"
|
|
296
|
-
}, Yt = {
|
|
297
|
-
key: 1,
|
|
298
|
-
class: "dsg-table-row-header__row dsg-table-row-header__row--expand-detail",
|
|
299
|
-
scope: "col"
|
|
300
|
-
}, Gt = ["title", "id", "onClick"], Jt = {
|
|
292
|
+
}), Yt = { class: "dsg-table-row-header" }, Gt = ["title", "id", "onClick"], Jt = {
|
|
301
293
|
key: 0,
|
|
302
294
|
class: "dsg-table-row-header__sort-icon"
|
|
303
|
-
}, Xt = ["innerHTML"], Zt = ["innerHTML"], _t = ["innerHTML"], ea = ["innerHTML"],
|
|
295
|
+
}, Xt = ["innerHTML"], Zt = ["innerHTML"], _t = ["innerHTML"], ea = ["innerHTML"], Ge = /* @__PURE__ */ Z({
|
|
304
296
|
__name: "DsgTableRowHeader",
|
|
305
297
|
props: /* @__PURE__ */ le({
|
|
306
298
|
fields: {},
|
|
307
299
|
scrollVisible: { type: Boolean },
|
|
308
300
|
hasSelectAll: { type: Boolean, default: !1 },
|
|
309
301
|
showExpandDetail: { type: Boolean, default: !0 },
|
|
310
|
-
tableDataLength: { default: 0 }
|
|
302
|
+
tableDataLength: { default: 0 },
|
|
303
|
+
selectableColumnWidth: { default: "4rem" },
|
|
304
|
+
expandableColumnWidth: { default: "3rem" }
|
|
311
305
|
}, {
|
|
312
306
|
sortField: { default: null },
|
|
313
307
|
sortFieldModifiers: {},
|
|
@@ -317,46 +311,56 @@ const Tt = { class: "dsg-table-pagination" }, Rt = ["disabled"], Mt = ["disabled
|
|
|
317
311
|
hasSelectedModifiers: {}
|
|
318
312
|
}),
|
|
319
313
|
emits: /* @__PURE__ */ le(["dsg-table:sort-field", "dsg-table:on-select-all", "dsg-table:on-deselect-all"], ["update:sortField", "update:selectedRows", "update:hasSelected"]),
|
|
320
|
-
setup(e, { emit:
|
|
321
|
-
const h = ae(e, "sortField"), u = ae(e, "selectedRows"), S = ae(e, "hasSelected"),
|
|
314
|
+
setup(e, { emit: B }) {
|
|
315
|
+
const h = ae(e, "sortField"), u = ae(e, "selectedRows"), S = ae(e, "hasSelected"), H = P("17px"), f = (D) => {
|
|
322
316
|
S.value && u.value.length > 0 && u.value.length !== e.tableDataLength ? (S.value = !0, g("dsg-table:on-select-all")) : !S.value && u.value.length === 0 ? (S.value = !1, g("dsg-table:on-select-all")) : g("dsg-table:on-deselect-all");
|
|
323
|
-
}, g =
|
|
324
|
-
|
|
325
|
-
|
|
317
|
+
}, g = B, A = (D, w) => [
|
|
318
|
+
D,
|
|
319
|
+
D + "-" + Tt(String(w?.name)),
|
|
326
320
|
w.titleClass || "",
|
|
327
321
|
{ "dsg-table-row-header__row--sortable": w.sortable },
|
|
328
322
|
{ "dsg-table-row-header__row--sort-active": h.value?.name === w.name }
|
|
329
|
-
],
|
|
330
|
-
|
|
331
|
-
name: String(
|
|
332
|
-
field: String(
|
|
333
|
-
direction: h.value?.name ===
|
|
334
|
-
}, g("dsg-table:sort-field",
|
|
323
|
+
], $ = (D) => {
|
|
324
|
+
D.sortable && (h.value = {
|
|
325
|
+
name: String(D?.name),
|
|
326
|
+
field: String(D?.sortField),
|
|
327
|
+
direction: h.value?.name === D.name && h.value?.direction === "asc" ? "desc" : "asc"
|
|
328
|
+
}, g("dsg-table:sort-field", D));
|
|
335
329
|
};
|
|
336
|
-
return (
|
|
337
|
-
e.hasSelectAll ? (s(), d("th",
|
|
338
|
-
|
|
330
|
+
return (D, w) => (s(), d("tr", Yt, [
|
|
331
|
+
e.hasSelectAll ? (s(), d("th", {
|
|
332
|
+
key: 0,
|
|
333
|
+
class: "dsg-table-row-header__row dsg-table-row-header__row--checkbox",
|
|
334
|
+
style: N({ width: e.selectableColumnWidth }),
|
|
335
|
+
scope: "col"
|
|
336
|
+
}, [
|
|
337
|
+
V(ze, {
|
|
339
338
|
modelValue: S.value,
|
|
340
339
|
"onUpdate:modelValue": [
|
|
341
340
|
w[0] || (w[0] = (a) => S.value = a),
|
|
342
|
-
|
|
341
|
+
f
|
|
343
342
|
],
|
|
344
343
|
indeterminate: u.value.length > 0 && u.value.length !== e.tableDataLength
|
|
345
344
|
}, null, 8, ["modelValue", "indeterminate"])
|
|
346
|
-
])) :
|
|
347
|
-
e.showExpandDetail ? (s(), d("th",
|
|
348
|
-
|
|
345
|
+
], 4)) : m("", !0),
|
|
346
|
+
e.showExpandDetail ? (s(), d("th", {
|
|
347
|
+
key: 1,
|
|
348
|
+
class: "dsg-table-row-header__row dsg-table-row-header__row--expand-detail",
|
|
349
|
+
style: N({ width: e.expandableColumnWidth }),
|
|
350
|
+
scope: "col"
|
|
351
|
+
}, null, 4)) : m("", !0),
|
|
352
|
+
(s(!0), d(q, null, Y(e.fields, (a, T) => (s(), d(q, null, [
|
|
349
353
|
a?.visible ? (s(), d("th", {
|
|
350
354
|
key: T,
|
|
351
|
-
class: L(
|
|
352
|
-
style:
|
|
355
|
+
class: L(A("dsg-table-row-header__row", a)),
|
|
356
|
+
style: N([{ width: a.width || void 0 }, a.style]),
|
|
353
357
|
title: a.title + (a.sortable ? " Sort" : ""),
|
|
354
358
|
id: "_" + a.name,
|
|
355
|
-
onClick: (R) =>
|
|
359
|
+
onClick: (R) => $(a),
|
|
356
360
|
scope: "col"
|
|
357
361
|
}, [
|
|
358
362
|
a.sortable ? (s(), d("div", Jt, [
|
|
359
|
-
a.tooltip ? (s(),
|
|
363
|
+
a.tooltip ? (s(), K(Ae, be({
|
|
360
364
|
key: 0,
|
|
361
365
|
ref_for: !0
|
|
362
366
|
}, a.tooltip, { class: "dsg-table-row-header__tooltip" }), {
|
|
@@ -365,78 +369,75 @@ const Tt = { class: "dsg-table-pagination" }, Rt = ["disabled"], Mt = ["disabled
|
|
|
365
369
|
key: 0,
|
|
366
370
|
class: "dsg-table-row-header__title",
|
|
367
371
|
innerHTML: a.title
|
|
368
|
-
}, null, 8, Xt)) :
|
|
369
|
-
a.tooltip.icon ? (s(),
|
|
372
|
+
}, null, 8, Xt)) : m("", !0),
|
|
373
|
+
a.tooltip.icon ? (s(), K(O, {
|
|
370
374
|
key: 1,
|
|
371
375
|
icon: a.tooltip.icon,
|
|
372
376
|
class: "inline-flex",
|
|
373
377
|
size: "xs"
|
|
374
|
-
}, null, 8, ["icon"])) :
|
|
378
|
+
}, null, 8, ["icon"])) : m("", !0)
|
|
375
379
|
]),
|
|
376
380
|
_: 2
|
|
377
381
|
}, 1040)) : a.title ? (s(), d("span", {
|
|
378
382
|
key: 1,
|
|
379
383
|
class: "dsg-table-row-header__title",
|
|
380
384
|
innerHTML: a.title
|
|
381
|
-
}, null, 8, Zt)) :
|
|
382
|
-
a.sortable && h.value?.name !== a.name ? (s(),
|
|
385
|
+
}, null, 8, Zt)) : m("", !0),
|
|
386
|
+
a.sortable && h.value?.name !== a.name ? (s(), K(O, {
|
|
383
387
|
key: 2,
|
|
384
388
|
icon: "chevron-selector-vertical",
|
|
385
389
|
class: "inline-flex",
|
|
386
390
|
size: "xs"
|
|
387
|
-
})) :
|
|
388
|
-
a.sortable && h.value?.name === a.name && h.value?.direction === "asc" ? (s(),
|
|
391
|
+
})) : m("", !0),
|
|
392
|
+
a.sortable && h.value?.name === a.name && h.value?.direction === "asc" ? (s(), K(O, {
|
|
389
393
|
key: 3,
|
|
390
394
|
icon: "chevron-down",
|
|
391
395
|
class: "inline-flex",
|
|
392
396
|
size: "xs"
|
|
393
|
-
})) :
|
|
394
|
-
a.sortable && h.value?.name === a.name && h.value?.direction === "desc" ? (s(),
|
|
397
|
+
})) : m("", !0),
|
|
398
|
+
a.sortable && h.value?.name === a.name && h.value?.direction === "desc" ? (s(), K(O, {
|
|
395
399
|
key: 4,
|
|
396
400
|
icon: "chevron-up",
|
|
397
401
|
class: "inline-flex",
|
|
398
402
|
size: "xs"
|
|
399
|
-
})) :
|
|
400
|
-
])) : (s(), d(
|
|
401
|
-
a.tooltip ? (s(),
|
|
403
|
+
})) : m("", !0)
|
|
404
|
+
])) : (s(), d(q, { key: 1 }, [
|
|
405
|
+
a.tooltip ? (s(), K(Ae, be({
|
|
402
406
|
key: 0,
|
|
403
407
|
ref_for: !0
|
|
404
408
|
}, a.tooltip, { class: "dsg-table-row-header__tooltip" }), {
|
|
405
409
|
"dsg-tooltip--trigger": ne(() => [
|
|
406
|
-
|
|
410
|
+
C("span", {
|
|
407
411
|
class: "dsg-table-row-header__title",
|
|
408
|
-
innerHTML:
|
|
412
|
+
innerHTML: G(Ve)(String(a?.title))
|
|
409
413
|
}, null, 8, _t),
|
|
410
|
-
a.tooltip.icon ? (s(),
|
|
414
|
+
a.tooltip.icon ? (s(), K(O, {
|
|
411
415
|
key: 0,
|
|
412
416
|
icon: a.tooltip.icon,
|
|
413
417
|
class: "inline-flex",
|
|
414
418
|
size: "xs"
|
|
415
|
-
}, null, 8, ["icon"])) :
|
|
419
|
+
}, null, 8, ["icon"])) : m("", !0)
|
|
416
420
|
]),
|
|
417
421
|
_: 2
|
|
418
422
|
}, 1040)) : (s(), d("span", {
|
|
419
423
|
key: 1,
|
|
420
424
|
class: "dsg-table-row-header__title",
|
|
421
|
-
innerHTML:
|
|
425
|
+
innerHTML: G(Ve)(String(a?.title))
|
|
422
426
|
}, null, 8, ea))
|
|
423
427
|
], 64))
|
|
424
|
-
], 14, Gt)) :
|
|
428
|
+
], 14, Gt)) : m("", !0)
|
|
425
429
|
], 64))), 256)),
|
|
426
430
|
e.scrollVisible ? (s(), d("th", {
|
|
427
431
|
key: 2,
|
|
428
|
-
style:
|
|
432
|
+
style: N({ width: H.value }),
|
|
429
433
|
class: "dsg-table-row-header__col-gutter"
|
|
430
|
-
}, null, 4)) :
|
|
434
|
+
}, null, 4)) : m("", !0)
|
|
431
435
|
]));
|
|
432
436
|
}
|
|
433
437
|
}), ta = ["span"], aa = {
|
|
434
438
|
key: 0,
|
|
435
439
|
class: "dsg-table-component__loading"
|
|
436
|
-
}, la = ["colspan"], na = ["colspan"], sa = ["onClick", "onDblclick", "onMouseover", "onMouseenter"], oa = ["onClickCapture"], ia = {
|
|
437
|
-
key: 1,
|
|
438
|
-
class: "dsg-table-component__cell dsg-table-component__cell--expand"
|
|
439
|
-
}, da = ["aria-expanded", "onClick"], ra = ["onClick", "onDblclick", "onContextmenu"], ua = ["innerHTML"], ca = ["onClick"], ga = ["colspan"], va = { key: 2 }, fa = ["colspan"], ba = { class: "dsg-table-component__footer" }, ha = /* @__PURE__ */ X({
|
|
440
|
+
}, la = ["colspan"], na = ["colspan"], sa = ["onClick", "onDblclick", "onMouseover", "onMouseenter"], oa = ["onClickCapture"], ia = ["aria-expanded", "onClick"], da = ["onClick", "onDblclick", "onContextmenu"], ra = ["innerHTML"], ua = ["onClick"], ca = ["colspan"], ga = { key: 2 }, va = ["colspan"], ba = { class: "dsg-table-component__footer" }, fa = /* @__PURE__ */ Z({
|
|
440
441
|
__name: "DsgTableComponent",
|
|
441
442
|
props: /* @__PURE__ */ le({
|
|
442
443
|
fields: { default: () => [] },
|
|
@@ -490,6 +491,8 @@ const Tt = { class: "dsg-table-pagination" }, Rt = ["disabled"], Mt = ["disabled
|
|
|
490
491
|
fieldPrefix: {},
|
|
491
492
|
eventPrefix: {},
|
|
492
493
|
selectable: { type: Boolean, default: !1 },
|
|
494
|
+
selectableColumnWidth: { default: "4rem" },
|
|
495
|
+
expandableColumnWidth: { default: "3rem" },
|
|
493
496
|
shiftSelectHighlight: { default: () => {
|
|
494
497
|
} },
|
|
495
498
|
selectedRowHighlight: { default: () => {
|
|
@@ -503,7 +506,7 @@ const Tt = { class: "dsg-table-pagination" }, Rt = ["disabled"], Mt = ["disabled
|
|
|
503
506
|
perPageModifiers: {}
|
|
504
507
|
}),
|
|
505
508
|
emits: /* @__PURE__ */ le(["dsg-table:loading", "dsg-table:loaded", "dsg-table:load-success", "dsg-table:load-error", "dsg-table:pagination-data", "dsg-table:rows-selected", "dsg-table:row-clicked", "dsg-table:row-hover", "dsg-table:row-dblclick", "dsg-table:row-expanded", "dsg-table:row-collapsed"], ["update:filterParams", "update:perPage"]),
|
|
506
|
-
setup(e, { expose:
|
|
509
|
+
setup(e, { expose: B, emit: h }) {
|
|
507
510
|
const u = (t) => t.map((l, n) => ({
|
|
508
511
|
field: l.field || "",
|
|
509
512
|
title: l.title || "",
|
|
@@ -519,11 +522,11 @@ const Tt = { class: "dsg-table-pagination" }, Rt = ["disabled"], Mt = ["disabled
|
|
|
519
522
|
$_index: n
|
|
520
523
|
})), S = () => {
|
|
521
524
|
if (!e.apiMode) return null;
|
|
522
|
-
const l =
|
|
525
|
+
const l = Oe().find((n) => n.key === e.queryParams.sort);
|
|
523
526
|
if (l && l.value.length > 0) {
|
|
524
|
-
const n = l.value[0], v = n.startsWith("-"), c = v ? n.substring(1) : n,
|
|
525
|
-
return
|
|
526
|
-
name: String(
|
|
527
|
+
const n = l.value[0], v = n.startsWith("-"), c = v ? n.substring(1) : n, x = e.fields.find((Q) => Q.sortField === c || Q.name === c || Q.field === c);
|
|
528
|
+
return x ? {
|
|
529
|
+
name: String(x.name || x.field),
|
|
527
530
|
field: c,
|
|
528
531
|
direction: v ? "desc" : "asc"
|
|
529
532
|
} : {
|
|
@@ -533,7 +536,7 @@ const Tt = { class: "dsg-table-pagination" }, Rt = ["disabled"], Mt = ["disabled
|
|
|
533
536
|
};
|
|
534
537
|
}
|
|
535
538
|
return null;
|
|
536
|
-
},
|
|
539
|
+
}, H = () => {
|
|
537
540
|
if (!(!e.apiMode || !e.replaceState) && e.replaceStrategy === "window") {
|
|
538
541
|
const t = new URL(window.location.href), l = new URLSearchParams(t.search);
|
|
539
542
|
if (l.delete(e.queryParams.sort), k.value) {
|
|
@@ -543,52 +546,52 @@ const Tt = { class: "dsg-table-pagination" }, Rt = ["disabled"], Mt = ["disabled
|
|
|
543
546
|
const n = `${t.pathname}${l.toString() ? "?" + l.toString() : ""}`;
|
|
544
547
|
window.history.pushState({}, "", n);
|
|
545
548
|
}
|
|
546
|
-
},
|
|
547
|
-
let t =
|
|
549
|
+
}, f = P(u(e.fields)), g = P(e.data), A = P(null), $ = P(e.initialPage), D = P("17px"), w = P(!1), a = P({}), T = P(0), R = P(!0), k = P(S()), p = P(null), I = P(0), se = ae(e, "filterParams"), re = ae(e, "perPage"), M = P([]), oe = P(!1), z = P(/* @__PURE__ */ new Set()), U = P(null), j = P(null), J = P(!1), _ = W(() => e.tableHeight != null), ee = W(() => {
|
|
550
|
+
let t = f.value.filter((l) => l.visible).length;
|
|
548
551
|
return e.selectable && t++, e.hasDetailRow && e.expandableRows && t++, t;
|
|
549
|
-
}),
|
|
552
|
+
}), fe = W(() => {
|
|
550
553
|
const t = {};
|
|
551
554
|
return e.shiftSelectHighlight && (t["--dsg-shift-select-bg"] = e.shiftSelectHighlight), e.selectedRowHighlight && (t["--dsg-selected-row-bg"] = e.selectedRowHighlight), Object.keys(t).length > 0 ? t : void 0;
|
|
552
555
|
}), he = (t, l) => {
|
|
553
556
|
const n = t?.[e.trackBy];
|
|
554
557
|
return n ?? l;
|
|
555
558
|
};
|
|
556
|
-
|
|
557
|
-
() =>
|
|
559
|
+
ie(
|
|
560
|
+
() => M.value.length,
|
|
558
561
|
(t) => {
|
|
559
|
-
|
|
562
|
+
oe.value = e.selectable && t > 0;
|
|
560
563
|
},
|
|
561
564
|
{ immediate: !0 }
|
|
562
|
-
),
|
|
565
|
+
), ie(
|
|
563
566
|
() => e.fields,
|
|
564
567
|
(t) => {
|
|
565
|
-
|
|
568
|
+
f.value = u(t);
|
|
566
569
|
},
|
|
567
570
|
{ immediate: !0, deep: !0 }
|
|
568
|
-
),
|
|
571
|
+
), ie(
|
|
569
572
|
() => se.value,
|
|
570
573
|
(t) => {
|
|
571
|
-
|
|
574
|
+
te();
|
|
572
575
|
},
|
|
573
576
|
{ deep: !0 }
|
|
574
|
-
),
|
|
577
|
+
), ie(
|
|
575
578
|
() => re.value,
|
|
576
579
|
() => {
|
|
577
|
-
|
|
580
|
+
te();
|
|
578
581
|
}
|
|
579
|
-
),
|
|
582
|
+
), ie(
|
|
580
583
|
() => e.apiUrl,
|
|
581
584
|
(t, l) => {
|
|
582
|
-
e.apiMode && t !== l && t &&
|
|
585
|
+
e.apiMode && t !== l && t && te();
|
|
583
586
|
}
|
|
584
|
-
),
|
|
587
|
+
), ie(
|
|
585
588
|
() => k.value,
|
|
586
589
|
() => {
|
|
587
|
-
|
|
590
|
+
H();
|
|
588
591
|
},
|
|
589
592
|
{ deep: !0 }
|
|
590
593
|
);
|
|
591
|
-
const
|
|
594
|
+
const F = h, me = (t, l) => t.formatter && typeof t.formatter == "function" ? t.formatter(t, l) : Se(l, String(t?.name), ""), we = (t) => "dsg-field--" + t.name?.toLowerCase().replaceAll(/[_ ]/g, "-"), ye = (t, l) => {
|
|
592
595
|
const n = {
|
|
593
596
|
odd: l % 2 === 0,
|
|
594
597
|
even: l % 2 !== 0,
|
|
@@ -599,105 +602,109 @@ const Tt = { class: "dsg-table-pagination" }, Rt = ["disabled"], Mt = ["disabled
|
|
|
599
602
|
let v = {};
|
|
600
603
|
if (typeof e.rowClass == "function") {
|
|
601
604
|
const c = e.rowClass(t, l);
|
|
602
|
-
typeof c == "string" ? c.split(" ").forEach((
|
|
603
|
-
|
|
604
|
-
}) : Array.isArray(c) ? c.forEach((
|
|
605
|
-
typeof
|
|
605
|
+
typeof c == "string" ? c.split(" ").forEach((x) => {
|
|
606
|
+
x.trim() && (v[x.trim()] = !0);
|
|
607
|
+
}) : Array.isArray(c) ? c.forEach((x) => {
|
|
608
|
+
typeof x == "string" && x.trim() && (v[x.trim()] = !0);
|
|
606
609
|
}) : typeof c == "object" && c !== null && (v = c);
|
|
607
610
|
} else typeof e.rowClass == "string" && e.rowClass.split(" ").forEach((c) => {
|
|
608
611
|
c.trim() && (v[c.trim()] = !0);
|
|
609
612
|
});
|
|
610
613
|
return { ...n, ...v };
|
|
611
|
-
},
|
|
614
|
+
}, X = (t) => z.value.has(t[e.trackBy]), ue = (t, l) => {
|
|
612
615
|
const n = t[e.trackBy];
|
|
613
|
-
|
|
614
|
-
}, ce = (t) => {
|
|
615
|
-
const l = t[e.trackBy];
|
|
616
|
-
O.value.has(l) || (e.expandMultiple || O.value.clear(), O.value.add(l));
|
|
616
|
+
z.value.has(n) ? (z.value.delete(n), F("dsg-table:row-collapsed", t, l)) : (e.expandMultiple || z.value.clear(), z.value.add(n), F("dsg-table:row-expanded", t, l));
|
|
617
617
|
}, ke = (t) => {
|
|
618
|
-
|
|
619
|
-
|
|
618
|
+
const l = t[e.trackBy];
|
|
619
|
+
z.value.has(l) || (e.expandMultiple || z.value.clear(), z.value.add(l));
|
|
620
|
+
}, pe = (t) => {
|
|
621
|
+
z.value.delete(t[e.trackBy]);
|
|
622
|
+
}, ce = () => {
|
|
620
623
|
g.value?.forEach((t) => {
|
|
621
|
-
|
|
624
|
+
z.value.add(t[e.trackBy]);
|
|
622
625
|
});
|
|
623
|
-
},
|
|
624
|
-
|
|
625
|
-
},
|
|
626
|
+
}, Pe = () => {
|
|
627
|
+
z.value.clear();
|
|
628
|
+
}, o = () => z.value, i = (t, l) => {
|
|
626
629
|
if (e.selectable) {
|
|
627
|
-
if (l !== void 0 && (
|
|
628
|
-
|
|
630
|
+
if (l !== void 0 && (U.value = l), t.selected)
|
|
631
|
+
M.value.push(t);
|
|
629
632
|
else {
|
|
630
|
-
const n =
|
|
631
|
-
n !== -1 &&
|
|
633
|
+
const n = M.value.findIndex((v) => v[e.trackBy] === t[e.trackBy]);
|
|
634
|
+
n !== -1 && M.value.splice(n, 1);
|
|
632
635
|
}
|
|
633
|
-
|
|
636
|
+
F("dsg-table:rows-selected", M.value);
|
|
634
637
|
}
|
|
635
|
-
},
|
|
636
|
-
if (e.selectable && t.shiftKey &&
|
|
638
|
+
}, r = (t, l, n) => {
|
|
639
|
+
if (e.selectable && t.shiftKey && U.value !== null) {
|
|
637
640
|
t.stopPropagation(), t.preventDefault();
|
|
638
|
-
const v = Math.min(
|
|
639
|
-
for (let
|
|
640
|
-
if (
|
|
641
|
-
const de = g.value?.[
|
|
641
|
+
const v = Math.min(U.value, n), c = Math.max(U.value, n), x = !l.selected;
|
|
642
|
+
for (let Q = v; Q <= c; Q++) {
|
|
643
|
+
if (Q === U.value) continue;
|
|
644
|
+
const de = g.value?.[Q];
|
|
642
645
|
if (de) {
|
|
643
|
-
const
|
|
644
|
-
if (de.selected =
|
|
645
|
-
|
|
646
|
-
else if (!
|
|
647
|
-
const
|
|
648
|
-
|
|
646
|
+
const Le = de.selected;
|
|
647
|
+
if (de.selected = x, x && !Le)
|
|
648
|
+
M.value.push(de);
|
|
649
|
+
else if (!x && Le) {
|
|
650
|
+
const Fe = M.value.findIndex((ct) => ct[e.trackBy] === de[e.trackBy]);
|
|
651
|
+
Fe !== -1 && M.value.splice(Fe, 1);
|
|
649
652
|
}
|
|
650
653
|
}
|
|
651
654
|
}
|
|
652
|
-
|
|
655
|
+
U.value = n, j.value = null, F("dsg-table:rows-selected", M.value);
|
|
653
656
|
}
|
|
654
|
-
},
|
|
657
|
+
}, b = () => {
|
|
655
658
|
e.selectable && (g.value?.forEach((t) => {
|
|
656
659
|
t.selected = !0;
|
|
657
|
-
}),
|
|
658
|
-
},
|
|
660
|
+
}), M.value = g.value?.filter((t) => t.selected) ?? [], U.value = null, F("dsg-table:rows-selected", M.value));
|
|
661
|
+
}, y = () => {
|
|
659
662
|
e.selectable && (g.value?.forEach((t) => {
|
|
660
663
|
t.selected = !1;
|
|
661
|
-
}),
|
|
664
|
+
}), M.value = [], U.value = null, F("dsg-table:rows-selected", M.value));
|
|
665
|
+
}, Ce = () => M.value ?? [], Je = () => {
|
|
666
|
+
e.selectable && g.value?.forEach((t) => {
|
|
667
|
+
t.selected = !1;
|
|
668
|
+
}), M.value = [], oe.value = !1, U.value = null, j.value = null, F("dsg-table:rows-selected", M.value);
|
|
662
669
|
}, ge = (t) => {
|
|
663
|
-
g.value = Array.isArray(t) ? t : [], e.selectable && (
|
|
670
|
+
g.value = Array.isArray(t) ? t : [], e.selectable && (U.value = null, g.value.forEach((l) => {
|
|
664
671
|
l.selected = l.selected ?? !1;
|
|
665
672
|
}));
|
|
666
|
-
},
|
|
667
|
-
t === "prev" ?
|
|
668
|
-
},
|
|
673
|
+
}, Xe = () => g.value ?? [], Ze = (t) => {
|
|
674
|
+
t === "prev" ? $.value > e.firstPage && $.value-- : t === "next" ? $.value < (A.value?.last_page ?? 0) && $.value++ : t != $.value && t >= e.firstPage && t <= (A.value?.last_page ?? 0) && ($.value = t), te();
|
|
675
|
+
}, _e = () => ({
|
|
669
676
|
[e.queryParams?.sort]: k.value ? (k.value?.direction === "desc" ? "-" : "") + k.value?.field : void 0,
|
|
670
677
|
[e.queryParams?.order]: k.value?.direction,
|
|
671
|
-
[e.queryParams?.page]:
|
|
678
|
+
[e.queryParams?.page]: $.value,
|
|
672
679
|
[e.queryParams?.perPage]: re.value
|
|
673
|
-
}),
|
|
680
|
+
}), xe = () => {
|
|
674
681
|
p.value && (p.value.abort(), p.value = null);
|
|
675
|
-
},
|
|
676
|
-
|
|
682
|
+
}, et = (t, l) => {
|
|
683
|
+
xe(), I.value++;
|
|
677
684
|
const n = I.value, v = new AbortController();
|
|
678
|
-
return l.signal = v.signal, p.value = v, (e.httpMethod.toLowerCase() === "get" ?
|
|
679
|
-
const
|
|
680
|
-
return delete l.params,
|
|
685
|
+
return l.signal = v.signal, p.value = v, (e.httpMethod.toLowerCase() === "get" ? Ue.get(t, l) : (() => {
|
|
686
|
+
const x = l.params;
|
|
687
|
+
return delete l.params, Ue.post(t, x, l);
|
|
681
688
|
})()).then(
|
|
682
|
-
(
|
|
683
|
-
(
|
|
684
|
-
throw
|
|
689
|
+
(x) => ({ ...x, _requestId: n, _apiUrl: t }),
|
|
690
|
+
(x) => {
|
|
691
|
+
throw x.name === "AbortError" || x.code === "ERR_CANCELED" ? { ...x, _requestId: n, _cancelled: !0 } : { ...x, _requestId: n };
|
|
685
692
|
}
|
|
686
693
|
);
|
|
687
|
-
},
|
|
694
|
+
}, De = (t) => {
|
|
688
695
|
if (t._requestId && t._requestId !== I.value || t._apiUrl && t._apiUrl !== e.apiUrl)
|
|
689
696
|
return;
|
|
690
|
-
|
|
697
|
+
F("dsg-table:load-success", t);
|
|
691
698
|
const l = e.transform ? e.transform(t.data) : t.data;
|
|
692
|
-
g.value =
|
|
699
|
+
g.value = Se(l, e.dataPath, null), e.selectable && (U.value = null, g.value?.forEach((n) => {
|
|
693
700
|
n.selected = n.selected ?? !1;
|
|
694
|
-
})),
|
|
701
|
+
})), A.value = Se(l, e.paginationPath, null) ?? null, T.value = g.value?.length ? g.value[0].order : T, !Rt(e.paginationPath) && A.value === null && console.warn(
|
|
695
702
|
'DsgTable: pagination-path "' + e.paginationPath + `" not found. It looks like the data returned from the server does not have pagination information or you may have set it incorrectly.
|
|
696
703
|
You can explicitly suppress this warning by setting pagination-path="".`
|
|
697
|
-
), p.value = null,
|
|
698
|
-
},
|
|
699
|
-
t._requestId && t._requestId !== I.value || t._apiUrl && t._apiUrl !== e.apiUrl || t._cancelled || (console.error("load-error", t), p.value = null,
|
|
700
|
-
},
|
|
704
|
+
), p.value = null, F("dsg-table:pagination-data", A.value), A.value && $.value > (A.value?.last_page || 0) && g.value?.length === 0 && ($.value = e.initialPage, te()), F("dsg-table:loaded"), R.value = !1;
|
|
705
|
+
}, $e = (t) => {
|
|
706
|
+
t._requestId && t._requestId !== I.value || t._apiUrl && t._apiUrl !== e.apiUrl || t._cancelled || (console.error("load-error", t), p.value = null, F("dsg-table:load-error", t), F("dsg-table:loaded"), R.value = !1);
|
|
707
|
+
}, Te = () => {
|
|
701
708
|
if (e.data !== null && Array.isArray(e.data)) {
|
|
702
709
|
ge(e.data), R.value = !1;
|
|
703
710
|
return;
|
|
@@ -707,230 +714,249 @@ You can explicitly suppress this warning by setting pagination-path="".`
|
|
|
707
714
|
ge(t), R.value = !1;
|
|
708
715
|
} else
|
|
709
716
|
ge(e.data), R.value = !1;
|
|
710
|
-
},
|
|
711
|
-
const v = t ||
|
|
717
|
+
}, te = (t = De, l = $e, n = {}) => {
|
|
718
|
+
const v = t || De, c = l || $e;
|
|
712
719
|
if (!e.apiMode) {
|
|
713
|
-
|
|
720
|
+
Te();
|
|
714
721
|
return;
|
|
715
722
|
}
|
|
716
|
-
return R.value = !0,
|
|
717
|
-
...
|
|
723
|
+
return R.value = !0, F("dsg-table:loading", R.value), e.httpOptions.params = {
|
|
724
|
+
..._e(),
|
|
718
725
|
...se.value
|
|
719
|
-
},
|
|
720
|
-
}, _e = (t, l, n) => {
|
|
721
|
-
A("dsg-table:row-clicked", t, l, n);
|
|
722
|
-
}, et = (t, l, n) => {
|
|
723
|
-
A("dsg-table:row-dblclick", t, l, n);
|
|
726
|
+
}, et(e.apiUrl, e.httpOptions).then(v).catch((x) => c(x));
|
|
724
727
|
}, tt = (t, l, n) => {
|
|
725
|
-
|
|
726
|
-
},
|
|
728
|
+
F("dsg-table:row-clicked", t, l, n);
|
|
729
|
+
}, at = (t, l, n) => {
|
|
730
|
+
F("dsg-table:row-dblclick", t, l, n);
|
|
731
|
+
}, lt = (t, l, n) => {
|
|
727
732
|
}, nt = (t, l, n, v) => {
|
|
728
|
-
}, st = (t, l, n) => {
|
|
729
|
-
},
|
|
730
|
-
|
|
731
|
-
},
|
|
732
|
-
t.key === "Shift" && (
|
|
733
|
-
},
|
|
734
|
-
|
|
735
|
-
},
|
|
736
|
-
|
|
737
|
-
}, it = () => {
|
|
738
|
-
j.value = null;
|
|
733
|
+
}, st = (t, l, n, v) => {
|
|
734
|
+
}, ot = (t, l, n, v) => {
|
|
735
|
+
}, it = (t, l, n) => {
|
|
736
|
+
}, Re = (t) => {
|
|
737
|
+
t.key === "Shift" && (J.value = !0);
|
|
738
|
+
}, Me = (t) => {
|
|
739
|
+
t.key === "Shift" && (J.value = !1, j.value = null);
|
|
740
|
+
}, Ee = () => {
|
|
741
|
+
J.value = !1, j.value = null;
|
|
739
742
|
}, dt = (t) => {
|
|
740
|
-
|
|
743
|
+
e.selectable && J.value && U.value !== null && (j.value = t);
|
|
744
|
+
}, rt = () => {
|
|
745
|
+
j.value = null;
|
|
746
|
+
}, ut = (t) => {
|
|
747
|
+
if (!e.selectable || !J.value || U.value === null || j.value === null)
|
|
741
748
|
return !1;
|
|
742
|
-
const l = Math.min(
|
|
749
|
+
const l = Math.min(U.value, j.value), n = Math.max(U.value, j.value);
|
|
743
750
|
return t >= l && t <= n;
|
|
744
751
|
};
|
|
745
|
-
|
|
746
|
-
e.apiMode === !0 ?
|
|
747
|
-
}),
|
|
748
|
-
e.selectable && (document.removeEventListener("keydown",
|
|
752
|
+
qe(() => {
|
|
753
|
+
e.apiMode === !0 ? te() : Te(), e.selectable && (document.addEventListener("keydown", Re), document.addEventListener("keyup", Me), window.addEventListener("blur", Ee));
|
|
754
|
+
}), bt(() => {
|
|
755
|
+
e.selectable && (document.removeEventListener("keydown", Re), document.removeEventListener("keyup", Me), window.removeEventListener("blur", Ee));
|
|
749
756
|
});
|
|
750
|
-
const
|
|
751
|
-
e.apiMode && (
|
|
757
|
+
const Be = () => {
|
|
758
|
+
e.apiMode && (M.value = [], xe(), te());
|
|
752
759
|
};
|
|
753
|
-
return
|
|
754
|
-
changePage:
|
|
755
|
-
reload:
|
|
756
|
-
getData:
|
|
760
|
+
return B({
|
|
761
|
+
changePage: Ze,
|
|
762
|
+
reload: Be,
|
|
763
|
+
getData: Xe,
|
|
757
764
|
setData: ge,
|
|
758
765
|
setLoading: (t) => {
|
|
759
|
-
R.value = t,
|
|
766
|
+
R.value = t, F("dsg-table:loading", R.value);
|
|
760
767
|
},
|
|
761
|
-
expandRow:
|
|
762
|
-
collapseRow:
|
|
768
|
+
expandRow: ke,
|
|
769
|
+
collapseRow: pe,
|
|
763
770
|
toggleRowExpand: ue,
|
|
764
|
-
expandAllRows:
|
|
765
|
-
collapseAllRows:
|
|
766
|
-
getExpandedRows:
|
|
767
|
-
isRowExpanded:
|
|
771
|
+
expandAllRows: ce,
|
|
772
|
+
collapseAllRows: Pe,
|
|
773
|
+
getExpandedRows: o,
|
|
774
|
+
isRowExpanded: X,
|
|
775
|
+
getSelection: Ce,
|
|
776
|
+
clearSelection: Je
|
|
768
777
|
}), (t, l) => (s(), d("div", {
|
|
769
|
-
class: L(["dsg-table-component", { "dsg-table-component--shift-active": e.selectable &&
|
|
770
|
-
style:
|
|
778
|
+
class: L(["dsg-table-component", { "dsg-table-component--shift-active": e.selectable && J.value }]),
|
|
779
|
+
style: N(fe.value)
|
|
771
780
|
}, [
|
|
772
|
-
|
|
781
|
+
C("div", {
|
|
773
782
|
ref: "dsgTableBodyWrapper",
|
|
774
|
-
class: L(["dsg-table-component__body-wrapper", { "dsg-table-component__body-wrapper--fixed-header":
|
|
775
|
-
style:
|
|
783
|
+
class: L(["dsg-table-component__body-wrapper", { "dsg-table-component__body-wrapper--fixed-header": _.value }]),
|
|
784
|
+
style: N({ height: e.tableHeight || void 0 })
|
|
776
785
|
}, [
|
|
777
|
-
|
|
786
|
+
C("table", {
|
|
778
787
|
class: L([
|
|
779
788
|
"dsg-table-component__main",
|
|
780
|
-
|
|
789
|
+
_.value ? "dsg-table-component__main--fixed-header" : "",
|
|
781
790
|
"dsg-table-component__main--" + e.tableLayout,
|
|
782
791
|
a.value.table
|
|
783
792
|
])
|
|
784
793
|
}, [
|
|
785
|
-
|
|
786
|
-
|
|
794
|
+
C("colgroup", { span: ee.value }, [
|
|
795
|
+
e.selectable ? (s(), d("col", {
|
|
796
|
+
key: 0,
|
|
797
|
+
style: N({ width: e.selectableColumnWidth }),
|
|
798
|
+
class: "dsg-table-component__col-checkbox"
|
|
799
|
+
}, null, 4)) : m("", !0),
|
|
800
|
+
e.hasDetailRow && e.expandableRows ? (s(), d("col", {
|
|
801
|
+
key: 1,
|
|
802
|
+
style: N({ width: e.expandableColumnWidth }),
|
|
803
|
+
class: "dsg-table-component__col-expand"
|
|
804
|
+
}, null, 4)) : m("", !0),
|
|
805
|
+
(s(!0), d(q, null, Y(f.value, (n, v) => (s(), d(q, null, [
|
|
787
806
|
n?.visible ? (s(), d("col", {
|
|
788
807
|
key: v,
|
|
789
|
-
style:
|
|
808
|
+
style: N({ width: n.width || void 0 }),
|
|
790
809
|
class: L("dsg-table-component__col-" + n.name + " " + n.titleClass)
|
|
791
|
-
}, null, 6)) :
|
|
810
|
+
}, null, 6)) : m("", !0)
|
|
792
811
|
], 64))), 256)),
|
|
793
|
-
!
|
|
794
|
-
key:
|
|
795
|
-
style:
|
|
812
|
+
!_.value && w.value ? (s(), d("col", {
|
|
813
|
+
key: 2,
|
|
814
|
+
style: N({ width: D.value }),
|
|
796
815
|
class: "dsg-table-component__col-gutter"
|
|
797
|
-
}, null, 4)) :
|
|
816
|
+
}, null, 4)) : m("", !0)
|
|
798
817
|
], 8, ta),
|
|
799
|
-
|
|
800
|
-
class: L([[a.value.thead, { sticky:
|
|
818
|
+
C("thead", {
|
|
819
|
+
class: L([[a.value.thead, { sticky: _.value, "top-0": _.value }], "dsg-table-component__head"])
|
|
801
820
|
}, [
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
fields:
|
|
821
|
+
E(t.$slots, "tableHeader", { fields: f.value }, () => [
|
|
822
|
+
V(Ge, {
|
|
823
|
+
fields: f.value,
|
|
805
824
|
"has-select-all": e.selectable,
|
|
806
|
-
"
|
|
807
|
-
"
|
|
808
|
-
"
|
|
809
|
-
"onUpdate:
|
|
825
|
+
"selectable-column-width": e.selectableColumnWidth,
|
|
826
|
+
"expandable-column-width": e.expandableColumnWidth,
|
|
827
|
+
"selected-rows": M.value,
|
|
828
|
+
"onUpdate:selectedRows": l[0] || (l[0] = (n) => M.value = n),
|
|
829
|
+
"has-selected": oe.value,
|
|
830
|
+
"onUpdate:hasSelected": l[1] || (l[1] = (n) => oe.value = n),
|
|
810
831
|
"scroll-visible": w.value,
|
|
811
832
|
"show-expand-detail": e.hasDetailRow && e.showExpandDetail,
|
|
812
833
|
"table-data-length": g.value?.length,
|
|
813
834
|
"sort-field": k.value,
|
|
814
835
|
"onUpdate:sortField": l[2] || (l[2] = (n) => k.value = n),
|
|
815
|
-
"onDsgTable:sortField": l[3] || (l[3] = (n) =>
|
|
816
|
-
"onDsgTable:onSelectAll":
|
|
817
|
-
"onDsgTable:onDeselectAll":
|
|
818
|
-
}, null, 8, ["fields", "has-select-all", "selected-rows", "has-selected", "scroll-visible", "show-expand-detail", "table-data-length", "sort-field"])
|
|
836
|
+
"onDsgTable:sortField": l[3] || (l[3] = (n) => Be()),
|
|
837
|
+
"onDsgTable:onSelectAll": b,
|
|
838
|
+
"onDsgTable:onDeselectAll": y
|
|
839
|
+
}, null, 8, ["fields", "has-select-all", "selectable-column-width", "expandable-column-width", "selected-rows", "has-selected", "scroll-visible", "show-expand-detail", "table-data-length", "sort-field"])
|
|
819
840
|
])
|
|
820
841
|
], 2),
|
|
821
|
-
|
|
842
|
+
C("tbody", {
|
|
822
843
|
class: L(["dsg-table-component__body", a.value.tbody])
|
|
823
844
|
}, [
|
|
824
845
|
R.value ? (s(), d("tr", aa, [
|
|
825
|
-
|
|
826
|
-
|
|
846
|
+
C("td", { colspan: ee.value }, [
|
|
847
|
+
C("div", {
|
|
827
848
|
"aria-label": "Loading...",
|
|
828
849
|
role: "status",
|
|
829
850
|
class: "flex items-center space-x-3 h-12 w-full justify-center",
|
|
830
|
-
colspan:
|
|
851
|
+
colspan: ee.value
|
|
831
852
|
}, [
|
|
832
|
-
|
|
833
|
-
|
|
853
|
+
E(t.$slots, "dsg-table-loading", {}, () => [
|
|
854
|
+
V(O, {
|
|
834
855
|
icon: "loading-02",
|
|
835
856
|
class: "animate-spin"
|
|
836
857
|
}),
|
|
837
|
-
l[5] || (l[5] =
|
|
858
|
+
l[5] || (l[5] = C("span", { class: "text-xs font-medium text-gray-500" }, "Loading...", -1))
|
|
838
859
|
])
|
|
839
860
|
], 8, na)
|
|
840
861
|
], 8, la)
|
|
841
|
-
])) : (s(!0), d(
|
|
862
|
+
])) : (s(!0), d(q, { key: 1 }, Y(g.value, (n, v) => (s(), d(q, {
|
|
842
863
|
key: he(n, v)
|
|
843
864
|
}, [
|
|
844
|
-
|
|
845
|
-
class: L(["dsg-table-component__row", [ye(n, v), { "dsg-table-component__row--shift-range": e.selectable &&
|
|
846
|
-
onClick: (c) =>
|
|
847
|
-
onDblclick: (c) =>
|
|
848
|
-
onMouseover: (c) =>
|
|
849
|
-
onMouseenter: (c) =>
|
|
850
|
-
onMouseleave: l[4] || (l[4] = (c) =>
|
|
865
|
+
C("tr", {
|
|
866
|
+
class: L(["dsg-table-component__row", [ye(n, v), { "dsg-table-component__row--shift-range": e.selectable && ut(v) }]]),
|
|
867
|
+
onClick: (c) => tt(c, v, n),
|
|
868
|
+
onDblclick: (c) => at(c, v, n),
|
|
869
|
+
onMouseover: (c) => lt(),
|
|
870
|
+
onMouseenter: (c) => dt(v),
|
|
871
|
+
onMouseleave: l[4] || (l[4] = (c) => rt())
|
|
851
872
|
}, [
|
|
852
873
|
e.selectable ? (s(), d("td", {
|
|
853
874
|
key: 0,
|
|
854
875
|
class: "dsg-table-component__cell dsg-table-component__cell--checkbox",
|
|
855
|
-
|
|
876
|
+
style: N({ width: e.selectableColumnWidth }),
|
|
877
|
+
onClickCapture: (c) => r(c, n, v)
|
|
856
878
|
}, [
|
|
857
|
-
|
|
879
|
+
V(ze, {
|
|
858
880
|
modelValue: n.selected,
|
|
859
|
-
"onUpdate:modelValue": [(c) => n.selected = c, (c) =>
|
|
881
|
+
"onUpdate:modelValue": [(c) => n.selected = c, (c) => i(n, v)]
|
|
860
882
|
}, null, 8, ["modelValue", "onUpdate:modelValue"])
|
|
861
|
-
],
|
|
862
|
-
e.hasDetailRow && e.expandableRows ? (s(), d("td",
|
|
863
|
-
|
|
883
|
+
], 44, oa)) : m("", !0),
|
|
884
|
+
e.hasDetailRow && e.expandableRows ? (s(), d("td", {
|
|
885
|
+
key: 1,
|
|
886
|
+
class: "dsg-table-component__cell dsg-table-component__cell--expand",
|
|
887
|
+
style: N({ width: e.expandableColumnWidth })
|
|
888
|
+
}, [
|
|
889
|
+
C("button", {
|
|
864
890
|
type: "button",
|
|
865
|
-
class: L(["dsg-table-component__expand-toggle", { "dsg-table-component__expand-toggle--expanded":
|
|
866
|
-
"aria-expanded":
|
|
891
|
+
class: L(["dsg-table-component__expand-toggle", { "dsg-table-component__expand-toggle--expanded": X(n) }]),
|
|
892
|
+
"aria-expanded": X(n),
|
|
867
893
|
"aria-label": "Toggle row details",
|
|
868
|
-
onClick:
|
|
894
|
+
onClick: ft((c) => ue(n, v), ["stop"])
|
|
869
895
|
}, [
|
|
870
|
-
|
|
896
|
+
V(O, {
|
|
871
897
|
icon: "chevron-right",
|
|
872
898
|
size: "sm",
|
|
873
899
|
class: "dsg-table-component__expand-icon"
|
|
874
900
|
})
|
|
875
|
-
], 10,
|
|
876
|
-
])) :
|
|
877
|
-
(s(!0), d(
|
|
901
|
+
], 10, ia)
|
|
902
|
+
], 4)) : m("", !0),
|
|
903
|
+
(s(!0), d(q, null, Y(f.value, (c, x) => (s(), d(q, { key: x }, [
|
|
878
904
|
c.visible ? (s(), d("td", {
|
|
879
905
|
key: 0,
|
|
880
906
|
class: L(["dsg-table-component__cell", c.dataClass]),
|
|
881
|
-
style:
|
|
882
|
-
onClick: (
|
|
883
|
-
onDblclick: (
|
|
884
|
-
onContextmenu: (
|
|
907
|
+
style: N({ width: c.width || void 0 }),
|
|
908
|
+
onClick: (Q) => nt(),
|
|
909
|
+
onDblclick: (Q) => st(),
|
|
910
|
+
onContextmenu: (Q) => ot()
|
|
885
911
|
}, [
|
|
886
|
-
|
|
912
|
+
E(t.$slots, we(c), {
|
|
887
913
|
rowData: n,
|
|
888
914
|
rowIndex: v,
|
|
889
915
|
rowField: c
|
|
890
916
|
}, () => [
|
|
891
|
-
|
|
892
|
-
innerHTML:
|
|
893
|
-
}, null, 8,
|
|
917
|
+
C("span", {
|
|
918
|
+
innerHTML: me(c, n)
|
|
919
|
+
}, null, 8, ra)
|
|
894
920
|
])
|
|
895
|
-
], 46,
|
|
921
|
+
], 46, da)) : m("", !0)
|
|
896
922
|
], 64))), 128))
|
|
897
923
|
], 42, sa),
|
|
898
|
-
e.hasDetailRow && (!e.expandableRows ||
|
|
924
|
+
e.hasDetailRow && (!e.expandableRows || X(n)) ? (s(), K(ht, {
|
|
899
925
|
key: 0,
|
|
900
926
|
name: e.detailRowTransition
|
|
901
927
|
}, {
|
|
902
928
|
default: ne(() => [
|
|
903
|
-
|
|
904
|
-
class: L(["dsg-table-component__detail", { "dsg-table-component__detail--expanded": e.expandableRows &&
|
|
905
|
-
onClick: (c) =>
|
|
929
|
+
C("tr", {
|
|
930
|
+
class: L(["dsg-table-component__detail", { "dsg-table-component__detail--expanded": e.expandableRows && X(n) }]),
|
|
931
|
+
onClick: (c) => it()
|
|
906
932
|
}, [
|
|
907
|
-
|
|
908
|
-
|
|
933
|
+
C("td", { colspan: ee.value }, [
|
|
934
|
+
E(t.$slots, "dsg-table-detail-row", {
|
|
909
935
|
rowData: n,
|
|
910
936
|
rowIndex: v,
|
|
911
937
|
options: e.detailRowOptions,
|
|
912
|
-
isExpanded: e.expandableRows ?
|
|
938
|
+
isExpanded: e.expandableRows ? X(n) : !0
|
|
913
939
|
})
|
|
914
|
-
], 8,
|
|
915
|
-
], 10,
|
|
940
|
+
], 8, ca)
|
|
941
|
+
], 10, ua)
|
|
916
942
|
]),
|
|
917
943
|
_: 2
|
|
918
|
-
}, 1032, ["name"])) :
|
|
944
|
+
}, 1032, ["name"])) : m("", !0)
|
|
919
945
|
], 64))), 128)),
|
|
920
|
-
!R.value && !g.value?.length && e.noDataTemplate.length ? (s(), d("tr",
|
|
921
|
-
|
|
922
|
-
colspan:
|
|
946
|
+
!R.value && !g.value?.length && e.noDataTemplate.length ? (s(), d("tr", ga, [
|
|
947
|
+
C("td", {
|
|
948
|
+
colspan: ee.value,
|
|
923
949
|
class: "dsg-table-component__empty-result"
|
|
924
950
|
}, [
|
|
925
|
-
|
|
926
|
-
|
|
951
|
+
E(t.$slots, "dsg-table-empty-result", {}, () => [
|
|
952
|
+
mt(ve(e.noDataTemplate), 1)
|
|
927
953
|
])
|
|
928
|
-
], 8,
|
|
929
|
-
])) :
|
|
954
|
+
], 8, va)
|
|
955
|
+
])) : m("", !0)
|
|
930
956
|
], 2),
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
fields:
|
|
957
|
+
C("tfoot", ba, [
|
|
958
|
+
E(t.$slots, "dsg-table-footer", {
|
|
959
|
+
fields: f.value,
|
|
934
960
|
data: g.value
|
|
935
961
|
})
|
|
936
962
|
])
|
|
@@ -938,18 +964,18 @@ You can explicitly suppress this warning by setting pagination-path="".`
|
|
|
938
964
|
], 6)
|
|
939
965
|
], 6));
|
|
940
966
|
}
|
|
941
|
-
}),
|
|
967
|
+
}), ha = { class: "dsg-table" }, ma = {
|
|
942
968
|
key: 0,
|
|
943
969
|
class: "dsg-table__pre-header"
|
|
944
|
-
},
|
|
970
|
+
}, wa = { class: "dsg-table--pre-header-left" }, ya = ["textContent"], ka = { class: "dsg-table__pre-header-right" }, pa = {
|
|
945
971
|
key: 1,
|
|
946
972
|
class: "dsg-table__search-header",
|
|
947
973
|
ref: "dsgTableSearchHeaderEl"
|
|
948
|
-
},
|
|
974
|
+
}, Pa = { class: "dsg-table__search-top" }, Ca = {
|
|
949
975
|
key: 2,
|
|
950
976
|
class: "dsg-table__footer",
|
|
951
977
|
ref: "dsgTableFooterEl"
|
|
952
|
-
},
|
|
978
|
+
}, Sa = { class: "dsg-table__footer-left" }, xa = { class: "dsg-table__footer-center" }, Da = { class: "dsg-table__footer-right" }, $a = /* @__PURE__ */ Z({
|
|
953
979
|
__name: "DsgTable",
|
|
954
980
|
props: {
|
|
955
981
|
getUrl: {},
|
|
@@ -959,6 +985,8 @@ You can explicitly suppress this warning by setting pagination-path="".`
|
|
|
959
985
|
displayPaginationInfo: { type: Boolean, default: !0 },
|
|
960
986
|
reloadOnChangeTimer: { type: Boolean, default: !1 },
|
|
961
987
|
selectable: { type: Boolean, default: !1 },
|
|
988
|
+
selectableColumnWidth: { default: "4rem" },
|
|
989
|
+
expandableColumnWidth: { default: "3rem" },
|
|
962
990
|
shiftSelectHighlight: { default: () => {
|
|
963
991
|
} },
|
|
964
992
|
selectedRowHighlight: { default: () => {
|
|
@@ -996,120 +1024,124 @@ You can explicitly suppress this warning by setting pagination-path="".`
|
|
|
996
1024
|
detailRowOptions: { default: () => ({}) }
|
|
997
1025
|
},
|
|
998
1026
|
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:row-clicked", "dsg-table:row-hover", "dsg-table:row-dblclick", "dsg-table:filter-updated", "dsg-table:save-as-default", "dsg-table:term-changed", "dsg-table:data-loaded", "dsg-table:row-expanded", "dsg-table:row-collapsed"],
|
|
999
|
-
setup(e, { expose:
|
|
1027
|
+
setup(e, { expose: B, emit: h }) {
|
|
1000
1028
|
const u = (o) => {
|
|
1001
1029
|
R.value = o;
|
|
1002
|
-
}, S = P(e.apiMode && !!(e.filterEntity || e.filterEndpoint || e.getUrl)),
|
|
1030
|
+
}, S = P(e.apiMode && !!(e.filterEntity || e.filterEndpoint || e.getUrl)), H = () => {
|
|
1003
1031
|
if (S.value) {
|
|
1004
1032
|
let o = {};
|
|
1005
|
-
return
|
|
1006
|
-
const r =
|
|
1033
|
+
return Oe().forEach((i) => {
|
|
1034
|
+
const r = xt(i.key);
|
|
1007
1035
|
if (!r)
|
|
1008
1036
|
return;
|
|
1009
|
-
const
|
|
1010
|
-
o[`filter[${r}]`] =
|
|
1037
|
+
const b = o[`filter[${r}]`], y = i.value.join(",");
|
|
1038
|
+
o[`filter[${r}]`] = b ? `${b},${y}` : y;
|
|
1011
1039
|
}), o;
|
|
1012
1040
|
} else
|
|
1013
1041
|
return {};
|
|
1014
|
-
},
|
|
1042
|
+
}, f = W(() => ({
|
|
1015
1043
|
...e.css,
|
|
1016
1044
|
tableWrapper: "border-b " + (e.css?.tableWrapper || "")
|
|
1017
|
-
})), g =
|
|
1045
|
+
})), g = wt(), A = P(!0), $ = P(null), D = P("<p>Showing {from} to {to} of {total}</p>"), w = P(null), a = We("dsgTable"), T = P({ perPage: e.perPage, change: u }), R = P(e.perPage), k = P({ ...H(), ...e.initialFilters }), p = h, I = (o) => {
|
|
1018
1046
|
a.value?.changePage(o);
|
|
1019
1047
|
}, se = (o) => {
|
|
1020
1048
|
w.value = o;
|
|
1021
1049
|
}, re = ({ data: o }) => {
|
|
1022
|
-
|
|
1023
|
-
},
|
|
1050
|
+
$.value = o, p("dsg-table:data-loaded", o);
|
|
1051
|
+
}, M = () => {
|
|
1024
1052
|
a.value?.reload();
|
|
1025
|
-
},
|
|
1053
|
+
}, oe = (o) => {
|
|
1026
1054
|
a.value?.setLoading(o);
|
|
1027
|
-
},
|
|
1055
|
+
}, z = (o) => {
|
|
1028
1056
|
const i = a.value?.getData?.() ?? [];
|
|
1029
1057
|
a.value?.setData(i.map((r) => r.id === o.id ? o : r));
|
|
1030
|
-
},
|
|
1058
|
+
}, U = (o) => {
|
|
1031
1059
|
const i = a.value?.getData?.() ?? [];
|
|
1032
1060
|
a.value?.setData([...i, o]);
|
|
1033
1061
|
}, j = (o) => {
|
|
1034
1062
|
const i = a.value?.getData?.() ?? [];
|
|
1035
1063
|
a.value?.setData(i.filter((r) => r.id !== o.id));
|
|
1036
|
-
},
|
|
1064
|
+
}, J = (o) => {
|
|
1037
1065
|
a.value?.setData(o);
|
|
1038
|
-
},
|
|
1066
|
+
}, _ = () => a.value?.getData() ?? [], ee = (o) => {
|
|
1039
1067
|
const i = a.value?.getData() ?? [], r = o(i);
|
|
1040
1068
|
r && a.value?.setData(r);
|
|
1041
|
-
},
|
|
1069
|
+
}, fe = (o) => {
|
|
1042
1070
|
a.value?.expandRow(o);
|
|
1043
1071
|
}, he = (o) => {
|
|
1044
1072
|
a.value?.collapseRow(o);
|
|
1045
|
-
},
|
|
1073
|
+
}, F = (o, i) => {
|
|
1046
1074
|
a.value?.toggleRowExpand(o, i);
|
|
1047
|
-
}, we = () => {
|
|
1048
|
-
a.value?.expandAllRows();
|
|
1049
1075
|
}, me = () => {
|
|
1076
|
+
a.value?.expandAllRows();
|
|
1077
|
+
}, we = () => {
|
|
1050
1078
|
a.value?.collapseAllRows();
|
|
1051
|
-
}, ye = () => a.value?.getExpandedRows() ?? /* @__PURE__ */ new Set(),
|
|
1079
|
+
}, ye = () => a.value?.getExpandedRows() ?? /* @__PURE__ */ new Set(), X = () => a.value?.getSelection() ?? [], ue = () => {
|
|
1080
|
+
a.value?.clearSelection();
|
|
1081
|
+
}, ke = (o) => {
|
|
1052
1082
|
k.value = o;
|
|
1053
|
-
},
|
|
1083
|
+
}, pe = () => k.value ?? {}, ce = (o) => {
|
|
1054
1084
|
const i = { ...k.value };
|
|
1055
|
-
!o || o.trim() === "" ? delete i["filter[term]"] : i["filter[term]"] = o, k.value = i,
|
|
1056
|
-
|
|
1085
|
+
!o || o.trim() === "" ? delete i["filter[term]"] : i["filter[term]"] = o, k.value = i, He(() => {
|
|
1086
|
+
M();
|
|
1057
1087
|
}), p("dsg-table:term-changed", o);
|
|
1058
|
-
},
|
|
1059
|
-
let
|
|
1060
|
-
k.value["filter[term]"] && (
|
|
1061
|
-
o[
|
|
1062
|
-
}), k.value =
|
|
1063
|
-
|
|
1088
|
+
}, Pe = (o, i, r) => {
|
|
1089
|
+
let b = {};
|
|
1090
|
+
k.value["filter[term]"] && (b["filter[term]"] = k.value["filter[term]"]), Object.keys(o).forEach((y) => {
|
|
1091
|
+
o[y] !== null && o[y] !== void 0 && o[y] !== "" && (b[y] = o[y]);
|
|
1092
|
+
}), k.value = b, He(() => {
|
|
1093
|
+
M();
|
|
1064
1094
|
}), p("dsg-table:filter-updated", k.value, i, r);
|
|
1065
1095
|
};
|
|
1066
|
-
return
|
|
1067
|
-
reloadTable:
|
|
1068
|
-
updateRowTable:
|
|
1069
|
-
addRowTable:
|
|
1096
|
+
return B({
|
|
1097
|
+
reloadTable: M,
|
|
1098
|
+
updateRowTable: z,
|
|
1099
|
+
addRowTable: U,
|
|
1070
1100
|
deleteRowTable: j,
|
|
1071
|
-
setData:
|
|
1072
|
-
getData:
|
|
1073
|
-
mutateData:
|
|
1101
|
+
setData: J,
|
|
1102
|
+
getData: _,
|
|
1103
|
+
mutateData: ee,
|
|
1074
1104
|
termChanged: ce,
|
|
1075
|
-
setFilters:
|
|
1076
|
-
getFilters:
|
|
1077
|
-
setLoading:
|
|
1078
|
-
expandRow:
|
|
1105
|
+
setFilters: ke,
|
|
1106
|
+
getFilters: pe,
|
|
1107
|
+
setLoading: oe,
|
|
1108
|
+
expandRow: fe,
|
|
1079
1109
|
collapseRow: he,
|
|
1080
|
-
toggleRowExpand:
|
|
1081
|
-
expandAllRows:
|
|
1082
|
-
collapseAllRows:
|
|
1110
|
+
toggleRowExpand: F,
|
|
1111
|
+
expandAllRows: me,
|
|
1112
|
+
collapseAllRows: we,
|
|
1083
1113
|
getExpandedRows: ye,
|
|
1114
|
+
getSelection: X,
|
|
1115
|
+
clearSelection: ue,
|
|
1084
1116
|
changePage: I
|
|
1085
|
-
}), (o, i) => (s(), d("div",
|
|
1117
|
+
}), (o, i) => (s(), d("div", ha, [
|
|
1086
1118
|
e.hasHeader ? (s(), d("div", ma, [
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
data:
|
|
1119
|
+
E(o.$slots, "dsg-table--pre-header", {}, () => [
|
|
1120
|
+
C("div", wa, [
|
|
1121
|
+
E(o.$slots, "dsg-table--page-title", {
|
|
1122
|
+
data: $.value,
|
|
1091
1123
|
title: e.title
|
|
1092
1124
|
}, () => [
|
|
1093
1125
|
e.title.length > 0 ? (s(), d("h1", {
|
|
1094
1126
|
key: 0,
|
|
1095
1127
|
class: "dsg-table__title",
|
|
1096
1128
|
textContent: ve(e.title)
|
|
1097
|
-
}, null, 8,
|
|
1129
|
+
}, null, 8, ya)) : m("", !0)
|
|
1098
1130
|
])
|
|
1099
1131
|
]),
|
|
1100
|
-
|
|
1101
|
-
|
|
1132
|
+
C("div", ka, [
|
|
1133
|
+
E(o.$slots, "dsg-table--page-actions", { data: $.value })
|
|
1102
1134
|
])
|
|
1103
1135
|
])
|
|
1104
|
-
])) :
|
|
1105
|
-
e.displaySearch ? (s(), d("div",
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1136
|
+
])) : m("", !0),
|
|
1137
|
+
e.displaySearch ? (s(), d("div", pa, [
|
|
1138
|
+
C("div", Pa, [
|
|
1139
|
+
E(o.$slots, "dsg-table--search-header", { data: $.value }, () => [
|
|
1140
|
+
V(Ye, {
|
|
1109
1141
|
name: "term",
|
|
1110
1142
|
"onDsgTable:termChanged": i[0] || (i[0] = (r) => ce(r))
|
|
1111
1143
|
}),
|
|
1112
|
-
|
|
1144
|
+
V(Ne, {
|
|
1113
1145
|
entity: e.filterEntity,
|
|
1114
1146
|
"filter-endpoint": e.filterEndpoint,
|
|
1115
1147
|
"search-endpoint": e.filterSearchEndpoint,
|
|
@@ -1119,15 +1151,15 @@ You can explicitly suppress this warning by setting pagination-path="".`
|
|
|
1119
1151
|
"save-as-default-label": e.saveAsDefaultLabel,
|
|
1120
1152
|
"show-clear-all": e.showClearAll,
|
|
1121
1153
|
"clear-all-label": e.clearAllLabel,
|
|
1122
|
-
"onDsgTable:filterUpdated": i[1] || (i[1] = (r,
|
|
1123
|
-
"onDsgTable:saveAsDefault": i[2] || (i[2] = (r,
|
|
1154
|
+
"onDsgTable:filterUpdated": i[1] || (i[1] = (r, b, y) => Pe(r, b, y)),
|
|
1155
|
+
"onDsgTable:saveAsDefault": i[2] || (i[2] = (r, b, y) => p("dsg-table:save-as-default", r, b, y))
|
|
1124
1156
|
}, null, 8, ["entity", "filter-endpoint", "search-endpoint", "auto-sort", "filters", "show-save-as-default", "save-as-default-label", "show-clear-all", "clear-all-label"]),
|
|
1125
|
-
|
|
1157
|
+
E(o.$slots, "dsg-table--search-actions", { data: $.value })
|
|
1126
1158
|
])
|
|
1127
1159
|
]),
|
|
1128
|
-
|
|
1129
|
-
], 512)) :
|
|
1130
|
-
|
|
1160
|
+
E(o.$slots, "dsg-table--search-navigation")
|
|
1161
|
+
], 512)) : m("", !0),
|
|
1162
|
+
V(fa, {
|
|
1131
1163
|
ref: "dsgTable",
|
|
1132
1164
|
"api-url": e.getUrl,
|
|
1133
1165
|
"filter-params": k.value,
|
|
@@ -1138,11 +1170,13 @@ You can explicitly suppress this warning by setting pagination-path="".`
|
|
|
1138
1170
|
"load-on-start": e.loadOnStart,
|
|
1139
1171
|
"pagination-path": e.paginationPath,
|
|
1140
1172
|
selectable: e.selectable,
|
|
1173
|
+
"selectable-column-width": e.selectableColumnWidth,
|
|
1174
|
+
"expandable-column-width": e.expandableColumnWidth,
|
|
1141
1175
|
"shift-select-highlight": e.shiftSelectHighlight,
|
|
1142
1176
|
"selected-row-highlight": e.selectedRowHighlight,
|
|
1143
1177
|
"track-by": e.trackBy,
|
|
1144
1178
|
"table-layout": e.tableLayout,
|
|
1145
|
-
css:
|
|
1179
|
+
css: f.value,
|
|
1146
1180
|
data: e.data,
|
|
1147
1181
|
"row-class": e.rowClass,
|
|
1148
1182
|
"api-mode": S.value,
|
|
@@ -1154,91 +1188,91 @@ You can explicitly suppress this warning by setting pagination-path="".`
|
|
|
1154
1188
|
"show-expand-detail": e.showExpandDetail,
|
|
1155
1189
|
"detail-row-transition": e.detailRowTransition,
|
|
1156
1190
|
"detail-row-options": e.detailRowOptions,
|
|
1157
|
-
"onDsgTable:loading": i[10] || (i[10] = (r) =>
|
|
1158
|
-
"onDsgTable:loaded": i[11] || (i[11] = (r) =>
|
|
1191
|
+
"onDsgTable:loading": i[10] || (i[10] = (r) => A.value = !0),
|
|
1192
|
+
"onDsgTable:loaded": i[11] || (i[11] = (r) => A.value = !1),
|
|
1159
1193
|
"onDsgTable:paginationData": se,
|
|
1160
1194
|
"onDsgTable:loadSuccess": re,
|
|
1161
1195
|
"onDsgTable:rowsSelected": i[12] || (i[12] = (r) => p("dsg-table:rows-selected", r)),
|
|
1162
|
-
"onDsgTable:rowClicked": i[13] || (i[13] = (r,
|
|
1163
|
-
"onDsgTable:rowHover": i[14] || (i[14] = (r,
|
|
1164
|
-
"onDsgTable:rowDblclick": i[15] || (i[15] = (r,
|
|
1165
|
-
"onDsgTable:rowExpanded": i[16] || (i[16] = (r,
|
|
1166
|
-
"onDsgTable:rowCollapsed": i[17] || (i[17] = (r,
|
|
1167
|
-
},
|
|
1196
|
+
"onDsgTable:rowClicked": i[13] || (i[13] = (r, b, y) => p("dsg-table:row-clicked", r, b, y)),
|
|
1197
|
+
"onDsgTable:rowHover": i[14] || (i[14] = (r, b, y) => p("dsg-table:row-hover", r, b, y)),
|
|
1198
|
+
"onDsgTable:rowDblclick": i[15] || (i[15] = (r, b, y) => p("dsg-table:row-dblclick", r, b, y)),
|
|
1199
|
+
"onDsgTable:rowExpanded": i[16] || (i[16] = (r, b) => p("dsg-table:row-expanded", r, b)),
|
|
1200
|
+
"onDsgTable:rowCollapsed": i[17] || (i[17] = (r, b) => p("dsg-table:row-collapsed", r, b))
|
|
1201
|
+
}, yt({
|
|
1168
1202
|
"dsg-field--actions": ne((r) => [
|
|
1169
|
-
|
|
1170
|
-
(s(),
|
|
1203
|
+
E(o.$slots, "dsg-table-actions", { data: r }, () => [
|
|
1204
|
+
(s(), K(Qe, {
|
|
1171
1205
|
key: r.rowData?.[e.trackBy] ?? r.rowIndex,
|
|
1172
1206
|
data: r,
|
|
1173
|
-
"onDsgTable:actionEdit": i[3] || (i[3] = (
|
|
1174
|
-
"onDsgTable:actionView": i[4] || (i[4] = (
|
|
1175
|
-
"onDsgTable:actionDelete": i[5] || (i[5] = (
|
|
1176
|
-
"onDsgTable:actionArchive": i[6] || (i[6] = (
|
|
1177
|
-
"onDsgTable:linkClicked": i[7] || (i[7] = (
|
|
1207
|
+
"onDsgTable:actionEdit": i[3] || (i[3] = (b, y) => p("dsg-table:action-edit", b, y)),
|
|
1208
|
+
"onDsgTable:actionView": i[4] || (i[4] = (b, y) => p("dsg-table:action-view", b, y)),
|
|
1209
|
+
"onDsgTable:actionDelete": i[5] || (i[5] = (b, y) => p("dsg-table:action-delete", b, y)),
|
|
1210
|
+
"onDsgTable:actionArchive": i[6] || (i[6] = (b, y) => p("dsg-table:action-archive", b, y)),
|
|
1211
|
+
"onDsgTable:linkClicked": i[7] || (i[7] = (b, y, Ce) => p("dsg-table:link-clicked", b, y, Ce))
|
|
1178
1212
|
}, null, 8, ["data"]))
|
|
1179
1213
|
])
|
|
1180
1214
|
]),
|
|
1181
1215
|
_: 2
|
|
1182
1216
|
}, [
|
|
1183
|
-
|
|
1184
|
-
name:
|
|
1185
|
-
fn: ne((
|
|
1186
|
-
String(
|
|
1217
|
+
Y(G(g), (r, b) => ({
|
|
1218
|
+
name: b,
|
|
1219
|
+
fn: ne((y) => [
|
|
1220
|
+
String(b) !== "dsg-field--actions" ? E(o.$slots, b, kt(be({ key: 0 }, y))) : m("", !0)
|
|
1187
1221
|
])
|
|
1188
1222
|
}))
|
|
1189
|
-
]), 1032, ["api-url", "filter-params", "per-page", "fields", "load-on-start", "pagination-path", "selectable", "shift-select-highlight", "selected-row-highlight", "track-by", "table-layout", "css", "data", "row-class", "api-mode", "replace-state", "replace-strategy", "has-detail-row", "expandable-rows", "expand-multiple", "show-expand-detail", "detail-row-transition", "detail-row-options"]),
|
|
1190
|
-
e.hasFooter ? (s(), d("div",
|
|
1191
|
-
|
|
1192
|
-
|
|
1223
|
+
]), 1032, ["api-url", "filter-params", "per-page", "fields", "load-on-start", "pagination-path", "selectable", "selectable-column-width", "expandable-column-width", "shift-select-highlight", "selected-row-highlight", "track-by", "table-layout", "css", "data", "row-class", "api-mode", "replace-state", "replace-strategy", "has-detail-row", "expandable-rows", "expand-multiple", "show-expand-detail", "detail-row-transition", "detail-row-options"]),
|
|
1224
|
+
e.hasFooter ? (s(), d("div", Ca, [
|
|
1225
|
+
C("div", Sa, [
|
|
1226
|
+
E(o.$slots, "dsg-table--footer-left", {
|
|
1193
1227
|
data: w.value,
|
|
1194
1228
|
perPage: T.value
|
|
1195
1229
|
}, () => [
|
|
1196
|
-
e.displayPaginationInfo ? (s(),
|
|
1230
|
+
e.displayPaginationInfo ? (s(), K(je, {
|
|
1197
1231
|
key: 0,
|
|
1198
1232
|
ref: "paginationInfoStart",
|
|
1199
1233
|
pagination: w.value,
|
|
1200
1234
|
"onUpdate:pagination": i[18] || (i[18] = (r) => w.value = r),
|
|
1201
|
-
"info-template":
|
|
1202
|
-
}, null, 8, ["pagination", "info-template"])) :
|
|
1203
|
-
|
|
1235
|
+
"info-template": D.value
|
|
1236
|
+
}, null, 8, ["pagination", "info-template"])) : m("", !0),
|
|
1237
|
+
E(o.$slots, "dsg-table--footer-left-extras", {
|
|
1204
1238
|
data: w.value,
|
|
1205
1239
|
perPage: T.value
|
|
1206
1240
|
})
|
|
1207
1241
|
])
|
|
1208
1242
|
]),
|
|
1209
|
-
|
|
1210
|
-
|
|
1243
|
+
C("div", xa, [
|
|
1244
|
+
E(o.$slots, "dsg-table--footer-center", {
|
|
1211
1245
|
data: w.value,
|
|
1212
1246
|
perPage: T.value
|
|
1213
1247
|
}, () => [
|
|
1214
|
-
|
|
1248
|
+
E(o.$slots, "dsg-table--footer-center-extras", {
|
|
1215
1249
|
data: w.value,
|
|
1216
1250
|
perPage: T.value
|
|
1217
1251
|
})
|
|
1218
1252
|
])
|
|
1219
1253
|
]),
|
|
1220
|
-
|
|
1221
|
-
|
|
1254
|
+
C("div", Da, [
|
|
1255
|
+
E(o.$slots, "dsg-table--footer-right", {
|
|
1222
1256
|
data: w.value,
|
|
1223
1257
|
perPage: T.value
|
|
1224
1258
|
}, () => [
|
|
1225
|
-
|
|
1259
|
+
A.value === !1 && e.displayPaginationInfo ? (s(), K(Ke, be({
|
|
1226
1260
|
key: 0,
|
|
1227
1261
|
ref: "pagination",
|
|
1228
1262
|
pagination: w.value,
|
|
1229
1263
|
"onUpdate:pagination": i[19] || (i[19] = (r) => w.value = r),
|
|
1230
1264
|
"onDsgTable:changePage": I
|
|
1231
|
-
}, e.pagination), null, 16, ["pagination"])) :
|
|
1232
|
-
|
|
1265
|
+
}, e.pagination), null, 16, ["pagination"])) : m("", !0),
|
|
1266
|
+
E(o.$slots, "dsg-table--footer-right-extras", {
|
|
1233
1267
|
data: w.value,
|
|
1234
1268
|
perPage: T.value
|
|
1235
1269
|
})
|
|
1236
1270
|
])
|
|
1237
1271
|
])
|
|
1238
|
-
], 512)) :
|
|
1272
|
+
], 512)) : m("", !0)
|
|
1239
1273
|
]));
|
|
1240
1274
|
}
|
|
1241
|
-
}),
|
|
1275
|
+
}), Ta = { class: "dsg-table-per-page" }, Ra = /* @__PURE__ */ Z({
|
|
1242
1276
|
__name: "DsgTablePerPage",
|
|
1243
1277
|
props: {
|
|
1244
1278
|
perPageOptions: { default: () => [
|
|
@@ -1251,12 +1285,12 @@ You can explicitly suppress this warning by setting pagination-path="".`
|
|
|
1251
1285
|
perPage: {}
|
|
1252
1286
|
},
|
|
1253
1287
|
setup(e) {
|
|
1254
|
-
const
|
|
1288
|
+
const B = (u) => e.perPageOptions.find((S) => S.label === u), h = (u) => {
|
|
1255
1289
|
e.perPage.perPage = u.label, e.perPage.change(u.label);
|
|
1256
1290
|
};
|
|
1257
|
-
return (u, S) => (s(), d("div",
|
|
1258
|
-
|
|
1259
|
-
modelValue:
|
|
1291
|
+
return (u, S) => (s(), d("div", Ta, [
|
|
1292
|
+
V(Dt, {
|
|
1293
|
+
modelValue: B(e.perPage.perPage),
|
|
1260
1294
|
"onUpdate:modelValue": h,
|
|
1261
1295
|
options: e.perPageOptions,
|
|
1262
1296
|
size: "sm",
|
|
@@ -1264,24 +1298,24 @@ You can explicitly suppress this warning by setting pagination-path="".`
|
|
|
1264
1298
|
}, null, 8, ["modelValue", "options"])
|
|
1265
1299
|
]));
|
|
1266
1300
|
}
|
|
1267
|
-
}),
|
|
1268
|
-
DsgTable:
|
|
1301
|
+
}), Ma = $a, Ea = Qe, Ba = Ra, La = Ne, Fa = Ke, Ha = je, Aa = Ye, Ua = Ge, Na = {
|
|
1302
|
+
DsgTable: Ma,
|
|
1269
1303
|
DsgTableActions: Ea,
|
|
1270
|
-
DsgTablePerPage:
|
|
1271
|
-
DsgTableFilter:
|
|
1272
|
-
DsgTablePagination:
|
|
1273
|
-
DsgTablePaginationInfo:
|
|
1274
|
-
DsgTableSearch:
|
|
1275
|
-
DsgTableRowHeader:
|
|
1304
|
+
DsgTablePerPage: Ba,
|
|
1305
|
+
DsgTableFilter: La,
|
|
1306
|
+
DsgTablePagination: Fa,
|
|
1307
|
+
DsgTablePaginationInfo: Ha,
|
|
1308
|
+
DsgTableSearch: Aa,
|
|
1309
|
+
DsgTableRowHeader: Ua
|
|
1276
1310
|
};
|
|
1277
1311
|
export {
|
|
1278
|
-
|
|
1312
|
+
Ma as DsgTable,
|
|
1279
1313
|
Ea as DsgTableActions,
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1314
|
+
La as DsgTableFilter,
|
|
1315
|
+
Fa as DsgTablePagination,
|
|
1316
|
+
Ha as DsgTablePaginationInfo,
|
|
1317
|
+
Ba as DsgTablePerPage,
|
|
1318
|
+
Ua as DsgTableRowHeader,
|
|
1319
|
+
Aa as DsgTableSearch,
|
|
1320
|
+
Na as default
|
|
1287
1321
|
};
|