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