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