@dcodegroup-au/dsg-vue 0.0.32 → 0.0.34

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