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