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