@dcodegroup-au/dsg-vue 0.1.11 → 0.1.13

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