@dcodegroup-au/dsg-vue 1.0.4-next → 1.0.5-next

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