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