@dcodegroup-au/dsg-vue 1.0.7-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/{DsgTablePerPage.vue_vue_type_style_index_0_lang-CcSyXBr6.js → DsgTablePerPage.vue_vue_type_style_index_0_lang-CaBn8JMp.js} +3195 -3163
- package/dist/{DsgTablePerPage.vue_vue_type_style_index_0_lang-DncMp8KQ.cjs → DsgTablePerPage.vue_vue_type_style_index_0_lang-DQk8doWV.cjs} +1200 -1200
- package/dist/components/Table/DsgTable.vue.d.ts +30 -2
- package/dist/components/Table/DsgTableComponent.vue.d.ts +6 -0
- package/dist/components/Table/DsgTableFilter.vue.d.ts +18 -0
- package/dist/components/Table/DsgTableRowHeader.vue.d.ts +2 -0
- package/dist/dsg-vue.cjs +1 -1
- package/dist/dsg-vue.css +1 -1
- package/dist/dsg-vue.esm.js +1 -1
- package/dist/dsg-vue.table.cjs +2 -2
- package/dist/dsg-vue.table.esm.js +561 -517
- package/dist/main.d.ts +10 -0
- package/dist/table.d.ts +46 -2
- package/dist/utilities/URL.d.ts +5 -0
- package/package.json +1 -6
|
@@ -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 $t = { class: "dsg-table-pagination" }, Tt = ["disabled"], Rt = ["disabled
|
|
|
18
18
|
paginationModifiers: {}
|
|
19
19
|
}),
|
|
20
20
|
emits: /* @__PURE__ */ le(["dsg-table:change-page"], ["update:pagination"]),
|
|
21
|
-
setup(e, { expose: B, emit:
|
|
22
|
-
const
|
|
23
|
-
|
|
24
|
-
}, T = (R) => R ===
|
|
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
|
+
w("dsg-table:change-page", R);
|
|
24
|
+
}, T = (R) => R === u.value?.current_page;
|
|
25
25
|
return B({
|
|
26
26
|
loadPage: a
|
|
27
|
-
}), (R,
|
|
27
|
+
}), (R, k) => Ie((s(), d("div", Mt, [
|
|
28
28
|
e.showFirstLast ? (s(), d("a", {
|
|
29
29
|
key: 0,
|
|
30
|
-
onClick:
|
|
31
|
-
class:
|
|
30
|
+
onClick: k[0] || (k[0] = (p) => a(e.firstPage)),
|
|
31
|
+
class: L(["dsg-table-pagination__link", { "dsg-table-pagination__link--disabled": f.value }]),
|
|
32
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
|
-
|
|
42
|
-
onClick:
|
|
43
|
-
class:
|
|
40
|
+
], 10, Et)) : m("", !0),
|
|
41
|
+
C("a", {
|
|
42
|
+
onClick: k[1] || (k[1] = (p) => a("prev")),
|
|
43
|
+
class: L(["dsg-table-pagination__link", { "dsg-table-pagination__link--disabled": f.value }]),
|
|
44
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
|
-
class:
|
|
57
|
-
innerHTML:
|
|
58
|
-
}, null, 10,
|
|
56
|
+
class: L(["dsg-table-pagination__link", { "dsg-table-pagination__link--active": T(I + e.firstPage) }]),
|
|
57
|
+
innerHTML: p
|
|
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:
|
|
62
|
-
innerHTML:
|
|
63
|
-
}, null, 10,
|
|
64
|
-
|
|
65
|
-
onClick:
|
|
66
|
-
class:
|
|
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
|
+
onClick: k[2] || (k[2] = (p) => a("next")),
|
|
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:
|
|
79
|
-
class:
|
|
78
|
+
onClick: k[3] || (k[3] = (p) => a(H.value)),
|
|
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 $t = { class: "dsg-table-pagination" }, Tt = ["disabled"], Rt = ["disabled
|
|
|
101
101
|
}),
|
|
102
102
|
emits: ["update:pagination"],
|
|
103
103
|
setup(e) {
|
|
104
|
-
const B = ae(e, "pagination"),
|
|
105
|
-
return (
|
|
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
|
+
return (u, S) => (s(), d("div", {
|
|
106
106
|
class: "dsg-table-pagination-info",
|
|
107
|
-
innerHTML:
|
|
108
|
-
}, null, 8,
|
|
107
|
+
innerHTML: h.value
|
|
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" },
|
|
@@ -122,10 +122,10 @@ const $t = { class: "dsg-table-pagination" }, Tt = ["disabled"], Rt = ["disabled
|
|
|
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
124
|
setup(e, { emit: B }) {
|
|
125
|
-
const
|
|
126
|
-
|
|
127
|
-
const
|
|
128
|
-
switch (
|
|
125
|
+
const h = P(!1);
|
|
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,95 +137,95 @@ const $t = { class: "dsg-table-pagination" }, Tt = ["disabled"], Rt = ["disabled
|
|
|
137
137
|
default:
|
|
138
138
|
return "dots-horizontal";
|
|
139
139
|
}
|
|
140
|
-
}, g = (
|
|
141
|
-
switch (
|
|
140
|
+
}, g = (D, w, a) => {
|
|
141
|
+
switch (w) {
|
|
142
142
|
case "edit":
|
|
143
|
-
$("dsg-table:action-edit", a,
|
|
143
|
+
$("dsg-table:action-edit", a, u.value);
|
|
144
144
|
break;
|
|
145
145
|
case "view":
|
|
146
|
-
$("dsg-table:action-view", a,
|
|
146
|
+
$("dsg-table:action-view", a, u.value);
|
|
147
147
|
break;
|
|
148
148
|
case "delete":
|
|
149
|
-
$("dsg-table:action-delete", a,
|
|
149
|
+
$("dsg-table:action-delete", a, u.value);
|
|
150
150
|
break;
|
|
151
151
|
case "archive":
|
|
152
|
-
$("dsg-table:action-archive", a,
|
|
152
|
+
$("dsg-table:action-archive", a, u.value);
|
|
153
153
|
break;
|
|
154
154
|
}
|
|
155
|
-
},
|
|
156
|
-
const a =
|
|
157
|
-
$("dsg-table:link-clicked",
|
|
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
158
|
}, $ = B;
|
|
159
|
-
return (
|
|
160
|
-
|
|
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,
|
|
164
164
|
strategy: "absolute",
|
|
165
|
-
shown:
|
|
165
|
+
shown: h.value,
|
|
166
166
|
class: "dsg-table-actions__popper",
|
|
167
|
-
onHide:
|
|
167
|
+
onHide: w[1] || (w[1] = (a) => h.value = !1),
|
|
168
168
|
ref: "floatingVueFilterDropdown"
|
|
169
169
|
}, {
|
|
170
170
|
popper: ne(() => [
|
|
171
|
-
|
|
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
|
-
|
|
180
|
-
class:
|
|
179
|
+
C("div", {
|
|
180
|
+
class: L(["dsg-table-actions__menu-item", `dsg-table-actions__menu-item--${String(T)}`])
|
|
181
181
|
}, [
|
|
182
|
-
|
|
182
|
+
V(O, {
|
|
183
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
|
-
|
|
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
|
-
quote:
|
|
200
|
-
"row-data":
|
|
201
|
-
}, null, 8, ["quote", "row-data"])) : a.hasOwnProperty("type") && a.type == "break" ? (s(), d("hr",
|
|
199
|
+
quote: u.value,
|
|
200
|
+
"row-data": u.value
|
|
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
|
-
class:
|
|
206
|
-
onClick: (T) =>
|
|
205
|
+
class: L(["dsg-table-actions__menu-item", a.class]),
|
|
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
212
|
}, null, 8, ["icon"])) : m("", !0),
|
|
213
|
-
|
|
214
|
-
], 10,
|
|
213
|
+
C("span", jt, ve(a.label), 1)
|
|
214
|
+
], 10, Kt))
|
|
215
215
|
], 64))), 128)) : m("", !0)
|
|
216
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
|
-
onClick:
|
|
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 $t = { class: "dsg-table-pagination" }, Tt = ["disabled"], Rt = ["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: {},
|
|
@@ -255,22 +255,22 @@ const $t = { class: "dsg-table-pagination" }, Tt = ["disabled"], Rt = ["disabled
|
|
|
255
255
|
},
|
|
256
256
|
emits: ["dsg-table:term-changed"],
|
|
257
257
|
setup(e, { emit: B }) {
|
|
258
|
-
const
|
|
259
|
-
|
|
258
|
+
const h = P("");
|
|
259
|
+
qe(() => {
|
|
260
260
|
const f = new URL(window.location.href).searchParams.get("term");
|
|
261
|
-
f && (
|
|
261
|
+
f && (h.value = f, u("dsg-table:term-changed", f));
|
|
262
262
|
});
|
|
263
|
-
const
|
|
264
|
-
if (
|
|
263
|
+
const u = B, S = St((H) => {
|
|
264
|
+
if (h.value = H, e.replaceState) {
|
|
265
265
|
const f = new URL(window.location.href);
|
|
266
|
-
|
|
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
|
-
|
|
272
|
-
modelValue:
|
|
273
|
-
"onUpdate:modelValue": f[0] || (f[0] = (g) =>
|
|
270
|
+
return (H, f) => (s(), d("div", Qt, [
|
|
271
|
+
V(Ct, {
|
|
272
|
+
modelValue: h.value,
|
|
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 $t = { class: "dsg-table-pagination" }, Tt = ["disabled"], Rt = ["disabled
|
|
|
283
283
|
size: "sm",
|
|
284
284
|
icon: "search-sm",
|
|
285
285
|
"icon-clickable": !0,
|
|
286
|
-
onIconClicked: f[1] || (f[1] = (g) =>
|
|
287
|
-
onEnterPressed: f[2] || (f[2] = (g) =>
|
|
288
|
-
onOnClear: f[3] || (f[3] = () =>
|
|
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
|
-
}, Qt = {
|
|
297
|
-
key: 1,
|
|
298
|
-
class: "dsg-table-row-header__row dsg-table-row-header__row--expand-detail",
|
|
299
|
-
scope: "col"
|
|
300
|
-
}, Yt = ["title", "id", "onClick"], Gt = {
|
|
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
|
-
},
|
|
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: {},
|
|
@@ -318,45 +312,55 @@ const $t = { class: "dsg-table-pagination" }, Tt = ["disabled"], Rt = ["disabled
|
|
|
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
314
|
setup(e, { emit: B }) {
|
|
321
|
-
const
|
|
322
|
-
|
|
323
|
-
}, g = B,
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
{ "dsg-table-row-header__row--sortable":
|
|
328
|
-
{ "dsg-table-row-header__row--sort-active":
|
|
329
|
-
], $ = (
|
|
330
|
-
|
|
331
|
-
name: String(
|
|
332
|
-
field: String(
|
|
333
|
-
direction:
|
|
334
|
-
}, g("dsg-table:sort-field",
|
|
315
|
+
const h = ae(e, "sortField"), u = ae(e, "selectedRows"), S = ae(e, "hasSelected"), H = P("17px"), f = (D) => {
|
|
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");
|
|
317
|
+
}, g = B, A = (D, w) => [
|
|
318
|
+
D,
|
|
319
|
+
D + "-" + Tt(String(w?.name)),
|
|
320
|
+
w.titleClass || "",
|
|
321
|
+
{ "dsg-table-row-header__row--sortable": w.sortable },
|
|
322
|
+
{ "dsg-table-row-header__row--sort-active": h.value?.name === w.name }
|
|
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
|
-
|
|
339
|
-
|
|
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, {
|
|
338
|
+
modelValue: S.value,
|
|
340
339
|
"onUpdate:modelValue": [
|
|
341
|
-
|
|
340
|
+
w[0] || (w[0] = (a) => S.value = a),
|
|
342
341
|
f
|
|
343
342
|
],
|
|
344
|
-
indeterminate:
|
|
343
|
+
indeterminate: u.value.length > 0 && u.value.length !== e.tableDataLength
|
|
345
344
|
}, null, 8, ["modelValue", "indeterminate"])
|
|
346
|
-
])) : m("", !0),
|
|
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:
|
|
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
359
|
onClick: (R) => $(a),
|
|
356
360
|
scope: "col"
|
|
357
361
|
}, [
|
|
358
|
-
a.sortable ? (s(), d("div",
|
|
359
|
-
a.tooltip ? (s(),
|
|
362
|
+
a.sortable ? (s(), d("div", Jt, [
|
|
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,8 +369,8 @@ const $t = { class: "dsg-table-pagination" }, Tt = ["disabled"], Rt = ["disabled
|
|
|
365
369
|
key: 0,
|
|
366
370
|
class: "dsg-table-row-header__title",
|
|
367
371
|
innerHTML: a.title
|
|
368
|
-
}, null, 8,
|
|
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",
|
|
@@ -378,36 +382,36 @@ const $t = { class: "dsg-table-pagination" }, Tt = ["disabled"], Rt = ["disabled
|
|
|
378
382
|
key: 1,
|
|
379
383
|
class: "dsg-table-row-header__title",
|
|
380
384
|
innerHTML: a.title
|
|
381
|
-
}, null, 8,
|
|
382
|
-
a.sortable &&
|
|
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
391
|
})) : m("", !0),
|
|
388
|
-
a.sortable &&
|
|
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
397
|
})) : m("", !0),
|
|
394
|
-
a.sortable &&
|
|
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
403
|
})) : m("", !0)
|
|
400
|
-
])) : (s(), d(
|
|
401
|
-
a.tooltip ? (s(),
|
|
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:
|
|
409
|
-
}, null, 8,
|
|
410
|
-
a.tooltip.icon ? (s(),
|
|
412
|
+
innerHTML: G(Ve)(String(a?.title))
|
|
413
|
+
}, null, 8, _t),
|
|
414
|
+
a.tooltip.icon ? (s(), K(O, {
|
|
411
415
|
key: 0,
|
|
412
416
|
icon: a.tooltip.icon,
|
|
413
417
|
class: "inline-flex",
|
|
@@ -418,25 +422,22 @@ const $t = { class: "dsg-table-pagination" }, Tt = ["disabled"], Rt = ["disabled
|
|
|
418
422
|
}, 1040)) : (s(), d("span", {
|
|
419
423
|
key: 1,
|
|
420
424
|
class: "dsg-table-row-header__title",
|
|
421
|
-
innerHTML:
|
|
422
|
-
}, null, 8,
|
|
425
|
+
innerHTML: G(Ve)(String(a?.title))
|
|
426
|
+
}, null, 8, ea))
|
|
423
427
|
], 64))
|
|
424
|
-
], 14,
|
|
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
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
|
-
},
|
|
437
|
-
key: 1,
|
|
438
|
-
class: "dsg-table-component__cell dsg-table-component__cell--expand"
|
|
439
|
-
}, ia = ["aria-expanded", "onClick"], da = ["onClick", "onDblclick", "onContextmenu"], ra = ["innerHTML"], ua = ["onClick"], ca = ["colspan"], ga = { key: 2 }, va = ["colspan"], fa = { class: "dsg-table-component__footer" }, ba = /* @__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 $t = { class: "dsg-table-pagination" }, Tt = ["disabled"], Rt = ["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,8 +506,8 @@ const $t = { class: "dsg-table-pagination" }, Tt = ["disabled"], Rt = ["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: B, emit:
|
|
507
|
-
const
|
|
509
|
+
setup(e, { expose: B, emit: h }) {
|
|
510
|
+
const u = (t) => t.map((l, n) => ({
|
|
508
511
|
field: l.field || "",
|
|
509
512
|
title: l.title || "",
|
|
510
513
|
name: l.name || "",
|
|
@@ -517,13 +520,13 @@ const $t = { class: "dsg-table-pagination" }, Tt = ["disabled"], Rt = ["disabled
|
|
|
517
520
|
formatter: l.formatter || null,
|
|
518
521
|
tooltip: l.tooltip ?? null,
|
|
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,62 +536,62 @@ const $t = { class: "dsg-table-pagination" }, Tt = ["disabled"], Rt = ["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
|
-
if (l.delete(e.queryParams.sort),
|
|
540
|
-
const v = (
|
|
542
|
+
if (l.delete(e.queryParams.sort), k.value) {
|
|
543
|
+
const v = (k.value.direction === "desc" ? "-" : "") + k.value.field;
|
|
541
544
|
l.set(e.queryParams.sort, v);
|
|
542
545
|
}
|
|
543
546
|
const n = `${t.pathname}${l.toString() ? "?" + l.toString() : ""}`;
|
|
544
547
|
window.history.pushState({}, "", n);
|
|
545
548
|
}
|
|
546
|
-
}, f =
|
|
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(() => {
|
|
547
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
|
-
f.value =
|
|
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
|
-
),
|
|
585
|
-
() =>
|
|
587
|
+
), ie(
|
|
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 $t = { class: "dsg-table-pagination" }, Tt = ["disabled"], Rt = ["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" ? $.value > e.firstPage && $.value-- : t === "next" ? $.value < (
|
|
668
|
-
},
|
|
669
|
-
[e.queryParams?.sort]:
|
|
670
|
-
[e.queryParams?.order]:
|
|
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 = () => ({
|
|
676
|
+
[e.queryParams?.sort]: k.value ? (k.value?.direction === "desc" ? "-" : "") + k.value?.field : void 0,
|
|
677
|
+
[e.queryParams?.order]: k.value?.direction,
|
|
671
678
|
[e.queryParams?.page]: $.value,
|
|
672
679
|
[e.queryParams?.perPage]: re.value
|
|
673
|
-
}),
|
|
674
|
-
|
|
675
|
-
},
|
|
676
|
-
|
|
680
|
+
}), xe = () => {
|
|
681
|
+
p.value && (p.value.abort(), p.value = null);
|
|
682
|
+
}, et = (t, l) => {
|
|
683
|
+
xe(), I.value++;
|
|
677
684
|
const n = I.value, v = new AbortController();
|
|
678
|
-
return l.signal = v.signal,
|
|
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
|
-
),
|
|
698
|
-
},
|
|
699
|
-
t._requestId && t._requestId !== I.value || t._apiUrl && t._apiUrl !== e.apiUrl || t._cancelled || (console.error("load-error", t),
|
|
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,209 +714,228 @@ 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
|
-
U("dsg-table:row-clicked", t, l, n);
|
|
722
|
-
}, et = (t, l, n) => {
|
|
723
|
-
U("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
760
|
return B({
|
|
754
|
-
changePage:
|
|
755
|
-
reload:
|
|
756
|
-
getData:
|
|
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:
|
|
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:
|
|
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
|
-
|
|
778
|
-
class:
|
|
786
|
+
C("table", {
|
|
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:
|
|
790
|
-
class:
|
|
808
|
+
style: N({ width: n.width || void 0 }),
|
|
809
|
+
class: L("dsg-table-component__col-" + n.name + " " + n.titleClass)
|
|
791
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
816
|
}, null, 4)) : m("", !0)
|
|
798
|
-
], 8,
|
|
799
|
-
|
|
800
|
-
class:
|
|
817
|
+
], 8, ta),
|
|
818
|
+
C("thead", {
|
|
819
|
+
class: L([[a.value.thead, { sticky: _.value, "top-0": _.value }], "dsg-table-component__head"])
|
|
801
820
|
}, [
|
|
802
|
-
|
|
803
|
-
|
|
821
|
+
E(t.$slots, "tableHeader", { fields: f.value }, () => [
|
|
822
|
+
V(Ge, {
|
|
804
823
|
fields: f.value,
|
|
805
824
|
"has-select-all": e.selectable,
|
|
806
|
-
"
|
|
807
|
-
"
|
|
808
|
-
"
|
|
809
|
-
"onUpdate:
|
|
810
|
-
"
|
|
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),
|
|
831
|
+
"scroll-visible": w.value,
|
|
811
832
|
"show-expand-detail": e.hasDetailRow && e.showExpandDetail,
|
|
812
833
|
"table-data-length": g.value?.length,
|
|
813
|
-
"sort-field":
|
|
814
|
-
"onUpdate:sortField": l[2] || (l[2] = (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"])
|
|
834
|
+
"sort-field": k.value,
|
|
835
|
+
"onUpdate:sortField": l[2] || (l[2] = (n) => k.value = n),
|
|
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
|
-
|
|
822
|
-
class:
|
|
842
|
+
C("tbody", {
|
|
843
|
+
class: L(["dsg-table-component__body", a.value.tbody])
|
|
823
844
|
}, [
|
|
824
|
-
R.value ? (s(), d("tr",
|
|
825
|
-
|
|
826
|
-
|
|
845
|
+
R.value ? (s(), d("tr", aa, [
|
|
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
|
-
], 8,
|
|
840
|
-
], 8,
|
|
841
|
-
])) : (s(!0), d(
|
|
860
|
+
], 8, na)
|
|
861
|
+
], 8, la)
|
|
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:
|
|
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:
|
|
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
901
|
], 10, ia)
|
|
876
|
-
])) : m("", !0),
|
|
877
|
-
(s(!0), d(
|
|
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
|
-
class:
|
|
881
|
-
style:
|
|
882
|
-
onClick: (
|
|
883
|
-
onDblclick: (
|
|
884
|
-
onContextmenu: (
|
|
906
|
+
class: L(["dsg-table-component__cell", c.dataClass]),
|
|
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:
|
|
917
|
+
C("span", {
|
|
918
|
+
innerHTML: me(c, n)
|
|
893
919
|
}, null, 8, ra)
|
|
894
920
|
])
|
|
895
921
|
], 46, da)) : m("", !0)
|
|
896
922
|
], 64))), 128))
|
|
897
|
-
], 42,
|
|
898
|
-
e.hasDetailRow && (!e.expandableRows ||
|
|
923
|
+
], 42, sa),
|
|
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:
|
|
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
940
|
], 8, ca)
|
|
915
941
|
], 10, ua)
|
|
@@ -918,18 +944,18 @@ You can explicitly suppress this warning by setting pagination-path="".`
|
|
|
918
944
|
}, 1032, ["name"])) : m("", !0)
|
|
919
945
|
], 64))), 128)),
|
|
920
946
|
!R.value && !g.value?.length && e.noDataTemplate.length ? (s(), d("tr", ga, [
|
|
921
|
-
|
|
922
|
-
colspan:
|
|
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
954
|
], 8, va)
|
|
929
955
|
])) : m("", !0)
|
|
930
956
|
], 2),
|
|
931
|
-
|
|
932
|
-
|
|
957
|
+
C("tfoot", ba, [
|
|
958
|
+
E(t.$slots, "dsg-table-footer", {
|
|
933
959
|
fields: f.value,
|
|
934
960
|
data: g.value
|
|
935
961
|
})
|
|
@@ -938,18 +964,18 @@ You can explicitly suppress this warning by setting pagination-path="".`
|
|
|
938
964
|
], 6)
|
|
939
965
|
], 6));
|
|
940
966
|
}
|
|
941
|
-
}), ha = { class: "dsg-table" },
|
|
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
|
-
}, Pa = { class: "dsg-table__search-top" },
|
|
974
|
+
}, Pa = { class: "dsg-table__search-top" }, Ca = {
|
|
949
975
|
key: 2,
|
|
950
976
|
class: "dsg-table__footer",
|
|
951
977
|
ref: "dsgTableFooterEl"
|
|
952
|
-
}, Sa = { class: "dsg-table__footer-left" },
|
|
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: () => {
|
|
@@ -973,6 +1001,10 @@ You can explicitly suppress this warning by setting pagination-path="".`
|
|
|
973
1001
|
filterSearchEndpoint: { default: "" },
|
|
974
1002
|
tableLayout: { default: "fixed" },
|
|
975
1003
|
autoSortFilters: { type: Boolean, default: !0 },
|
|
1004
|
+
showSaveAsDefault: { type: Boolean, default: !1 },
|
|
1005
|
+
saveAsDefaultLabel: { default: "Save as default" },
|
|
1006
|
+
showClearAll: { type: Boolean, default: !0 },
|
|
1007
|
+
clearAllLabel: { default: "Clear all" },
|
|
976
1008
|
data: { default: null },
|
|
977
1009
|
hasHeader: { type: Boolean, default: !0 },
|
|
978
1010
|
hasFooter: { type: Boolean, default: !0 },
|
|
@@ -991,97 +1023,102 @@ You can explicitly suppress this warning by setting pagination-path="".`
|
|
|
991
1023
|
detailRowTransition: { default: "fade" },
|
|
992
1024
|
detailRowOptions: { default: () => ({}) }
|
|
993
1025
|
},
|
|
994
|
-
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:term-changed", "dsg-table:data-loaded", "dsg-table:row-expanded", "dsg-table:row-collapsed"],
|
|
995
|
-
setup(e, { expose: B, emit:
|
|
996
|
-
const
|
|
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"],
|
|
1027
|
+
setup(e, { expose: B, emit: h }) {
|
|
1028
|
+
const u = (o) => {
|
|
997
1029
|
R.value = o;
|
|
998
|
-
},
|
|
999
|
-
if (
|
|
1030
|
+
}, S = P(e.apiMode && !!(e.filterEntity || e.filterEndpoint || e.getUrl)), H = () => {
|
|
1031
|
+
if (S.value) {
|
|
1000
1032
|
let o = {};
|
|
1001
|
-
return
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
}
|
|
1033
|
+
return Oe().forEach((i) => {
|
|
1034
|
+
const r = xt(i.key);
|
|
1035
|
+
if (!r)
|
|
1036
|
+
return;
|
|
1037
|
+
const b = o[`filter[${r}]`], y = i.value.join(",");
|
|
1038
|
+
o[`filter[${r}]`] = b ? `${b},${y}` : y;
|
|
1006
1039
|
}), o;
|
|
1007
1040
|
} else
|
|
1008
1041
|
return {};
|
|
1009
|
-
}, f =
|
|
1042
|
+
}, f = W(() => ({
|
|
1010
1043
|
...e.css,
|
|
1011
1044
|
tableWrapper: "border-b " + (e.css?.tableWrapper || "")
|
|
1012
|
-
})), 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) => {
|
|
1013
1046
|
a.value?.changePage(o);
|
|
1014
1047
|
}, se = (o) => {
|
|
1015
|
-
|
|
1048
|
+
w.value = o;
|
|
1016
1049
|
}, re = ({ data: o }) => {
|
|
1017
|
-
$.value = o,
|
|
1018
|
-
},
|
|
1050
|
+
$.value = o, p("dsg-table:data-loaded", o);
|
|
1051
|
+
}, M = () => {
|
|
1019
1052
|
a.value?.reload();
|
|
1020
|
-
},
|
|
1053
|
+
}, oe = (o) => {
|
|
1021
1054
|
a.value?.setLoading(o);
|
|
1022
|
-
},
|
|
1055
|
+
}, z = (o) => {
|
|
1023
1056
|
const i = a.value?.getData?.() ?? [];
|
|
1024
|
-
a.value?.setData(i.map((
|
|
1025
|
-
},
|
|
1057
|
+
a.value?.setData(i.map((r) => r.id === o.id ? o : r));
|
|
1058
|
+
}, U = (o) => {
|
|
1026
1059
|
const i = a.value?.getData?.() ?? [];
|
|
1027
1060
|
a.value?.setData([...i, o]);
|
|
1028
1061
|
}, j = (o) => {
|
|
1029
1062
|
const i = a.value?.getData?.() ?? [];
|
|
1030
|
-
a.value?.setData(i.filter((
|
|
1031
|
-
},
|
|
1063
|
+
a.value?.setData(i.filter((r) => r.id !== o.id));
|
|
1064
|
+
}, J = (o) => {
|
|
1032
1065
|
a.value?.setData(o);
|
|
1033
|
-
},
|
|
1034
|
-
const i = a.value?.getData() ?? [],
|
|
1035
|
-
|
|
1036
|
-
},
|
|
1066
|
+
}, _ = () => a.value?.getData() ?? [], ee = (o) => {
|
|
1067
|
+
const i = a.value?.getData() ?? [], r = o(i);
|
|
1068
|
+
r && a.value?.setData(r);
|
|
1069
|
+
}, fe = (o) => {
|
|
1037
1070
|
a.value?.expandRow(o);
|
|
1038
1071
|
}, he = (o) => {
|
|
1039
1072
|
a.value?.collapseRow(o);
|
|
1040
|
-
},
|
|
1073
|
+
}, F = (o, i) => {
|
|
1041
1074
|
a.value?.toggleRowExpand(o, i);
|
|
1042
|
-
}, we = () => {
|
|
1043
|
-
a.value?.expandAllRows();
|
|
1044
1075
|
}, me = () => {
|
|
1076
|
+
a.value?.expandAllRows();
|
|
1077
|
+
}, we = () => {
|
|
1045
1078
|
a.value?.collapseAllRows();
|
|
1046
|
-
}, ye = () => a.value?.getExpandedRows() ?? /* @__PURE__ */ new Set(),
|
|
1047
|
-
|
|
1048
|
-
},
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
}), k
|
|
1079
|
+
}, ye = () => a.value?.getExpandedRows() ?? /* @__PURE__ */ new Set(), X = () => a.value?.getSelection() ?? [], ue = () => {
|
|
1080
|
+
a.value?.clearSelection();
|
|
1081
|
+
}, ke = (o) => {
|
|
1082
|
+
k.value = o;
|
|
1083
|
+
}, pe = () => k.value ?? {}, ce = (o) => {
|
|
1084
|
+
const i = { ...k.value };
|
|
1085
|
+
!o || o.trim() === "" ? delete i["filter[term]"] : i["filter[term]"] = o, k.value = i, He(() => {
|
|
1086
|
+
M();
|
|
1087
|
+
}), p("dsg-table:term-changed", o);
|
|
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();
|
|
1094
|
+
}), p("dsg-table:filter-updated", k.value, i, r);
|
|
1060
1095
|
};
|
|
1061
1096
|
return B({
|
|
1062
|
-
reloadTable:
|
|
1063
|
-
updateRowTable:
|
|
1064
|
-
addRowTable:
|
|
1097
|
+
reloadTable: M,
|
|
1098
|
+
updateRowTable: z,
|
|
1099
|
+
addRowTable: U,
|
|
1065
1100
|
deleteRowTable: j,
|
|
1066
|
-
setData:
|
|
1067
|
-
getData:
|
|
1068
|
-
mutateData:
|
|
1101
|
+
setData: J,
|
|
1102
|
+
getData: _,
|
|
1103
|
+
mutateData: ee,
|
|
1069
1104
|
termChanged: ce,
|
|
1070
|
-
setFilters:
|
|
1071
|
-
getFilters:
|
|
1072
|
-
setLoading:
|
|
1073
|
-
expandRow:
|
|
1105
|
+
setFilters: ke,
|
|
1106
|
+
getFilters: pe,
|
|
1107
|
+
setLoading: oe,
|
|
1108
|
+
expandRow: fe,
|
|
1074
1109
|
collapseRow: he,
|
|
1075
|
-
toggleRowExpand:
|
|
1076
|
-
expandAllRows:
|
|
1077
|
-
collapseAllRows:
|
|
1110
|
+
toggleRowExpand: F,
|
|
1111
|
+
expandAllRows: me,
|
|
1112
|
+
collapseAllRows: we,
|
|
1078
1113
|
getExpandedRows: ye,
|
|
1114
|
+
getSelection: X,
|
|
1115
|
+
clearSelection: ue,
|
|
1079
1116
|
changePage: I
|
|
1080
1117
|
}), (o, i) => (s(), d("div", ha, [
|
|
1081
|
-
e.hasHeader ? (s(), d("div",
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1118
|
+
e.hasHeader ? (s(), d("div", ma, [
|
|
1119
|
+
E(o.$slots, "dsg-table--pre-header", {}, () => [
|
|
1120
|
+
C("div", wa, [
|
|
1121
|
+
E(o.$slots, "dsg-table--page-title", {
|
|
1085
1122
|
data: $.value,
|
|
1086
1123
|
title: e.title
|
|
1087
1124
|
}, () => [
|
|
@@ -1092,42 +1129,49 @@ You can explicitly suppress this warning by setting pagination-path="".`
|
|
|
1092
1129
|
}, null, 8, ya)) : m("", !0)
|
|
1093
1130
|
])
|
|
1094
1131
|
]),
|
|
1095
|
-
|
|
1096
|
-
|
|
1132
|
+
C("div", ka, [
|
|
1133
|
+
E(o.$slots, "dsg-table--page-actions", { data: $.value })
|
|
1097
1134
|
])
|
|
1098
1135
|
])
|
|
1099
1136
|
])) : m("", !0),
|
|
1100
1137
|
e.displaySearch ? (s(), d("div", pa, [
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1138
|
+
C("div", Pa, [
|
|
1139
|
+
E(o.$slots, "dsg-table--search-header", { data: $.value }, () => [
|
|
1140
|
+
V(Ye, {
|
|
1104
1141
|
name: "term",
|
|
1105
|
-
"onDsgTable:termChanged": i[0] || (i[0] = (
|
|
1142
|
+
"onDsgTable:termChanged": i[0] || (i[0] = (r) => ce(r))
|
|
1106
1143
|
}),
|
|
1107
|
-
|
|
1144
|
+
V(Ne, {
|
|
1108
1145
|
entity: e.filterEntity,
|
|
1109
1146
|
"filter-endpoint": e.filterEndpoint,
|
|
1110
1147
|
"search-endpoint": e.filterSearchEndpoint,
|
|
1111
1148
|
"auto-sort": e.autoSortFilters,
|
|
1112
1149
|
filters: e.filters,
|
|
1113
|
-
"
|
|
1114
|
-
|
|
1115
|
-
|
|
1150
|
+
"show-save-as-default": e.showSaveAsDefault,
|
|
1151
|
+
"save-as-default-label": e.saveAsDefaultLabel,
|
|
1152
|
+
"show-clear-all": e.showClearAll,
|
|
1153
|
+
"clear-all-label": e.clearAllLabel,
|
|
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))
|
|
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"]),
|
|
1157
|
+
E(o.$slots, "dsg-table--search-actions", { data: $.value })
|
|
1116
1158
|
])
|
|
1117
1159
|
]),
|
|
1118
|
-
|
|
1160
|
+
E(o.$slots, "dsg-table--search-navigation")
|
|
1119
1161
|
], 512)) : m("", !0),
|
|
1120
|
-
|
|
1162
|
+
V(fa, {
|
|
1121
1163
|
ref: "dsgTable",
|
|
1122
1164
|
"api-url": e.getUrl,
|
|
1123
|
-
"filter-params":
|
|
1124
|
-
"onUpdate:filterParams": i[
|
|
1165
|
+
"filter-params": k.value,
|
|
1166
|
+
"onUpdate:filterParams": i[8] || (i[8] = (r) => k.value = r),
|
|
1125
1167
|
"per-page": R.value,
|
|
1126
|
-
"onUpdate:perPage": i[
|
|
1168
|
+
"onUpdate:perPage": i[9] || (i[9] = (r) => R.value = r),
|
|
1127
1169
|
fields: e.fields,
|
|
1128
1170
|
"load-on-start": e.loadOnStart,
|
|
1129
1171
|
"pagination-path": e.paginationPath,
|
|
1130
1172
|
selectable: e.selectable,
|
|
1173
|
+
"selectable-column-width": e.selectableColumnWidth,
|
|
1174
|
+
"expandable-column-width": e.expandableColumnWidth,
|
|
1131
1175
|
"shift-select-highlight": e.shiftSelectHighlight,
|
|
1132
1176
|
"selected-row-highlight": e.selectedRowHighlight,
|
|
1133
1177
|
"track-by": e.trackBy,
|
|
@@ -1135,7 +1179,7 @@ You can explicitly suppress this warning by setting pagination-path="".`
|
|
|
1135
1179
|
css: f.value,
|
|
1136
1180
|
data: e.data,
|
|
1137
1181
|
"row-class": e.rowClass,
|
|
1138
|
-
"api-mode":
|
|
1182
|
+
"api-mode": S.value,
|
|
1139
1183
|
"replace-state": e.replaceState,
|
|
1140
1184
|
"replace-strategy": e.replaceStrategy,
|
|
1141
1185
|
"has-detail-row": e.hasDetailRow,
|
|
@@ -1144,83 +1188,83 @@ You can explicitly suppress this warning by setting pagination-path="".`
|
|
|
1144
1188
|
"show-expand-detail": e.showExpandDetail,
|
|
1145
1189
|
"detail-row-transition": e.detailRowTransition,
|
|
1146
1190
|
"detail-row-options": e.detailRowOptions,
|
|
1147
|
-
"onDsgTable:loading": i[
|
|
1148
|
-
"onDsgTable:loaded": i[
|
|
1191
|
+
"onDsgTable:loading": i[10] || (i[10] = (r) => A.value = !0),
|
|
1192
|
+
"onDsgTable:loaded": i[11] || (i[11] = (r) => A.value = !1),
|
|
1149
1193
|
"onDsgTable:paginationData": se,
|
|
1150
1194
|
"onDsgTable:loadSuccess": re,
|
|
1151
|
-
"onDsgTable:rowsSelected": i[
|
|
1152
|
-
"onDsgTable:rowClicked": i[
|
|
1153
|
-
"onDsgTable:rowHover": i[
|
|
1154
|
-
"onDsgTable:rowDblclick": i[
|
|
1155
|
-
"onDsgTable:rowExpanded": i[
|
|
1156
|
-
"onDsgTable:rowCollapsed": i[
|
|
1157
|
-
},
|
|
1158
|
-
"dsg-field--actions": ne((
|
|
1159
|
-
|
|
1160
|
-
(s(),
|
|
1161
|
-
key:
|
|
1162
|
-
data:
|
|
1163
|
-
"onDsgTable:actionEdit": i[
|
|
1164
|
-
"onDsgTable:actionView": i[
|
|
1165
|
-
"onDsgTable:actionDelete": i[
|
|
1166
|
-
"onDsgTable:actionArchive": i[
|
|
1167
|
-
"onDsgTable:linkClicked": i[
|
|
1195
|
+
"onDsgTable:rowsSelected": i[12] || (i[12] = (r) => p("dsg-table:rows-selected", r)),
|
|
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({
|
|
1202
|
+
"dsg-field--actions": ne((r) => [
|
|
1203
|
+
E(o.$slots, "dsg-table-actions", { data: r }, () => [
|
|
1204
|
+
(s(), K(Qe, {
|
|
1205
|
+
key: r.rowData?.[e.trackBy] ?? r.rowIndex,
|
|
1206
|
+
data: r,
|
|
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))
|
|
1168
1212
|
}, null, 8, ["data"]))
|
|
1169
1213
|
])
|
|
1170
1214
|
]),
|
|
1171
1215
|
_: 2
|
|
1172
1216
|
}, [
|
|
1173
|
-
|
|
1174
|
-
name:
|
|
1175
|
-
fn: ne((
|
|
1176
|
-
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)
|
|
1177
1221
|
])
|
|
1178
1222
|
}))
|
|
1179
|
-
]), 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"]),
|
|
1180
|
-
e.hasFooter ? (s(), d("div",
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
data:
|
|
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", {
|
|
1227
|
+
data: w.value,
|
|
1184
1228
|
perPage: T.value
|
|
1185
1229
|
}, () => [
|
|
1186
|
-
e.displayPaginationInfo ? (s(),
|
|
1230
|
+
e.displayPaginationInfo ? (s(), K(je, {
|
|
1187
1231
|
key: 0,
|
|
1188
1232
|
ref: "paginationInfoStart",
|
|
1189
|
-
pagination:
|
|
1190
|
-
"onUpdate:pagination": i[
|
|
1191
|
-
"info-template":
|
|
1233
|
+
pagination: w.value,
|
|
1234
|
+
"onUpdate:pagination": i[18] || (i[18] = (r) => w.value = r),
|
|
1235
|
+
"info-template": D.value
|
|
1192
1236
|
}, null, 8, ["pagination", "info-template"])) : m("", !0),
|
|
1193
|
-
|
|
1194
|
-
data:
|
|
1237
|
+
E(o.$slots, "dsg-table--footer-left-extras", {
|
|
1238
|
+
data: w.value,
|
|
1195
1239
|
perPage: T.value
|
|
1196
1240
|
})
|
|
1197
1241
|
])
|
|
1198
1242
|
]),
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
data:
|
|
1243
|
+
C("div", xa, [
|
|
1244
|
+
E(o.$slots, "dsg-table--footer-center", {
|
|
1245
|
+
data: w.value,
|
|
1202
1246
|
perPage: T.value
|
|
1203
1247
|
}, () => [
|
|
1204
|
-
|
|
1205
|
-
data:
|
|
1248
|
+
E(o.$slots, "dsg-table--footer-center-extras", {
|
|
1249
|
+
data: w.value,
|
|
1206
1250
|
perPage: T.value
|
|
1207
1251
|
})
|
|
1208
1252
|
])
|
|
1209
1253
|
]),
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
data:
|
|
1254
|
+
C("div", Da, [
|
|
1255
|
+
E(o.$slots, "dsg-table--footer-right", {
|
|
1256
|
+
data: w.value,
|
|
1213
1257
|
perPage: T.value
|
|
1214
1258
|
}, () => [
|
|
1215
|
-
|
|
1259
|
+
A.value === !1 && e.displayPaginationInfo ? (s(), K(Ke, be({
|
|
1216
1260
|
key: 0,
|
|
1217
1261
|
ref: "pagination",
|
|
1218
|
-
pagination:
|
|
1219
|
-
"onUpdate:pagination": i[
|
|
1262
|
+
pagination: w.value,
|
|
1263
|
+
"onUpdate:pagination": i[19] || (i[19] = (r) => w.value = r),
|
|
1220
1264
|
"onDsgTable:changePage": I
|
|
1221
1265
|
}, e.pagination), null, 16, ["pagination"])) : m("", !0),
|
|
1222
|
-
|
|
1223
|
-
data:
|
|
1266
|
+
E(o.$slots, "dsg-table--footer-right-extras", {
|
|
1267
|
+
data: w.value,
|
|
1224
1268
|
perPage: T.value
|
|
1225
1269
|
})
|
|
1226
1270
|
])
|
|
@@ -1228,7 +1272,7 @@ You can explicitly suppress this warning by setting pagination-path="".`
|
|
|
1228
1272
|
], 512)) : m("", !0)
|
|
1229
1273
|
]));
|
|
1230
1274
|
}
|
|
1231
|
-
}), Ta = { class: "dsg-table-per-page" }, Ra = /* @__PURE__ */
|
|
1275
|
+
}), Ta = { class: "dsg-table-per-page" }, Ra = /* @__PURE__ */ Z({
|
|
1232
1276
|
__name: "DsgTablePerPage",
|
|
1233
1277
|
props: {
|
|
1234
1278
|
perPageOptions: { default: () => [
|
|
@@ -1241,37 +1285,37 @@ You can explicitly suppress this warning by setting pagination-path="".`
|
|
|
1241
1285
|
perPage: {}
|
|
1242
1286
|
},
|
|
1243
1287
|
setup(e) {
|
|
1244
|
-
const B = (
|
|
1245
|
-
e.perPage.perPage =
|
|
1288
|
+
const B = (u) => e.perPageOptions.find((S) => S.label === u), h = (u) => {
|
|
1289
|
+
e.perPage.perPage = u.label, e.perPage.change(u.label);
|
|
1246
1290
|
};
|
|
1247
|
-
return (
|
|
1248
|
-
|
|
1291
|
+
return (u, S) => (s(), d("div", Ta, [
|
|
1292
|
+
V(Dt, {
|
|
1249
1293
|
modelValue: B(e.perPage.perPage),
|
|
1250
|
-
"onUpdate:modelValue":
|
|
1294
|
+
"onUpdate:modelValue": h,
|
|
1251
1295
|
options: e.perPageOptions,
|
|
1252
1296
|
size: "sm",
|
|
1253
1297
|
"close-on-select": ""
|
|
1254
1298
|
}, null, 8, ["modelValue", "options"])
|
|
1255
1299
|
]));
|
|
1256
1300
|
}
|
|
1257
|
-
}), Ma = $a, Ea =
|
|
1301
|
+
}), Ma = $a, Ea = Qe, Ba = Ra, La = Ne, Fa = Ke, Ha = je, Aa = Ye, Ua = Ge, Na = {
|
|
1258
1302
|
DsgTable: Ma,
|
|
1259
1303
|
DsgTableActions: Ea,
|
|
1260
1304
|
DsgTablePerPage: Ba,
|
|
1261
|
-
DsgTableFilter:
|
|
1262
|
-
DsgTablePagination:
|
|
1305
|
+
DsgTableFilter: La,
|
|
1306
|
+
DsgTablePagination: Fa,
|
|
1263
1307
|
DsgTablePaginationInfo: Ha,
|
|
1264
|
-
DsgTableSearch:
|
|
1265
|
-
DsgTableRowHeader:
|
|
1308
|
+
DsgTableSearch: Aa,
|
|
1309
|
+
DsgTableRowHeader: Ua
|
|
1266
1310
|
};
|
|
1267
1311
|
export {
|
|
1268
1312
|
Ma as DsgTable,
|
|
1269
1313
|
Ea as DsgTableActions,
|
|
1270
|
-
|
|
1271
|
-
|
|
1314
|
+
La as DsgTableFilter,
|
|
1315
|
+
Fa as DsgTablePagination,
|
|
1272
1316
|
Ha as DsgTablePaginationInfo,
|
|
1273
1317
|
Ba as DsgTablePerPage,
|
|
1274
|
-
|
|
1275
|
-
|
|
1318
|
+
Ua as DsgTableRowHeader,
|
|
1319
|
+
Aa as DsgTableSearch,
|
|
1276
1320
|
Na as default
|
|
1277
1321
|
};
|