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