vs-datatable 1.2.0 → 1.2.2

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,56 +1,63 @@
1
- import { defineComponent as _, computed as T, createElementBlock as w, openBlock as h, createElementVNode as g, createCommentVNode as P, Fragment as K, renderList as z, normalizeClass as W, toDisplayString as D, unref as R, mergeProps as xt, renderSlot as q, ref as L, watch as G, createVNode as j, withModifiers as le, withCtx as I, withDirectives as U, vModelText as oe, nextTick as Ct, onMounted as st, onUnmounted as lt, createBlock as fe, Teleport as kt, Transition as Rt, vModelSelect as Me, normalizeStyle as St, createSlots as Ne, createTextVNode as je, isRef as ye, shallowRef as at, useAttrs as Tt, onBeforeMount as $t, normalizeProps as ze, guardReactiveProps as Ze } from "vue";
2
- import './index.css';function Vt(e, t) {
3
- return t.split(".").reduce((n, o) => n?.[o], e) ?? "";
4
- }
5
- function X(e, t, n = "id") {
6
- return typeof n == "function" ? n(e, t) : e[n] || t;
7
- }
8
- function rt(e, t, n = "id") {
9
- return t.some(
10
- (o) => X(o, -1, n) === X(e, -1, n)
1
+ import { defineComponent as _, computed as F, createElementBlock as k, openBlock as y, createElementVNode as w, createCommentVNode as D, Fragment as K, renderList as Q, normalizeClass as G, toDisplayString as H, unref as $, mergeProps as Ae, renderSlot as z, ref as q, watch as Y, createVNode as ne, withModifiers as me, withCtx as X, withDirectives as te, vModelText as ve, nextTick as oe, onMounted as Re, onUnmounted as mt, createBlock as fe, Teleport as Dt, Transition as It, vModelSelect as Xe, normalizeStyle as pt, createSlots as Te, createTextVNode as Ye, onBeforeUnmount as He, isRef as Fe, shallowRef as gt, useAttrs as qt, onBeforeMount as Mt, normalizeProps as nt, guardReactiveProps as ot } from "vue";
2
+ import './index.css';const Bt = (e, n) => n ? n.split(".").reduce((t, o) => t && t[o], e) : "";
3
+ function re(e, n, t = "id") {
4
+ return typeof t == "function" ? t(e, n) : e[t] || n;
5
+ }
6
+ function yt(e, n, t = "id") {
7
+ return n.some(
8
+ (o) => re(o, -1, t) === re(e, -1, t)
11
9
  );
12
10
  }
13
- function Ot(e, t, n) {
14
- return e.length + (t ? 1 : 0) + (n ? 1 : 0);
11
+ function Ht(e, n, t) {
12
+ const o = (l) => l.reduce((a, r) => r.children && r.children.length > 0 ? a + o(r.children) : a + 1, 0);
13
+ return o(e) + (n ? 1 : 0) + (t ? 1 : 0);
15
14
  }
16
- function At(e, t) {
17
- if (!t.length) return e;
18
- const n = (o, s) => s.split(".").reduce((l, a) => l?.[a], o) ?? "";
15
+ function Wt(e, n) {
16
+ if (!n.length) return e;
17
+ const t = (o, s) => s.split(".").reduce((l, a) => l?.[a], o) ?? "";
19
18
  return [...e].sort((o, s) => {
20
- for (const { field: l, order: a } of t) {
21
- const r = n(o, l), u = n(s, l);
22
- if (r !== u)
23
- return a === "asc" ? r > u ? 1 : -1 : r < u ? 1 : -1;
19
+ for (const { field: l, order: a } of n) {
20
+ const r = t(o, l), i = t(s, l);
21
+ if (r !== i)
22
+ return a === "asc" ? r > i ? 1 : -1 : r < i ? 1 : -1;
24
23
  }
25
24
  return 0;
26
25
  });
27
26
  }
28
- function Et(e, t, n) {
29
- if (!n) return e;
30
- const o = (t - 1) * n, s = o + n;
27
+ function Nt(e, n, t) {
28
+ if (!t) return e;
29
+ const o = (n - 1) * t, s = o + t;
31
30
  return e.slice(o, s);
32
31
  }
33
- function Pt(e, t, n) {
34
- const o = (e - 1) * t + 1, s = Math.min(e * t, n);
32
+ function Kt(e, n, t) {
33
+ const o = (e - 1) * n + 1, s = Math.min(e * n, t);
35
34
  return { start: o, end: s };
36
35
  }
37
- function it(e, t) {
38
- return Math.ceil(e / t);
36
+ function wt(e, n) {
37
+ return Math.ceil(e / n);
39
38
  }
40
- function Qe(e, t, n) {
41
- if (!t || t.trim() === "") return e;
42
- const o = t.toLowerCase();
39
+ function st(e, n, t) {
40
+ if (!n || n.trim() === "") return e;
41
+ const o = n.toLowerCase();
43
42
  return e.filter((s) => Object.values(s).some(
44
43
  (l) => String(l ?? "").toLowerCase().includes(o)
45
44
  ));
46
45
  }
47
- const Dt = ["id"], Lt = ["disabled"], Ft = {
46
+ function zt(e = []) {
47
+ const n = [], t = (o) => {
48
+ o.forEach((s) => {
49
+ Array.isArray(s.children) && s.children.length ? t(s.children) : n.push(s);
50
+ });
51
+ };
52
+ return t(e), n;
53
+ }
54
+ const jt = ["id"], Ut = ["disabled"], Zt = {
48
55
  key: 1,
49
56
  class: "vs-pagination-ellipsis"
50
- }, Bt = ["id", "onClick"], Mt = {
57
+ }, Xt = ["id", "onClick"], Qt = {
51
58
  key: 2,
52
59
  class: "vs-pagination-ellipsis"
53
- }, qt = ["disabled"], Nt = /* @__PURE__ */ _({
60
+ }, Yt = ["disabled"], Gt = /* @__PURE__ */ _({
54
61
  __name: "VsPagination",
55
62
  props: {
56
63
  modelValue: {},
@@ -61,169 +68,169 @@ const Dt = ["id"], Lt = ["disabled"], Ft = {
61
68
  paginationClass: {}
62
69
  },
63
70
  emits: ["update:modelValue", "pageChanged"],
64
- setup(e, { emit: t }) {
65
- const n = e, o = t, s = n.maxVisible ?? 3, l = T({
66
- get: () => n.modelValue,
67
- set: (v) => {
68
- o("update:modelValue", v), o("pageChanged", v);
71
+ setup(e, { emit: n }) {
72
+ const t = e, o = n, s = t.maxVisible ?? 3, l = F({
73
+ get: () => t.modelValue,
74
+ set: (f) => {
75
+ o("update:modelValue", f), o("pageChanged", f);
69
76
  }
70
- }), a = T(() => l.value <= Math.floor(s / 2) ? 1 : l.value >= u.value - Math.floor(s / 2) ? Math.max(u.value - s + 1, 1) : l.value - Math.floor(s / 2)), r = T(() => Math.min(a.value + s - 1, u.value)), u = T(() => it(n.totalRecords, n.rowsPerPage)), c = T(() => {
71
- const v = [];
72
- for (let d = a.value; d <= r.value; d++)
73
- v.push(d);
74
- return v;
75
- }), f = (v) => {
76
- v >= 1 && v <= u.value && (l.value = v);
77
- }, i = () => {
77
+ }), a = F(() => l.value <= Math.floor(s / 2) ? 1 : l.value >= i.value - Math.floor(s / 2) ? Math.max(i.value - s + 1, 1) : l.value - Math.floor(s / 2)), r = F(() => Math.min(a.value + s - 1, i.value)), i = F(() => wt(t.totalRecords, t.rowsPerPage)), c = F(() => {
78
+ const f = [];
79
+ for (let u = a.value; u <= r.value; u++)
80
+ f.push(u);
81
+ return f;
82
+ }), d = (f) => {
83
+ f >= 1 && f <= i.value && (l.value = f);
84
+ }, v = () => {
78
85
  l.value > 1 && l.value--;
79
- }, p = () => {
80
- l.value < u.value && l.value++;
86
+ }, m = () => {
87
+ l.value < i.value && l.value++;
81
88
  };
82
- return (v, d) => (h(), w("div", {
89
+ return (f, u) => (y(), k("div", {
83
90
  class: "vs-pagination",
84
91
  id: e.tablename + "-pagination"
85
92
  }, [
86
- g("button", {
87
- onClick: i,
93
+ w("button", {
94
+ onClick: v,
88
95
  type: "button",
89
96
  class: "vs-pagination-button vs-pagination-nav",
90
97
  disabled: l.value === 1
91
- }, " ‹‹ ", 8, Lt),
92
- a.value > 1 ? (h(), w("button", {
98
+ }, " ‹‹ ", 8, Ut),
99
+ a.value > 1 ? (y(), k("button", {
93
100
  key: 0,
94
101
  type: "button",
95
102
  class: "vs-pagination-button",
96
- onClick: d[0] || (d[0] = (m) => f(1))
97
- }, " 1 ")) : P("", !0),
98
- a.value > 2 ? (h(), w("span", Ft, "...")) : P("", !0),
99
- (h(!0), w(K, null, z(c.value, (m) => (h(), w("button", {
100
- key: m,
103
+ onClick: u[0] || (u[0] = (h) => d(1))
104
+ }, " 1 ")) : D("", !0),
105
+ a.value > 2 ? (y(), k("span", Zt, "...")) : D("", !0),
106
+ (y(!0), k(K, null, Q(c.value, (h) => (y(), k("button", {
107
+ key: h,
101
108
  type: "button",
102
- class: W([
109
+ class: G([
103
110
  "vs-pagination-button",
104
- { "vs-active": l.value === m }
111
+ { "vs-active": l.value === h }
105
112
  ]),
106
- id: e.tablename + "-page-" + m,
107
- onClick: (b) => f(m)
108
- }, D(m), 11, Bt))), 128)),
109
- r.value < u.value - 1 ? (h(), w("span", Mt, "...")) : P("", !0),
110
- r.value < u.value ? (h(), w("button", {
113
+ id: e.tablename + "-page-" + h,
114
+ onClick: (g) => d(h)
115
+ }, H(h), 11, Xt))), 128)),
116
+ r.value < i.value - 1 ? (y(), k("span", Qt, "...")) : D("", !0),
117
+ r.value < i.value ? (y(), k("button", {
111
118
  key: 3,
112
119
  type: "button",
113
120
  class: "vs-pagination-button",
114
- onClick: d[1] || (d[1] = (m) => f(u.value))
115
- }, D(u.value), 1)) : P("", !0),
116
- g("button", {
117
- onClick: p,
121
+ onClick: u[1] || (u[1] = (h) => d(i.value))
122
+ }, H(i.value), 1)) : D("", !0),
123
+ w("button", {
124
+ onClick: m,
118
125
  type: "button",
119
126
  class: "vs-pagination-button vs-pagination-nav",
120
- disabled: l.value === u.value
121
- }, " ›› ", 8, qt)
122
- ], 8, Dt));
127
+ disabled: l.value === i.value
128
+ }, " ›› ", 8, Yt)
129
+ ], 8, jt));
123
130
  }
124
- }), ne = (e, t) => {
125
- const n = e.__vccOpts || e;
126
- for (const [o, s] of t)
127
- n[o] = s;
128
- return n;
129
- }, It = /* @__PURE__ */ ne(Nt, [["__scopeId", "data-v-b327b254"]]), Ht = { class: "vs-rows-per-page" }, Kt = ["value"], Wt = ["value"], Ut = /* @__PURE__ */ _({
131
+ }), ae = (e, n) => {
132
+ const t = e.__vccOpts || e;
133
+ for (const [o, s] of n)
134
+ t[o] = s;
135
+ return t;
136
+ }, Jt = /* @__PURE__ */ ae(Gt, [["__scopeId", "data-v-b327b254"]]), _t = { class: "vs-rows-per-page" }, en = ["value"], tn = ["value"], nn = /* @__PURE__ */ _({
130
137
  __name: "VsRowsPerPage",
131
138
  props: {
132
139
  modelValue: {},
133
140
  options: {}
134
141
  },
135
142
  emits: ["update:modelValue", "rowsPerPageChanged"],
136
- setup(e, { emit: t }) {
137
- const n = e, o = t, s = n.options ?? [10, 25, 50, 100], l = (a) => {
143
+ setup(e, { emit: n }) {
144
+ const t = e, o = n, s = t.options ?? [10, 25, 50, 100], l = (a) => {
138
145
  const r = Number(a.target.value);
139
146
  o("update:modelValue", r), o("rowsPerPageChanged", r);
140
147
  };
141
- return (a, r) => (h(), w("div", Ht, [
142
- r[0] || (r[0] = g("span", { class: "vs-rows-label" }, "Items Per Page", -1)),
143
- g("select", {
148
+ return (a, r) => (y(), k("div", _t, [
149
+ r[0] || (r[0] = w("span", { class: "vs-rows-label" }, "Items Per Page", -1)),
150
+ w("select", {
144
151
  class: "vs-items-dropdown",
145
152
  value: e.modelValue,
146
153
  onChange: l
147
154
  }, [
148
- (h(!0), w(K, null, z(R(s), (u) => (h(), w("option", {
149
- key: u,
150
- value: u
151
- }, D(u), 9, Wt))), 128))
152
- ], 40, Kt)
155
+ (y(!0), k(K, null, Q($(s), (i) => (y(), k("option", {
156
+ key: i,
157
+ value: i
158
+ }, H(i), 9, tn))), 128))
159
+ ], 40, en)
153
160
  ]));
154
161
  }
155
- }), jt = /* @__PURE__ */ ne(Ut, [["__scopeId", "data-v-0c2bdd9c"]]), Te = Math.min, ie = Math.max, $e = Math.round, Re = Math.floor, Y = (e) => ({
162
+ }), on = /* @__PURE__ */ ae(nn, [["__scopeId", "data-v-0c2bdd9c"]]), De = Math.min, we = Math.max, Ie = Math.round, Le = Math.floor, ie = (e) => ({
156
163
  x: e,
157
164
  y: e
158
- }), zt = {
165
+ }), sn = {
159
166
  left: "right",
160
167
  right: "left",
161
168
  bottom: "top",
162
169
  top: "bottom"
163
- }, Zt = {
170
+ }, ln = {
164
171
  start: "end",
165
172
  end: "start"
166
173
  };
167
- function Xe(e, t, n) {
168
- return ie(e, Te(t, n));
174
+ function lt(e, n, t) {
175
+ return we(e, De(n, t));
169
176
  }
170
- function Ee(e, t) {
171
- return typeof e == "function" ? e(t) : e;
177
+ function We(e, n) {
178
+ return typeof e == "function" ? e(n) : e;
172
179
  }
173
- function ue(e) {
180
+ function be(e) {
174
181
  return e.split("-")[0];
175
182
  }
176
- function Pe(e) {
183
+ function Ne(e) {
177
184
  return e.split("-")[1];
178
185
  }
179
- function ut(e) {
186
+ function bt(e) {
180
187
  return e === "x" ? "y" : "x";
181
188
  }
182
- function ct(e) {
189
+ function xt(e) {
183
190
  return e === "y" ? "height" : "width";
184
191
  }
185
- const Qt = /* @__PURE__ */ new Set(["top", "bottom"]);
186
- function se(e) {
187
- return Qt.has(ue(e)) ? "y" : "x";
192
+ const an = /* @__PURE__ */ new Set(["top", "bottom"]);
193
+ function he(e) {
194
+ return an.has(be(e)) ? "y" : "x";
188
195
  }
189
- function dt(e) {
190
- return ut(se(e));
196
+ function kt(e) {
197
+ return bt(he(e));
191
198
  }
192
- function Xt(e, t, n) {
193
- n === void 0 && (n = !1);
194
- const o = Pe(e), s = dt(e), l = ct(s);
195
- let a = s === "x" ? o === (n ? "end" : "start") ? "right" : "left" : o === "start" ? "bottom" : "top";
196
- return t.reference[l] > t.floating[l] && (a = Ve(a)), [a, Ve(a)];
199
+ function rn(e, n, t) {
200
+ t === void 0 && (t = !1);
201
+ const o = Ne(e), s = kt(e), l = xt(s);
202
+ let a = s === "x" ? o === (t ? "end" : "start") ? "right" : "left" : o === "start" ? "bottom" : "top";
203
+ return n.reference[l] > n.floating[l] && (a = qe(a)), [a, qe(a)];
197
204
  }
198
- function Yt(e) {
199
- const t = Ve(e);
200
- return [Ie(e), t, Ie(t)];
205
+ function cn(e) {
206
+ const n = qe(e);
207
+ return [Ge(e), n, Ge(n)];
201
208
  }
202
- function Ie(e) {
203
- return e.replace(/start|end/g, (t) => Zt[t]);
209
+ function Ge(e) {
210
+ return e.replace(/start|end/g, (n) => ln[n]);
204
211
  }
205
- const Ye = ["left", "right"], Ge = ["right", "left"], Gt = ["top", "bottom"], Jt = ["bottom", "top"];
206
- function _t(e, t, n) {
212
+ const at = ["left", "right"], rt = ["right", "left"], un = ["top", "bottom"], dn = ["bottom", "top"];
213
+ function fn(e, n, t) {
207
214
  switch (e) {
208
215
  case "top":
209
216
  case "bottom":
210
- return n ? t ? Ge : Ye : t ? Ye : Ge;
217
+ return t ? n ? rt : at : n ? at : rt;
211
218
  case "left":
212
219
  case "right":
213
- return t ? Gt : Jt;
220
+ return n ? un : dn;
214
221
  default:
215
222
  return [];
216
223
  }
217
224
  }
218
- function en(e, t, n, o) {
219
- const s = Pe(e);
220
- let l = _t(ue(e), n === "start", o);
221
- return s && (l = l.map((a) => a + "-" + s), t && (l = l.concat(l.map(Ie)))), l;
225
+ function vn(e, n, t, o) {
226
+ const s = Ne(e);
227
+ let l = fn(be(e), t === "start", o);
228
+ return s && (l = l.map((a) => a + "-" + s), n && (l = l.concat(l.map(Ge)))), l;
222
229
  }
223
- function Ve(e) {
224
- return e.replace(/left|right|bottom|top/g, (t) => zt[t]);
230
+ function qe(e) {
231
+ return e.replace(/left|right|bottom|top/g, (n) => sn[n]);
225
232
  }
226
- function tn(e) {
233
+ function hn(e) {
227
234
  return {
228
235
  top: 0,
229
236
  right: 0,
@@ -232,452 +239,452 @@ function tn(e) {
232
239
  ...e
233
240
  };
234
241
  }
235
- function nn(e) {
236
- return typeof e != "number" ? tn(e) : {
242
+ function mn(e) {
243
+ return typeof e != "number" ? hn(e) : {
237
244
  top: e,
238
245
  right: e,
239
246
  bottom: e,
240
247
  left: e
241
248
  };
242
249
  }
243
- function Oe(e) {
250
+ function Me(e) {
244
251
  const {
245
- x: t,
246
- y: n,
252
+ x: n,
253
+ y: t,
247
254
  width: o,
248
255
  height: s
249
256
  } = e;
250
257
  return {
251
258
  width: o,
252
259
  height: s,
253
- top: n,
254
- left: t,
255
- right: t + o,
256
- bottom: n + s,
257
- x: t,
258
- y: n
260
+ top: t,
261
+ left: n,
262
+ right: n + o,
263
+ bottom: t + s,
264
+ x: n,
265
+ y: t
259
266
  };
260
267
  }
261
- function Je(e, t, n) {
268
+ function it(e, n, t) {
262
269
  let {
263
270
  reference: o,
264
271
  floating: s
265
272
  } = e;
266
- const l = se(t), a = dt(t), r = ct(a), u = ue(t), c = l === "y", f = o.x + o.width / 2 - s.width / 2, i = o.y + o.height / 2 - s.height / 2, p = o[r] / 2 - s[r] / 2;
267
- let v;
268
- switch (u) {
273
+ const l = he(n), a = kt(n), r = xt(a), i = be(n), c = l === "y", d = o.x + o.width / 2 - s.width / 2, v = o.y + o.height / 2 - s.height / 2, m = o[r] / 2 - s[r] / 2;
274
+ let f;
275
+ switch (i) {
269
276
  case "top":
270
- v = {
271
- x: f,
277
+ f = {
278
+ x: d,
272
279
  y: o.y - s.height
273
280
  };
274
281
  break;
275
282
  case "bottom":
276
- v = {
277
- x: f,
283
+ f = {
284
+ x: d,
278
285
  y: o.y + o.height
279
286
  };
280
287
  break;
281
288
  case "right":
282
- v = {
289
+ f = {
283
290
  x: o.x + o.width,
284
- y: i
291
+ y: v
285
292
  };
286
293
  break;
287
294
  case "left":
288
- v = {
295
+ f = {
289
296
  x: o.x - s.width,
290
- y: i
297
+ y: v
291
298
  };
292
299
  break;
293
300
  default:
294
- v = {
301
+ f = {
295
302
  x: o.x,
296
303
  y: o.y
297
304
  };
298
305
  }
299
- switch (Pe(t)) {
306
+ switch (Ne(n)) {
300
307
  case "start":
301
- v[a] -= p * (n && c ? -1 : 1);
308
+ f[a] -= m * (t && c ? -1 : 1);
302
309
  break;
303
310
  case "end":
304
- v[a] += p * (n && c ? -1 : 1);
311
+ f[a] += m * (t && c ? -1 : 1);
305
312
  break;
306
313
  }
307
- return v;
314
+ return f;
308
315
  }
309
- const on = async (e, t, n) => {
316
+ const pn = async (e, n, t) => {
310
317
  const {
311
318
  placement: o = "bottom",
312
319
  strategy: s = "absolute",
313
320
  middleware: l = [],
314
321
  platform: a
315
- } = n, r = l.filter(Boolean), u = await (a.isRTL == null ? void 0 : a.isRTL(t));
322
+ } = t, r = l.filter(Boolean), i = await (a.isRTL == null ? void 0 : a.isRTL(n));
316
323
  let c = await a.getElementRects({
317
324
  reference: e,
318
- floating: t,
325
+ floating: n,
319
326
  strategy: s
320
327
  }), {
321
- x: f,
322
- y: i
323
- } = Je(c, o, u), p = o, v = {}, d = 0;
324
- for (let m = 0; m < r.length; m++) {
328
+ x: d,
329
+ y: v
330
+ } = it(c, o, i), m = o, f = {}, u = 0;
331
+ for (let h = 0; h < r.length; h++) {
325
332
  const {
326
- name: b,
333
+ name: g,
327
334
  fn: C
328
- } = r[m], {
329
- x: k,
330
- y: S,
331
- data: O,
332
- reset: A
335
+ } = r[h], {
336
+ x: S,
337
+ y: E,
338
+ data: L,
339
+ reset: P
333
340
  } = await C({
334
- x: f,
335
- y: i,
341
+ x: d,
342
+ y: v,
336
343
  initialPlacement: o,
337
- placement: p,
344
+ placement: m,
338
345
  strategy: s,
339
- middlewareData: v,
346
+ middlewareData: f,
340
347
  rects: c,
341
348
  platform: a,
342
349
  elements: {
343
350
  reference: e,
344
- floating: t
351
+ floating: n
345
352
  }
346
353
  });
347
- f = k ?? f, i = S ?? i, v = {
348
- ...v,
349
- [b]: {
350
- ...v[b],
351
- ...O
354
+ d = S ?? d, v = E ?? v, f = {
355
+ ...f,
356
+ [g]: {
357
+ ...f[g],
358
+ ...L
352
359
  }
353
- }, A && d <= 50 && (d++, typeof A == "object" && (A.placement && (p = A.placement), A.rects && (c = A.rects === !0 ? await a.getElementRects({
360
+ }, P && u <= 50 && (u++, typeof P == "object" && (P.placement && (m = P.placement), P.rects && (c = P.rects === !0 ? await a.getElementRects({
354
361
  reference: e,
355
- floating: t,
362
+ floating: n,
356
363
  strategy: s
357
- }) : A.rects), {
358
- x: f,
359
- y: i
360
- } = Je(c, p, u)), m = -1);
364
+ }) : P.rects), {
365
+ x: d,
366
+ y: v
367
+ } = it(c, m, i)), h = -1);
361
368
  }
362
369
  return {
363
- x: f,
364
- y: i,
365
- placement: p,
370
+ x: d,
371
+ y: v,
372
+ placement: m,
366
373
  strategy: s,
367
- middlewareData: v
374
+ middlewareData: f
368
375
  };
369
376
  };
370
- async function ft(e, t) {
371
- var n;
372
- t === void 0 && (t = {});
377
+ async function Ct(e, n) {
378
+ var t;
379
+ n === void 0 && (n = {});
373
380
  const {
374
381
  x: o,
375
382
  y: s,
376
383
  platform: l,
377
384
  rects: a,
378
385
  elements: r,
379
- strategy: u
386
+ strategy: i
380
387
  } = e, {
381
388
  boundary: c = "clippingAncestors",
382
- rootBoundary: f = "viewport",
383
- elementContext: i = "floating",
384
- altBoundary: p = !1,
385
- padding: v = 0
386
- } = Ee(t, e), d = nn(v), b = r[p ? i === "floating" ? "reference" : "floating" : i], C = Oe(await l.getClippingRect({
387
- element: (n = await (l.isElement == null ? void 0 : l.isElement(b))) == null || n ? b : b.contextElement || await (l.getDocumentElement == null ? void 0 : l.getDocumentElement(r.floating)),
389
+ rootBoundary: d = "viewport",
390
+ elementContext: v = "floating",
391
+ altBoundary: m = !1,
392
+ padding: f = 0
393
+ } = We(n, e), u = mn(f), g = r[m ? v === "floating" ? "reference" : "floating" : v], C = Me(await l.getClippingRect({
394
+ element: (t = await (l.isElement == null ? void 0 : l.isElement(g))) == null || t ? g : g.contextElement || await (l.getDocumentElement == null ? void 0 : l.getDocumentElement(r.floating)),
388
395
  boundary: c,
389
- rootBoundary: f,
390
- strategy: u
391
- })), k = i === "floating" ? {
396
+ rootBoundary: d,
397
+ strategy: i
398
+ })), S = v === "floating" ? {
392
399
  x: o,
393
400
  y: s,
394
401
  width: a.floating.width,
395
402
  height: a.floating.height
396
- } : a.reference, S = await (l.getOffsetParent == null ? void 0 : l.getOffsetParent(r.floating)), O = await (l.isElement == null ? void 0 : l.isElement(S)) ? await (l.getScale == null ? void 0 : l.getScale(S)) || {
403
+ } : a.reference, E = await (l.getOffsetParent == null ? void 0 : l.getOffsetParent(r.floating)), L = await (l.isElement == null ? void 0 : l.isElement(E)) ? await (l.getScale == null ? void 0 : l.getScale(E)) || {
397
404
  x: 1,
398
405
  y: 1
399
406
  } : {
400
407
  x: 1,
401
408
  y: 1
402
- }, A = Oe(l.convertOffsetParentRelativeRectToViewportRelativeRect ? await l.convertOffsetParentRelativeRectToViewportRelativeRect({
409
+ }, P = Me(l.convertOffsetParentRelativeRectToViewportRelativeRect ? await l.convertOffsetParentRelativeRectToViewportRelativeRect({
403
410
  elements: r,
404
- rect: k,
405
- offsetParent: S,
406
- strategy: u
407
- }) : k);
411
+ rect: S,
412
+ offsetParent: E,
413
+ strategy: i
414
+ }) : S);
408
415
  return {
409
- top: (C.top - A.top + d.top) / O.y,
410
- bottom: (A.bottom - C.bottom + d.bottom) / O.y,
411
- left: (C.left - A.left + d.left) / O.x,
412
- right: (A.right - C.right + d.right) / O.x
416
+ top: (C.top - P.top + u.top) / L.y,
417
+ bottom: (P.bottom - C.bottom + u.bottom) / L.y,
418
+ left: (C.left - P.left + u.left) / L.x,
419
+ right: (P.right - C.right + u.right) / L.x
413
420
  };
414
421
  }
415
- const sn = function(e) {
422
+ const gn = function(e) {
416
423
  return e === void 0 && (e = {}), {
417
424
  name: "flip",
418
425
  options: e,
419
- async fn(t) {
420
- var n, o;
426
+ async fn(n) {
427
+ var t, o;
421
428
  const {
422
429
  placement: s,
423
430
  middlewareData: l,
424
431
  rects: a,
425
432
  initialPlacement: r,
426
- platform: u,
433
+ platform: i,
427
434
  elements: c
428
- } = t, {
429
- mainAxis: f = !0,
430
- crossAxis: i = !0,
431
- fallbackPlacements: p,
432
- fallbackStrategy: v = "bestFit",
433
- fallbackAxisSideDirection: d = "none",
434
- flipAlignment: m = !0,
435
- ...b
436
- } = Ee(e, t);
437
- if ((n = l.arrow) != null && n.alignmentOffset)
435
+ } = n, {
436
+ mainAxis: d = !0,
437
+ crossAxis: v = !0,
438
+ fallbackPlacements: m,
439
+ fallbackStrategy: f = "bestFit",
440
+ fallbackAxisSideDirection: u = "none",
441
+ flipAlignment: h = !0,
442
+ ...g
443
+ } = We(e, n);
444
+ if ((t = l.arrow) != null && t.alignmentOffset)
438
445
  return {};
439
- const C = ue(s), k = se(r), S = ue(r) === r, O = await (u.isRTL == null ? void 0 : u.isRTL(c.floating)), A = p || (S || !m ? [Ve(r)] : Yt(r)), M = d !== "none";
440
- !p && M && A.push(...en(r, m, d, O));
441
- const $ = [r, ...A], x = await ft(t, b), y = [];
442
- let N = ((o = l.flip) == null ? void 0 : o.overflows) || [];
443
- if (f && y.push(x[C]), i) {
444
- const te = Xt(s, a, O);
445
- y.push(x[te[0]], x[te[1]]);
446
+ const C = be(s), S = he(r), E = be(r) === r, L = await (i.isRTL == null ? void 0 : i.isRTL(c.floating)), P = m || (E || !h ? [qe(r)] : cn(r)), B = u !== "none";
447
+ !m && B && P.push(...vn(r, h, u, L));
448
+ const b = [r, ...P], p = await Ct(n, g), x = [];
449
+ let R = ((o = l.flip) == null ? void 0 : o.overflows) || [];
450
+ if (d && x.push(p[C]), v) {
451
+ const O = rn(s, a, L);
452
+ x.push(p[O[0]], p[O[1]]);
446
453
  }
447
- if (N = [...N, {
454
+ if (R = [...R, {
448
455
  placement: s,
449
- overflows: y
450
- }], !y.every((te) => te <= 0)) {
451
- var de, Ce;
452
- const te = (((de = l.flip) == null ? void 0 : de.index) || 0) + 1, he = $[te];
453
- if (he && (!(i === "alignment" ? k !== se(he) : !1) || // We leave the current main axis only if every placement on that axis
456
+ overflows: x
457
+ }], !x.every((O) => O <= 0)) {
458
+ var T, M;
459
+ const O = (((T = l.flip) == null ? void 0 : T.index) || 0) + 1, N = b[O];
460
+ if (N && (!(v === "alignment" ? S !== he(N) : !1) || // We leave the current main axis only if every placement on that axis
454
461
  // overflows the main axis.
455
- N.every((V) => se(V.placement) === k ? V.overflows[0] > 0 : !0)))
462
+ R.every((V) => he(V.placement) === S ? V.overflows[0] > 0 : !0)))
456
463
  return {
457
464
  data: {
458
- index: te,
459
- overflows: N
465
+ index: O,
466
+ overflows: R
460
467
  },
461
468
  reset: {
462
- placement: he
469
+ placement: N
463
470
  }
464
471
  };
465
- let B = (Ce = N.filter((E) => E.overflows[0] <= 0).sort((E, V) => E.overflows[1] - V.overflows[1])[0]) == null ? void 0 : Ce.placement;
466
- if (!B)
467
- switch (v) {
472
+ let I = (M = R.filter((W) => W.overflows[0] <= 0).sort((W, V) => W.overflows[1] - V.overflows[1])[0]) == null ? void 0 : M.placement;
473
+ if (!I)
474
+ switch (f) {
468
475
  case "bestFit": {
469
- var ke;
470
- const E = (ke = N.filter((V) => {
471
- if (M) {
472
- const F = se(V.placement);
473
- return F === k || // Create a bias to the `y` side axis due to horizontal
476
+ var A;
477
+ const W = (A = R.filter((V) => {
478
+ if (B) {
479
+ const U = he(V.placement);
480
+ return U === S || // Create a bias to the `y` side axis due to horizontal
474
481
  // reading directions favoring greater width.
475
- F === "y";
482
+ U === "y";
476
483
  }
477
484
  return !0;
478
- }).map((V) => [V.placement, V.overflows.filter((F) => F > 0).reduce((F, we) => F + we, 0)]).sort((V, F) => V[1] - F[1])[0]) == null ? void 0 : ke[0];
479
- E && (B = E);
485
+ }).map((V) => [V.placement, V.overflows.filter((U) => U > 0).reduce((U, ge) => U + ge, 0)]).sort((V, U) => V[1] - U[1])[0]) == null ? void 0 : A[0];
486
+ W && (I = W);
480
487
  break;
481
488
  }
482
489
  case "initialPlacement":
483
- B = r;
490
+ I = r;
484
491
  break;
485
492
  }
486
- if (s !== B)
493
+ if (s !== I)
487
494
  return {
488
495
  reset: {
489
- placement: B
496
+ placement: I
490
497
  }
491
498
  };
492
499
  }
493
500
  return {};
494
501
  }
495
502
  };
496
- }, ln = /* @__PURE__ */ new Set(["left", "top"]);
497
- async function an(e, t) {
503
+ }, yn = /* @__PURE__ */ new Set(["left", "top"]);
504
+ async function wn(e, n) {
498
505
  const {
499
- placement: n,
506
+ placement: t,
500
507
  platform: o,
501
508
  elements: s
502
- } = e, l = await (o.isRTL == null ? void 0 : o.isRTL(s.floating)), a = ue(n), r = Pe(n), u = se(n) === "y", c = ln.has(a) ? -1 : 1, f = l && u ? -1 : 1, i = Ee(t, e);
509
+ } = e, l = await (o.isRTL == null ? void 0 : o.isRTL(s.floating)), a = be(t), r = Ne(t), i = he(t) === "y", c = yn.has(a) ? -1 : 1, d = l && i ? -1 : 1, v = We(n, e);
503
510
  let {
504
- mainAxis: p,
505
- crossAxis: v,
506
- alignmentAxis: d
507
- } = typeof i == "number" ? {
508
- mainAxis: i,
511
+ mainAxis: m,
512
+ crossAxis: f,
513
+ alignmentAxis: u
514
+ } = typeof v == "number" ? {
515
+ mainAxis: v,
509
516
  crossAxis: 0,
510
517
  alignmentAxis: null
511
518
  } : {
512
- mainAxis: i.mainAxis || 0,
513
- crossAxis: i.crossAxis || 0,
514
- alignmentAxis: i.alignmentAxis
519
+ mainAxis: v.mainAxis || 0,
520
+ crossAxis: v.crossAxis || 0,
521
+ alignmentAxis: v.alignmentAxis
515
522
  };
516
- return r && typeof d == "number" && (v = r === "end" ? d * -1 : d), u ? {
517
- x: v * f,
518
- y: p * c
523
+ return r && typeof u == "number" && (f = r === "end" ? u * -1 : u), i ? {
524
+ x: f * d,
525
+ y: m * c
519
526
  } : {
520
- x: p * c,
521
- y: v * f
527
+ x: m * c,
528
+ y: f * d
522
529
  };
523
530
  }
524
- const rn = function(e) {
531
+ const bn = function(e) {
525
532
  return e === void 0 && (e = 0), {
526
533
  name: "offset",
527
534
  options: e,
528
- async fn(t) {
529
- var n, o;
535
+ async fn(n) {
536
+ var t, o;
530
537
  const {
531
538
  x: s,
532
539
  y: l,
533
540
  placement: a,
534
541
  middlewareData: r
535
- } = t, u = await an(t, e);
536
- return a === ((n = r.offset) == null ? void 0 : n.placement) && (o = r.arrow) != null && o.alignmentOffset ? {} : {
537
- x: s + u.x,
538
- y: l + u.y,
542
+ } = n, i = await wn(n, e);
543
+ return a === ((t = r.offset) == null ? void 0 : t.placement) && (o = r.arrow) != null && o.alignmentOffset ? {} : {
544
+ x: s + i.x,
545
+ y: l + i.y,
539
546
  data: {
540
- ...u,
547
+ ...i,
541
548
  placement: a
542
549
  }
543
550
  };
544
551
  }
545
552
  };
546
- }, un = function(e) {
553
+ }, xn = function(e) {
547
554
  return e === void 0 && (e = {}), {
548
555
  name: "shift",
549
556
  options: e,
550
- async fn(t) {
557
+ async fn(n) {
551
558
  const {
552
- x: n,
559
+ x: t,
553
560
  y: o,
554
561
  placement: s
555
- } = t, {
562
+ } = n, {
556
563
  mainAxis: l = !0,
557
564
  crossAxis: a = !1,
558
565
  limiter: r = {
559
- fn: (b) => {
566
+ fn: (g) => {
560
567
  let {
561
568
  x: C,
562
- y: k
563
- } = b;
569
+ y: S
570
+ } = g;
564
571
  return {
565
572
  x: C,
566
- y: k
573
+ y: S
567
574
  };
568
575
  }
569
576
  },
570
- ...u
571
- } = Ee(e, t), c = {
572
- x: n,
577
+ ...i
578
+ } = We(e, n), c = {
579
+ x: t,
573
580
  y: o
574
- }, f = await ft(t, u), i = se(ue(s)), p = ut(i);
575
- let v = c[p], d = c[i];
581
+ }, d = await Ct(n, i), v = he(be(s)), m = bt(v);
582
+ let f = c[m], u = c[v];
576
583
  if (l) {
577
- const b = p === "y" ? "top" : "left", C = p === "y" ? "bottom" : "right", k = v + f[b], S = v - f[C];
578
- v = Xe(k, v, S);
584
+ const g = m === "y" ? "top" : "left", C = m === "y" ? "bottom" : "right", S = f + d[g], E = f - d[C];
585
+ f = lt(S, f, E);
579
586
  }
580
587
  if (a) {
581
- const b = i === "y" ? "top" : "left", C = i === "y" ? "bottom" : "right", k = d + f[b], S = d - f[C];
582
- d = Xe(k, d, S);
588
+ const g = v === "y" ? "top" : "left", C = v === "y" ? "bottom" : "right", S = u + d[g], E = u - d[C];
589
+ u = lt(S, u, E);
583
590
  }
584
- const m = r.fn({
585
- ...t,
586
- [p]: v,
587
- [i]: d
591
+ const h = r.fn({
592
+ ...n,
593
+ [m]: f,
594
+ [v]: u
588
595
  });
589
596
  return {
590
- ...m,
597
+ ...h,
591
598
  data: {
592
- x: m.x - n,
593
- y: m.y - o,
599
+ x: h.x - t,
600
+ y: h.y - o,
594
601
  enabled: {
595
- [p]: l,
596
- [i]: a
602
+ [m]: l,
603
+ [v]: a
597
604
  }
598
605
  }
599
606
  };
600
607
  }
601
608
  };
602
609
  };
603
- function De() {
610
+ function Ke() {
604
611
  return typeof window < "u";
605
612
  }
606
- function ge(e) {
607
- return vt(e) ? (e.nodeName || "").toLowerCase() : "#document";
613
+ function Ee(e) {
614
+ return St(e) ? (e.nodeName || "").toLowerCase() : "#document";
608
615
  }
609
- function H(e) {
610
- var t;
611
- return (e == null || (t = e.ownerDocument) == null ? void 0 : t.defaultView) || window;
616
+ function J(e) {
617
+ var n;
618
+ return (e == null || (n = e.ownerDocument) == null ? void 0 : n.defaultView) || window;
612
619
  }
613
- function ee(e) {
614
- var t;
615
- return (t = (vt(e) ? e.ownerDocument : e.document) || window.document) == null ? void 0 : t.documentElement;
620
+ function ue(e) {
621
+ var n;
622
+ return (n = (St(e) ? e.ownerDocument : e.document) || window.document) == null ? void 0 : n.documentElement;
616
623
  }
617
- function vt(e) {
618
- return De() ? e instanceof Node || e instanceof H(e).Node : !1;
624
+ function St(e) {
625
+ return Ke() ? e instanceof Node || e instanceof J(e).Node : !1;
619
626
  }
620
- function Z(e) {
621
- return De() ? e instanceof Element || e instanceof H(e).Element : !1;
627
+ function se(e) {
628
+ return Ke() ? e instanceof Element || e instanceof J(e).Element : !1;
622
629
  }
623
- function J(e) {
624
- return De() ? e instanceof HTMLElement || e instanceof H(e).HTMLElement : !1;
630
+ function ce(e) {
631
+ return Ke() ? e instanceof HTMLElement || e instanceof J(e).HTMLElement : !1;
625
632
  }
626
- function _e(e) {
627
- return !De() || typeof ShadowRoot > "u" ? !1 : e instanceof ShadowRoot || e instanceof H(e).ShadowRoot;
633
+ function ct(e) {
634
+ return !Ke() || typeof ShadowRoot > "u" ? !1 : e instanceof ShadowRoot || e instanceof J(e).ShadowRoot;
628
635
  }
629
- const cn = /* @__PURE__ */ new Set(["inline", "contents"]);
630
- function xe(e) {
636
+ const kn = /* @__PURE__ */ new Set(["inline", "contents"]);
637
+ function Ve(e) {
631
638
  const {
632
- overflow: t,
633
- overflowX: n,
639
+ overflow: n,
640
+ overflowX: t,
634
641
  overflowY: o,
635
642
  display: s
636
- } = Q(e);
637
- return /auto|scroll|overlay|hidden|clip/.test(t + o + n) && !cn.has(s);
643
+ } = le(e);
644
+ return /auto|scroll|overlay|hidden|clip/.test(n + o + t) && !kn.has(s);
638
645
  }
639
- const dn = /* @__PURE__ */ new Set(["table", "td", "th"]);
640
- function fn(e) {
641
- return dn.has(ge(e));
646
+ const Cn = /* @__PURE__ */ new Set(["table", "td", "th"]);
647
+ function Sn(e) {
648
+ return Cn.has(Ee(e));
642
649
  }
643
- const vn = [":popover-open", ":modal"];
644
- function Le(e) {
645
- return vn.some((t) => {
650
+ const Rn = [":popover-open", ":modal"];
651
+ function ze(e) {
652
+ return Rn.some((n) => {
646
653
  try {
647
- return e.matches(t);
654
+ return e.matches(n);
648
655
  } catch {
649
656
  return !1;
650
657
  }
651
658
  });
652
659
  }
653
- const pn = ["transform", "translate", "scale", "rotate", "perspective"], mn = ["transform", "translate", "scale", "rotate", "perspective", "filter"], gn = ["paint", "layout", "strict", "content"];
654
- function Ke(e) {
655
- const t = We(), n = Z(e) ? Q(e) : e;
656
- return pn.some((o) => n[o] ? n[o] !== "none" : !1) || (n.containerType ? n.containerType !== "normal" : !1) || !t && (n.backdropFilter ? n.backdropFilter !== "none" : !1) || !t && (n.filter ? n.filter !== "none" : !1) || mn.some((o) => (n.willChange || "").includes(o)) || gn.some((o) => (n.contain || "").includes(o));
657
- }
658
- function hn(e) {
659
- let t = ae(e);
660
- for (; J(t) && !me(t); ) {
661
- if (Ke(t))
662
- return t;
663
- if (Le(t))
660
+ const En = ["transform", "translate", "scale", "rotate", "perspective"], $n = ["transform", "translate", "scale", "rotate", "perspective", "filter"], An = ["paint", "layout", "strict", "content"];
661
+ function _e(e) {
662
+ const n = et(), t = se(e) ? le(e) : e;
663
+ return En.some((o) => t[o] ? t[o] !== "none" : !1) || (t.containerType ? t.containerType !== "normal" : !1) || !n && (t.backdropFilter ? t.backdropFilter !== "none" : !1) || !n && (t.filter ? t.filter !== "none" : !1) || $n.some((o) => (t.willChange || "").includes(o)) || An.some((o) => (t.contain || "").includes(o));
664
+ }
665
+ function Fn(e) {
666
+ let n = pe(e);
667
+ for (; ce(n) && !Se(n); ) {
668
+ if (_e(n))
669
+ return n;
670
+ if (ze(n))
664
671
  return null;
665
- t = ae(t);
672
+ n = pe(n);
666
673
  }
667
674
  return null;
668
675
  }
669
- function We() {
676
+ function et() {
670
677
  return typeof CSS > "u" || !CSS.supports ? !1 : CSS.supports("-webkit-backdrop-filter", "none");
671
678
  }
672
- const wn = /* @__PURE__ */ new Set(["html", "body", "#document"]);
673
- function me(e) {
674
- return wn.has(ge(e));
679
+ const Tn = /* @__PURE__ */ new Set(["html", "body", "#document"]);
680
+ function Se(e) {
681
+ return Tn.has(Ee(e));
675
682
  }
676
- function Q(e) {
677
- return H(e).getComputedStyle(e);
683
+ function le(e) {
684
+ return J(e).getComputedStyle(e);
678
685
  }
679
- function Fe(e) {
680
- return Z(e) ? {
686
+ function je(e) {
687
+ return se(e) ? {
681
688
  scrollLeft: e.scrollLeft,
682
689
  scrollTop: e.scrollTop
683
690
  } : {
@@ -685,300 +692,300 @@ function Fe(e) {
685
692
  scrollTop: e.scrollY
686
693
  };
687
694
  }
688
- function ae(e) {
689
- if (ge(e) === "html")
695
+ function pe(e) {
696
+ if (Ee(e) === "html")
690
697
  return e;
691
- const t = (
698
+ const n = (
692
699
  // Step into the shadow DOM of the parent of a slotted node.
693
700
  e.assignedSlot || // DOM Element detected.
694
701
  e.parentNode || // ShadowRoot detected.
695
- _e(e) && e.host || // Fallback.
696
- ee(e)
702
+ ct(e) && e.host || // Fallback.
703
+ ue(e)
697
704
  );
698
- return _e(t) ? t.host : t;
705
+ return ct(n) ? n.host : n;
699
706
  }
700
- function pt(e) {
701
- const t = ae(e);
702
- return me(t) ? e.ownerDocument ? e.ownerDocument.body : e.body : J(t) && xe(t) ? t : pt(t);
707
+ function Rt(e) {
708
+ const n = pe(e);
709
+ return Se(n) ? e.ownerDocument ? e.ownerDocument.body : e.body : ce(n) && Ve(n) ? n : Rt(n);
703
710
  }
704
- function be(e, t, n) {
711
+ function Oe(e, n, t) {
705
712
  var o;
706
- t === void 0 && (t = []), n === void 0 && (n = !0);
707
- const s = pt(e), l = s === ((o = e.ownerDocument) == null ? void 0 : o.body), a = H(s);
713
+ n === void 0 && (n = []), t === void 0 && (t = !0);
714
+ const s = Rt(e), l = s === ((o = e.ownerDocument) == null ? void 0 : o.body), a = J(s);
708
715
  if (l) {
709
- const r = He(a);
710
- return t.concat(a, a.visualViewport || [], xe(s) ? s : [], r && n ? be(r) : []);
716
+ const r = Je(a);
717
+ return n.concat(a, a.visualViewport || [], Ve(s) ? s : [], r && t ? Oe(r) : []);
711
718
  }
712
- return t.concat(s, be(s, [], n));
719
+ return n.concat(s, Oe(s, [], t));
713
720
  }
714
- function He(e) {
721
+ function Je(e) {
715
722
  return e.parent && Object.getPrototypeOf(e.parent) ? e.frameElement : null;
716
723
  }
717
- function mt(e) {
718
- const t = Q(e);
719
- let n = parseFloat(t.width) || 0, o = parseFloat(t.height) || 0;
720
- const s = J(e), l = s ? e.offsetWidth : n, a = s ? e.offsetHeight : o, r = $e(n) !== l || $e(o) !== a;
721
- return r && (n = l, o = a), {
722
- width: n,
724
+ function Et(e) {
725
+ const n = le(e);
726
+ let t = parseFloat(n.width) || 0, o = parseFloat(n.height) || 0;
727
+ const s = ce(e), l = s ? e.offsetWidth : t, a = s ? e.offsetHeight : o, r = Ie(t) !== l || Ie(o) !== a;
728
+ return r && (t = l, o = a), {
729
+ width: t,
723
730
  height: o,
724
731
  $: r
725
732
  };
726
733
  }
727
- function Ue(e) {
728
- return Z(e) ? e : e.contextElement;
734
+ function tt(e) {
735
+ return se(e) ? e : e.contextElement;
729
736
  }
730
- function ve(e) {
731
- const t = Ue(e);
732
- if (!J(t))
733
- return Y(1);
734
- const n = t.getBoundingClientRect(), {
737
+ function ke(e) {
738
+ const n = tt(e);
739
+ if (!ce(n))
740
+ return ie(1);
741
+ const t = n.getBoundingClientRect(), {
735
742
  width: o,
736
743
  height: s,
737
744
  $: l
738
- } = mt(t);
739
- let a = (l ? $e(n.width) : n.width) / o, r = (l ? $e(n.height) : n.height) / s;
745
+ } = Et(n);
746
+ let a = (l ? Ie(t.width) : t.width) / o, r = (l ? Ie(t.height) : t.height) / s;
740
747
  return (!a || !Number.isFinite(a)) && (a = 1), (!r || !Number.isFinite(r)) && (r = 1), {
741
748
  x: a,
742
749
  y: r
743
750
  };
744
751
  }
745
- const yn = /* @__PURE__ */ Y(0);
746
- function gt(e) {
747
- const t = H(e);
748
- return !We() || !t.visualViewport ? yn : {
749
- x: t.visualViewport.offsetLeft,
750
- y: t.visualViewport.offsetTop
752
+ const On = /* @__PURE__ */ ie(0);
753
+ function $t(e) {
754
+ const n = J(e);
755
+ return !et() || !n.visualViewport ? On : {
756
+ x: n.visualViewport.offsetLeft,
757
+ y: n.visualViewport.offsetTop
751
758
  };
752
759
  }
753
- function bn(e, t, n) {
754
- return t === void 0 && (t = !1), !n || t && n !== H(e) ? !1 : t;
760
+ function Vn(e, n, t) {
761
+ return n === void 0 && (n = !1), !t || n && t !== J(e) ? !1 : n;
755
762
  }
756
- function ce(e, t, n, o) {
757
- t === void 0 && (t = !1), n === void 0 && (n = !1);
758
- const s = e.getBoundingClientRect(), l = Ue(e);
759
- let a = Y(1);
760
- t && (o ? Z(o) && (a = ve(o)) : a = ve(e));
761
- const r = bn(l, n, o) ? gt(l) : Y(0);
762
- let u = (s.left + r.x) / a.x, c = (s.top + r.y) / a.y, f = s.width / a.x, i = s.height / a.y;
763
+ function xe(e, n, t, o) {
764
+ n === void 0 && (n = !1), t === void 0 && (t = !1);
765
+ const s = e.getBoundingClientRect(), l = tt(e);
766
+ let a = ie(1);
767
+ n && (o ? se(o) && (a = ke(o)) : a = ke(e));
768
+ const r = Vn(l, t, o) ? $t(l) : ie(0);
769
+ let i = (s.left + r.x) / a.x, c = (s.top + r.y) / a.y, d = s.width / a.x, v = s.height / a.y;
763
770
  if (l) {
764
- const p = H(l), v = o && Z(o) ? H(o) : o;
765
- let d = p, m = He(d);
766
- for (; m && o && v !== d; ) {
767
- const b = ve(m), C = m.getBoundingClientRect(), k = Q(m), S = C.left + (m.clientLeft + parseFloat(k.paddingLeft)) * b.x, O = C.top + (m.clientTop + parseFloat(k.paddingTop)) * b.y;
768
- u *= b.x, c *= b.y, f *= b.x, i *= b.y, u += S, c += O, d = H(m), m = He(d);
771
+ const m = J(l), f = o && se(o) ? J(o) : o;
772
+ let u = m, h = Je(u);
773
+ for (; h && o && f !== u; ) {
774
+ const g = ke(h), C = h.getBoundingClientRect(), S = le(h), E = C.left + (h.clientLeft + parseFloat(S.paddingLeft)) * g.x, L = C.top + (h.clientTop + parseFloat(S.paddingTop)) * g.y;
775
+ i *= g.x, c *= g.y, d *= g.x, v *= g.y, i += E, c += L, u = J(h), h = Je(u);
769
776
  }
770
777
  }
771
- return Oe({
772
- width: f,
773
- height: i,
774
- x: u,
778
+ return Me({
779
+ width: d,
780
+ height: v,
781
+ x: i,
775
782
  y: c
776
783
  });
777
784
  }
778
- function Be(e, t) {
779
- const n = Fe(e).scrollLeft;
780
- return t ? t.left + n : ce(ee(e)).left + n;
785
+ function Ue(e, n) {
786
+ const t = je(e).scrollLeft;
787
+ return n ? n.left + t : xe(ue(e)).left + t;
781
788
  }
782
- function ht(e, t) {
783
- const n = e.getBoundingClientRect(), o = n.left + t.scrollLeft - Be(e, n), s = n.top + t.scrollTop;
789
+ function At(e, n) {
790
+ const t = e.getBoundingClientRect(), o = t.left + n.scrollLeft - Ue(e, t), s = t.top + n.scrollTop;
784
791
  return {
785
792
  x: o,
786
793
  y: s
787
794
  };
788
795
  }
789
- function xn(e) {
796
+ function Ln(e) {
790
797
  let {
791
- elements: t,
792
- rect: n,
798
+ elements: n,
799
+ rect: t,
793
800
  offsetParent: o,
794
801
  strategy: s
795
802
  } = e;
796
- const l = s === "fixed", a = ee(o), r = t ? Le(t.floating) : !1;
803
+ const l = s === "fixed", a = ue(o), r = n ? ze(n.floating) : !1;
797
804
  if (o === a || r && l)
798
- return n;
799
- let u = {
805
+ return t;
806
+ let i = {
800
807
  scrollLeft: 0,
801
808
  scrollTop: 0
802
- }, c = Y(1);
803
- const f = Y(0), i = J(o);
804
- if ((i || !i && !l) && ((ge(o) !== "body" || xe(a)) && (u = Fe(o)), J(o))) {
805
- const v = ce(o);
806
- c = ve(o), f.x = v.x + o.clientLeft, f.y = v.y + o.clientTop;
809
+ }, c = ie(1);
810
+ const d = ie(0), v = ce(o);
811
+ if ((v || !v && !l) && ((Ee(o) !== "body" || Ve(a)) && (i = je(o)), ce(o))) {
812
+ const f = xe(o);
813
+ c = ke(o), d.x = f.x + o.clientLeft, d.y = f.y + o.clientTop;
807
814
  }
808
- const p = a && !i && !l ? ht(a, u) : Y(0);
815
+ const m = a && !v && !l ? At(a, i) : ie(0);
809
816
  return {
810
- width: n.width * c.x,
811
- height: n.height * c.y,
812
- x: n.x * c.x - u.scrollLeft * c.x + f.x + p.x,
813
- y: n.y * c.y - u.scrollTop * c.y + f.y + p.y
817
+ width: t.width * c.x,
818
+ height: t.height * c.y,
819
+ x: t.x * c.x - i.scrollLeft * c.x + d.x + m.x,
820
+ y: t.y * c.y - i.scrollTop * c.y + d.y + m.y
814
821
  };
815
822
  }
816
- function Cn(e) {
823
+ function Pn(e) {
817
824
  return Array.from(e.getClientRects());
818
825
  }
819
- function kn(e) {
820
- const t = ee(e), n = Fe(e), o = e.ownerDocument.body, s = ie(t.scrollWidth, t.clientWidth, o.scrollWidth, o.clientWidth), l = ie(t.scrollHeight, t.clientHeight, o.scrollHeight, o.clientHeight);
821
- let a = -n.scrollLeft + Be(e);
822
- const r = -n.scrollTop;
823
- return Q(o).direction === "rtl" && (a += ie(t.clientWidth, o.clientWidth) - s), {
826
+ function Dn(e) {
827
+ const n = ue(e), t = je(e), o = e.ownerDocument.body, s = we(n.scrollWidth, n.clientWidth, o.scrollWidth, o.clientWidth), l = we(n.scrollHeight, n.clientHeight, o.scrollHeight, o.clientHeight);
828
+ let a = -t.scrollLeft + Ue(e);
829
+ const r = -t.scrollTop;
830
+ return le(o).direction === "rtl" && (a += we(n.clientWidth, o.clientWidth) - s), {
824
831
  width: s,
825
832
  height: l,
826
833
  x: a,
827
834
  y: r
828
835
  };
829
836
  }
830
- const et = 25;
831
- function Rn(e, t) {
832
- const n = H(e), o = ee(e), s = n.visualViewport;
833
- let l = o.clientWidth, a = o.clientHeight, r = 0, u = 0;
837
+ const ut = 25;
838
+ function In(e, n) {
839
+ const t = J(e), o = ue(e), s = t.visualViewport;
840
+ let l = o.clientWidth, a = o.clientHeight, r = 0, i = 0;
834
841
  if (s) {
835
842
  l = s.width, a = s.height;
836
- const f = We();
837
- (!f || f && t === "fixed") && (r = s.offsetLeft, u = s.offsetTop);
843
+ const d = et();
844
+ (!d || d && n === "fixed") && (r = s.offsetLeft, i = s.offsetTop);
838
845
  }
839
- const c = Be(o);
846
+ const c = Ue(o);
840
847
  if (c <= 0) {
841
- const f = o.ownerDocument, i = f.body, p = getComputedStyle(i), v = f.compatMode === "CSS1Compat" && parseFloat(p.marginLeft) + parseFloat(p.marginRight) || 0, d = Math.abs(o.clientWidth - i.clientWidth - v);
842
- d <= et && (l -= d);
843
- } else c <= et && (l += c);
848
+ const d = o.ownerDocument, v = d.body, m = getComputedStyle(v), f = d.compatMode === "CSS1Compat" && parseFloat(m.marginLeft) + parseFloat(m.marginRight) || 0, u = Math.abs(o.clientWidth - v.clientWidth - f);
849
+ u <= ut && (l -= u);
850
+ } else c <= ut && (l += c);
844
851
  return {
845
852
  width: l,
846
853
  height: a,
847
854
  x: r,
848
- y: u
855
+ y: i
849
856
  };
850
857
  }
851
- const Sn = /* @__PURE__ */ new Set(["absolute", "fixed"]);
852
- function Tn(e, t) {
853
- const n = ce(e, !0, t === "fixed"), o = n.top + e.clientTop, s = n.left + e.clientLeft, l = J(e) ? ve(e) : Y(1), a = e.clientWidth * l.x, r = e.clientHeight * l.y, u = s * l.x, c = o * l.y;
858
+ const qn = /* @__PURE__ */ new Set(["absolute", "fixed"]);
859
+ function Mn(e, n) {
860
+ const t = xe(e, !0, n === "fixed"), o = t.top + e.clientTop, s = t.left + e.clientLeft, l = ce(e) ? ke(e) : ie(1), a = e.clientWidth * l.x, r = e.clientHeight * l.y, i = s * l.x, c = o * l.y;
854
861
  return {
855
862
  width: a,
856
863
  height: r,
857
- x: u,
864
+ x: i,
858
865
  y: c
859
866
  };
860
867
  }
861
- function tt(e, t, n) {
868
+ function dt(e, n, t) {
862
869
  let o;
863
- if (t === "viewport")
864
- o = Rn(e, n);
865
- else if (t === "document")
866
- o = kn(ee(e));
867
- else if (Z(t))
868
- o = Tn(t, n);
870
+ if (n === "viewport")
871
+ o = In(e, t);
872
+ else if (n === "document")
873
+ o = Dn(ue(e));
874
+ else if (se(n))
875
+ o = Mn(n, t);
869
876
  else {
870
- const s = gt(e);
877
+ const s = $t(e);
871
878
  o = {
872
- x: t.x - s.x,
873
- y: t.y - s.y,
874
- width: t.width,
875
- height: t.height
879
+ x: n.x - s.x,
880
+ y: n.y - s.y,
881
+ width: n.width,
882
+ height: n.height
876
883
  };
877
884
  }
878
- return Oe(o);
885
+ return Me(o);
879
886
  }
880
- function wt(e, t) {
881
- const n = ae(e);
882
- return n === t || !Z(n) || me(n) ? !1 : Q(n).position === "fixed" || wt(n, t);
887
+ function Ft(e, n) {
888
+ const t = pe(e);
889
+ return t === n || !se(t) || Se(t) ? !1 : le(t).position === "fixed" || Ft(t, n);
883
890
  }
884
- function $n(e, t) {
885
- const n = t.get(e);
886
- if (n)
887
- return n;
888
- let o = be(e, [], !1).filter((r) => Z(r) && ge(r) !== "body"), s = null;
889
- const l = Q(e).position === "fixed";
890
- let a = l ? ae(e) : e;
891
- for (; Z(a) && !me(a); ) {
892
- const r = Q(a), u = Ke(a);
893
- !u && r.position === "fixed" && (s = null), (l ? !u && !s : !u && r.position === "static" && !!s && Sn.has(s.position) || xe(a) && !u && wt(e, a)) ? o = o.filter((f) => f !== a) : s = r, a = ae(a);
891
+ function Bn(e, n) {
892
+ const t = n.get(e);
893
+ if (t)
894
+ return t;
895
+ let o = Oe(e, [], !1).filter((r) => se(r) && Ee(r) !== "body"), s = null;
896
+ const l = le(e).position === "fixed";
897
+ let a = l ? pe(e) : e;
898
+ for (; se(a) && !Se(a); ) {
899
+ const r = le(a), i = _e(a);
900
+ !i && r.position === "fixed" && (s = null), (l ? !i && !s : !i && r.position === "static" && !!s && qn.has(s.position) || Ve(a) && !i && Ft(e, a)) ? o = o.filter((d) => d !== a) : s = r, a = pe(a);
894
901
  }
895
- return t.set(e, o), o;
902
+ return n.set(e, o), o;
896
903
  }
897
- function Vn(e) {
904
+ function Hn(e) {
898
905
  let {
899
- element: t,
900
- boundary: n,
906
+ element: n,
907
+ boundary: t,
901
908
  rootBoundary: o,
902
909
  strategy: s
903
910
  } = e;
904
- const a = [...n === "clippingAncestors" ? Le(t) ? [] : $n(t, this._c) : [].concat(n), o], r = a[0], u = a.reduce((c, f) => {
905
- const i = tt(t, f, s);
906
- return c.top = ie(i.top, c.top), c.right = Te(i.right, c.right), c.bottom = Te(i.bottom, c.bottom), c.left = ie(i.left, c.left), c;
907
- }, tt(t, r, s));
911
+ const a = [...t === "clippingAncestors" ? ze(n) ? [] : Bn(n, this._c) : [].concat(t), o], r = a[0], i = a.reduce((c, d) => {
912
+ const v = dt(n, d, s);
913
+ return c.top = we(v.top, c.top), c.right = De(v.right, c.right), c.bottom = De(v.bottom, c.bottom), c.left = we(v.left, c.left), c;
914
+ }, dt(n, r, s));
908
915
  return {
909
- width: u.right - u.left,
910
- height: u.bottom - u.top,
911
- x: u.left,
912
- y: u.top
916
+ width: i.right - i.left,
917
+ height: i.bottom - i.top,
918
+ x: i.left,
919
+ y: i.top
913
920
  };
914
921
  }
915
- function On(e) {
922
+ function Wn(e) {
916
923
  const {
917
- width: t,
918
- height: n
919
- } = mt(e);
924
+ width: n,
925
+ height: t
926
+ } = Et(e);
920
927
  return {
921
- width: t,
922
- height: n
928
+ width: n,
929
+ height: t
923
930
  };
924
931
  }
925
- function An(e, t, n) {
926
- const o = J(t), s = ee(t), l = n === "fixed", a = ce(e, !0, l, t);
932
+ function Nn(e, n, t) {
933
+ const o = ce(n), s = ue(n), l = t === "fixed", a = xe(e, !0, l, n);
927
934
  let r = {
928
935
  scrollLeft: 0,
929
936
  scrollTop: 0
930
937
  };
931
- const u = Y(0);
938
+ const i = ie(0);
932
939
  function c() {
933
- u.x = Be(s);
940
+ i.x = Ue(s);
934
941
  }
935
942
  if (o || !o && !l)
936
- if ((ge(t) !== "body" || xe(s)) && (r = Fe(t)), o) {
937
- const v = ce(t, !0, l, t);
938
- u.x = v.x + t.clientLeft, u.y = v.y + t.clientTop;
943
+ if ((Ee(n) !== "body" || Ve(s)) && (r = je(n)), o) {
944
+ const f = xe(n, !0, l, n);
945
+ i.x = f.x + n.clientLeft, i.y = f.y + n.clientTop;
939
946
  } else s && c();
940
947
  l && !o && s && c();
941
- const f = s && !o && !l ? ht(s, r) : Y(0), i = a.left + r.scrollLeft - u.x - f.x, p = a.top + r.scrollTop - u.y - f.y;
948
+ const d = s && !o && !l ? At(s, r) : ie(0), v = a.left + r.scrollLeft - i.x - d.x, m = a.top + r.scrollTop - i.y - d.y;
942
949
  return {
943
- x: i,
944
- y: p,
950
+ x: v,
951
+ y: m,
945
952
  width: a.width,
946
953
  height: a.height
947
954
  };
948
955
  }
949
- function qe(e) {
950
- return Q(e).position === "static";
956
+ function Qe(e) {
957
+ return le(e).position === "static";
951
958
  }
952
- function nt(e, t) {
953
- if (!J(e) || Q(e).position === "fixed")
959
+ function ft(e, n) {
960
+ if (!ce(e) || le(e).position === "fixed")
954
961
  return null;
955
- if (t)
956
- return t(e);
957
- let n = e.offsetParent;
958
- return ee(e) === n && (n = n.ownerDocument.body), n;
959
- }
960
- function yt(e, t) {
961
- const n = H(e);
962
- if (Le(e))
963
- return n;
964
- if (!J(e)) {
965
- let s = ae(e);
966
- for (; s && !me(s); ) {
967
- if (Z(s) && !qe(s))
962
+ if (n)
963
+ return n(e);
964
+ let t = e.offsetParent;
965
+ return ue(e) === t && (t = t.ownerDocument.body), t;
966
+ }
967
+ function Tt(e, n) {
968
+ const t = J(e);
969
+ if (ze(e))
970
+ return t;
971
+ if (!ce(e)) {
972
+ let s = pe(e);
973
+ for (; s && !Se(s); ) {
974
+ if (se(s) && !Qe(s))
968
975
  return s;
969
- s = ae(s);
976
+ s = pe(s);
970
977
  }
971
- return n;
978
+ return t;
972
979
  }
973
- let o = nt(e, t);
974
- for (; o && fn(o) && qe(o); )
975
- o = nt(o, t);
976
- return o && me(o) && qe(o) && !Ke(o) ? n : o || hn(e) || n;
980
+ let o = ft(e, n);
981
+ for (; o && Sn(o) && Qe(o); )
982
+ o = ft(o, n);
983
+ return o && Se(o) && Qe(o) && !_e(o) ? t : o || Fn(e) || t;
977
984
  }
978
- const En = async function(e) {
979
- const t = this.getOffsetParent || yt, n = this.getDimensions, o = await n(e.floating);
985
+ const Kn = async function(e) {
986
+ const n = this.getOffsetParent || Tt, t = this.getDimensions, o = await t(e.floating);
980
987
  return {
981
- reference: An(e.reference, await t(e.floating), e.strategy),
988
+ reference: Nn(e.reference, await n(e.floating), e.strategy),
982
989
  floating: {
983
990
  x: 0,
984
991
  y: 0,
@@ -987,123 +994,123 @@ const En = async function(e) {
987
994
  }
988
995
  };
989
996
  };
990
- function Pn(e) {
991
- return Q(e).direction === "rtl";
992
- }
993
- const Dn = {
994
- convertOffsetParentRelativeRectToViewportRelativeRect: xn,
995
- getDocumentElement: ee,
996
- getClippingRect: Vn,
997
- getOffsetParent: yt,
998
- getElementRects: En,
999
- getClientRects: Cn,
1000
- getDimensions: On,
1001
- getScale: ve,
1002
- isElement: Z,
1003
- isRTL: Pn
997
+ function zn(e) {
998
+ return le(e).direction === "rtl";
999
+ }
1000
+ const jn = {
1001
+ convertOffsetParentRelativeRectToViewportRelativeRect: Ln,
1002
+ getDocumentElement: ue,
1003
+ getClippingRect: Hn,
1004
+ getOffsetParent: Tt,
1005
+ getElementRects: Kn,
1006
+ getClientRects: Pn,
1007
+ getDimensions: Wn,
1008
+ getScale: ke,
1009
+ isElement: se,
1010
+ isRTL: zn
1004
1011
  };
1005
- function bt(e, t) {
1006
- return e.x === t.x && e.y === t.y && e.width === t.width && e.height === t.height;
1012
+ function Ot(e, n) {
1013
+ return e.x === n.x && e.y === n.y && e.width === n.width && e.height === n.height;
1007
1014
  }
1008
- function Ln(e, t) {
1009
- let n = null, o;
1010
- const s = ee(e);
1015
+ function Un(e, n) {
1016
+ let t = null, o;
1017
+ const s = ue(e);
1011
1018
  function l() {
1012
1019
  var r;
1013
- clearTimeout(o), (r = n) == null || r.disconnect(), n = null;
1020
+ clearTimeout(o), (r = t) == null || r.disconnect(), t = null;
1014
1021
  }
1015
- function a(r, u) {
1016
- r === void 0 && (r = !1), u === void 0 && (u = 1), l();
1022
+ function a(r, i) {
1023
+ r === void 0 && (r = !1), i === void 0 && (i = 1), l();
1017
1024
  const c = e.getBoundingClientRect(), {
1018
- left: f,
1019
- top: i,
1020
- width: p,
1021
- height: v
1025
+ left: d,
1026
+ top: v,
1027
+ width: m,
1028
+ height: f
1022
1029
  } = c;
1023
- if (r || t(), !p || !v)
1030
+ if (r || n(), !m || !f)
1024
1031
  return;
1025
- const d = Re(i), m = Re(s.clientWidth - (f + p)), b = Re(s.clientHeight - (i + v)), C = Re(f), S = {
1026
- rootMargin: -d + "px " + -m + "px " + -b + "px " + -C + "px",
1027
- threshold: ie(0, Te(1, u)) || 1
1032
+ const u = Le(v), h = Le(s.clientWidth - (d + m)), g = Le(s.clientHeight - (v + f)), C = Le(d), E = {
1033
+ rootMargin: -u + "px " + -h + "px " + -g + "px " + -C + "px",
1034
+ threshold: we(0, De(1, i)) || 1
1028
1035
  };
1029
- let O = !0;
1030
- function A(M) {
1031
- const $ = M[0].intersectionRatio;
1032
- if ($ !== u) {
1033
- if (!O)
1036
+ let L = !0;
1037
+ function P(B) {
1038
+ const b = B[0].intersectionRatio;
1039
+ if (b !== i) {
1040
+ if (!L)
1034
1041
  return a();
1035
- $ ? a(!1, $) : o = setTimeout(() => {
1042
+ b ? a(!1, b) : o = setTimeout(() => {
1036
1043
  a(!1, 1e-7);
1037
1044
  }, 1e3);
1038
1045
  }
1039
- $ === 1 && !bt(c, e.getBoundingClientRect()) && a(), O = !1;
1046
+ b === 1 && !Ot(c, e.getBoundingClientRect()) && a(), L = !1;
1040
1047
  }
1041
1048
  try {
1042
- n = new IntersectionObserver(A, {
1043
- ...S,
1049
+ t = new IntersectionObserver(P, {
1050
+ ...E,
1044
1051
  // Handle <iframe>s
1045
1052
  root: s.ownerDocument
1046
1053
  });
1047
1054
  } catch {
1048
- n = new IntersectionObserver(A, S);
1055
+ t = new IntersectionObserver(P, E);
1049
1056
  }
1050
- n.observe(e);
1057
+ t.observe(e);
1051
1058
  }
1052
1059
  return a(!0), l;
1053
1060
  }
1054
- function Fn(e, t, n, o) {
1061
+ function Zn(e, n, t, o) {
1055
1062
  o === void 0 && (o = {});
1056
1063
  const {
1057
1064
  ancestorScroll: s = !0,
1058
1065
  ancestorResize: l = !0,
1059
1066
  elementResize: a = typeof ResizeObserver == "function",
1060
1067
  layoutShift: r = typeof IntersectionObserver == "function",
1061
- animationFrame: u = !1
1062
- } = o, c = Ue(e), f = s || l ? [...c ? be(c) : [], ...be(t)] : [];
1063
- f.forEach((C) => {
1064
- s && C.addEventListener("scroll", n, {
1068
+ animationFrame: i = !1
1069
+ } = o, c = tt(e), d = s || l ? [...c ? Oe(c) : [], ...Oe(n)] : [];
1070
+ d.forEach((C) => {
1071
+ s && C.addEventListener("scroll", t, {
1065
1072
  passive: !0
1066
- }), l && C.addEventListener("resize", n);
1073
+ }), l && C.addEventListener("resize", t);
1067
1074
  });
1068
- const i = c && r ? Ln(c, n) : null;
1069
- let p = -1, v = null;
1070
- a && (v = new ResizeObserver((C) => {
1071
- let [k] = C;
1072
- k && k.target === c && v && (v.unobserve(t), cancelAnimationFrame(p), p = requestAnimationFrame(() => {
1073
- var S;
1074
- (S = v) == null || S.observe(t);
1075
- })), n();
1076
- }), c && !u && v.observe(c), v.observe(t));
1077
- let d, m = u ? ce(e) : null;
1078
- u && b();
1079
- function b() {
1080
- const C = ce(e);
1081
- m && !bt(m, C) && n(), m = C, d = requestAnimationFrame(b);
1075
+ const v = c && r ? Un(c, t) : null;
1076
+ let m = -1, f = null;
1077
+ a && (f = new ResizeObserver((C) => {
1078
+ let [S] = C;
1079
+ S && S.target === c && f && (f.unobserve(n), cancelAnimationFrame(m), m = requestAnimationFrame(() => {
1080
+ var E;
1081
+ (E = f) == null || E.observe(n);
1082
+ })), t();
1083
+ }), c && !i && f.observe(c), f.observe(n));
1084
+ let u, h = i ? xe(e) : null;
1085
+ i && g();
1086
+ function g() {
1087
+ const C = xe(e);
1088
+ h && !Ot(h, C) && t(), h = C, u = requestAnimationFrame(g);
1082
1089
  }
1083
- return n(), () => {
1090
+ return t(), () => {
1084
1091
  var C;
1085
- f.forEach((k) => {
1086
- s && k.removeEventListener("scroll", n), l && k.removeEventListener("resize", n);
1087
- }), i?.(), (C = v) == null || C.disconnect(), v = null, u && cancelAnimationFrame(d);
1092
+ d.forEach((S) => {
1093
+ s && S.removeEventListener("scroll", t), l && S.removeEventListener("resize", t);
1094
+ }), v?.(), (C = f) == null || C.disconnect(), f = null, i && cancelAnimationFrame(u);
1088
1095
  };
1089
1096
  }
1090
- const Bn = rn, Mn = un, qn = sn, Nn = (e, t, n) => {
1097
+ const Xn = bn, Qn = xn, Yn = gn, Gn = (e, n, t) => {
1091
1098
  const o = /* @__PURE__ */ new Map(), s = {
1092
- platform: Dn,
1093
- ...n
1099
+ platform: jn,
1100
+ ...t
1094
1101
  }, l = {
1095
1102
  ...s.platform,
1096
1103
  _c: o
1097
1104
  };
1098
- return on(e, t, {
1105
+ return pn(e, n, {
1099
1106
  ...s,
1100
1107
  platform: l
1101
1108
  });
1102
- }, Ae = {
1103
- text: (e, t, n) => {
1104
- const o = String(e[t] ?? "").toLowerCase(), s = (n.value ?? "").toLowerCase().trim();
1105
- if (!s && !["empty", "notEmpty"].includes(n.operator ?? "")) return !0;
1106
- switch (n.operator) {
1109
+ }, Be = {
1110
+ text: (e, n, t) => {
1111
+ const o = String(e[n] ?? "").toLowerCase(), s = (t.value ?? "").toLowerCase().trim();
1112
+ if (!s && !["empty", "notEmpty"].includes(t.operator ?? "")) return !0;
1113
+ switch (t.operator) {
1107
1114
  case "contains":
1108
1115
  return o.includes(s);
1109
1116
  case "doesNotContains":
@@ -1124,34 +1131,34 @@ const Bn = rn, Mn = un, qn = sn, Nn = (e, t, n) => {
1124
1131
  return !0;
1125
1132
  }
1126
1133
  },
1127
- "multi-select": (e, t, n) => n.value?.length ? n.value.includes(String(e[t])) : !0,
1128
- "number-range": (e, t, n) => {
1129
- const o = Number(e[t]);
1134
+ "multi-select": (e, n, t) => t.value?.length ? t.value.includes(String(e[n])) : !0,
1135
+ "number-range": (e, n, t) => {
1136
+ const o = Number(e[n]);
1130
1137
  if (isNaN(o)) return !1;
1131
- switch (n.operator) {
1138
+ switch (t.operator) {
1132
1139
  case "between":
1133
- return !(n.min != null && o < n.min || n.max != null && o > n.max);
1140
+ return !(t.min != null && o < t.min || t.max != null && o > t.max);
1134
1141
  case "equals":
1135
- return o === Number(n.value);
1142
+ return o === Number(t.value);
1136
1143
  case "notEqual":
1137
- return o !== Number(n.value);
1144
+ return o !== Number(t.value);
1138
1145
  case "greaterThan":
1139
- return o > Number(n.value);
1146
+ return o > Number(t.value);
1140
1147
  case "lessThan":
1141
- return o < Number(n.value);
1148
+ return o < Number(t.value);
1142
1149
  case "empty":
1143
- return e[t] == null || e[t] === "";
1150
+ return e[n] == null || e[n] === "";
1144
1151
  case "notEmpty":
1145
- return e[t] != null && e[t] !== "";
1152
+ return e[n] != null && e[n] !== "";
1146
1153
  default:
1147
1154
  return !0;
1148
1155
  }
1149
1156
  },
1150
- "date-range": (e, t, n) => {
1151
- const o = new Date(String(e[t]));
1157
+ "date-range": (e, n, t) => {
1158
+ const o = new Date(String(e[n]));
1152
1159
  if (isNaN(o.getTime())) return !1;
1153
- const s = n.value ?? null, l = n.start ? new Date(n.start) : null, a = n.end ? new Date(n.end) : null;
1154
- switch (n.operator ?? "between") {
1160
+ const s = t.value ?? null, l = t.start ? new Date(t.start) : null, a = t.end ? new Date(t.end) : null;
1161
+ switch (t.operator ?? "between") {
1155
1162
  case "between":
1156
1163
  return !(l && o < l || a && o > a);
1157
1164
  case "equals":
@@ -1163,56 +1170,56 @@ const Bn = rn, Mn = un, qn = sn, Nn = (e, t, n) => {
1163
1170
  case "after":
1164
1171
  return s ? o > new Date(s) : !0;
1165
1172
  case "empty":
1166
- return e[t] == null || e[t] === "";
1173
+ return e[n] == null || e[n] === "";
1167
1174
  case "notEmpty":
1168
- return e[t] != null && e[t] !== "";
1175
+ return e[n] != null && e[n] !== "";
1169
1176
  default:
1170
1177
  return !0;
1171
1178
  }
1172
1179
  },
1173
1180
  // Default handler for custom filters
1174
- custom: (e, t, n) => {
1175
- const o = e[t];
1176
- if (typeof n.filterFn == "function")
1177
- return n.filterFn(o, n.value, e);
1178
- if (n.filterKey && Object.prototype.hasOwnProperty.call(Ae, n.filterKey)) {
1179
- const s = Ae[n.filterKey];
1181
+ custom: (e, n, t) => {
1182
+ const o = e[n];
1183
+ if (typeof t.filterFn == "function")
1184
+ return t.filterFn(o, t.value, e);
1185
+ if (t.filterKey && Object.prototype.hasOwnProperty.call(Be, t.filterKey)) {
1186
+ const s = Be[t.filterKey];
1180
1187
  if (typeof s == "function")
1181
- return s(e, t, n);
1188
+ return s(e, n, t);
1182
1189
  }
1183
1190
  return !0;
1184
1191
  }
1185
1192
  };
1186
- function pe(e, t) {
1187
- const n = {
1188
- operator: t?.operator,
1189
- value: t?.value ?? null
1193
+ function Ce(e, n) {
1194
+ const t = {
1195
+ operator: n?.operator,
1196
+ value: n?.value ?? null
1190
1197
  };
1191
1198
  switch (e) {
1192
1199
  case "text": {
1193
1200
  const s = { type: e, value: "", operator: "contains" };
1194
- return t?.type === "text" ? { ...s, ...t } : s;
1201
+ return n?.type === "text" ? { ...s, ...n } : s;
1195
1202
  }
1196
1203
  case "multi-select": {
1197
1204
  const s = { type: e, value: [], operator: "in" };
1198
- return t?.type === "multi-select" ? { ...s, ...t } : s;
1205
+ return n?.type === "multi-select" ? { ...s, ...n } : s;
1199
1206
  }
1200
1207
  case "number-range": {
1201
1208
  const s = { type: e, operator: "between", value: null, min: null, max: null };
1202
- return t?.type === "number-range" ? { ...s, ...t } : s;
1209
+ return n?.type === "number-range" ? { ...s, ...n } : s;
1203
1210
  }
1204
1211
  case "date-range": {
1205
1212
  const s = { type: e, operator: "between", value: null, start: null, end: null };
1206
- return t?.type === "date-range" ? { ...s, ...t } : s;
1213
+ return n?.type === "date-range" ? { ...s, ...n } : s;
1207
1214
  }
1208
1215
  case "custom":
1209
- const o = { type: e, value: null, operator: n.operator ?? "equals", custom: "", filterFn: void 0 };
1210
- return t?.type === "custom" ? { ...o, ...t } : o;
1216
+ const o = { type: e, value: null, operator: t.operator ?? "equals", custom: "", filterFn: void 0 };
1217
+ return n?.type === "custom" ? { ...o, ...n } : o;
1211
1218
  default:
1212
1219
  throw new Error(`Unsupported filter type: ${e}`);
1213
1220
  }
1214
1221
  }
1215
- function ot(e) {
1222
+ function vt(e) {
1216
1223
  switch (e.type) {
1217
1224
  case "text":
1218
1225
  return e.operator ? ["empty", "notEmpty"].includes(e.operator || "") ? !0 : !!e.value?.trim() : !1;
@@ -1228,7 +1235,7 @@ function ot(e) {
1228
1235
  return !1;
1229
1236
  }
1230
1237
  }
1231
- const In = _({
1238
+ const Jn = _({
1232
1239
  name: "VsDFlex",
1233
1240
  inheritAttrs: !1,
1234
1241
  props: {
@@ -1239,36 +1246,36 @@ const In = _({
1239
1246
  gap: [String, Number],
1240
1247
  responsive: Object
1241
1248
  },
1242
- setup(e, { attrs: t }) {
1243
- const n = (s, l) => `${s}-${l}`;
1244
- return { flexClasses: T(() => {
1249
+ setup(e, { attrs: n }) {
1250
+ const t = (s, l) => `${s}-${l}`;
1251
+ return { flexClasses: F(() => {
1245
1252
  const s = ["vs-d-flex"];
1246
- return e.direction && s.push(n("vs-row", e.direction)), e.justify && s.push(n("vs-justify", e.justify)), e.align && s.push(n("vs-align", e.align)), e.wrap !== void 0 && s.push(e.wrap ? "vs-wrap" : "vs-nowrap"), e.gap && s.push(n("vs-gap", e.gap)), Object.entries(e.responsive || {}).forEach(([l, a]) => {
1253
+ return e.direction && s.push(t("vs-row", e.direction)), e.justify && s.push(t("vs-justify", e.justify)), e.align && s.push(t("vs-align", e.align)), e.wrap !== void 0 && s.push(e.wrap ? "vs-wrap" : "vs-nowrap"), e.gap && s.push(t("vs-gap", e.gap)), Object.entries(e.responsive || {}).forEach(([l, a]) => {
1247
1254
  const r = l + ":";
1248
- a.direction && s.push(r + n("vs-row", a.direction)), a.justify && s.push(r + n("vs-justify", a.justify)), a.align && s.push(r + n("vs-align", a.align)), a.wrap !== void 0 && s.push(r + (a.wrap ? "vs-wrap" : "vs-nowrap")), a.gap && s.push(r + n("vs-gap", a.gap));
1255
+ a.direction && s.push(r + t("vs-row", a.direction)), a.justify && s.push(r + t("vs-justify", a.justify)), a.align && s.push(r + t("vs-align", a.align)), a.wrap !== void 0 && s.push(r + (a.wrap ? "vs-wrap" : "vs-nowrap")), a.gap && s.push(r + t("vs-gap", a.gap));
1249
1256
  }), s;
1250
- }), attrs: t };
1257
+ }), attrs: n };
1251
1258
  }
1252
1259
  });
1253
- function Hn(e, t, n, o, s, l) {
1254
- return h(), w("div", xt({ class: e.flexClasses }, e.attrs), [
1255
- q(e.$slots, "default")
1260
+ function _n(e, n, t, o, s, l) {
1261
+ return y(), k("div", Ae({ class: e.flexClasses }, e.attrs), [
1262
+ z(e.$slots, "default")
1256
1263
  ], 16);
1257
1264
  }
1258
- const re = /* @__PURE__ */ ne(In, [["render", Hn]]), Kn = { class: "vs-multiselect" }, Wn = { class: "vs-multiselect-actions" }, Un = {
1265
+ const ye = /* @__PURE__ */ ae(Jn, [["render", _n]]), eo = { class: "vs-multiselect" }, to = { class: "vs-multiselect-actions" }, no = {
1259
1266
  key: 0,
1260
1267
  class: "vs-py-4 vs-text-center vs-text-primary"
1261
- }, jn = {
1268
+ }, oo = {
1262
1269
  key: 1,
1263
1270
  class: "vs-multiselect-options"
1264
- }, zn = ["onClick"], Zn = { class: "option-label" }, Qn = {
1271
+ }, so = ["onClick"], lo = { class: "option-label" }, ao = {
1265
1272
  key: 0,
1266
1273
  xmlns: "http://www.w3.org/2000/svg",
1267
1274
  class: "check-icon",
1268
1275
  fill: "none",
1269
1276
  viewBox: "0 0 24 24",
1270
1277
  stroke: "currentColor"
1271
- }, Xn = /* @__PURE__ */ _({
1278
+ }, ro = /* @__PURE__ */ _({
1272
1279
  __name: "VsMultiSelect",
1273
1280
  props: {
1274
1281
  columnData: {},
@@ -1276,81 +1283,81 @@ const re = /* @__PURE__ */ ne(In, [["render", Hn]]), Kn = { class: "vs-multisele
1276
1283
  isLoading: { type: Boolean }
1277
1284
  },
1278
1285
  emits: ["update:modelValue"],
1279
- setup(e, { emit: t }) {
1280
- const n = e, o = t, s = L(""), l = L([...n.modelValue ?? []]), a = T(() => {
1281
- const v = new Set(n.columnData.filter(Boolean));
1282
- return Array.from(v);
1283
- }), r = T(() => {
1284
- const v = s.value.toLowerCase();
1285
- return a.value.filter((d) => d.toString().toLowerCase().includes(v));
1286
- }), u = T(() => l.value.length), c = T(() => a.value.length - l.value.length), f = (v) => {
1287
- const d = l.value.indexOf(v);
1288
- d > -1 ? l.value.splice(d, 1) : l.value.push(v), o("update:modelValue", [...l.value]);
1289
- }, i = () => {
1286
+ setup(e, { emit: n }) {
1287
+ const t = e, o = n, s = q(""), l = q([...t.modelValue ?? []]), a = F(() => {
1288
+ const f = new Set(t.columnData.filter(Boolean));
1289
+ return Array.from(f);
1290
+ }), r = F(() => {
1291
+ const f = s.value.toLowerCase();
1292
+ return a.value.filter((u) => u.toString().toLowerCase().includes(f));
1293
+ }), i = F(() => l.value.length), c = F(() => a.value.length - l.value.length), d = (f) => {
1294
+ const u = l.value.indexOf(f);
1295
+ u > -1 ? l.value.splice(u, 1) : l.value.push(f), o("update:modelValue", [...l.value]);
1296
+ }, v = () => {
1290
1297
  l.value = [...a.value], o("update:modelValue", [...l.value]);
1291
- }, p = () => {
1298
+ }, m = () => {
1292
1299
  l.value = [], o("update:modelValue", []);
1293
1300
  };
1294
- return G(
1295
- () => n.modelValue,
1296
- (v) => {
1297
- l.value = [...v || []];
1301
+ return Y(
1302
+ () => t.modelValue,
1303
+ (f) => {
1304
+ l.value = [...f || []];
1298
1305
  }
1299
- ), (v, d) => (h(), w("div", Kn, [
1300
- g("div", Wn, [
1301
- g("button", {
1302
- onClick: le(i, ["stop"])
1303
- }, "Select All (" + D(c.value) + ")", 1),
1304
- g("button", {
1305
- onClick: le(p, ["stop"])
1306
- }, "Deselect All (" + D(u.value) + ")", 1)
1306
+ ), (f, u) => (y(), k("div", eo, [
1307
+ w("div", to, [
1308
+ w("button", {
1309
+ onClick: me(v, ["stop"])
1310
+ }, "Select All (" + H(c.value) + ")", 1),
1311
+ w("button", {
1312
+ onClick: me(m, ["stop"])
1313
+ }, "Deselect All (" + H(i.value) + ")", 1)
1307
1314
  ]),
1308
- j(re, { direction: "row" }, {
1309
- default: I(() => [
1310
- U(g("input", {
1315
+ ne(ye, { direction: "row" }, {
1316
+ default: X(() => [
1317
+ te(w("input", {
1311
1318
  type: "text",
1312
- "onUpdate:modelValue": d[0] || (d[0] = (m) => s.value = m),
1319
+ "onUpdate:modelValue": u[0] || (u[0] = (h) => s.value = h),
1313
1320
  placeholder: "Search...",
1314
1321
  class: "vs-multiselect-search vs-w-full"
1315
1322
  }, null, 512), [
1316
- [oe, s.value]
1323
+ [ve, s.value]
1317
1324
  ])
1318
1325
  ]),
1319
1326
  _: 1
1320
1327
  }),
1321
- e.isLoading ? (h(), w("div", Un, "Loading options...")) : (h(), w("ul", jn, [
1322
- (h(!0), w(K, null, z(r.value, (m) => (h(), w("li", {
1323
- key: m,
1324
- onClick: le((b) => f(m), ["stop"]),
1325
- class: W({ selected: l.value.includes(m) })
1328
+ e.isLoading ? (y(), k("div", no, "Loading options...")) : (y(), k("ul", oo, [
1329
+ (y(!0), k(K, null, Q(r.value, (h) => (y(), k("li", {
1330
+ key: h,
1331
+ onClick: me((g) => d(h), ["stop"]),
1332
+ class: G({ selected: l.value.includes(h) })
1326
1333
  }, [
1327
- g("span", Zn, D(m), 1),
1328
- l.value.includes(m) ? (h(), w("svg", Qn, [...d[1] || (d[1] = [
1329
- g("path", {
1334
+ w("span", lo, H(h), 1),
1335
+ l.value.includes(h) ? (y(), k("svg", ao, [...u[1] || (u[1] = [
1336
+ w("path", {
1330
1337
  "stroke-linecap": "round",
1331
1338
  "stroke-linejoin": "round",
1332
1339
  "stroke-width": "2",
1333
1340
  d: "M5 13l4 4L19 7"
1334
1341
  }, null, -1)
1335
- ])])) : P("", !0)
1336
- ], 10, zn))), 128))
1342
+ ])])) : D("", !0)
1343
+ ], 10, so))), 128))
1337
1344
  ]))
1338
1345
  ]));
1339
1346
  }
1340
- }), Se = /* @__PURE__ */ new Map();
1341
- function Yn(e) {
1342
- const t = L(e.columnData || []), n = L(!1), o = () => n.value = !0, s = () => n.value = !1;
1347
+ }), Pe = /* @__PURE__ */ new Map();
1348
+ function io(e) {
1349
+ const n = q(e.columnData || []), t = q(!1), o = () => t.value = !0, s = () => t.value = !1;
1343
1350
  async function l(r = !1) {
1344
1351
  if (!e.asyncOptions) return;
1345
- const u = e.cacheKey ?? "default";
1346
- if (!r && Se.has(u)) {
1347
- t.value = Se.get(u);
1352
+ const i = e.cacheKey ?? "default";
1353
+ if (!r && Pe.has(i)) {
1354
+ n.value = Pe.get(i);
1348
1355
  return;
1349
1356
  }
1350
1357
  try {
1351
1358
  o();
1352
- const c = await e.asyncOptions(), f = Array.isArray(c) ? c : [];
1353
- t.value = f, Se.set(u, f);
1359
+ const c = await e.asyncOptions(), d = Array.isArray(c) ? c : [];
1360
+ n.value = d, Pe.set(i, d);
1354
1361
  } catch (c) {
1355
1362
  console.error("Failed to load async filter options:", c);
1356
1363
  } finally {
@@ -1359,43 +1366,43 @@ function Yn(e) {
1359
1366
  }
1360
1367
  function a() {
1361
1368
  const r = e.cacheKey ?? "default";
1362
- Se.delete(r);
1369
+ Pe.delete(r);
1363
1370
  }
1364
1371
  return {
1365
- columnOrAsyncOptions: t,
1366
- isLoading: n,
1372
+ columnOrAsyncOptions: n,
1373
+ isLoading: t,
1367
1374
  clearCache: a,
1368
1375
  loadAsyncOptions: l
1369
1376
  };
1370
1377
  }
1371
- const Gn = {
1378
+ const co = {
1372
1379
  key: 0,
1373
1380
  class: "vs-filter-text"
1374
- }, Jn = {
1381
+ }, uo = {
1375
1382
  key: 0,
1376
1383
  class: "vs-pb-sm"
1377
- }, _n = ["value"], eo = {
1384
+ }, fo = ["value"], vo = {
1378
1385
  key: 1,
1379
1386
  class: "vs-filter-multi"
1380
- }, to = {
1387
+ }, ho = {
1381
1388
  key: 2,
1382
1389
  class: "vs-filter-range"
1383
- }, no = {
1390
+ }, mo = {
1384
1391
  key: 0,
1385
1392
  class: "vs-pb-sm"
1386
- }, oo = ["value"], so = { key: 1 }, lo = { class: "vs-operator-fixed" }, ao = { key: 4 }, ro = {
1393
+ }, po = ["value"], go = { key: 1 }, yo = { class: "vs-operator-fixed" }, wo = { key: 4 }, bo = {
1387
1394
  key: 3,
1388
1395
  class: "vs-filter-date"
1389
- }, io = {
1396
+ }, xo = {
1390
1397
  key: 0,
1391
1398
  class: "vs-pb-sm"
1392
- }, uo = ["value"], co = { key: 1 }, fo = { class: "vs-operator-fixed" }, vo = {
1399
+ }, ko = ["value"], Co = { key: 1 }, So = { class: "vs-operator-fixed" }, Ro = {
1393
1400
  key: 4,
1394
1401
  class: "vs-muted vs-text-center vs-pt-sm"
1395
- }, po = {
1402
+ }, Eo = {
1396
1403
  key: 4,
1397
1404
  class: "vs-filter-actions"
1398
- }, mo = /* @__PURE__ */ _({
1405
+ }, $o = /* @__PURE__ */ _({
1399
1406
  __name: "VsDataTableFilterDropdown",
1400
1407
  props: {
1401
1408
  modelValue: {},
@@ -1407,11 +1414,11 @@ const Gn = {
1407
1414
  asyncOptions: {}
1408
1415
  },
1409
1416
  emits: ["update:modelValue", "apply", "clear", "open", "close"],
1410
- setup(e, { emit: t }) {
1411
- const n = e, o = t, { columnOrAsyncOptions: s, isLoading: l, loadAsyncOptions: a } = Yn({
1412
- asyncOptions: n.asyncOptions,
1413
- columnData: n.columnData,
1414
- cacheKey: n.field
1417
+ setup(e, { emit: n }) {
1418
+ const t = e, o = n, { columnOrAsyncOptions: s, isLoading: l, loadAsyncOptions: a } = io({
1419
+ asyncOptions: t.asyncOptions,
1420
+ columnData: t.columnData,
1421
+ cacheKey: t.field
1415
1422
  }), r = {
1416
1423
  text: [
1417
1424
  "contains",
@@ -1428,8 +1435,8 @@ const Gn = {
1428
1435
  "date-range": ["between", "equals", "notEqual", "before", "after", "empty", "notEmpty"],
1429
1436
  custom: []
1430
1437
  };
1431
- function u($) {
1432
- switch ($) {
1438
+ function i(b) {
1439
+ switch (b) {
1433
1440
  case "notEqual":
1434
1441
  return "Not Equal";
1435
1442
  case "greaterThan":
@@ -1447,330 +1454,463 @@ const Gn = {
1447
1454
  case "notEmpty":
1448
1455
  return "Not Empty";
1449
1456
  default:
1450
- return $.charAt(0).toUpperCase() + $.slice(1);
1457
+ return b.charAt(0).toUpperCase() + b.slice(1);
1451
1458
  }
1452
1459
  }
1453
- const c = T(() => n.type === "custom" ? [] : n.operators?.length ? n.operators : r[n.type]), f = L(null), i = L(null), p = L(), v = L(!1);
1454
- G(
1455
- () => n.visible,
1456
- async ($) => {
1457
- v.value = !!$, v.value ? (await Ct(), S(), n.asyncOptions && a()) : O();
1460
+ const c = F(() => t.type === "custom" ? [] : t.operators?.length ? t.operators : r[t.type]), d = q(null), v = q(null), m = q(), f = q(!1);
1461
+ Y(
1462
+ () => t.visible,
1463
+ async (b) => {
1464
+ f.value = !!b, f.value ? (await oe(), E(), t.asyncOptions && a()) : L();
1458
1465
  },
1459
1466
  { immediate: !0 }
1460
1467
  );
1461
- const d = L(pe(n.type, n.modelValue));
1462
- G(
1463
- () => n.modelValue,
1464
- ($) => {
1465
- d.value = pe(n.type, $);
1468
+ const u = q(Ce(t.type, t.modelValue));
1469
+ Y(
1470
+ () => t.modelValue,
1471
+ (b) => {
1472
+ u.value = Ce(t.type, b);
1466
1473
  },
1467
1474
  { immediate: !0 }
1468
1475
  );
1469
- function m() {
1476
+ function h() {
1470
1477
  o("open");
1471
1478
  }
1472
- function b() {
1473
- o("update:modelValue", { ...d.value }), o("apply", { ...d.value });
1479
+ function g() {
1480
+ o("update:modelValue", { ...u.value }), o("apply", { ...u.value });
1474
1481
  }
1475
1482
  function C() {
1476
- d.value = pe(n.type), o("update:modelValue", { ...d.value }), o("clear"), k();
1483
+ u.value = Ce(t.type), o("update:modelValue", { ...u.value }), o("clear"), S();
1477
1484
  }
1478
- function k() {
1485
+ function S() {
1479
1486
  o("close");
1480
1487
  }
1481
- function S() {
1482
- !f.value || !i.value || (p.value = Fn(f.value, i.value, () => {
1483
- Nn(f.value, i.value, {
1488
+ function E() {
1489
+ !d.value || !v.value || (m.value = Zn(d.value, v.value, () => {
1490
+ Gn(d.value, v.value, {
1484
1491
  placement: "bottom-start",
1485
- middleware: [Bn(6), qn(), Mn({ padding: 8 })]
1486
- }).then(({ x: $, y: x }) => {
1487
- Object.assign(i.value.style, {
1488
- left: `${$}px`,
1489
- top: `${x}px`,
1492
+ middleware: [Xn(6), Yn(), Qn({ padding: 8 })]
1493
+ }).then(({ x: b, y: p }) => {
1494
+ Object.assign(v.value.style, {
1495
+ left: `${b}px`,
1496
+ top: `${p}px`,
1490
1497
  position: "absolute",
1491
1498
  zIndex: 2e3
1492
1499
  });
1493
1500
  });
1494
1501
  }));
1495
1502
  }
1496
- function O() {
1497
- p.value?.(), p.value = void 0;
1503
+ function L() {
1504
+ m.value?.(), m.value = void 0;
1498
1505
  }
1499
- function A($) {
1500
- const x = $.target;
1501
- v.value && f.value && i.value && !f.value.contains(x) && !i.value.contains(x) && k();
1506
+ function P(b) {
1507
+ const p = b.target;
1508
+ f.value && d.value && v.value && !d.value.contains(p) && !v.value.contains(p) && S();
1502
1509
  }
1503
- function M($) {
1504
- $.key === "Escape" && v.value && k();
1510
+ function B(b) {
1511
+ b.key === "Escape" && f.value && S();
1505
1512
  }
1506
- return st(() => {
1507
- document.addEventListener("click", A), document.addEventListener("keydown", M);
1508
- }), lt(() => {
1509
- document.removeEventListener("click", A), document.removeEventListener("keydown", M), O();
1510
- }), ($, x) => (h(), w(K, null, [
1511
- g("span", {
1513
+ return Re(() => {
1514
+ document.addEventListener("click", P), document.addEventListener("keydown", B);
1515
+ }), mt(() => {
1516
+ document.removeEventListener("click", P), document.removeEventListener("keydown", B), L();
1517
+ }), (b, p) => (y(), k(K, null, [
1518
+ w("span", {
1512
1519
  ref_key: "referenceRef",
1513
- ref: f,
1514
- class: W(["vs-column-filter", {
1515
- "is-active": R(ot)(d.value),
1516
- "in-active": !R(ot)(d.value)
1520
+ ref: d,
1521
+ class: G(["vs-column-filter", {
1522
+ "is-active": $(vt)(u.value),
1523
+ "in-active": !$(vt)(u.value)
1517
1524
  }]),
1518
- onClick: le(m, ["stop"])
1519
- }, [...x[13] || (x[13] = [
1520
- g("svg", {
1525
+ onClick: me(h, ["stop"])
1526
+ }, [...p[13] || (p[13] = [
1527
+ w("svg", {
1521
1528
  xmlns: "http://www.w3.org/2000/svg",
1522
1529
  height: "24px",
1523
1530
  viewBox: "0 -960 960 960",
1524
1531
  width: "24px",
1525
1532
  fill: "currentColor"
1526
1533
  }, [
1527
- g("path", { d: "M440-160q-17 0-28.5-11.5T400-200v-240L168-736q-15-20-4.5-42t36.5-22h560q26 0 36.5 22t-4.5 42L560-440v240q0 17-11.5 28.5T520-160h-80Zm40-308 198-252H282l198 252Zm0 0Z" })
1534
+ w("path", { d: "M400-240v-80h160v80H400ZM240-440v-80h480v80H240ZM120-640v-80h720v80H120Z" })
1528
1535
  ], -1)
1529
1536
  ])], 2),
1530
- (h(), fe(kt, { to: "body" }, [
1531
- j(Rt, { name: "fade" }, {
1532
- default: I(() => [
1533
- v.value ? (h(), w("div", {
1537
+ (y(), fe(Dt, { to: "body" }, [
1538
+ ne(It, { name: "fade" }, {
1539
+ default: X(() => [
1540
+ f.value ? (y(), k("div", {
1534
1541
  key: 0,
1535
1542
  ref_key: "floatingRef",
1536
- ref: i,
1543
+ ref: v,
1537
1544
  class: "vs-filter-dropdown",
1538
1545
  style: { position: "absolute", "z-index": "1000" },
1539
- onClick: x[12] || (x[12] = le(() => {
1546
+ onClick: p[12] || (p[12] = me(() => {
1540
1547
  }, ["stop"]))
1541
1548
  }, [
1542
- d.value.type === "text" ? (h(), w("div", Gn, [
1543
- c.value.length > 1 ? (h(), w("div", Jn, [
1544
- U(g("select", {
1545
- "onUpdate:modelValue": x[0] || (x[0] = (y) => d.value.operator = y),
1549
+ u.value.type === "text" ? (y(), k("div", co, [
1550
+ c.value.length > 1 ? (y(), k("div", uo, [
1551
+ te(w("select", {
1552
+ "onUpdate:modelValue": p[0] || (p[0] = (x) => u.value.operator = x),
1546
1553
  class: "vs-operator-select vs-mx-auto vs-w-full"
1547
1554
  }, [
1548
- (h(!0), w(K, null, z(c.value, (y) => (h(), w("option", {
1549
- key: y,
1550
- value: y
1551
- }, D(u(y)), 9, _n))), 128))
1555
+ (y(!0), k(K, null, Q(c.value, (x) => (y(), k("option", {
1556
+ key: x,
1557
+ value: x
1558
+ }, H(i(x)), 9, fo))), 128))
1552
1559
  ], 512), [
1553
- [Me, d.value.operator]
1560
+ [Xe, u.value.operator]
1554
1561
  ])
1555
- ])) : P("", !0),
1556
- j(re, {
1562
+ ])) : D("", !0),
1563
+ ne(ye, {
1557
1564
  direction: "row",
1558
1565
  class: "mb-6"
1559
1566
  }, {
1560
- default: I(() => [
1561
- U(g("input", {
1567
+ default: X(() => [
1568
+ te(w("input", {
1562
1569
  type: "text",
1563
- "onUpdate:modelValue": x[1] || (x[1] = (y) => d.value.value = y),
1570
+ "onUpdate:modelValue": p[1] || (p[1] = (x) => u.value.value = x),
1564
1571
  placeholder: "Search...",
1565
1572
  class: "vs-input vs-mx-auto vs-w-full"
1566
1573
  }, null, 512), [
1567
- [oe, d.value.value]
1574
+ [ve, u.value.value]
1568
1575
  ])
1569
1576
  ]),
1570
1577
  _: 1
1571
1578
  })
1572
- ])) : d.value.type === "multi-select" ? (h(), w("div", eo, [
1573
- j(re, {
1579
+ ])) : u.value.type === "multi-select" ? (y(), k("div", vo, [
1580
+ ne(ye, {
1574
1581
  direction: "row",
1575
1582
  class: "mb-6 vs-align-center vs-justify-end"
1576
1583
  }, {
1577
- default: I(() => [
1578
- e.asyncOptions ? (h(), w("span", {
1584
+ default: X(() => [
1585
+ e.asyncOptions ? (y(), k("span", {
1579
1586
  key: 0,
1580
- onClick: x[2] || (x[2] = (y) => R(a)(!0)),
1587
+ onClick: p[2] || (p[2] = (x) => $(a)(!0)),
1581
1588
  class: "vs-cursor-pointer"
1582
- }, [...x[14] || (x[14] = [
1583
- g("svg", {
1589
+ }, [...p[14] || (p[14] = [
1590
+ w("svg", {
1584
1591
  xmlns: "http://www.w3.org/2000/svg",
1585
1592
  height: "24px",
1586
1593
  viewBox: "0 -960 960 960",
1587
1594
  width: "24px",
1588
1595
  fill: "var(--vs-inactive)"
1589
1596
  }, [
1590
- g("path", { d: "M480-160q-134 0-227-93t-93-227q0-134 93-227t227-93q69 0 132 28.5T720-690v-110h80v280H520v-80h168q-32-56-87.5-88T480-720q-100 0-170 70t-70 170q0 100 70 170t170 70q77 0 139-44t87-116h84q-28 106-114 173t-196 67Z" })
1597
+ w("path", { d: "M480-160q-134 0-227-93t-93-227q0-134 93-227t227-93q69 0 132 28.5T720-690v-110h80v280H520v-80h168q-32-56-87.5-88T480-720q-100 0-170 70t-70 170q0 100 70 170t170 70q77 0 139-44t87-116h84q-28 106-114 173t-196 67Z" })
1591
1598
  ], -1)
1592
- ])])) : P("", !0)
1599
+ ])])) : D("", !0)
1593
1600
  ]),
1594
1601
  _: 1
1595
1602
  }),
1596
- j(Xn, {
1597
- isLoading: R(l),
1598
- columnData: R(s),
1599
- modelValue: d.value.value,
1600
- "onUpdate:modelValue": x[3] || (x[3] = (y) => d.value.value = y),
1603
+ ne(ro, {
1604
+ isLoading: $(l),
1605
+ columnData: $(s),
1606
+ modelValue: u.value.value,
1607
+ "onUpdate:modelValue": p[3] || (p[3] = (x) => u.value.value = x),
1601
1608
  placeholder: "Select values..."
1602
1609
  }, null, 8, ["isLoading", "columnData", "modelValue"])
1603
- ])) : d.value.type === "number-range" ? (h(), w("div", to, [
1604
- c.value.length > 1 ? (h(), w("div", no, [
1605
- U(g("select", {
1606
- "onUpdate:modelValue": x[4] || (x[4] = (y) => d.value.operator = y),
1610
+ ])) : u.value.type === "number-range" ? (y(), k("div", ho, [
1611
+ c.value.length > 1 ? (y(), k("div", mo, [
1612
+ te(w("select", {
1613
+ "onUpdate:modelValue": p[4] || (p[4] = (x) => u.value.operator = x),
1607
1614
  class: "vs-operator-select vs-w-full"
1608
1615
  }, [
1609
- (h(!0), w(K, null, z(c.value, (y) => (h(), w("option", {
1610
- key: y,
1611
- value: y
1612
- }, D(u(y)), 9, oo))), 128))
1616
+ (y(!0), k(K, null, Q(c.value, (x) => (y(), k("option", {
1617
+ key: x,
1618
+ value: x
1619
+ }, H(i(x)), 9, po))), 128))
1613
1620
  ], 512), [
1614
- [Me, d.value.operator]
1621
+ [Xe, u.value.operator]
1615
1622
  ])
1616
- ])) : (h(), w("div", so, [
1617
- g("span", lo, D(d.value.operator), 1)
1623
+ ])) : (y(), k("div", go, [
1624
+ w("span", yo, H(u.value.operator), 1)
1618
1625
  ])),
1619
- d.value.operator === "between" ? (h(), fe(re, {
1626
+ u.value.operator === "between" ? (y(), fe(ye, {
1620
1627
  key: 2,
1621
1628
  justify: "between",
1622
1629
  align: "center",
1623
1630
  gap: "4",
1624
1631
  class: "mb-6"
1625
1632
  }, {
1626
- default: I(() => [
1627
- U(g("input", {
1633
+ default: X(() => [
1634
+ te(w("input", {
1628
1635
  type: "number",
1629
- "onUpdate:modelValue": x[5] || (x[5] = (y) => d.value.min = y),
1636
+ "onUpdate:modelValue": p[5] || (p[5] = (x) => u.value.min = x),
1630
1637
  placeholder: "Min",
1631
1638
  class: "vs-input vs-w-full"
1632
1639
  }, null, 512), [
1633
1640
  [
1634
- oe,
1635
- d.value.min,
1641
+ ve,
1642
+ u.value.min,
1636
1643
  void 0,
1637
1644
  { number: !0 }
1638
1645
  ]
1639
1646
  ]),
1640
- x[15] || (x[15] = g("span", null, "-", -1)),
1641
- U(g("input", {
1647
+ p[15] || (p[15] = w("span", null, "-", -1)),
1648
+ te(w("input", {
1642
1649
  type: "number",
1643
- "onUpdate:modelValue": x[6] || (x[6] = (y) => d.value.max = y),
1650
+ "onUpdate:modelValue": p[6] || (p[6] = (x) => u.value.max = x),
1644
1651
  placeholder: "Max",
1645
1652
  class: "vs-input vs-w-full"
1646
1653
  }, null, 512), [
1647
1654
  [
1648
- oe,
1649
- d.value.max,
1655
+ ve,
1656
+ u.value.max,
1650
1657
  void 0,
1651
1658
  { number: !0 }
1652
1659
  ]
1653
1660
  ])
1654
1661
  ]),
1655
1662
  _: 1
1656
- })) : ["equals", "notEqual", "greaterThan", "lessThan"].includes(d.value.operator || "") ? (h(), fe(re, {
1663
+ })) : ["equals", "notEqual", "greaterThan", "lessThan"].includes(u.value.operator || "") ? (y(), fe(ye, {
1657
1664
  key: 3,
1658
1665
  direction: "row"
1659
1666
  }, {
1660
- default: I(() => [
1661
- U(g("input", {
1667
+ default: X(() => [
1668
+ te(w("input", {
1662
1669
  type: "number",
1663
- "onUpdate:modelValue": x[7] || (x[7] = (y) => d.value.value = y),
1670
+ "onUpdate:modelValue": p[7] || (p[7] = (x) => u.value.value = x),
1664
1671
  placeholder: "Enter number",
1665
1672
  class: "vs-input vs-w-full"
1666
1673
  }, null, 512), [
1667
1674
  [
1668
- oe,
1669
- d.value.value,
1675
+ ve,
1676
+ u.value.value,
1670
1677
  void 0,
1671
1678
  { number: !0 }
1672
1679
  ]
1673
1680
  ])
1674
1681
  ]),
1675
1682
  _: 1
1676
- })) : ["empty", "notEmpty"].includes(d.value.operator || "") ? (h(), w("div", ao, [...x[16] || (x[16] = [
1677
- g("div", { class: "vs-muted vs-text-center vs-pt-sm" }, "No input required", -1)
1678
- ])])) : P("", !0)
1679
- ])) : d.value.type === "date-range" ? (h(), w("div", ro, [
1680
- c.value.length > 1 ? (h(), w("div", io, [
1681
- U(g("select", {
1682
- "onUpdate:modelValue": x[8] || (x[8] = (y) => d.value.operator = y),
1683
+ })) : ["empty", "notEmpty"].includes(u.value.operator || "") ? (y(), k("div", wo, [...p[16] || (p[16] = [
1684
+ w("div", { class: "vs-muted vs-text-center vs-pt-sm" }, "No input required", -1)
1685
+ ])])) : D("", !0)
1686
+ ])) : u.value.type === "date-range" ? (y(), k("div", bo, [
1687
+ c.value.length > 1 ? (y(), k("div", xo, [
1688
+ te(w("select", {
1689
+ "onUpdate:modelValue": p[8] || (p[8] = (x) => u.value.operator = x),
1683
1690
  class: "vs-operator-select vs-w-full"
1684
1691
  }, [
1685
- (h(!0), w(K, null, z(c.value, (y) => (h(), w("option", {
1686
- key: y,
1687
- value: y
1688
- }, D(u(y)), 9, uo))), 128))
1692
+ (y(!0), k(K, null, Q(c.value, (x) => (y(), k("option", {
1693
+ key: x,
1694
+ value: x
1695
+ }, H(i(x)), 9, ko))), 128))
1689
1696
  ], 512), [
1690
- [Me, d.value.operator]
1697
+ [Xe, u.value.operator]
1691
1698
  ])
1692
- ])) : (h(), w("div", co, [
1693
- g("span", fo, D(d.value.operator), 1)
1699
+ ])) : (y(), k("div", Co, [
1700
+ w("span", So, H(u.value.operator), 1)
1694
1701
  ])),
1695
- d.value.operator === "between" ? (h(), fe(re, {
1702
+ u.value.operator === "between" ? (y(), fe(ye, {
1696
1703
  key: 2,
1697
1704
  justify: "between",
1698
1705
  align: "center",
1699
1706
  gap: "4",
1700
1707
  class: "mb-6"
1701
1708
  }, {
1702
- default: I(() => [
1703
- U(g("input", {
1709
+ default: X(() => [
1710
+ te(w("input", {
1704
1711
  type: "date",
1705
- "onUpdate:modelValue": x[9] || (x[9] = (y) => d.value.start = y),
1712
+ "onUpdate:modelValue": p[9] || (p[9] = (x) => u.value.start = x),
1706
1713
  class: "vs-input vs-w-full"
1707
1714
  }, null, 512), [
1708
- [oe, d.value.start]
1715
+ [ve, u.value.start]
1709
1716
  ]),
1710
- x[17] || (x[17] = g("span", null, "-", -1)),
1711
- U(g("input", {
1717
+ p[17] || (p[17] = w("span", null, "-", -1)),
1718
+ te(w("input", {
1712
1719
  type: "date",
1713
- "onUpdate:modelValue": x[10] || (x[10] = (y) => d.value.end = y),
1720
+ "onUpdate:modelValue": p[10] || (p[10] = (x) => u.value.end = x),
1714
1721
  class: "vs-input vs-w-full"
1715
1722
  }, null, 512), [
1716
- [oe, d.value.end]
1723
+ [ve, u.value.end]
1717
1724
  ])
1718
1725
  ]),
1719
1726
  _: 1
1720
- })) : ["equals", "notEqual", "before", "after"].includes(d.value.operator || "") ? (h(), fe(re, {
1727
+ })) : ["equals", "notEqual", "before", "after"].includes(u.value.operator || "") ? (y(), fe(ye, {
1721
1728
  key: 3,
1722
1729
  direction: "row",
1723
1730
  class: "vs-filter-single-date"
1724
1731
  }, {
1725
- default: I(() => [
1726
- U(g("input", {
1732
+ default: X(() => [
1733
+ te(w("input", {
1727
1734
  type: "date",
1728
- "onUpdate:modelValue": x[11] || (x[11] = (y) => d.value.value = y),
1735
+ "onUpdate:modelValue": p[11] || (p[11] = (x) => u.value.value = x),
1729
1736
  class: "vs-input vs-w-full"
1730
1737
  }, null, 512), [
1731
- [oe, d.value.value]
1738
+ [ve, u.value.value]
1732
1739
  ])
1733
1740
  ]),
1734
1741
  _: 1
1735
- })) : ["empty", "notEmpty"].includes(d.value.operator || "") ? (h(), w("div", vo, " No date input required ")) : P("", !0)
1736
- ])) : P("", !0),
1737
- d.value.type !== "custom" ? (h(), w("div", po, [
1738
- g("button", {
1742
+ })) : ["empty", "notEmpty"].includes(u.value.operator || "") ? (y(), k("div", Ro, " No date input required ")) : D("", !0)
1743
+ ])) : D("", !0),
1744
+ u.value.type !== "custom" ? (y(), k("div", Eo, [
1745
+ w("button", {
1739
1746
  class: "vs-btn vs-btn-primary",
1740
- onClick: b
1747
+ onClick: g
1741
1748
  }, "Apply"),
1742
- g("button", {
1749
+ w("button", {
1743
1750
  class: "vs-btn vs-btn-secondary",
1744
1751
  onClick: C
1745
1752
  }, "Clear")
1746
- ])) : P("", !0),
1747
- q($.$slots, "custom", {
1748
- filter: d.value,
1749
- apply: b,
1753
+ ])) : D("", !0),
1754
+ z(b.$slots, "custom", {
1755
+ filter: u.value,
1756
+ apply: g,
1750
1757
  clear: C
1751
1758
  }, void 0, !0)
1752
- ], 512)) : P("", !0)
1759
+ ], 512)) : D("", !0)
1753
1760
  ]),
1754
1761
  _: 3
1755
1762
  })
1756
1763
  ]))
1757
1764
  ], 64));
1758
1765
  }
1759
- }), go = /* @__PURE__ */ ne(mo, [["__scopeId", "data-v-bdeb98d2"]]), ho = {
1766
+ }), Ao = /* @__PURE__ */ ae($o, [["__scopeId", "data-v-f4972f8b"]]), Fo = ["data-field", "rowspan"], To = { class: "vs-header-content" }, Oo = { class: "vs-header-label" }, Vo = {
1767
+ key: 0,
1768
+ class: "vs-sort-icons"
1769
+ }, Lo = {
1770
+ key: 1,
1771
+ class: "vs-sort-priority"
1772
+ }, Po = /* @__PURE__ */ _({
1773
+ __name: "HeaderCell",
1774
+ props: {
1775
+ column: {},
1776
+ rows: {},
1777
+ rowspan: {},
1778
+ sortHelpers: {},
1779
+ filters: {},
1780
+ openFilter: {},
1781
+ headerClass: {},
1782
+ tablename: {}
1783
+ },
1784
+ emits: ["applyFilter", "clearFilter", "openFilter", "closeFilter", "update:filters"],
1785
+ setup(e, { emit: n }) {
1786
+ const t = e, o = n, s = F({
1787
+ get: () => t.filters,
1788
+ set: (v) => o("update:filters", v)
1789
+ });
1790
+ function l(v) {
1791
+ t.column.sortable && t.column.field && t.sortHelpers.handleSort(t.column.field, v);
1792
+ }
1793
+ function a() {
1794
+ return t.column.field ? t.rows.map((v) => v[t.column.field]) : [];
1795
+ }
1796
+ function r(v) {
1797
+ t.column.field && o("applyFilter", t.column.field, v);
1798
+ }
1799
+ function i() {
1800
+ t.column.field && o("clearFilter", t.column.field);
1801
+ }
1802
+ function c() {
1803
+ t.column.field && o("closeFilter", t.column.field);
1804
+ }
1805
+ function d() {
1806
+ t.column.field && o("openFilter", t.column.field);
1807
+ }
1808
+ return (v, m) => e.column && e.column.field ? (y(), k("th", {
1809
+ key: 0,
1810
+ onClick: l,
1811
+ style: pt([
1812
+ {
1813
+ width: e.column.width + "%",
1814
+ textAlign: "center"
1815
+ }
1816
+ ]),
1817
+ "data-field": e.column.field || e.column.label,
1818
+ rowspan: e.rowspan,
1819
+ class: G(["vs-group-header", [
1820
+ e.headerClass,
1821
+ e.column.colHeaderClass,
1822
+ e.column.sortable ? "vs-sortable" : ""
1823
+ ]])
1824
+ }, [
1825
+ z(v.$slots, `header-${e.column.field}`, { column: e.column }, () => [
1826
+ w("div", To, [
1827
+ w("span", Oo, H(e.column.label), 1),
1828
+ e.column.sortable ? (y(), k("div", Vo, [
1829
+ w("span", {
1830
+ class: G(["vs-sort-icon vs-sort-asc", {
1831
+ "vs-active": e.sortHelpers.isColumnSorted(e.column.field) && e.sortHelpers.getSortOrder(e.column.field) === "asc"
1832
+ }])
1833
+ }, [...m[2] || (m[2] = [
1834
+ w("svg", {
1835
+ xmlns: "http://www.w3.org/2000/svg",
1836
+ height: "24px",
1837
+ viewBox: "0 -960 960 960",
1838
+ width: "24px",
1839
+ fill: "var(--vs-gray-800)"
1840
+ }, [
1841
+ w("path", { d: "m280-400 200-200 200 200H280Z" })
1842
+ ], -1)
1843
+ ])], 2),
1844
+ w("span", {
1845
+ class: G(["vs-sort-icon vs-sort-desc", {
1846
+ "vs-active": e.sortHelpers.isColumnSorted(e.column.field) && e.sortHelpers.getSortOrder(e.column.field) === "desc"
1847
+ }])
1848
+ }, [...m[3] || (m[3] = [
1849
+ w("svg", {
1850
+ xmlns: "http://www.w3.org/2000/svg",
1851
+ height: "24px",
1852
+ viewBox: "0 -960 960 960",
1853
+ width: "24px"
1854
+ }, [
1855
+ w("path", { d: "M480-360 280-560h400L480-360Z" })
1856
+ ], -1)
1857
+ ])], 2)
1858
+ ])) : D("", !0),
1859
+ e.sortHelpers.getSortPriority(e.column.field) !== null ? (y(), k("span", Lo, H(e.sortHelpers.getSortPriority(e.column.field)), 1)) : D("", !0),
1860
+ e.column.filter ? (y(), fe(Ao, {
1861
+ key: 2,
1862
+ type: e.column.filter.type,
1863
+ "async-options": e.column.filter.asyncOptions,
1864
+ field: e.column.field,
1865
+ operators: e.column.filter.operators,
1866
+ modelValue: s.value[e.column.field],
1867
+ "onUpdate:modelValue": m[0] || (m[0] = (f) => s.value[e.column.field] = f),
1868
+ visible: e.openFilter === e.column.field,
1869
+ "column-data": a(),
1870
+ onApply: m[1] || (m[1] = (f) => r(f)),
1871
+ onClear: i,
1872
+ onClose: c,
1873
+ onOpen: d
1874
+ }, Te({ _: 2 }, [
1875
+ e.column.filter.custom ? {
1876
+ name: "custom",
1877
+ fn: X(({ filter: f, apply: u, clear: h }) => [
1878
+ z(v.$slots, e.column.filter.custom, {
1879
+ filter: f,
1880
+ apply: u,
1881
+ clear: h
1882
+ }, void 0, !0)
1883
+ ]),
1884
+ key: "0"
1885
+ } : void 0
1886
+ ]), 1032, ["type", "async-options", "field", "operators", "modelValue", "visible", "column-data"])) : D("", !0)
1887
+ ])
1888
+ ], !0)
1889
+ ], 14, Fo)) : D("", !0);
1890
+ }
1891
+ }), ht = /* @__PURE__ */ ae(Po, [["__scopeId", "data-v-69e5e343"]]), Do = { key: 0 }, Io = {
1760
1892
  key: 0,
1761
1893
  class: "vs-expand-column",
1762
- style: { width: "5%" }
1763
- }, wo = {
1894
+ rowspan: "2",
1895
+ style: { width: "5%" },
1896
+ "data-field": "_expand"
1897
+ }, qo = {
1764
1898
  key: 1,
1765
1899
  class: "vs-checkbox-column",
1766
- style: { width: "5%" }
1767
- }, yo = { class: "vs-checkbox" }, bo = ["id", "checked", "indeterminate"], xo = ["for"], Co = ["onClick"], ko = { class: "vs-header-content" }, Ro = { class: "vs-header-label" }, So = {
1900
+ rowspan: "2",
1901
+ style: { width: "5%" },
1902
+ "data-field": "_checkbox"
1903
+ }, Mo = { class: "vs-checkbox" }, Bo = ["id", "checked", "indeterminate"], Ho = ["for"], Wo = ["colspan", "data-field"], No = {
1768
1904
  key: 0,
1769
- class: "vs-sort-icons"
1770
- }, To = {
1905
+ class: "vs-expand-column",
1906
+ style: { width: "5%" },
1907
+ "data-field": "_expand"
1908
+ }, Ko = {
1771
1909
  key: 1,
1772
- class: "vs-sort-priority"
1773
- }, $o = /* @__PURE__ */ _({
1910
+ class: "vs-checkbox-column",
1911
+ style: { width: "5%" },
1912
+ "data-field": "_checkbox"
1913
+ }, zo = { class: "vs-checkbox" }, jo = ["id", "checked", "indeterminate"], Uo = ["for"], Zo = /* @__PURE__ */ _({
1774
1914
  __name: "VsDataTableHeader",
1775
1915
  props: {
1776
1916
  columns: {},
@@ -1786,123 +1926,140 @@ const Gn = {
1786
1926
  headerClass: {}
1787
1927
  },
1788
1928
  emits: ["toggleAll", "applyFilter", "clearFilter", "update:filters"],
1789
- setup(e, { emit: t }) {
1790
- const n = e, o = t;
1791
- function s(c) {
1792
- o("toggleAll", c);
1929
+ setup(e, { emit: n }) {
1930
+ const t = e, o = n;
1931
+ function s(f) {
1932
+ o("toggleAll", f);
1933
+ }
1934
+ const l = F({
1935
+ get: () => t.filters,
1936
+ set: (f) => o("update:filters", f)
1937
+ }), a = q(null);
1938
+ function r(f) {
1939
+ a.value = f;
1793
1940
  }
1794
- const l = T({
1795
- get: () => n.filters,
1796
- set: (c) => o("update:filters", c)
1797
- }), a = L(null);
1798
- function r(c) {
1799
- a.value = c;
1941
+ function i(f) {
1942
+ a.value === f && (a.value = null);
1800
1943
  }
1801
- function u(c) {
1802
- a.value === c && (a.value = null);
1944
+ const c = q(null), d = F(() => t.columns.some((f) => f.children && f.children.length)), v = F(() => {
1945
+ const f = [];
1946
+ return t.columns.forEach((u) => {
1947
+ u.children && u.children.length ? f.push(...u.children) : f.push(u);
1948
+ }), f;
1949
+ });
1950
+ function m(f) {
1951
+ return d.value ? t.columns.some(
1952
+ (u) => u.children && u.children.some((h) => h.field === f.field)
1953
+ ) : !0;
1803
1954
  }
1804
- return (c, f) => (h(), w("thead", null, [
1805
- g("tr", null, [
1806
- e.expandable ? (h(), w("th", ho)) : P("", !0),
1807
- e.isItemSelectedControlled ? (h(), w("th", wo, [
1808
- g("div", yo, [
1809
- g("input", {
1955
+ return (f, u) => (y(), k("thead", {
1956
+ ref_key: "headerRef",
1957
+ ref: c
1958
+ }, [
1959
+ d.value ? (y(), k("tr", Do, [
1960
+ e.expandable ? (y(), k("th", Io)) : D("", !0),
1961
+ e.isItemSelectedControlled ? (y(), k("th", qo, [
1962
+ w("div", Mo, [
1963
+ w("input", {
1810
1964
  type: "checkbox",
1811
1965
  id: e.tablename + "-main-checkbox",
1812
1966
  checked: e.isAllChecked,
1813
1967
  indeterminate: e.isSomeChecked,
1814
1968
  onChange: s
1815
- }, null, 40, bo),
1816
- g("label", {
1969
+ }, null, 40, Bo),
1970
+ w("label", {
1817
1971
  for: e.tablename + "-main-checkbox"
1818
- }, null, 8, xo)
1972
+ }, null, 8, Ho)
1819
1973
  ])
1820
- ])) : P("", !0),
1821
- (h(!0), w(K, null, z(e.columns, (i) => (h(), w("th", {
1822
- key: i.field,
1823
- onClick: (p) => i.sortable ? e.sortHelpers.handleSort(i.field, p) : null,
1824
- style: St({ width: i.width + "%" }),
1825
- class: W([i.sortable ? "vs-sortable" : "", e.headerClass])
1974
+ ])) : D("", !0),
1975
+ (y(!0), k(K, null, Q(t.columns, (h) => (y(), k(K, {
1976
+ key: h.field || h.label
1826
1977
  }, [
1827
- q(c.$slots, `header-${i.field}`, { column: i }, () => [
1828
- g("div", ko, [
1829
- g("span", Ro, D(i.label), 1),
1830
- i.sortable ? (h(), w("div", So, [
1831
- g("span", {
1832
- class: W(["vs-sort-icon vs-sort-asc", {
1833
- "vs-active": e.sortHelpers.isColumnSorted(i.field) && e.sortHelpers.getSortOrder(i.field) === "asc"
1834
- }])
1835
- }, [...f[0] || (f[0] = [
1836
- g("svg", {
1837
- xmlns: "http://www.w3.org/2000/svg",
1838
- height: "24px",
1839
- viewBox: "0 -960 960 960",
1840
- width: "24px",
1841
- fill: "var(--vs-gray-800)"
1842
- }, [
1843
- g("path", { d: "m280-400 200-200 200 200H280Z" })
1844
- ], -1)
1845
- ])], 2),
1846
- g("span", {
1847
- class: W(["vs-sort-icon vs-sort-desc", {
1848
- "vs-active": e.sortHelpers.isColumnSorted(i.field) && e.sortHelpers.getSortOrder(i.field) === "desc"
1849
- }])
1850
- }, [...f[1] || (f[1] = [
1851
- g("svg", {
1852
- xmlns: "http://www.w3.org/2000/svg",
1853
- height: "24px",
1854
- viewBox: "0 -960 960 960",
1855
- width: "24px"
1856
- }, [
1857
- g("path", { d: "M480-360 280-560h400L480-360Z" })
1858
- ], -1)
1859
- ])], 2)
1860
- ])) : P("", !0),
1861
- e.sortHelpers.getSortPriority(i.field) !== null ? (h(), w("span", To, D(e.sortHelpers.getSortPriority(i.field)), 1)) : P("", !0),
1862
- i.filter ? (h(), fe(go, {
1863
- key: 2,
1864
- type: i.filter.type,
1865
- "async-options": i.filter.asyncOptions,
1866
- field: i.field,
1867
- operators: i.filter.operators,
1868
- modelValue: l.value[i.field],
1869
- "onUpdate:modelValue": (p) => l.value[i.field] = p,
1870
- visible: a.value === i.field,
1871
- "column-data": e.rows.map((p) => p[i.field]),
1872
- onApply: (p) => {
1873
- o("applyFilter", i.field, p);
1874
- },
1875
- onClear: () => {
1876
- o("clearFilter", i.field);
1877
- },
1878
- onClose: (p) => u(i.field),
1879
- onOpen: (p) => r(i.field)
1880
- }, Ne({ _: 2 }, [
1881
- i.filter.custom ? {
1882
- name: "custom",
1883
- fn: I(({ filter: p, apply: v, clear: d }) => [
1884
- q(c.$slots, i.filter.custom, {
1885
- filter: p,
1886
- apply: v,
1887
- clear: d
1888
- }, void 0, !0)
1889
- ]),
1890
- key: "0"
1891
- } : void 0
1892
- ]), 1032, ["type", "async-options", "field", "operators", "modelValue", "onUpdate:modelValue", "visible", "column-data", "onApply", "onClear", "onClose", "onOpen"])) : P("", !0)
1893
- ])
1894
- ], !0)
1895
- ], 14, Co))), 128))
1978
+ !h.children || !h.children.length ? (y(), fe(ht, Ae({
1979
+ key: 0,
1980
+ column: h,
1981
+ rows: e.rows,
1982
+ rowspan: 2,
1983
+ "sort-helpers": e.sortHelpers,
1984
+ filters: l.value,
1985
+ "open-filter": a.value,
1986
+ "header-class": e.headerClass,
1987
+ tablename: e.tablename
1988
+ }, { ref_for: !0 }, f.$attrs, {
1989
+ onApplyFilter: u[0] || (u[0] = (g, C) => o("applyFilter", g, C)),
1990
+ onClearFilter: u[1] || (u[1] = (g) => o("clearFilter", g)),
1991
+ onOpenFilter: r,
1992
+ onCloseFilter: i,
1993
+ "onUpdate:filters": u[2] || (u[2] = (g) => o("update:filters", g))
1994
+ }), Te({ _: 2 }, [
1995
+ Q(f.$slots, (g, C) => ({
1996
+ name: C,
1997
+ fn: X((S) => [
1998
+ z(f.$slots, C, Ae({ ref_for: !0 }, S), void 0, !0)
1999
+ ])
2000
+ }))
2001
+ ]), 1040, ["column", "rows", "sort-helpers", "filters", "open-filter", "header-class", "tablename"])) : (y(), k("th", {
2002
+ key: 1,
2003
+ colspan: h.children.length,
2004
+ "data-field": `group-${h.label}`,
2005
+ class: "vs-group-header",
2006
+ style: { textAlign: "center" }
2007
+ }, H(h.label), 9, Wo))
2008
+ ], 64))), 128))
2009
+ ])) : D("", !0),
2010
+ w("tr", null, [
2011
+ e.expandable && !d.value ? (y(), k("th", No)) : D("", !0),
2012
+ e.isItemSelectedControlled && !d.value ? (y(), k("th", Ko, [
2013
+ w("div", zo, [
2014
+ w("input", {
2015
+ type: "checkbox",
2016
+ id: e.tablename + "-main-checkbox",
2017
+ checked: e.isAllChecked,
2018
+ indeterminate: e.isSomeChecked,
2019
+ onChange: s
2020
+ }, null, 40, jo),
2021
+ w("label", {
2022
+ for: e.tablename + "-main-checkbox"
2023
+ }, null, 8, Uo)
2024
+ ])
2025
+ ])) : D("", !0),
2026
+ (y(!0), k(K, null, Q(v.value, (h) => (y(), k(K, {
2027
+ key: h.field
2028
+ }, [
2029
+ h.field && m(h) ? (y(), fe(ht, Ae({
2030
+ key: 0,
2031
+ column: h,
2032
+ rows: e.rows,
2033
+ "sort-helpers": e.sortHelpers,
2034
+ filters: l.value,
2035
+ "open-filter": a.value,
2036
+ "header-class": e.headerClass,
2037
+ tablename: e.tablename
2038
+ }, { ref_for: !0 }, f.$attrs, {
2039
+ onApplyFilter: u[3] || (u[3] = (g, C) => o("applyFilter", g, C)),
2040
+ onClearFilter: u[4] || (u[4] = (g) => o("clearFilter", g)),
2041
+ onOpenFilter: r,
2042
+ onCloseFilter: i,
2043
+ "onUpdate:filters": u[5] || (u[5] = (g) => o("update:filters", g))
2044
+ }), Te({ _: 2 }, [
2045
+ Q(f.$slots, (g, C) => ({
2046
+ name: C,
2047
+ fn: X((S) => [
2048
+ z(f.$slots, C, Ae({ ref_for: !0 }, S), void 0, !0)
2049
+ ])
2050
+ }))
2051
+ ]), 1040, ["column", "rows", "sort-helpers", "filters", "open-filter", "header-class", "tablename"])) : D("", !0)
2052
+ ], 64))), 128))
1896
2053
  ])
1897
- ]));
2054
+ ], 512));
1898
2055
  }
1899
- }), Vo = /* @__PURE__ */ ne($o, [["__scopeId", "data-v-1776a5d5"]]), Oo = { key: 0 }, Ao = ["colspan"], Eo = { key: 1 }, Po = ["colspan"], Do = { class: "vs-no-data-message" }, Lo = { class: "vs-no-data-description" }, Fo = ["onClick"], Bo = ["aria-expanded", "aria-controls", "onClick"], Mo = { key: 0 }, qo = { key: 1 }, No = { class: "vs-checkbox" }, Io = ["id", "value", "checked", "onChange"], Ho = ["for"], Ko = {
2056
+ }), Xo = /* @__PURE__ */ ae(Zo, [["__scopeId", "data-v-f82c670c"]]), Qo = { key: 0 }, Yo = ["colspan"], Go = { key: 1 }, Jo = ["colspan"], _o = { class: "vs-no-data-message" }, es = { class: "vs-no-data-description" }, ts = ["onClick"], ns = ["aria-expanded", "aria-controls", "onClick"], os = { key: 0 }, ss = { key: 1 }, ls = { class: "vs-checkbox" }, as = ["id", "value", "checked", "onChange"], rs = ["for"], is = ["data-field"], cs = {
1900
2057
  key: 0,
1901
2058
  class: "vs-row-expanded"
1902
- }, Wo = ["colspan"], Uo = {
2059
+ }, us = ["colspan"], ds = {
1903
2060
  key: 1,
1904
2061
  class: "vs-expanded-content"
1905
- }, jo = /* @__PURE__ */ _({
2062
+ }, fs = /* @__PURE__ */ _({
1906
2063
  __name: "VsDataTableBody",
1907
2064
  props: {
1908
2065
  loading: { type: Boolean },
@@ -1929,181 +2086,191 @@ const Gn = {
1929
2086
  isRowSelected: { type: Function }
1930
2087
  },
1931
2088
  emits: ["row-click"],
1932
- setup(e, { emit: t }) {
1933
- const n = e, o = T(() => n.rowKey ?? "id");
1934
- return (s, l) => (h(), w("tbody", null, [
1935
- e.loading ? (h(), w("tr", Oo, [
1936
- g("td", {
2089
+ setup(e, { emit: n }) {
2090
+ const t = e, o = F(() => t.rowKey ?? "id"), s = q(null), l = F(() => t.columns.flatMap(
2091
+ (a) => "children" in a ? a.children : [a]
2092
+ ));
2093
+ return (a, r) => (y(), k("tbody", {
2094
+ ref_key: "bodyRef",
2095
+ ref: s
2096
+ }, [
2097
+ e.loading ? (y(), k("tr", Qo, [
2098
+ w("td", {
1937
2099
  colspan: e.totalColumns,
1938
2100
  class: "vs-loading"
1939
2101
  }, [
1940
- l[2] || (l[2] = g("div", { class: "vs-spinner" }, null, -1)),
1941
- g("span", null, D(e.loadingText), 1)
1942
- ], 8, Ao)
1943
- ])) : e.paginatedRows.length ? (h(!0), w(K, { key: 2 }, z(e.paginatedRows, (a, r) => (h(), w(K, {
1944
- key: e.getRowKey(a, r)
2102
+ r[2] || (r[2] = w("div", { class: "vs-spinner" }, null, -1)),
2103
+ w("span", null, H(e.loadingText), 1)
2104
+ ], 8, Yo)
2105
+ ])) : e.paginatedRows.length ? (y(!0), k(K, { key: 2 }, Q(e.paginatedRows, (i, c) => (y(), k(K, {
2106
+ key: e.getRowKey(i, c)
1945
2107
  }, [
1946
- g("tr", {
1947
- class: W([
2108
+ w("tr", {
2109
+ class: G([
1948
2110
  e.rowClass,
1949
2111
  { "vs-row-clickable": e.hasRowClick },
1950
- { "vs-row-selected": e.isRowSelected(a, e.selectedItems, o.value) }
2112
+ { "vs-row-selected": e.isRowSelected(i, e.selectedItems, o.value) }
1951
2113
  ]),
1952
- onClick: (u) => s.$emit("row-click", a, r)
2114
+ onClick: (d) => a.$emit("row-click", i, c)
1953
2115
  }, [
1954
- e.expandable ? (h(), w("td", {
2116
+ e.expandable ? (y(), k("td", {
1955
2117
  key: 0,
1956
2118
  class: "vs-expand-column",
1957
- onClick: l[0] || (l[0] = le(() => {
2119
+ "data-field": "_expand",
2120
+ onClick: r[0] || (r[0] = me(() => {
1958
2121
  }, ["stop"]))
1959
2122
  }, [
1960
- g("button", {
2123
+ w("button", {
1961
2124
  class: "vs-expand-btn",
1962
2125
  type: "button",
1963
- "aria-expanded": e.isRowExpanded(a, r),
1964
- "aria-controls": `row-details-${e.getRowKey(a, r)}`,
1965
- onClick: le((u) => e.toggleRowExpansion(a, r), ["stop"])
2126
+ "aria-expanded": e.isRowExpanded(i, c),
2127
+ "aria-controls": `row-details-${e.getRowKey(i, c)}`,
2128
+ onClick: me((d) => e.toggleRowExpansion(i, c), ["stop"])
1966
2129
  }, [
1967
- e.isRowExpanded(a, r) ? (h(), w("span", Mo, [...l[4] || (l[4] = [
1968
- g("svg", {
2130
+ e.isRowExpanded(i, c) ? (y(), k("span", os, [...r[4] || (r[4] = [
2131
+ w("svg", {
1969
2132
  xmlns: "http://www.w3.org/2000/svg",
1970
2133
  height: "24px",
1971
2134
  viewBox: "0 -960 960 960",
1972
2135
  width: "24px",
1973
2136
  fill: "var(--vs-gray-800)"
1974
2137
  }, [
1975
- g("path", { d: "M480-345 240-585l56-56 184 183 184-183 56 56-240 240Z" })
2138
+ w("path", { d: "M480-345 240-585l56-56 184 183 184-183 56 56-240 240Z" })
1976
2139
  ], -1)
1977
- ])])) : (h(), w("span", qo, [...l[5] || (l[5] = [
1978
- g("svg", {
2140
+ ])])) : (y(), k("span", ss, [...r[5] || (r[5] = [
2141
+ w("svg", {
1979
2142
  xmlns: "http://www.w3.org/2000/svg",
1980
2143
  height: "24px",
1981
2144
  viewBox: "0 -960 960 960",
1982
2145
  width: "24px",
1983
2146
  fill: "var(--vs-gray-800)"
1984
2147
  }, [
1985
- g("path", { d: "M504-480 320-664l56-56 240 240-240 240-56-56 184-184Z" })
2148
+ w("path", { d: "M504-480 320-664l56-56 240 240-240 240-56-56 184-184Z" })
1986
2149
  ], -1)
1987
2150
  ])]))
1988
- ], 8, Bo)
1989
- ])) : P("", !0),
1990
- e.isItemSelectedControlled ? (h(), w("td", {
2151
+ ], 8, ns)
2152
+ ])) : D("", !0),
2153
+ e.isItemSelectedControlled ? (y(), k("td", {
1991
2154
  key: 1,
1992
- onClick: l[1] || (l[1] = le(() => {
1993
- }, ["stop"])),
1994
- class: "vs-checkbox-column"
2155
+ class: "vs-checkbox-column",
2156
+ "data-field": "_checkbox",
2157
+ onClick: r[1] || (r[1] = me(() => {
2158
+ }, ["stop"]))
1995
2159
  }, [
1996
- g("div", No, [
1997
- g("input", {
2160
+ w("div", ls, [
2161
+ w("input", {
1998
2162
  type: "checkbox",
1999
- id: e.tablename + "-checkbox-" + e.getRowKey(a, r),
2000
- value: a,
2001
- checked: e.selectedItems.some((u, c) => e.getRowKey(u, c) === e.getRowKey(a, r)),
2002
- onChange: (u) => e.toggleRow(a, r)
2003
- }, null, 40, Io),
2004
- g("label", {
2005
- for: e.tablename + "-checkbox-" + e.getRowKey(a, r)
2006
- }, null, 8, Ho)
2163
+ id: e.tablename + "-checkbox-" + e.getRowKey(i, c),
2164
+ value: i,
2165
+ checked: e.selectedItems.some((d, v) => e.getRowKey(d, v) === e.getRowKey(i, c)),
2166
+ onChange: (d) => e.toggleRow(i, c)
2167
+ }, null, 40, as),
2168
+ w("label", {
2169
+ for: e.tablename + "-checkbox-" + e.getRowKey(i, c)
2170
+ }, null, 8, rs)
2007
2171
  ])
2008
- ])) : P("", !0),
2009
- (h(!0), w(K, null, z(e.columns, (u) => (h(), w("td", {
2010
- key: u.field,
2011
- class: W(e.cellClass)
2012
- }, [
2013
- q(s.$slots, `cell-${u.field}`, {
2014
- item: a,
2015
- value: e.getValue(a, u.field),
2016
- column: u,
2017
- index: r
2018
- }, () => [
2019
- je(D(e.getValue(a, u.field)), 1)
2020
- ], !0)
2021
- ], 2))), 128))
2022
- ], 10, Fo),
2023
- e.expandable ? (h(), w(K, { key: 0 }, [
2024
- e.isRowExpanded(a, r) ? (h(), w("tr", Ko, [
2025
- g("td", {
2172
+ ])) : D("", !0),
2173
+ (y(!0), k(K, null, Q(l.value, (d) => (y(), k(K, null, [
2174
+ d && d.field ? (y(), k("td", {
2175
+ key: d.field,
2176
+ class: G(e.cellClass),
2177
+ "data-field": d.field
2178
+ }, [
2179
+ z(a.$slots, `cell-${d.field}`, {
2180
+ item: i,
2181
+ value: e.getValue(i, d.field),
2182
+ column: d,
2183
+ index: c
2184
+ }, () => [
2185
+ Ye(H(e.getValue(i, d.field)), 1)
2186
+ ], !0)
2187
+ ], 10, is)) : D("", !0)
2188
+ ], 64))), 256))
2189
+ ], 10, ts),
2190
+ e.expandable ? (y(), k(K, { key: 0 }, [
2191
+ e.isRowExpanded(i, c) ? (y(), k("tr", cs, [
2192
+ w("td", {
2026
2193
  colspan: e.totalColumns,
2027
2194
  class: "vs-expanded-cell"
2028
2195
  }, [
2029
- e.isRowLoading(a, r) ? q(s.$slots, "row-expanded-loader", {
2196
+ e.isRowLoading(i, c) ? z(a.$slots, "row-expanded-loader", {
2030
2197
  key: 0,
2031
- item: a,
2032
- index: r
2198
+ item: i,
2199
+ index: c
2033
2200
  }, () => [
2034
- l[6] || (l[6] = g("div", { class: "vs-loader-bar" }, [
2035
- g("div", { class: "vs-loader-bar-inner" })
2201
+ r[6] || (r[6] = w("div", { class: "vs-loader-bar" }, [
2202
+ w("div", { class: "vs-loader-bar-inner" })
2036
2203
  ], -1))
2037
- ], !0) : (h(), w("div", Uo, [
2038
- q(s.$slots, "row-expanded", {
2039
- item: a,
2040
- index: r
2204
+ ], !0) : (y(), k("div", ds, [
2205
+ z(a.$slots, "row-expanded", {
2206
+ item: i,
2207
+ index: c
2041
2208
  }, () => [
2042
- l[7] || (l[7] = je(" Expanded details for row ", -1)),
2043
- g("b", null, D(e.getRowKey(a, r)), 1)
2209
+ r[7] || (r[7] = Ye(" Expanded details for row ", -1)),
2210
+ w("b", null, H(e.getRowKey(i, c)), 1)
2044
2211
  ], !0)
2045
2212
  ]))
2046
- ], 8, Wo)
2047
- ])) : P("", !0)
2048
- ], 64)) : P("", !0)
2049
- ], 64))), 128)) : (h(), w("tr", Eo, [
2050
- g("td", {
2213
+ ], 8, us)
2214
+ ])) : D("", !0)
2215
+ ], 64)) : D("", !0)
2216
+ ], 64))), 128)) : (y(), k("tr", Go, [
2217
+ w("td", {
2051
2218
  colspan: e.totalColumns,
2052
2219
  class: "vs-no-data"
2053
2220
  }, [
2054
- q(s.$slots, "no-data", {}, () => [
2055
- l[3] || (l[3] = g("div", { class: "vs-no-data-icon" }, [
2056
- g("svg", {
2221
+ z(a.$slots, "no-data", {}, () => [
2222
+ r[3] || (r[3] = w("div", { class: "vs-no-data-icon" }, [
2223
+ w("svg", {
2057
2224
  viewBox: "0 0 24 24",
2058
2225
  fill: "currentColor"
2059
2226
  }, [
2060
- g("path", { d: "M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-5 14H7v-2h7v2zm3-4H7v-2h10v2zm0-4H7V7h10v2z" })
2227
+ w("path", { d: "M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-5 14H7v-2h7v2zm3-4H7v-2h10v2zm0-4H7V7h10v2z" })
2061
2228
  ])
2062
2229
  ], -1)),
2063
- g("div", Do, D(e.noDataText), 1),
2064
- g("div", Lo, D(e.noDataDescription), 1)
2230
+ w("div", _o, H(e.noDataText), 1),
2231
+ w("div", es, H(e.noDataDescription), 1)
2065
2232
  ], !0)
2066
- ], 8, Po)
2233
+ ], 8, Jo)
2067
2234
  ]))
2068
- ]));
2235
+ ], 512));
2069
2236
  }
2070
- }), zo = /* @__PURE__ */ ne(jo, [["__scopeId", "data-v-149f0fb5"]]), Zo = { class: "vs-search" }, Qo = ["placeholder", "value"], Xo = /* @__PURE__ */ _({
2237
+ }), vs = /* @__PURE__ */ ae(fs, [["__scopeId", "data-v-d11afcd0"]]), hs = { class: "vs-search" }, ms = ["placeholder", "value"], ps = /* @__PURE__ */ _({
2071
2238
  __name: "VsSearch",
2072
2239
  props: {
2073
2240
  modelValue: {},
2074
2241
  placeholder: {}
2075
2242
  },
2076
2243
  emits: ["update:modelValue", "inputTyped"],
2077
- setup(e, { emit: t }) {
2078
- const n = t, o = (s) => {
2244
+ setup(e, { emit: n }) {
2245
+ const t = n, o = (s) => {
2079
2246
  const l = s.target;
2080
- n("update:modelValue", l.value), n("inputTyped", l.value);
2247
+ t("update:modelValue", l.value), t("inputTyped", l.value);
2081
2248
  };
2082
- return (s, l) => (h(), w("div", Zo, [
2083
- l[0] || (l[0] = g("div", { class: "vs-search-icon" }, [
2084
- g("svg", {
2249
+ return (s, l) => (y(), k("div", hs, [
2250
+ l[0] || (l[0] = w("div", { class: "vs-search-icon" }, [
2251
+ w("svg", {
2085
2252
  xmlns: "http://www.w3.org/2000/svg",
2086
2253
  height: "22px",
2087
2254
  viewBox: "0 -960 960 960",
2088
2255
  width: "22px",
2089
2256
  fill: "#e3e3e3"
2090
2257
  }, [
2091
- g("path", { d: "M784-120 532-372q-30 24-69 38t-83 14q-109 0-184.5-75.5T120-580q0-109 75.5-184.5T380-840q109 0 184.5 75.5T640-580q0 44-14 83t-38 69l252 252-56 56ZM380-400q75 0 127.5-52.5T560-580q0-75-52.5-127.5T380-760q-75 0-127.5 52.5T200-580q0 75 52.5 127.5T380-400Z" })
2258
+ w("path", { d: "M784-120 532-372q-30 24-69 38t-83 14q-109 0-184.5-75.5T120-580q0-109 75.5-184.5T380-840q109 0 184.5 75.5T640-580q0 44-14 83t-38 69l252 252-56 56ZM380-400q75 0 127.5-52.5T560-580q0-75-52.5-127.5T380-760q-75 0-127.5 52.5T200-580q0 75 52.5 127.5T380-400Z" })
2092
2259
  ])
2093
2260
  ], -1)),
2094
- g("input", {
2261
+ w("input", {
2095
2262
  type: "text",
2096
2263
  class: "vs-search-input",
2097
2264
  placeholder: e.placeholder,
2098
2265
  value: e.modelValue,
2099
2266
  onInput: o
2100
- }, null, 40, Qo)
2267
+ }, null, 40, ms)
2101
2268
  ]));
2102
2269
  }
2103
- }), Yo = /* @__PURE__ */ ne(Xo, [["__scopeId", "data-v-60b73b45"]]), Go = { class: "vs-datatable-toolbar vs-layout-row" }, Jo = { class: "vs-layout-start" }, _o = {
2270
+ }), gs = /* @__PURE__ */ ae(ps, [["__scopeId", "data-v-60b73b45"]]), ys = { class: "vs-datatable-toolbar vs-layout-row" }, ws = { class: "vs-layout-start" }, bs = {
2104
2271
  key: 0,
2105
2272
  class: "vs-search-container"
2106
- }, es = { class: "vs-layout-end" }, ts = /* @__PURE__ */ _({
2273
+ }, xs = { class: "vs-layout-end" }, ks = /* @__PURE__ */ _({
2107
2274
  __name: "VsDataTableToolbar",
2108
2275
  props: {
2109
2276
  showSearch: { type: Boolean },
@@ -2112,146 +2279,217 @@ const Gn = {
2112
2279
  searchClass: {}
2113
2280
  },
2114
2281
  emits: ["update:searchQuery", "search"],
2115
- setup(e, { emit: t }) {
2116
- const n = t, o = (s) => {
2117
- n("update:searchQuery", s), n("search", s);
2282
+ setup(e, { emit: n }) {
2283
+ const t = n, o = (s) => {
2284
+ t("update:searchQuery", s), t("search", s);
2118
2285
  };
2119
- return (s, l) => (h(), w("div", Go, [
2120
- g("div", Jo, [
2121
- e.showSearch ? (h(), w("div", _o, [
2122
- j(Yo, {
2286
+ return (s, l) => (y(), k("div", ys, [
2287
+ w("div", ws, [
2288
+ e.showSearch ? (y(), k("div", bs, [
2289
+ ne(gs, {
2123
2290
  "model-value": e.searchQuery,
2124
2291
  "onUpdate:modelValue": o,
2125
2292
  placeholder: e.searchPlaceholder,
2126
- class: W(e.searchClass)
2293
+ class: G(e.searchClass)
2127
2294
  }, null, 8, ["model-value", "placeholder", "class"])
2128
- ])) : P("", !0),
2129
- q(s.$slots, "left", {}, void 0, !0)
2295
+ ])) : D("", !0),
2296
+ z(s.$slots, "left", {}, void 0, !0)
2130
2297
  ]),
2131
- g("div", es, [
2132
- q(s.$slots, "right", {}, void 0, !0)
2298
+ w("div", xs, [
2299
+ z(s.$slots, "right", {}, void 0, !0)
2133
2300
  ])
2134
2301
  ]));
2135
2302
  }
2136
- }), ns = /* @__PURE__ */ ne(ts, [["__scopeId", "data-v-8524b8f7"]]);
2137
- function os(e, t, n) {
2138
- const o = L(1), s = L(e.sort ? [...e.sort] : []);
2139
- G(
2303
+ }), Cs = /* @__PURE__ */ ae(ks, [["__scopeId", "data-v-8a8215b9"]]), Ss = { key: 0 }, Rs = { class: "vs-footer-row" }, Es = {
2304
+ key: 0,
2305
+ class: "vs-footer-cell vs-expand-column"
2306
+ }, $s = {
2307
+ key: 1,
2308
+ class: "vs-footer-cell vs-checkbox-column"
2309
+ }, As = ["data-field"], Fs = /* @__PURE__ */ _({
2310
+ __name: "VsDataTableFooter",
2311
+ props: {
2312
+ columns: {},
2313
+ rows: {},
2314
+ expandable: { type: Boolean },
2315
+ isItemSelectedControlled: { type: Boolean }
2316
+ },
2317
+ setup(e) {
2318
+ const n = e, t = F(() => {
2319
+ const s = [];
2320
+ function l(a) {
2321
+ for (const r of a)
2322
+ r.hidden || (r.children && r.children.length ? l(r.children) : s.push(r));
2323
+ }
2324
+ return l(n.columns), s.map((a) => {
2325
+ const r = a.footerValue !== void 0;
2326
+ let i = null;
2327
+ if (typeof a.footerValue == "function")
2328
+ try {
2329
+ i = a.footerValue(n.rows);
2330
+ } catch (c) {
2331
+ console.warn(`Error computing footerValue for column "${a.field}"`, c);
2332
+ }
2333
+ else a.footerValue !== void 0 && (i = a.footerValue);
2334
+ return {
2335
+ ...a,
2336
+ hasFooter: r,
2337
+ footerValue: i,
2338
+ formattedValue: o(a, i)
2339
+ };
2340
+ });
2341
+ });
2342
+ function o(s, l) {
2343
+ if (l == null) return "";
2344
+ if (s.footerFormatter)
2345
+ try {
2346
+ return s.footerFormatter(l, s);
2347
+ } catch (a) {
2348
+ return console.warn(`Error in footerFormatter for column "${s.field}"`, a), String(l);
2349
+ }
2350
+ return typeof l == "number" ? s.field === "price" ? `$${l.toFixed(2)}` : s.field === "tax" ? l.toFixed(2) : l.toLocaleString() : String(l);
2351
+ }
2352
+ return (s, l) => t.value.length ? (y(), k("tfoot", Ss, [
2353
+ w("tr", Rs, [
2354
+ e.expandable ? (y(), k("td", Es)) : D("", !0),
2355
+ e.isItemSelectedControlled ? (y(), k("td", $s)) : D("", !0),
2356
+ (y(!0), k(K, null, Q(t.value, (a, r) => (y(), k("td", {
2357
+ key: r,
2358
+ "data-field": a.field,
2359
+ class: G(["vs-footer-cell", a.footerClass || ""]),
2360
+ style: pt(a.footerStyle || {})
2361
+ }, [
2362
+ a.hasFooter ? z(s.$slots, `footer-${a.field}`, {
2363
+ key: 0,
2364
+ column: a,
2365
+ value: a.footerValue,
2366
+ rows: e.rows
2367
+ }, () => [
2368
+ Ye(H(a.formattedValue), 1)
2369
+ ], !0) : D("", !0)
2370
+ ], 14, As))), 128))
2371
+ ])
2372
+ ])) : D("", !0);
2373
+ }
2374
+ }), Ts = /* @__PURE__ */ ae(Fs, [["__scopeId", "data-v-f3b614d3"]]);
2375
+ function Os(e, n, t) {
2376
+ const o = q(1), s = q(e.sort ? [...e.sort] : []);
2377
+ Y(
2140
2378
  () => e.sort,
2141
- (i) => {
2142
- i && (s.value = [...i]);
2379
+ (v) => {
2380
+ v && (s.value = [...v]);
2143
2381
  },
2144
2382
  { deep: !0 }
2145
2383
  );
2146
- const l = T(
2384
+ const l = F(
2147
2385
  () => e.serverOptions?.sort ?? s.value ?? []
2148
2386
  );
2149
2387
  return {
2150
2388
  activeSort: l,
2151
2389
  sortHelpers: {
2152
- isColumnSorted: (i) => l.value.some((p) => p.field === i),
2153
- getSortPriority: (i) => {
2154
- const p = l.value.find((v) => v.field === i);
2155
- return p ? p.priority ?? null : null;
2390
+ isColumnSorted: (v) => l.value.some((m) => m.field === v),
2391
+ getSortPriority: (v) => {
2392
+ const m = l.value.find((f) => f.field === v);
2393
+ return m ? m.priority ?? null : null;
2156
2394
  },
2157
- getSortOrder: (i) => l.value.find((p) => p.field === i)?.order ?? null,
2158
- handleSort: (i, p) => {
2159
- let v = [...s.value];
2160
- const d = v.findIndex((m) => m.field === i);
2161
- p.shiftKey ? d === -1 ? v.push({ field: i, order: "asc" }) : v[d]?.order === "asc" ? v[d].order = "desc" : v.splice(d, 1) : d === -1 ? v = [{ field: i, order: "asc" }] : v[d]?.order === "asc" ? v = [{ field: i, order: "desc" }] : v = [], v = v.map((m, b) => ({ ...m, priority: b + 1 })), s.value = [...v], e.serverOptions ? t("update:serverOptions", { ...e.serverOptions, sort: v }) : t("update:sort", v), n.value = o.value, t("sortChanged", { sort: v });
2395
+ getSortOrder: (v) => l.value.find((m) => m.field === v)?.order ?? null,
2396
+ handleSort: (v, m) => {
2397
+ let f = [...s.value];
2398
+ const u = f.findIndex((h) => h.field === v);
2399
+ m.shiftKey ? u === -1 ? f.push({ field: v, order: "asc" }) : f[u]?.order === "asc" ? f[u].order = "desc" : f.splice(u, 1) : u === -1 ? f = [{ field: v, order: "asc" }] : f[u]?.order === "asc" ? f = [{ field: v, order: "desc" }] : f = [], f = f.map((h, g) => ({ ...h, priority: g + 1 })), s.value = [...f], e.serverOptions ? n("update:serverOptions", { ...e.serverOptions, sort: f }) : n("update:sort", f), t.value = o.value, n("sortChanged", { sort: f });
2162
2400
  }
2163
2401
  }
2164
2402
  };
2165
2403
  }
2166
- function ss(e, t, n, o, s) {
2167
- const l = T({
2404
+ function Vs(e, n, t, o, s) {
2405
+ const l = F({
2168
2406
  get: () => e.serverItemsLength !== void 0 ? e.serverItemsLength : s.value.length,
2169
- set: (f) => {
2170
- e.serverItemsLength !== void 0 && t("update:serverItemsLength", f);
2407
+ set: (d) => {
2408
+ e.serverItemsLength !== void 0 && n("update:serverItemsLength", d);
2171
2409
  }
2172
- }), a = T({
2173
- get: () => e.serverOptions?.page ?? n.value,
2174
- set: (f) => {
2175
- e.serverOptions ? t("update:serverOptions", { ...e.serverOptions, page: f }) : n.value = f;
2410
+ }), a = F({
2411
+ get: () => e.serverOptions?.page ?? t.value,
2412
+ set: (d) => {
2413
+ e.serverOptions ? n("update:serverOptions", { ...e.serverOptions, page: d }) : t.value = d;
2176
2414
  }
2177
- }), r = T(() => {
2178
- const f = o.value;
2179
- return Pt(n.value, f, l.value);
2180
- }), u = (f) => {
2181
- e.serverOptions && t("update:serverOptions", { ...e.serverOptions, page: f }), t("pageUpdated", f);
2415
+ }), r = F(() => {
2416
+ const d = o.value;
2417
+ return Kt(t.value, d, l.value);
2418
+ }), i = (d) => {
2419
+ e.serverOptions && n("update:serverOptions", { ...e.serverOptions, page: d }), n("pageUpdated", d);
2182
2420
  };
2183
2421
  return {
2184
2422
  currentPage: a,
2185
2423
  totalRecords: l,
2186
2424
  recordRange: r,
2187
- handlePageChange: u,
2425
+ handlePageChange: i,
2188
2426
  paginationHelpers: {
2189
- page: n,
2427
+ page: t,
2190
2428
  totalRecords: l,
2191
2429
  recordRange: r,
2192
- handlePageChange: u
2430
+ handlePageChange: i
2193
2431
  }
2194
2432
  };
2195
2433
  }
2196
- function ls(e, t, n, o) {
2197
- const s = T({
2434
+ function Ls(e, n, t, o) {
2435
+ const s = F({
2198
2436
  get: () => o.value,
2199
2437
  set: (a) => o.value = a
2200
2438
  });
2201
- return G(o, (a) => {
2202
- const r = e.serverItemsLength ?? e.rows.length, u = it(r, a);
2203
- n.value > u ? n.value = u || 1 : n.value < 1 && (n.value = 1);
2439
+ return Y(o, (a) => {
2440
+ const r = e.serverItemsLength ?? e.rows.length, i = wt(r, a);
2441
+ t.value > i ? t.value = i || 1 : t.value < 1 && (t.value = 1);
2204
2442
  }), {
2205
2443
  vsRowsPerPage: s,
2206
2444
  handleRowsPerPage: (a) => {
2207
- o.value = a, t("rowsPerPageChanged", a);
2445
+ o.value = a, n("rowsPerPageChanged", a);
2208
2446
  }
2209
2447
  };
2210
2448
  }
2211
- function as(e, t) {
2212
- const n = (a) => {
2213
- t.value = a, e("inputTyped", a);
2449
+ function Ps(e, n) {
2450
+ const t = (a) => {
2451
+ n.value = a, e("inputTyped", a);
2214
2452
  };
2215
2453
  return {
2216
- searchQuery: t,
2217
- onInputTyped: n,
2454
+ searchQuery: n,
2455
+ onInputTyped: t,
2218
2456
  clearSearch: () => {
2219
- t.value = "", e("inputTyped", "");
2457
+ n.value = "", e("inputTyped", "");
2220
2458
  },
2221
2459
  setSearchQuery: (a) => {
2222
- t.value = a, e("inputTyped", a);
2460
+ n.value = a, e("inputTyped", a);
2223
2461
  },
2224
2462
  searchHelpers: {
2225
- searchQuery: t,
2226
- onInputTyped: n
2463
+ searchQuery: n,
2464
+ onInputTyped: t
2227
2465
  }
2228
2466
  };
2229
2467
  }
2230
- function rs(e, t) {
2231
- const n = L([]), o = L(/* @__PURE__ */ new Map()), s = T({
2232
- get: () => e.expanded ?? n.value,
2233
- set: (f) => {
2234
- e.expanded !== void 0 ? t("update:expanded", f) : n.value = f;
2468
+ function Ds(e, n) {
2469
+ const t = q([]), o = q(/* @__PURE__ */ new Map()), s = F({
2470
+ get: () => e.expanded ?? t.value,
2471
+ set: (d) => {
2472
+ e.expanded !== void 0 ? n("update:expanded", d) : t.value = d;
2235
2473
  }
2236
2474
  });
2237
- function l(f, i) {
2238
- return typeof e.rowKey == "function" ? e.rowKey(f, i) : typeof e.rowKey == "string" && f[e.rowKey] !== void 0 ? f[e.rowKey] : i;
2475
+ function l(d, v) {
2476
+ return typeof e.rowKey == "function" ? e.rowKey(d, v) : typeof e.rowKey == "string" && d[e.rowKey] !== void 0 ? d[e.rowKey] : v;
2239
2477
  }
2240
- function a(f, i) {
2241
- const p = l(f, i);
2242
- return s.value.includes(p);
2478
+ function a(d, v) {
2479
+ const m = l(d, v);
2480
+ return s.value.includes(m);
2243
2481
  }
2244
- function r(f, i) {
2245
- const p = l(f, i), v = s.value.includes(p);
2246
- let d;
2247
- v ? (d = s.value.filter((m) => m !== p), t("collapseRow", { row: f, index: i, rowId: p })) : (d = e.accordion ? [p] : [...s.value, p], t("expandRow", { row: f, index: i, rowId: p })), s.value = d;
2482
+ function r(d, v) {
2483
+ const m = l(d, v), f = s.value.includes(m);
2484
+ let u;
2485
+ f ? (u = s.value.filter((h) => h !== m), n("collapseRow", { row: d, index: v, rowId: m })) : (u = e.accordion ? [m] : [...s.value, m], n("expandRow", { row: d, index: v, rowId: m })), s.value = u;
2248
2486
  }
2249
- function u(f, i) {
2250
- const p = l(f, i);
2251
- return o.value.get(p) === !0;
2487
+ function i(d, v) {
2488
+ const m = l(d, v);
2489
+ return o.value.get(m) === !0;
2252
2490
  }
2253
- function c(f, i) {
2254
- o.value.set(f, i);
2491
+ function c(d, v) {
2492
+ o.value.set(d, v);
2255
2493
  }
2256
2494
  return {
2257
2495
  expandedRows: s,
@@ -2259,68 +2497,69 @@ function rs(e, t) {
2259
2497
  toggleRowExpansion: r,
2260
2498
  getRowId: l,
2261
2499
  setRowLoading: c,
2262
- isRowLoading: u
2500
+ isRowLoading: i
2263
2501
  };
2264
2502
  }
2265
- function is(e, t, n) {
2266
- const o = L({}), s = T(() => n?.serverMode ? e.value : e.value.filter((r) => t.every((u) => {
2267
- const c = o.value[u.field];
2503
+ function Is(e, n, t) {
2504
+ const o = q({}), s = F(() => (console.log("InitFilter Filtered:", e.value), t?.serverMode ? e.value : e.value.filter((r) => n.every((i) => {
2505
+ if (!i.field) return !0;
2506
+ const c = o.value[i.field];
2268
2507
  if (!c || !c.type) return !0;
2269
- const f = r[u.field];
2270
- if (u.filter?.filterFn)
2271
- return u.filter.filterFn(f, c.value, r);
2272
- if (c.type === "custom" && u.filter?.filterKey) {
2273
- const p = Ae[u.filter.filterKey];
2274
- return typeof p == "function" ? p(r, u.field, c) : !0;
2508
+ const d = r[i.field];
2509
+ if (i.filter?.filterFn)
2510
+ return i.filter.filterFn(d, c.value, r);
2511
+ if (c.type === "custom" && i.filter?.filterKey) {
2512
+ const m = Be[i.filter.filterKey];
2513
+ return typeof m == "function" ? m(r, i.field, c) : !0;
2275
2514
  }
2276
- const i = Ae[c.type];
2277
- return typeof i == "function" ? i(r, u.field, c) : !0;
2278
- })));
2279
- G(
2515
+ const v = Be[c.type];
2516
+ return typeof v == "function" ? v(r, i.field, c) : !0;
2517
+ }))));
2518
+ Y(
2280
2519
  o,
2281
2520
  (r) => {
2282
- if (n?.serverMode && n.onServerFilter) {
2283
- const u = Object.entries(r).reduce(
2284
- (c, [f, i]) => {
2285
- if (!i?.type) return c;
2286
- const p = {
2287
- type: i.type,
2288
- operator: i.operator
2521
+ if (t?.serverMode && t.onServerFilter) {
2522
+ const i = Object.entries(r).reduce(
2523
+ (c, [d, v]) => {
2524
+ if (!v?.type) return c;
2525
+ const m = {
2526
+ type: v.type,
2527
+ operator: v.operator
2289
2528
  };
2290
- switch (i.type) {
2529
+ switch (v.type) {
2291
2530
  case "text":
2292
- c[f] = {
2293
- ...p,
2294
- value: i.value ?? null
2531
+ c[d] = {
2532
+ ...m,
2533
+ value: v.value ?? null
2295
2534
  };
2296
2535
  break;
2297
2536
  case "multi-select":
2298
- c[f] = {
2299
- ...p,
2300
- value: i.value ?? []
2537
+ c[d] = {
2538
+ ...m,
2539
+ value: v.value ?? []
2301
2540
  };
2302
2541
  break;
2303
2542
  case "number-range":
2304
- c[f] = {
2305
- ...p,
2306
- value: i.value ?? null,
2307
- min: i.min ?? null,
2308
- max: i.max ?? null
2543
+ c[d] = {
2544
+ ...m,
2545
+ value: v.value ?? null,
2546
+ min: v.min ?? null,
2547
+ max: v.max ?? null
2309
2548
  };
2310
2549
  break;
2311
2550
  case "date-range":
2312
- c[f] = {
2313
- ...p,
2314
- value: i.value ?? null,
2315
- start: i.start ?? null,
2316
- end: i.end ?? null
2551
+ c[d] = {
2552
+ ...m,
2553
+ value: v.value ?? null,
2554
+ start: v.start ?? null,
2555
+ end: v.end ?? null
2317
2556
  };
2318
2557
  break;
2319
2558
  case "custom":
2320
- c[f] = {
2321
- ...p,
2322
- value: i.value,
2323
- filterKey: i.filterKey
2559
+ c[d] = {
2560
+ ...m,
2561
+ value: v.value,
2562
+ filterKey: v.filterKey
2324
2563
  };
2325
2564
  break;
2326
2565
  }
@@ -2328,16 +2567,16 @@ function is(e, t, n) {
2328
2567
  },
2329
2568
  {}
2330
2569
  );
2331
- n.onServerFilter(u);
2570
+ t.onServerFilter(i);
2332
2571
  }
2333
2572
  },
2334
2573
  { deep: !0 }
2335
2574
  );
2336
- function l(r, u, c) {
2337
- u ? o.value[r] = pe(u.type, u) : c && (o.value[r] = pe(c));
2575
+ function l(r, i, c) {
2576
+ i ? o.value[r] = Ce(i.type, i) : c && (o.value[r] = Ce(c));
2338
2577
  }
2339
- function a(r, u) {
2340
- u ? o.value[r] = pe(u) : delete o.value[r];
2578
+ function a(r, i) {
2579
+ i ? o.value[r] = Ce(i) : delete o.value[r];
2341
2580
  }
2342
2581
  return {
2343
2582
  filters: o,
@@ -2346,97 +2585,264 @@ function is(e, t, n) {
2346
2585
  clearFilter: a
2347
2586
  };
2348
2587
  }
2349
- function us(e, t) {
2350
- const n = ye(e.rows) ? e.rows : at(e.rows), o = L(1), s = L(e.serverOptions?.rowsPerPage ?? e.rowsPerPage), l = L(""), { isRowExpanded: a, toggleRowExpansion: r, getRowId: u, setRowLoading: c, isRowLoading: f } = rs(e, t), { filters: i, filteredData: p, setFilter: v, clearFilter: d } = is(
2351
- T(() => R(n)),
2352
- e.columns,
2588
+ function qs(e, n = {}) {
2589
+ const { enabled: t = !1, maxHeight: o = "calc(100vh - 250px)" } = n;
2590
+ let s = null, l = null;
2591
+ const a = () => {
2592
+ const c = e.value;
2593
+ if (!t || !c) return;
2594
+ const d = c.querySelector("thead"), v = c.querySelector("tbody");
2595
+ !d || !v || (c.parentElement?.classList.contains("vs-table-wrapper") ? s = c.parentElement : (s = document.createElement("div"), s.classList.add("vs-table-wrapper"), c.parentNode?.insertBefore(s, c), s.appendChild(c)), Object.assign(s.style, {
2596
+ overflowY: "auto",
2597
+ overflowX: "auto",
2598
+ position: "relative",
2599
+ maxHeight: typeof o == "number" ? `${o}px` : o
2600
+ }), Object.assign(d.style, {
2601
+ position: "sticky",
2602
+ top: "0",
2603
+ zIndex: "5",
2604
+ background: "var(--vs-table-header-bg, #fff)"
2605
+ }), l || (l = new ResizeObserver(() => {
2606
+ r();
2607
+ }), l.observe(c)), r());
2608
+ }, r = () => {
2609
+ const c = e.value;
2610
+ if (!c) return;
2611
+ const d = c.querySelector("thead"), v = c.querySelector("tbody");
2612
+ if (!d || !v) return;
2613
+ const m = Array.from(d.querySelectorAll("tr")), f = v.querySelector("tr");
2614
+ if (!f) return;
2615
+ const u = Array.from(f.querySelectorAll("td"));
2616
+ if (!u.length) return;
2617
+ const h = [];
2618
+ m.forEach((g) => {
2619
+ Array.from(g.querySelectorAll("th")).forEach((S) => {
2620
+ parseInt(S.getAttribute("colspan") || "1", 10) === 1 && h.push(S);
2621
+ });
2622
+ }), h.forEach((g, C) => {
2623
+ const S = u[C];
2624
+ S && (g.style.width = `${S.offsetWidth}px`);
2625
+ }), m.forEach((g) => {
2626
+ Array.from(g.querySelectorAll("th")).forEach((S) => {
2627
+ const E = parseInt(S.getAttribute("colspan") || "1", 10);
2628
+ if (E > 1) {
2629
+ let L = 0;
2630
+ const P = Array.from(g.children).indexOf(S);
2631
+ for (let B = 0; B < E; B++) {
2632
+ const b = u[P + B];
2633
+ b && (L += b.offsetWidth);
2634
+ }
2635
+ L > 0 && (S.style.width = `${L}px`);
2636
+ }
2637
+ });
2638
+ });
2639
+ }, i = () => {
2640
+ l && (l.disconnect(), l = null);
2641
+ };
2642
+ return Re(async () => {
2643
+ t && (await oe(), a());
2644
+ }), He(() => {
2645
+ i();
2646
+ }), Y(
2647
+ () => t,
2648
+ async (c) => {
2649
+ await oe(), c ? a() : i();
2650
+ }
2651
+ ), {
2652
+ refresh: a,
2653
+ cleanup: i
2654
+ };
2655
+ }
2656
+ function Ms(e, n = {}) {
2657
+ const {
2658
+ enabled: t = !1,
2659
+ maxHeight: o = "calc(100vh - 250px)",
2660
+ debounceMs: s = 100
2661
+ } = n;
2662
+ let l = null, a = null, r = null, i = !1, c = !1, d = null;
2663
+ const m = ((h, g = 100) => {
2664
+ let C = null;
2665
+ return (...S) => {
2666
+ C && clearTimeout(C), C = window.setTimeout(() => h(...S), g);
2667
+ };
2668
+ })(() => {
2669
+ i || (i = !0, cancelAnimationFrame(r), r = requestAnimationFrame(() => {
2670
+ const h = e.value;
2671
+ if (!h) return;
2672
+ const g = h.querySelector("tfoot"), C = h.querySelector("tbody");
2673
+ if (!g || !C) return;
2674
+ const S = g.querySelector("tr"), E = C.querySelector("tr");
2675
+ if (!S || !E) {
2676
+ i = !1;
2677
+ return;
2678
+ }
2679
+ const L = Array.from(S.querySelectorAll("td, th")), P = Array.from(E.querySelectorAll("td"));
2680
+ if (!L.length || !P.length) {
2681
+ i = !1;
2682
+ return;
2683
+ }
2684
+ let B = 0;
2685
+ L.forEach((b) => {
2686
+ const p = parseInt(b.getAttribute("colspan") || "1", 10);
2687
+ if (p === 1) {
2688
+ const x = P[B];
2689
+ if (x) {
2690
+ const R = x.offsetWidth;
2691
+ b.offsetWidth !== R && (b.style.width = `${R}px`, b.style.minWidth = `${R}px`);
2692
+ }
2693
+ B += 1;
2694
+ } else {
2695
+ let x = 0;
2696
+ for (let R = 0; R < p; R++) {
2697
+ const T = P[B + R];
2698
+ T && (x += T.offsetWidth);
2699
+ }
2700
+ x > 0 && b.offsetWidth !== x && (b.style.width = `${x}px`, b.style.minWidth = `${x}px`), B += p;
2701
+ }
2702
+ }), i = !1;
2703
+ }));
2704
+ }, s), f = () => {
2705
+ const h = e.value;
2706
+ if (!t || !h) return;
2707
+ const g = h.querySelector("tfoot"), C = h.querySelector("tbody"), S = h.querySelector("thead");
2708
+ !g || !C || (h.parentElement?.classList.contains("vs-table-wrapper") ? l = h.parentElement : (l = document.createElement("div"), l.classList.add("vs-table-wrapper"), h.parentNode?.insertBefore(l, h), l.appendChild(h)), Object.assign(l.style, {
2709
+ overflowY: "auto",
2710
+ overflowX: "auto",
2711
+ position: "relative",
2712
+ maxHeight: typeof o == "number" ? `${o}px` : o
2713
+ }), Object.assign(g.style, {
2714
+ position: "sticky",
2715
+ bottom: "0",
2716
+ zIndex: "5",
2717
+ background: "var(--vs-table-footer-bg, var(--vs-table-header-bg, #fff))"
2718
+ }), !c && S && (d = () => {
2719
+ const E = l.scrollLeft;
2720
+ S.scrollLeft = E, g.scrollLeft = E;
2721
+ }, l.addEventListener("scroll", d), c = !0), a || (a = new ResizeObserver(() => {
2722
+ m();
2723
+ }), a.observe(h)), m());
2724
+ }, u = () => {
2725
+ cancelAnimationFrame(r), a && (a.disconnect(), a = null), l && d && c && (l.removeEventListener("scroll", d), c = !1);
2726
+ const h = e.value;
2727
+ if (h) {
2728
+ const g = h.querySelector("tfoot");
2729
+ g && (g.style.position = "", g.style.bottom = "", g.style.zIndex = "", g.style.background = "");
2730
+ }
2731
+ };
2732
+ return Re(async () => {
2733
+ t && (await oe(), f());
2734
+ }), He(u), Y(
2735
+ () => t,
2736
+ async (h) => {
2737
+ await oe(), h ? f() : u();
2738
+ }
2739
+ ), {
2740
+ refresh: m,
2741
+ cleanup: u
2742
+ };
2743
+ }
2744
+ function Bs(e, n, t = {}) {
2745
+ const o = Fe(e.rows) ? e.rows : gt(e.rows), s = q(1), l = q(e.serverOptions?.rowsPerPage ?? e.rowsPerPage), a = q(""), r = q(), i = q(null), c = q(), { isRowExpanded: d, toggleRowExpansion: v, getRowId: m, setRowLoading: f, isRowLoading: u } = Ds(e, n), { filters: h, filteredData: g, setFilter: C, clearFilter: S } = Is(
2746
+ F(() => $(o)),
2747
+ zt($(e.columns)),
2353
2748
  {
2354
2749
  serverMode: !!e.serverOptions,
2355
- onServerFilter(y) {
2356
- t("filterChange", y);
2750
+ onServerFilter(V) {
2751
+ n("filterChange", V);
2357
2752
  }
2358
2753
  }
2359
- ), { activeSort: m, sortHelpers: b } = os(e, t, o), { onInputTyped: C } = as(t, l), { totalRecords: k, recordRange: S, handlePageChange: O } = ss(
2754
+ ), { activeSort: E, sortHelpers: L } = Os(e, n, s), { onInputTyped: P } = Ps(n, a), { totalRecords: B, recordRange: b, handlePageChange: p } = Vs(
2360
2755
  e,
2361
- t,
2362
- o,
2756
+ n,
2363
2757
  s,
2364
- T(() => $.value)
2365
- ), { handleRowsPerPage: A } = ls(e, t, o, s), M = T(() => {
2366
- let y = p.value;
2367
- return l.value && (y = Qe(y, l.value)), y;
2368
- }), $ = T(() => {
2369
- let y = M.value;
2370
- return e.serverOptions || (l.value && (y = Qe(y, l.value)), m.value.length && (y = At(y, m.value))), y = y.map((N, de) => ({
2371
- ...N,
2372
- isExpanded: a(N, de)
2758
+ l,
2759
+ F(() => I.value)
2760
+ ), { handleRowsPerPage: x } = Ls(e, n, s, l), { header: R = !0, footer: T = !0, maxHeight: M = "calc(100vh - 100px)" } = t, A = qs(c, { enabled: R, maxHeight: M }), O = Ms(c, { enabled: T, maxHeight: M }), N = F(() => {
2761
+ let V = g.value;
2762
+ return a.value && (V = st(V, a.value)), V;
2763
+ }), I = F(() => {
2764
+ let V = N.value;
2765
+ return e.serverOptions || (a.value && (V = st(V, a.value)), E.value.length && (V = Wt(V, E.value))), V = V.map((U, ge) => ({
2766
+ ...U,
2767
+ isExpanded: d(U, ge)
2373
2768
  // pass index here
2374
- })), y;
2769
+ })), V;
2375
2770
  });
2376
- G([i, l], () => o.value = 1, { deep: !0 });
2377
- const x = T(
2378
- () => Et($.value, o.value, s.value)
2771
+ Y([h, a], () => s.value = 1, { deep: !0 });
2772
+ const W = F(
2773
+ () => Nt(I.value, s.value, l.value)
2379
2774
  );
2380
- return G(n, (y) => {
2381
- Array.isArray(y) && y.length > 1e3 && console.log(`[useDataTable] Large dataset updated (${y.length} rows)`);
2775
+ return Y(o, (V) => {
2776
+ Array.isArray(V) && V.length > 1e3 && console.log(`[useDataTable] Large dataset updated (${V.length} rows)`);
2382
2777
  }), {
2383
2778
  // Pagination
2384
- page: o,
2385
- totalRecords: k,
2386
- recordRange: S,
2387
- handlePageChange: O,
2388
- rowsPerPage: s,
2389
- handleRowsPerPage: A,
2779
+ page: s,
2780
+ totalRecords: B,
2781
+ recordRange: b,
2782
+ handlePageChange: p,
2783
+ rowsPerPage: l,
2784
+ handleRowsPerPage: x,
2390
2785
  // Sorting
2391
- processedRows: $,
2392
- paginatedRows: x,
2393
- sortHelpers: b,
2786
+ processedRows: I,
2787
+ paginatedRows: W,
2788
+ sortHelpers: L,
2394
2789
  // Search
2395
- searchQuery: l,
2396
- onInputTyped: C,
2790
+ searchQuery: a,
2791
+ onInputTyped: P,
2397
2792
  // Expandable
2398
- isRowExpanded: a,
2399
- toggleRowExpansion: r,
2400
- getRowId: u,
2401
- setRowLoading: c,
2402
- isRowLoading: f,
2793
+ isRowExpanded: d,
2794
+ toggleRowExpansion: v,
2795
+ getRowId: m,
2796
+ setRowLoading: f,
2797
+ isRowLoading: u,
2403
2798
  // Column filters
2404
- filters: i,
2405
- filteredData: p,
2406
- setFilter: v,
2407
- clearFilter: d
2799
+ filters: h,
2800
+ filteredData: g,
2801
+ setFilter: C,
2802
+ clearFilter: S,
2803
+ // Table Ref
2804
+ tableContainer: r,
2805
+ tableResponsiveRef: i,
2806
+ tableRef: c,
2807
+ // Sticky Header and Footer
2808
+ refresh() {
2809
+ A.refresh?.(), O.refresh?.();
2810
+ },
2811
+ cleanup() {
2812
+ A.cleanup?.(), O.cleanup?.();
2813
+ }
2408
2814
  };
2409
2815
  }
2410
- function cs(e, t) {
2411
- const n = L(e.itemSelected || []);
2412
- G(
2816
+ function Hs(e, n) {
2817
+ const t = q(e.itemSelected || []);
2818
+ Y(
2413
2819
  () => e.itemSelected,
2414
- (m) => {
2415
- m ? n.value = [...m] : n.value = [];
2820
+ (h) => {
2821
+ h ? t.value = [...h] : t.value = [];
2416
2822
  },
2417
2823
  { immediate: !0, deep: !0 }
2418
2824
  );
2419
- const o = T({
2420
- get: () => n.value,
2421
- set: (m) => {
2422
- n.value = m, t("update:itemSelected", m);
2825
+ const o = F({
2826
+ get: () => t.value,
2827
+ set: (h) => {
2828
+ t.value = h, n("update:itemSelected", h);
2423
2829
  }
2424
- }), s = T(() => e.itemSelected !== null), l = T(
2830
+ }), s = F(() => e.itemSelected !== null), l = F(
2425
2831
  () => e.rows.length > 0 && o.value.length === e.rows.length
2426
- ), a = T(() => !e.rows.length || !o.value.length ? !1 : !l.value && e.rows.some(
2427
- (m, b) => o.value.some(
2428
- (C, k) => X(C, k, e.rowKey) === X(m, b, e.rowKey)
2832
+ ), a = F(() => !e.rows.length || !o.value.length ? !1 : !l.value && e.rows.some(
2833
+ (h, g) => o.value.some(
2834
+ (C, S) => re(C, S, e.rowKey) === re(h, g, e.rowKey)
2429
2835
  )
2430
- )), r = (m, b) => {
2431
- const C = X(m, b, e.rowKey);
2836
+ )), r = (h, g) => {
2837
+ const C = re(h, g, e.rowKey);
2432
2838
  o.value.some(
2433
- (S, O) => X(S, O, e.rowKey) === C
2839
+ (E, L) => re(E, L, e.rowKey) === C
2434
2840
  ) ? (o.value = o.value.filter(
2435
- (S, O) => X(S, O, e.rowKey) !== C
2436
- ), t("rowDeselected", m, b)) : (o.value = [...o.value, m], t("rowSelected", m, b));
2437
- }, u = (m) => {
2438
- const b = m.target;
2439
- o.value = b.checked ? [...e.rows] : [], t("allRowsSelected", o.value);
2841
+ (E, L) => re(E, L, e.rowKey) !== C
2842
+ ), n("rowDeselected", h, g)) : (o.value = [...o.value, h], n("rowSelected", h, g));
2843
+ }, i = (h) => {
2844
+ const g = h.target;
2845
+ o.value = g.checked ? [...e.rows] : [], n("allRowsSelected", o.value);
2440
2846
  };
2441
2847
  return {
2442
2848
  selectedItems: o,
@@ -2444,21 +2850,21 @@ function cs(e, t) {
2444
2850
  isAllChecked: l,
2445
2851
  isSomeChecked: a,
2446
2852
  toggleRow: r,
2447
- toggleAll: u,
2448
- selectRow: (m, b) => {
2449
- rt(m, o.value, e.rowKey) || (o.value = [...o.value, m], t("rowSelected", m, b));
2853
+ toggleAll: i,
2854
+ selectRow: (h, g) => {
2855
+ yt(h, o.value, e.rowKey) || (o.value = [...o.value, h], n("rowSelected", h, g));
2450
2856
  },
2451
- deselectRow: (m, b) => {
2452
- const C = X(m, b, e.rowKey);
2857
+ deselectRow: (h, g) => {
2858
+ const C = re(h, g, e.rowKey);
2453
2859
  o.value = o.value.filter(
2454
- (k, S) => X(k, S, e.rowKey) !== C
2455
- ), t("rowDeselected", m, b);
2860
+ (S, E) => re(S, E, e.rowKey) !== C
2861
+ ), n("rowDeselected", h, g);
2456
2862
  },
2457
2863
  selectAll: () => {
2458
- o.value = [...e.rows], t("allRowsSelected", o.value);
2864
+ o.value = [...e.rows], n("allRowsSelected", o.value);
2459
2865
  },
2460
2866
  deselectAll: () => {
2461
- o.value = [], t("allRowsSelected", []);
2867
+ o.value = [], n("allRowsSelected", []);
2462
2868
  },
2463
2869
  clearSelection: () => {
2464
2870
  o.value = [];
@@ -2469,17 +2875,191 @@ function cs(e, t) {
2469
2875
  isAllChecked: l,
2470
2876
  isSomeChecked: a,
2471
2877
  toggleRow: r,
2472
- toggleAll: u
2878
+ toggleAll: i
2879
+ }
2880
+ };
2881
+ }
2882
+ function Ws(e, n, t = q(!1)) {
2883
+ const o = q(!1), s = q(!1);
2884
+ let l = !1;
2885
+ const a = () => {
2886
+ if (l) return;
2887
+ const b = e.value?.parentElement, p = e.value;
2888
+ if (!b || !p) return;
2889
+ const x = b.scrollLeft, R = b.scrollWidth - b.clientWidth;
2890
+ o.value = x > 0, s.value = x < R - 1;
2891
+ const T = Array.from(
2892
+ p.querySelectorAll(".vs-sticky-left")
2893
+ ), M = Array.from(
2894
+ p.querySelectorAll(".vs-sticky-right")
2895
+ );
2896
+ if (x > 0 ? T.forEach((A) => {
2897
+ const O = A.closest("thead") !== null;
2898
+ A.style.zIndex = O ? "5" : "4";
2899
+ }) : T.forEach((A) => {
2900
+ const O = A.closest("thead") !== null;
2901
+ A.style.zIndex = O ? "4" : "3";
2902
+ }), M.length) {
2903
+ const A = M[0], O = A ? p.offsetWidth - A.offsetLeft : p.offsetWidth;
2904
+ b.scrollWidth - (x + b.clientWidth) <= O + 5 ? M.forEach((I) => {
2905
+ const W = I.closest("thead") !== null;
2906
+ I.style.zIndex = W ? "5" : "4";
2907
+ }) : M.forEach((I) => {
2908
+ const W = I.closest("thead") !== null;
2909
+ I.style.zIndex = W ? "4" : "3";
2910
+ });
2911
+ }
2912
+ }, r = () => {
2913
+ const b = e.value;
2914
+ return b ? Array.from(b.querySelectorAll("tr")) : [];
2915
+ }, i = (b) => b.filter((p) => p.closest("tbody")), c = (b) => {
2916
+ const p = b[0];
2917
+ return p ? Array.from(p.children) : [];
2918
+ }, d = (b) => {
2919
+ const p = /* @__PURE__ */ new Map();
2920
+ return b.forEach((x, R) => {
2921
+ const T = x.getAttribute("data-field");
2922
+ T && p.set(T, R);
2923
+ }), p;
2924
+ }, v = (b) => {
2925
+ for (const p of b)
2926
+ if (p.children?.length) {
2927
+ if (p.children.some((x) => x.sticky === "left" || x.sticky === "right"))
2928
+ return !0;
2929
+ } else if (p.sticky === "left" || p.sticky === "right")
2930
+ return !0;
2931
+ return !1;
2932
+ }, m = (b, p, x) => {
2933
+ const R = [], T = [];
2934
+ return v(x) && b.forEach((A, O) => {
2935
+ (A.classList.contains("vs-expand-column") || A.classList.contains("vs-checkbox-column")) && R.push(O);
2936
+ }), x.forEach((A) => {
2937
+ if (A.children?.length)
2938
+ A.children.forEach((O) => {
2939
+ const N = p.get(O.field);
2940
+ if (N === void 0) return;
2941
+ const I = A.sticky || O.sticky;
2942
+ I === "left" && R.push(N), I === "right" && T.push(N);
2943
+ });
2944
+ else {
2945
+ const O = p.get(A.field);
2946
+ if (O === void 0) return;
2947
+ const N = A.sticky;
2948
+ N === "left" && R.push(O), N === "right" && T.push(O);
2949
+ }
2950
+ }), {
2951
+ left: [...new Set(R)].sort((A, O) => A - O),
2952
+ right: [...new Set(T)].sort((A, O) => O - A)
2953
+ };
2954
+ }, f = (b, p, x) => {
2955
+ const R = /* @__PURE__ */ new Map();
2956
+ let T = 0;
2957
+ return p.forEach((M) => {
2958
+ R.set(M, T);
2959
+ const A = b[M];
2960
+ A && (T += A.offsetWidth);
2961
+ }), R;
2962
+ }, u = (b) => {
2963
+ const p = /* @__PURE__ */ new Map(), x = /* @__PURE__ */ new Map();
2964
+ return b.forEach((R) => {
2965
+ R.children?.length && (p.set(R.label, R.children[0]?.field), x.set(R.label, R.children[R.children.length - 1]?.field));
2966
+ }), { firstChild: p, lastChild: x };
2967
+ }, h = (b, p, x, R) => {
2968
+ if (b) {
2969
+ if (b.startsWith("group-")) {
2970
+ const T = b.replace(/^group-/, "");
2971
+ if (R === "left") {
2972
+ const M = x.firstChild.get(T);
2973
+ return M ? p.get(M) : void 0;
2974
+ } else {
2975
+ const M = x.lastChild.get(T);
2976
+ return M ? p.get(M) : void 0;
2977
+ }
2978
+ }
2979
+ return p.get(b);
2980
+ }
2981
+ }, g = (b) => {
2982
+ b.forEach((p) => {
2983
+ Array.from(p.children).forEach((R) => {
2984
+ R.style.position = "", R.style.left = "", R.style.right = "", R.style.zIndex = "", R.style.background = "", R.style.minWidth = "", R.style.width = "", R.classList.remove("vs-sticky-left", "vs-sticky-right");
2985
+ });
2986
+ });
2987
+ }, C = (b, p, x, R, T, M) => {
2988
+ if (!l) {
2989
+ l = !0;
2990
+ try {
2991
+ b.forEach((A) => {
2992
+ const O = Array.from(A.children), N = A.closest("thead") !== null;
2993
+ O.forEach((I) => {
2994
+ const W = I.getAttribute("data-field");
2995
+ if (!W) return;
2996
+ const V = h(W, T, M, R);
2997
+ if (V === void 0 || !p.includes(V)) return;
2998
+ const U = x.get(V) || 0, ge = N ? "4" : "3";
2999
+ I.style.position = "sticky", I.style[R] = `${U}px`, I.style.zIndex = ge, I.classList.add(`vs-sticky-${R}`), I.style.background = "var(--vs-table-bg, #fff)";
3000
+ });
3001
+ });
3002
+ } finally {
3003
+ l = !1;
3004
+ }
3005
+ }
3006
+ }, S = async () => {
3007
+ if (l) return;
3008
+ const b = r();
3009
+ if (!b.length) return;
3010
+ const p = i(b);
3011
+ if (!p.length) return;
3012
+ const x = c(p), R = d(x), T = m(x, R, n.value);
3013
+ if (g(b), T.left.length > 0 || T.right.length > 0) {
3014
+ const M = f(x, T.left), A = f(x, T.right), O = u(n.value);
3015
+ C(b, T.left, M, "left", R, O), C(b, T.right, A, "right", R, O);
2473
3016
  }
3017
+ a();
3018
+ }, E = async () => {
3019
+ l || (await oe(), setTimeout(() => {
3020
+ try {
3021
+ S();
3022
+ } catch (b) {
3023
+ console.warn("[useStickyColumns] refreshSticky failed:", b);
3024
+ }
3025
+ }, 150));
3026
+ }, L = () => {
3027
+ e.value?.parentElement?.addEventListener("scroll", a), a();
3028
+ }, P = () => {
3029
+ e.value?.parentElement?.removeEventListener("scroll", a);
2474
3030
  };
3031
+ Re(async () => {
3032
+ await oe(), setTimeout(() => {
3033
+ E();
3034
+ }, 300), L();
3035
+ }), He(P);
3036
+ let B = null;
3037
+ return Y([n, t], () => {
3038
+ B && clearTimeout(B), B = setTimeout(() => {
3039
+ E();
3040
+ }, 100);
3041
+ }, { deep: !0 }), { hasLeftShadow: o, hasRightShadow: s, refreshSticky: E };
3042
+ }
3043
+ function Ns(e, n) {
3044
+ let t = null, o = null;
3045
+ const s = () => {
3046
+ const a = e.value;
3047
+ a && (l(), t = new ResizeObserver(() => {
3048
+ o && cancelAnimationFrame(o), o = requestAnimationFrame(() => {
3049
+ n();
3050
+ });
3051
+ }), t.observe(a));
3052
+ }, l = () => {
3053
+ t && (t.disconnect(), t = null), o && (cancelAnimationFrame(o), o = null);
3054
+ };
3055
+ return Re(async () => {
3056
+ await oe(), s();
3057
+ }), He(l), { refreshSticky: n, cleanup: l };
2475
3058
  }
2476
- const ds = { class: "vs-datatable" }, fs = {
2477
- ref: "tableResponsiveRef",
2478
- class: "vs-table-wrapper"
2479
- }, vs = {
3059
+ const Ks = { class: "vs-datatable" }, zs = {
2480
3060
  key: 0,
2481
- class: "vs-table-footer"
2482
- }, ps = { class: "vs-footer-left" }, ms = { class: "vs-table-info" }, gs = /* @__PURE__ */ _({
3061
+ class: "vs-table-pagination"
3062
+ }, js = { class: "vs-pagination-left" }, Us = { class: "vs-table-info" }, Zs = /* @__PURE__ */ _({
2483
3063
  __name: "VsDataTable",
2484
3064
  props: {
2485
3065
  rows: { default: () => [] },
@@ -2511,175 +3091,233 @@ const ds = { class: "vs-datatable" }, fs = {
2511
3091
  rowKey: { type: [String, Function], default: "id" },
2512
3092
  expanded: {},
2513
3093
  expandable: { type: Boolean },
2514
- accordion: { type: Boolean }
3094
+ accordion: { type: Boolean },
3095
+ stickyHeader: { type: Boolean, default: !1 },
3096
+ stickyFooter: { type: Boolean, default: !1 },
3097
+ showPagination: { type: Boolean, default: !0 }
2515
3098
  },
2516
3099
  emits: ["update:serverItemsLength", "update:serverOptions", "pageUpdated", "inputTyped", "update:sort", "sortChanged", "update:itemSelected", "rowSelected", "rowDeselected", "allRowsSelected", "rowClick", "tableBeforeMount", "tableMounted", "tableUnmounted", "dataLoaded", "dataError", "update:expanded", "expandRow", "collapseRow", "filterChange"],
2517
- setup(e, { expose: t, emit: n }) {
2518
- const o = e, s = at(o.rows);
2519
- G(
3100
+ setup(e, { expose: n, emit: t }) {
3101
+ const o = e, s = gt(o.rows);
3102
+ Y(
2520
3103
  () => o.rows,
2521
- (B) => {
2522
- s.value = B;
3104
+ (ee) => {
3105
+ s.value = ee;
2523
3106
  },
2524
3107
  { deep: !1 }
2525
3108
  );
2526
- const l = n, a = Tt(), r = T(() => !!a.onRowClick), {
2527
- page: u,
2528
- rowsPerPage: c,
2529
- totalRecords: f,
2530
- recordRange: i,
2531
- handlePageChange: p,
2532
- handleRowsPerPage: v,
2533
- paginatedRows: d,
2534
- sortHelpers: m,
2535
- searchQuery: b,
2536
- onInputTyped: C,
2537
- isRowExpanded: k,
2538
- toggleRowExpansion: S,
2539
- setRowLoading: O,
2540
- isRowLoading: A,
2541
- filters: M,
2542
- setFilter: $,
2543
- clearFilter: x
2544
- } = us({ ...o, rows: s.value }, l), {
2545
- selectedItems: y,
2546
- isItemSelectedControlled: N,
2547
- isAllChecked: de,
2548
- isSomeChecked: Ce,
2549
- toggleAll: ke,
2550
- toggleRow: te
2551
- } = cs(o, l), he = T(
2552
- () => Ot(o.columns, N.value, o.expandable)
3109
+ const l = t, a = qt(), r = F(() => !!a.onRowClick), i = q(), c = q(), {
3110
+ page: d,
3111
+ rowsPerPage: v,
3112
+ totalRecords: m,
3113
+ recordRange: f,
3114
+ handlePageChange: u,
3115
+ handleRowsPerPage: h,
3116
+ paginatedRows: g,
3117
+ sortHelpers: C,
3118
+ searchQuery: S,
3119
+ onInputTyped: E,
3120
+ isRowExpanded: L,
3121
+ toggleRowExpansion: P,
3122
+ setRowLoading: B,
3123
+ isRowLoading: b,
3124
+ filters: p,
3125
+ setFilter: x,
3126
+ clearFilter: R,
3127
+ tableRef: T,
3128
+ tableContainer: M,
3129
+ tableResponsiveRef: A,
3130
+ refresh: O
3131
+ } = Bs(
3132
+ { ...o, rows: s.value },
3133
+ l,
3134
+ { header: o.stickyHeader, footer: o.stickyFooter }
3135
+ ), {
3136
+ selectedItems: N,
3137
+ isItemSelectedControlled: I,
3138
+ isAllChecked: W,
3139
+ isSomeChecked: V,
3140
+ toggleAll: U,
3141
+ toggleRow: ge
3142
+ } = Hs(o, l), Vt = F(
3143
+ () => Ht(o.columns, I.value, o.expandable)
3144
+ ), { hasLeftShadow: Lt, hasRightShadow: Pt, refreshSticky: $e } = Ws(
3145
+ T,
3146
+ F(() => o.columns)
2553
3147
  );
2554
- return t({
2555
- toggleRowExpansion: S,
2556
- setRowLoading: O
2557
- }), st(() => {
2558
- l("tableMounted");
3148
+ return Ns(T, $e), Y(
3149
+ () => g.value,
3150
+ () => {
3151
+ oe(() => {
3152
+ $e();
3153
+ });
3154
+ },
3155
+ { deep: !0 }
3156
+ ), Y(
3157
+ () => o.columns,
3158
+ () => {
3159
+ oe(() => {
3160
+ $e();
3161
+ });
3162
+ },
3163
+ { deep: !0 }
3164
+ ), n({
3165
+ toggleRowExpansion: P,
3166
+ setRowLoading: B,
3167
+ refreshSticky: $e
3168
+ }), Re(async () => {
3169
+ setTimeout(() => {
3170
+ $e();
3171
+ }, 100), await oe(), O(), l("tableMounted");
2559
3172
  try {
2560
3173
  l("dataLoaded", o.rows);
2561
- } catch (B) {
2562
- l("dataError", B);
3174
+ } catch (ee) {
3175
+ l("dataError", ee);
2563
3176
  }
2564
- }), lt(() => {
3177
+ }), mt(() => {
2565
3178
  l("tableUnmounted");
2566
- }), $t(() => {
3179
+ }), Mt(() => {
2567
3180
  l("tableBeforeMount");
2568
- }), (B, E) => (h(), w("div", ds, [
2569
- j(ns, {
3181
+ }), (ee, j) => (y(), k("div", Ks, [
3182
+ ne(Cs, {
2570
3183
  "show-search": e.showSearch,
2571
- "search-query": R(b),
2572
- "onUpdate:searchQuery": E[0] || (E[0] = (V) => ye(b) ? b.value = V : null),
2573
- onSearch: R(C),
3184
+ "search-query": $(S),
3185
+ "onUpdate:searchQuery": j[0] || (j[0] = (Z) => Fe(S) ? S.value = Z : null),
3186
+ onSearch: $(E),
2574
3187
  "search-placeholder": e.searchPlaceholder,
2575
3188
  "search-class": e.searchClass
2576
3189
  }, {
2577
- left: I(() => [
2578
- q(B.$slots, "filterAreaLeft", {}, void 0, !0)
3190
+ left: X(() => [
3191
+ z(ee.$slots, "filterAreaLeft", {}, void 0, !0)
2579
3192
  ]),
2580
- right: I(() => [
2581
- q(B.$slots, "filterAreaRight", {}, void 0, !0)
3193
+ right: X(() => [
3194
+ z(ee.$slots, "filterAreaRight", {}, void 0, !0)
2582
3195
  ]),
2583
3196
  _: 3
2584
3197
  }, 8, ["show-search", "search-query", "onSearch", "search-placeholder", "search-class"]),
2585
- g("div", {
2586
- class: W(["vs-table-container", e.containerClass])
3198
+ w("div", {
3199
+ ref_key: "tableContainer",
3200
+ ref: M,
3201
+ class: G(["vs-table-container vs-position-relative vs-overflow-auto", [
3202
+ e.containerClass,
3203
+ {
3204
+ "has-left-shadow": $(Lt),
3205
+ "has-right-shadow": $(Pt)
3206
+ }
3207
+ ]])
2587
3208
  }, [
2588
- g("div", fs, [
2589
- g("table", {
2590
- class: W(["vs-table", e.tableClass])
3209
+ w("div", {
3210
+ ref_key: "tableResponsiveRef",
3211
+ ref: A,
3212
+ class: G(["vs-table-wrapper", { "vs-sticky-header-wrapper": e.stickyHeader }])
3213
+ }, [
3214
+ w("table", {
3215
+ ref_key: "tableRef",
3216
+ ref: T,
3217
+ class: G(["vs-table", e.tableClass])
2591
3218
  }, [
2592
- j(Vo, {
3219
+ ne(Xo, {
3220
+ ref_key: "headerRef",
3221
+ ref: i,
2593
3222
  columns: e.columns,
2594
3223
  expandable: e.expandable,
2595
- "is-item-selected-controlled": R(N),
2596
- "is-all-checked": R(de),
2597
- "is-some-checked": R(Ce),
3224
+ "is-item-selected-controlled": $(I),
3225
+ "is-all-checked": $(W),
3226
+ "is-some-checked": $(V),
2598
3227
  tablename: e.tablename,
2599
- "sort-helpers": R(m),
2600
- filters: R(M),
2601
- "onUpdate:filters": E[1] || (E[1] = (V) => ye(M) ? M.value = V : null),
3228
+ "sort-helpers": $(C),
3229
+ filters: $(p),
3230
+ "onUpdate:filters": j[1] || (j[1] = (Z) => Fe(p) ? p.value = Z : null),
2602
3231
  rows: e.rows,
2603
3232
  "header-class": e.headerClass,
2604
- onToggleAll: R(ke),
2605
- onApplyFilter: E[2] || (E[2] = (V, F) => {
2606
- R($)(V, F), u.value = 1;
3233
+ onToggleAll: $(U),
3234
+ onApplyFilter: j[2] || (j[2] = (Z, de) => {
3235
+ $(x)(Z, de), d.value = 1;
2607
3236
  }),
2608
- onClearFilter: E[3] || (E[3] = (V) => {
2609
- R(x)(V), u.value = 1;
3237
+ onClearFilter: j[3] || (j[3] = (Z) => {
3238
+ $(R)(Z), d.value = 1;
2610
3239
  })
2611
- }, Ne({ _: 2 }, [
2612
- z(B.$slots, (V, F) => ({
2613
- name: F,
2614
- fn: I((we) => [
2615
- q(B.$slots, F, ze(Ze(we)), void 0, !0)
3240
+ }, Te({ _: 2 }, [
3241
+ Q(ee.$slots, (Z, de) => ({
3242
+ name: de,
3243
+ fn: X((Ze) => [
3244
+ z(ee.$slots, de, nt(ot(Ze)), void 0, !0)
2616
3245
  ])
2617
3246
  }))
2618
3247
  ]), 1032, ["columns", "expandable", "is-item-selected-controlled", "is-all-checked", "is-some-checked", "tablename", "sort-helpers", "filters", "rows", "header-class", "onToggleAll"]),
2619
- j(zo, {
3248
+ ne(vs, {
3249
+ ref_key: "bodyRef",
3250
+ ref: c,
2620
3251
  loading: e.loading,
2621
3252
  "loading-text": e.loadingText,
2622
3253
  "no-data-text": e.noDataText,
2623
3254
  "no-data-description": e.noDataDescription,
2624
- "paginated-rows": R(d),
2625
- "total-columns": he.value,
3255
+ "paginated-rows": $(g),
3256
+ "total-columns": Vt.value,
2626
3257
  expandable: e.expandable,
2627
- "is-item-selected-controlled": R(N),
2628
- "selected-items": R(y),
3258
+ "is-item-selected-controlled": $(I),
3259
+ "selected-items": $(N),
2629
3260
  tablename: e.tablename,
2630
3261
  columns: e.columns,
2631
3262
  "row-key": e.rowKey,
2632
3263
  "row-class": e.rowClass,
2633
3264
  "cell-class": e.cellClass,
2634
3265
  "has-row-click": r.value,
2635
- "get-row-key": R(X),
2636
- "get-value": R(Vt),
2637
- "is-row-expanded": R(k),
2638
- "is-row-loading": R(A),
2639
- "toggle-row-expansion": R(S),
2640
- "toggle-row": R(te),
2641
- "is-row-selected": R(rt),
2642
- onRowClick: E[4] || (E[4] = (V, F) => B.$emit("rowClick", V, F))
2643
- }, Ne({ _: 2 }, [
2644
- z(B.$slots, (V, F) => ({
2645
- name: F,
2646
- fn: I((we) => [
2647
- q(B.$slots, F, ze(Ze(we)), void 0, !0)
3266
+ "get-row-key": $(re),
3267
+ "get-value": $(Bt),
3268
+ "is-row-expanded": $(L),
3269
+ "is-row-loading": $(b),
3270
+ "toggle-row-expansion": $(P),
3271
+ "toggle-row": $(ge),
3272
+ "is-row-selected": $(yt),
3273
+ onRowClick: j[4] || (j[4] = (Z, de) => ee.$emit("rowClick", Z, de))
3274
+ }, Te({ _: 2 }, [
3275
+ Q(ee.$slots, (Z, de) => ({
3276
+ name: de,
3277
+ fn: X((Ze) => [
3278
+ z(ee.$slots, de, nt(ot(Ze)), void 0, !0)
2648
3279
  ])
2649
3280
  }))
2650
- ]), 1032, ["loading", "loading-text", "no-data-text", "no-data-description", "paginated-rows", "total-columns", "expandable", "is-item-selected-controlled", "selected-items", "tablename", "columns", "row-key", "row-class", "cell-class", "has-row-click", "get-row-key", "get-value", "is-row-expanded", "is-row-loading", "toggle-row-expansion", "toggle-row", "is-row-selected"])
3281
+ ]), 1032, ["loading", "loading-text", "no-data-text", "no-data-description", "paginated-rows", "total-columns", "expandable", "is-item-selected-controlled", "selected-items", "tablename", "columns", "row-key", "row-class", "cell-class", "has-row-click", "get-row-key", "get-value", "is-row-expanded", "is-row-loading", "toggle-row-expansion", "toggle-row", "is-row-selected"]),
3282
+ e.showFooter ? (y(), fe(Ts, {
3283
+ key: 0,
3284
+ columns: e.columns,
3285
+ rows: $(g),
3286
+ expandable: e.expandable,
3287
+ "is-item-selected-controlled": $(I)
3288
+ }, null, 8, ["columns", "rows", "expandable", "is-item-selected-controlled"])) : D("", !0)
2651
3289
  ], 2)
2652
- ], 512)
3290
+ ], 2)
2653
3291
  ], 2),
2654
- e.showFooter ? (h(), w("div", vs, [
2655
- g("div", ps, [
2656
- j(jt, {
2657
- modelValue: R(c),
2658
- "onUpdate:modelValue": E[5] || (E[5] = (V) => ye(c) ? c.value = V : null),
2659
- onRowsPerPageChanged: R(v)
3292
+ e.showPagination ? (y(), k("div", zs, [
3293
+ w("div", js, [
3294
+ ne(on, {
3295
+ modelValue: $(v),
3296
+ "onUpdate:modelValue": j[5] || (j[5] = (Z) => Fe(v) ? v.value = Z : null),
3297
+ onRowsPerPageChanged: $(h)
2660
3298
  }, null, 8, ["modelValue", "onRowsPerPageChanged"]),
2661
- E[7] || (E[7] = g("div", { class: "vs-divider" }, null, -1)),
2662
- g("div", ms, D(R(i).start < 1 ? 0 : R(i).start) + " - " + D(R(i).end) + " of " + D(R(f)) + " " + D(e.entriesText), 1)
3299
+ j[7] || (j[7] = w("div", { class: "vs-divider" }, null, -1)),
3300
+ w("div", Us, H($(f).start < 1 ? 0 : $(f).start) + " - " + H($(f).end) + " of " + H($(m)) + " " + H(e.entriesText), 1)
2663
3301
  ]),
2664
- j(It, {
2665
- modelValue: R(u),
2666
- "onUpdate:modelValue": E[6] || (E[6] = (V) => ye(u) ? u.value = V : null),
2667
- totalRecords: R(f),
2668
- rowsPerPage: R(c),
3302
+ ne(Jt, {
3303
+ modelValue: $(d),
3304
+ "onUpdate:modelValue": j[6] || (j[6] = (Z) => Fe(d) ? d.value = Z : null),
3305
+ totalRecords: $(m),
3306
+ rowsPerPage: $(v),
2669
3307
  maxVisible: e.maxVisiblePages,
2670
3308
  tablename: e.tablename,
2671
- class: W(e.paginationClass),
2672
- onPageChanged: R(p)
3309
+ class: G(e.paginationClass),
3310
+ onPageChanged: $(u)
2673
3311
  }, null, 8, ["modelValue", "totalRecords", "rowsPerPage", "maxVisible", "tablename", "class", "onPageChanged"])
2674
- ])) : P("", !0)
3312
+ ])) : D("", !0)
2675
3313
  ]));
2676
3314
  }
2677
- }), hs = /* @__PURE__ */ ne(gs, [["__scopeId", "data-v-4da895c0"]]), ys = {
3315
+ }), Xs = /* @__PURE__ */ ae(Zs, [["__scopeId", "data-v-6e690e26"]]), Ys = {
2678
3316
  install(e) {
2679
- e.component("VsDataTable", hs);
3317
+ e.component("VsDataTable", Xs);
2680
3318
  }
2681
3319
  };
2682
3320
  export {
2683
- hs as VsDataTable,
2684
- ys as default
3321
+ Xs as VsDataTable,
3322
+ Ys as default
2685
3323
  };