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