@dcodegroup-au/dsg-vue 0.1.20 → 0.1.22

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