@dcodegroup-au/dsg-vue 1.0.1-next.1 → 1.0.2-next

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