vueye-table 2.0.0-alpha.12 → 2.0.0-alpha.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,67 +1,67 @@
1
- import { openBlock as h, createElementBlock as g, createElementVNode as i, defineComponent as M, mergeDefaults as H, ref as V, computed as v, watchEffect as J, unref as c, toDisplayString as P, createVNode as $, createCommentVNode as T, withDirectives as E, normalizeClass as S, Fragment as L, renderList as B, vShow as X, nextTick as ee, mergeProps as te, isRef as I, vModelCheckbox as ne, createStaticVNode as oe, renderSlot as m, createTextVNode as G, toValue as O, useSlots as le, createSlots as x, withCtx as R, normalizeProps as j, guardReactiveProps as D } from "vue";
2
- function se(t) {
1
+ import { openBlock as g, createElementBlock as b, createElementVNode as d, defineComponent as L, mergeDefaults as D, ref as C, computed as m, watchEffect as Y, unref as c, toDisplayString as P, createVNode as $, createCommentVNode as z, withDirectives as F, normalizeClass as K, Fragment as j, renderList as R, vShow as q, nextTick as te, mergeProps as ne, isRef as A, vModelCheckbox as oe, createStaticVNode as le, renderSlot as y, createTextVNode as J, watch as se, toValue as S, useSlots as ae, createSlots as X, withCtx as O, normalizeProps as M, guardReactiveProps as H } from "vue";
2
+ function re(t) {
3
3
  return t.replace(/_/g, " ").replace(/([a-z])([A-Z])/g, "$1 $2").replace(/(?:^|\s)\S/g, (n) => n.toUpperCase()).trim().replace(/\s\s+/g, " ");
4
4
  }
5
- function z(t) {
5
+ function Q(t) {
6
6
  let n = 1;
7
7
  return t.forEach((e) => {
8
- e.children && (n = Math.max(n, z(e.children) + 1));
8
+ e.children && (n = Math.max(n, Q(e.children) + 1));
9
9
  }), n;
10
10
  }
11
- function F(t) {
11
+ function W(t) {
12
12
  let n = 0;
13
13
  return t.forEach((e) => {
14
- e.children ? n += F(e.children) : n++;
14
+ e.children ? n += W(e.children) : n++;
15
15
  }), n;
16
16
  }
17
- function Q(t, n, e = [], o = 0, s = 0, r = "") {
18
- return t.forEach((d) => {
19
- if (e[o] || (e[o] = []), d.children) {
20
- const { children: _, ...a } = d, l = F(_);
17
+ function Z(t, n, e = [], o = 0, s = 0, a = "") {
18
+ return t.forEach((u) => {
19
+ if (e[o] || (e[o] = []), u.children) {
20
+ const { children: h, ...r } = u, l = W(h);
21
21
  e[o].push({
22
- ...a,
22
+ ...r,
23
23
  colSpan: l,
24
24
  scope: "colgroup"
25
- }), Q(_, n, e, o + 1, s + 1, `${r}${d.key}.`);
25
+ }), Z(h, n, e, o + 1, s + 1, `${a}${u.key}.`);
26
26
  } else {
27
- const _ = n - s;
27
+ const h = n - s;
28
28
  e[o].push({
29
- ...d,
30
- key: d.key,
31
- fullKey: `${r}${d.key}`,
32
- label: d.label,
33
- rowSpan: _,
29
+ ...u,
30
+ key: u.key,
31
+ fullKey: `${a}${u.key}`,
32
+ label: u.label,
33
+ rowSpan: h,
34
34
  scope: "col",
35
- sortable: Object.prototype.hasOwnProperty.call(d, "sortable") ? d.sortable : !0
35
+ sortable: Object.prototype.hasOwnProperty.call(u, "sortable") ? u.sortable : !0
36
36
  });
37
37
  }
38
38
  }), e;
39
39
  }
40
- function W(t, n = "", e = []) {
40
+ function I(t, n = "", e = []) {
41
41
  return t.forEach((o) => {
42
- o.children ? W(o.children, `${n}${o.key}.`, e) : e.push(`${n}${o.key}`);
42
+ o.children ? I(o.children, `${n}${o.key}.`, e) : e.push(`${n}${o.key}`);
43
43
  }), e;
44
44
  }
45
- function Kt(t) {
46
- const n = z(t);
47
- return Q(t, n).reduce((s, r) => [...s, ...r], []);
45
+ function At(t) {
46
+ const n = Q(t);
47
+ return Z(t, n).reduce((s, a) => [...s, ...a], []);
48
48
  }
49
- function Y(t) {
49
+ function G(t) {
50
50
  const n = [];
51
51
  for (const e in t) {
52
- const o = se(e), s = {
52
+ const o = re(e), s = {
53
53
  key: e,
54
54
  label: o
55
55
  };
56
56
  if (typeof t[e] == "object" && t[e] !== null) {
57
- const r = Y(t[e]);
58
- r.length > 0 && (s.children = r);
57
+ const a = G(t[e]);
58
+ a.length > 0 && (s.children = a);
59
59
  }
60
60
  n.push(s);
61
61
  }
62
62
  return n;
63
63
  }
64
- const ae = (t, n) => {
64
+ const ce = (t, n) => {
65
65
  const e = n.split(".");
66
66
  let o = t;
67
67
  for (let s = 0; s < e.length; s++)
@@ -71,39 +71,40 @@ const ae = (t, n) => {
71
71
  return;
72
72
  return o;
73
73
  };
74
- function re(t, n) {
75
- return t.map((e) => W(n).map((o) => ({
76
- [o]: ae(e, o)
77
- })).reduce((o, s) => ({ ...o, ...s }), {}));
74
+ function ie(t, n) {
75
+ return t.map((e) => n.map((a) => ({
76
+ [a]: ce(e, a)
77
+ // ...row,
78
+ })).reduce((a, u) => ({ ...a, ...u }), {}));
78
79
  }
79
- function ce(t, n = 0, e = t.length) {
80
+ function ue(t, n = 0, e = t.length) {
80
81
  return t.slice(n, e);
81
82
  }
82
- function Z(t) {
83
+ function x(t) {
83
84
  const n = {};
84
85
  for (const [e, o] of Object.entries(t))
85
86
  if (e.includes(".")) {
86
- const [s, r] = e.split(".");
87
- n[s] || (n[s] = {}), n[s][r] = o;
87
+ const [s, a] = e.split(".");
88
+ n[s] || (n[s] = {}), n[s][a] = o;
88
89
  } else
89
90
  n[e] = o;
90
91
  for (const [e, o] of Object.entries(n))
91
- typeof o == "object" && (n[e] = Z(o));
92
+ typeof o == "object" && (n[e] = x(o));
92
93
  return n;
93
94
  }
94
- function ie(t) {
95
+ function de(t) {
95
96
  const n = [];
96
97
  for (const e in t)
97
- typeof t[e] == "object" ? n.push(...ie(t[e])) : n.push(t[e]);
98
+ typeof t[e] == "object" ? n.push(...de(t[e])) : n.push(t[e]);
98
99
  return n;
99
100
  }
100
- function ue(t) {
101
+ function pe(t) {
101
102
  return typeof t != "function" || typeof t != "object";
102
103
  }
103
- function Nt(t) {
104
+ function It(t) {
104
105
  return (n, e, o) => t(n, e, o);
105
106
  }
106
- function de() {
107
+ function _e() {
107
108
  return {
108
109
  itemValue: "id",
109
110
  columnHeaders: () => [],
@@ -119,12 +120,12 @@ function de() {
119
120
  filterQuery: "",
120
121
  filterBy: void 0,
121
122
  filterMethod: (t, n, e) => t === "" || t === void 0 || e === void 0 || e.length === 0 ? !0 : e == null ? void 0 : e.some((s) => {
122
- const r = n[s];
123
- return ue(r) ? r == null ? void 0 : r.toString().toLowerCase().includes(t.toLowerCase()) : !1;
123
+ const a = n[s];
124
+ return pe(a) ? a == null ? void 0 : a.toString().toLowerCase().includes(t.toLowerCase()) : !1;
124
125
  })
125
126
  };
126
127
  }
127
- const pe = {
128
+ const he = {
128
129
  options: () => [],
129
130
  modelValue: "",
130
131
  label: ""
@@ -133,99 +134,99 @@ const pe = {
133
134
  for (const [o, s] of n)
134
135
  e[o] = s;
135
136
  return e;
136
- }, _e = {}, he = {
137
+ }, ge = {}, be = {
137
138
  xmlns: "http://www.w3.org/2000/svg",
138
139
  width: "1em",
139
140
  height: "1em",
140
141
  viewBox: "0 0 24 24"
141
- }, ge = /* @__PURE__ */ i("path", {
142
+ }, fe = /* @__PURE__ */ d("path", {
142
143
  fill: "none",
143
144
  stroke: "currentColor",
144
145
  "stroke-linecap": "round",
145
146
  "stroke-linejoin": "round",
146
147
  "stroke-width": "1.5",
147
148
  d: "m19 9l-7 6l-7-6"
148
- }, null, -1), be = [
149
- ge
149
+ }, null, -1), me = [
150
+ fe
150
151
  ];
151
- function fe(t, n) {
152
- return h(), g("svg", he, be);
152
+ function ye(t, n) {
153
+ return g(), b("svg", be, me);
153
154
  }
154
- const me = /* @__PURE__ */ U(_e, [["render", fe]]), ve = { class: "table__dropdown-wrapper" }, we = ["aria-expanded"], ye = {
155
+ const ve = /* @__PURE__ */ U(ge, [["render", ye]]), we = { class: "table__dropdown-wrapper" }, ke = ["aria-expanded"], $e = {
155
156
  class: "py-1",
156
157
  role: "none"
157
- }, ke = ["onClick"], $e = /* @__PURE__ */ M({
158
+ }, Pe = ["onClick"], Ce = /* @__PURE__ */ L({
158
159
  __name: "VueyeDropdown",
159
- props: H({
160
+ props: D({
160
161
  options: {},
161
162
  modelValue: {},
162
163
  label: {},
163
164
  defaultValue: {}
164
- }, pe),
165
+ }, he),
165
166
  emits: ["update:modelValue"],
166
167
  setup(t, { emit: n }) {
167
- const e = t, o = V(!1), s = V(-1), r = V(null), d = V(null), _ = V(!0), a = v(() => s.value === -1 ? e.options[0] : e.options[s.value]), l = `dropdown-label-${Math.random().toString(36).substring(2, 9)}`;
168
- async function u() {
169
- var w, p;
168
+ const e = t, o = C(!1), s = C(-1), a = C(null), u = C(null), h = C(!0), r = m(() => s.value === -1 ? e.options[0] : e.options[s.value]), l = `dropdown-label-${Math.random().toString(36).substring(2, 9)}`;
169
+ async function i() {
170
+ var v, p;
170
171
  if (o.value = !o.value, o.value) {
171
- await ee();
172
- const C = ((w = r.value) == null ? void 0 : w.getBoundingClientRect()) ?? { bottom: 0 }, k = ((p = d.value) == null ? void 0 : p.offsetHeight) ?? 200;
173
- _.value = window.innerHeight - (C == null ? void 0 : C.bottom) > k;
172
+ await te();
173
+ const k = ((v = a.value) == null ? void 0 : v.getBoundingClientRect()) ?? { bottom: 0 }, V = ((p = u.value) == null ? void 0 : p.offsetHeight) ?? 200;
174
+ h.value = window.innerHeight - (k == null ? void 0 : k.bottom) > V;
174
175
  }
175
176
  }
176
- function b(w) {
177
- s.value = w, o.value = !1, n("update:modelValue", a.value.content);
177
+ function _(v) {
178
+ s.value = v, o.value = !1, n("update:modelValue", r.value.content);
178
179
  }
179
- return J(() => {
180
- const w = e.options.findIndex((p) => p.content === e.modelValue);
181
- w !== -1 && (s.value = w), e.modelValue === void 0 && (s.value = -1);
182
- }), (w, p) => (h(), g("div", ve, [
183
- i("button", {
180
+ return Y(() => {
181
+ const v = e.options.findIndex((p) => p.content === e.modelValue);
182
+ v !== -1 && (s.value = v), e.modelValue === void 0 && (s.value = -1);
183
+ }), (v, p) => (g(), b("div", we, [
184
+ d("button", {
184
185
  type: "button",
185
186
  class: "table__dropdown-trigger",
186
- onClick: u,
187
+ onClick: i,
187
188
  "aria-expanded": c(o),
188
189
  "aria-haspopup": !0,
189
190
  ref_key: "buttonRef",
190
- ref: r
191
+ ref: a
191
192
  }, [
192
- i("span", null, P(c(a).label), 1),
193
- $(me)
194
- ], 8, we),
195
- c(o) ? (h(), g("div", {
193
+ d("span", null, P(c(r).label), 1),
194
+ $(ve)
195
+ ], 8, ke),
196
+ c(o) ? (g(), b("div", {
196
197
  key: 0,
197
198
  class: "table__dropdown-overlay",
198
- onClick: u
199
- })) : T("", !0),
200
- E(i("div", {
201
- class: S(["table__dropdown-menu", { "table__dropdown-menu--top": !c(_) }]),
199
+ onClick: i
200
+ })) : z("", !0),
201
+ F(d("div", {
202
+ class: K(["table__dropdown-menu", { "table__dropdown-menu--top": !c(h) }]),
202
203
  role: "menu",
203
204
  "aria-orientation": "vertical",
204
205
  "aria-labelledby": l,
205
206
  ref_key: "dropdownMenuRef",
206
- ref: d
207
+ ref: u
207
208
  }, [
208
- i("div", ye, [
209
- (h(!0), g(L, null, B(w.options, (C, k) => (h(), g("button", {
210
- key: k,
211
- class: S([{
212
- "table__dropdown-menu-item--selected ": k === c(s)
209
+ d("div", $e, [
210
+ (g(!0), b(j, null, R(v.options, (k, V) => (g(), b("button", {
211
+ key: V,
212
+ class: K([{
213
+ "table__dropdown-menu-item--selected ": V === c(s)
213
214
  }, "table__dropdown-menu-item"]),
214
215
  role: "menuitem",
215
- onClick: (K) => b(k)
216
- }, P(C.label), 11, ke))), 128))
216
+ onClick: (B) => _(V)
217
+ }, P(k.label), 11, Pe))), 128))
217
218
  ])
218
219
  ], 2), [
219
- [X, c(o)]
220
+ [q, c(o)]
220
221
  ])
221
222
  ]));
222
223
  }
223
- }), Pe = {
224
+ }), Ve = {
224
225
  loading: !1,
225
226
  bodyRows: () => [],
226
227
  itemValue: "id",
227
228
  columnsLength: 0
228
- }, Ce = ["id", "checked", "indeterminate"], Ve = ["for"], Se = /* @__PURE__ */ oe('<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" aria-hidden="true"><g fill="none" stroke="currentColor" stroke-width="1.5"><path class="rounded-square" d="M2 12c0-4.714 0-7.071 1.464-8.536C4.93 2 7.286 2 12 2c4.714 0 7.071 0 8.535 1.464C22 4.93 22 7.286 22 12c0 4.714 0 7.071-1.465 8.535C19.072 22 16.714 22 12 22s-7.071 0-8.536-1.465C2 19.072 2 16.714 2 12Z"></path><path class="checkmark" stroke-linecap="round" stroke-linejoin="round" d="m8.5 12.5l2 2l5-5"></path><path class="indeterminate" stroke-linecap="round" stroke-linejoin="round" d="M6 12h12"></path></g></svg>', 1), q = /* @__PURE__ */ M({
229
+ }, Se = ["id", "checked", "indeterminate"], Ke = ["for"], Oe = /* @__PURE__ */ le('<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" aria-hidden="true"><g fill="none" stroke="currentColor" stroke-width="1.5"><path class="rounded-square" d="M2 12c0-4.714 0-7.071 1.464-8.536C4.93 2 7.286 2 12 2c4.714 0 7.071 0 8.535 1.464C22 4.93 22 7.286 22 12c0 4.714 0 7.071-1.465 8.535C19.072 22 16.714 22 12 22s-7.071 0-8.536-1.465C2 19.072 2 16.714 2 12Z"></path><path class="checkmark" stroke-linecap="round" stroke-linejoin="round" d="m8.5 12.5l2 2l5-5"></path><path class="indeterminate" stroke-linecap="round" stroke-linejoin="round" d="M6 12h12"></path></g></svg>', 1), ee = /* @__PURE__ */ L({
229
230
  inheritAttrs: !1,
230
231
  __name: "VueyeCheckbox",
231
232
  props: {
@@ -233,127 +234,128 @@ const me = /* @__PURE__ */ U(_e, [["render", fe]]), ve = { class: "table__dropdo
233
234
  id: String,
234
235
  label: String,
235
236
  indeterminate: Boolean,
236
- modelValue: Boolean
237
+ modelValue: [Boolean, Array]
237
238
  },
238
239
  emits: ["change", "update:modelValue"],
239
240
  setup(t, { emit: n }) {
240
- const e = t, o = V(e.modelValue), s = v({
241
+ const e = t, o = C(e.modelValue), s = m({
241
242
  get() {
242
243
  return e.modelValue;
243
244
  },
244
- set(d) {
245
- n("update:modelValue", d);
245
+ set(u) {
246
+ n("update:modelValue", u);
246
247
  }
247
- }), r = (d) => {
248
- n("change", d);
248
+ }), a = (u) => {
249
+ n("change", u);
249
250
  };
250
- return (d, _) => (h(), g("div", {
251
- class: S(["table__checkbox", { "table__checkbox--checked": o.value, "table__checkbox--indeterminate": t.indeterminate }])
251
+ return (u, h) => (g(), b("div", {
252
+ class: K(["table__checkbox", { "table__checkbox--checked": o.value, "table__checkbox--indeterminate": t.indeterminate }])
252
253
  }, [
253
- E(i("input", te({
254
+ F(d("input", ne({
254
255
  id: t.id,
255
256
  type: "checkbox",
256
257
  checked: o.value,
257
- "onUpdate:modelValue": _[0] || (_[0] = (a) => I(s) ? s.value = a : null),
258
+ "onUpdate:modelValue": h[0] || (h[0] = (r) => A(s) ? s.value = r : null),
258
259
  indeterminate: t.indeterminate,
259
- onChange: r,
260
+ onChange: a,
260
261
  "aria-labelledby": "checkboxLabel"
261
- }, d.$attrs), null, 16, Ce), [
262
- [ne, c(s)]
262
+ }, u.$attrs), null, 16, Se), [
263
+ [oe, c(s)]
263
264
  ]),
264
- i("label", {
265
+ d("label", {
265
266
  for: t.id,
266
267
  id: "checkboxLabel"
267
- }, P(t.label), 9, Ve),
268
- Se
268
+ }, P(t.label), 9, Ke),
269
+ Oe
269
270
  ], 2));
270
271
  }
271
272
  });
272
- const Oe = { class: "table__body" }, Re = {
273
+ const Re = { class: "table__body" }, Be = {
273
274
  key: 0,
274
275
  class: "table__row table__row--loading"
275
- }, Be = ["colspan"], Me = {
276
+ }, Le = ["colspan"], Me = {
276
277
  key: 1,
277
278
  class: "table__row table__row--empty"
278
- }, je = ["colspan"], De = /* @__PURE__ */ i("div", { class: "text-center" }, "No data available", -1), Le = { class: "table__row" }, He = { class: "table__cell table_cell--checkbox" }, Ue = { class: "table__cell" }, Ke = /* @__PURE__ */ M({
279
+ }, He = ["colspan"], je = /* @__PURE__ */ d("div", { class: "text-center" }, "No data available", -1), De = { class: "table__row" }, Ue = { class: "table__cell table_cell--checkbox" }, Ne = { class: "table__cell" }, Ae = /* @__PURE__ */ L({
279
280
  __name: "VueyeBody",
280
- props: H({
281
+ props: D({
281
282
  loading: { type: Boolean },
282
283
  bodyRows: {},
284
+ notListedKeys: {},
283
285
  itemValue: {},
284
286
  columnsLength: {},
285
287
  selected: {}
286
- }, Pe),
288
+ }, Ve),
287
289
  emits: ["update:selected"],
288
290
  setup(t, { emit: n }) {
289
- const e = t, o = v(() => Object.keys(e.bodyRows[0])), s = v(() => o.value.reduce(
290
- (a, l) => ({
291
- ...a,
291
+ const e = t, o = m(() => Object.keys(e.bodyRows[0]).filter((r) => !e.notListedKeys.includes(r))), s = m(() => o.value.reduce(
292
+ (r, l) => ({
293
+ ...r,
292
294
  [l]: l.split(".").pop() ?? ""
293
295
  }),
294
296
  {}
295
- )), r = v(() => e.bodyRows.map((a) => ({
296
- flat: a,
297
- nest: Z(a)
298
- }))), d = v(() => r.value.map((a) => a.nest)), _ = v({
297
+ )), a = m(() => e.bodyRows.map((r) => ({
298
+ flat: r,
299
+ nest: x(r)
300
+ }))), u = m(() => a.value.map((r) => r.nest)), h = m({
299
301
  get() {
300
302
  return e.selected;
301
303
  },
302
- set(a) {
303
- n("update:selected", a);
304
+ set(r) {
305
+ n("update:selected", r);
304
306
  }
305
307
  });
306
- return (a, l) => m(a.$slots, "body", { rows: a.bodyRows }, () => [
307
- i("tbody", Oe, [
308
- a.loading ? (h(), g("tr", Re, [
309
- i("td", {
310
- colspan: a.columnsLength,
308
+ return (r, l) => y(r.$slots, "body", { rows: r.bodyRows }, () => [
309
+ d("tbody", Re, [
310
+ r.loading ? (g(), b("tr", Be, [
311
+ d("td", {
312
+ colspan: r.columnsLength,
311
313
  class: "table__cell table__cell--loading"
312
314
  }, [
313
- m(a.$slots, "loading", {}, () => [
314
- G(" Loading... ")
315
+ y(r.$slots, "loading", {}, () => [
316
+ J(" Loading... ")
315
317
  ])
316
- ], 8, Be)
317
- ])) : a.bodyRows.length === 0 ? (h(), g("tr", Me, [
318
- i("td", {
318
+ ], 8, Le)
319
+ ])) : r.bodyRows.length === 0 ? (g(), b("tr", Me, [
320
+ d("td", {
319
321
  class: "table__cell",
320
- colspan: a.columnsLength
322
+ colspan: r.columnsLength
321
323
  }, [
322
- m(a.$slots, "empty", {}, () => [
323
- De
324
+ y(r.$slots, "empty", {}, () => [
325
+ je
324
326
  ])
325
- ], 8, je)
326
- ])) : m(a.$slots, "rows", {
327
+ ], 8, He)
328
+ ])) : y(r.$slots, "rows", {
327
329
  key: 2,
328
- rows: c(d)
330
+ rows: c(u)
329
331
  }, () => [
330
- (h(!0), g(L, null, B(c(r), (u) => m(a.$slots, "row", {
331
- key: u[a.itemValue],
332
- row: u.nest
332
+ (g(!0), b(j, null, R(c(a), (i) => y(r.$slots, "row", {
333
+ key: i[r.itemValue],
334
+ row: i.nest
333
335
  }, () => [
334
- i("tr", Le, [
335
- a.selected ? m(a.$slots, "checkbox", {
336
+ d("tr", De, [
337
+ r.selected ? y(r.$slots, "checkbox", {
336
338
  key: 0,
337
- row: u.nest
339
+ row: i.nest
338
340
  }, () => [
339
- i("td", He, [
340
- $(q, {
341
- modelValue: c(_),
342
- "onUpdate:modelValue": l[0] || (l[0] = (b) => I(_) ? _.value = b : null),
343
- value: u.nest,
341
+ d("td", Ue, [
342
+ $(ee, {
343
+ modelValue: c(h),
344
+ "onUpdate:modelValue": l[0] || (l[0] = (_) => A(h) ? h.value = _ : null),
345
+ value: i.nest,
344
346
  "aria-label": "Select row"
345
347
  }, null, 8, ["modelValue", "value"])
346
348
  ])
347
- ]) : T("", !0),
348
- (h(!0), g(L, null, B(c(o), (b) => m(a.$slots, `itemCell.${b}`, {
349
- key: `${u[a.itemValue]}.${b}`,
350
- itemCell: u.nest
349
+ ]) : z("", !0),
350
+ (g(!0), b(j, null, R(c(o), (_) => y(r.$slots, `itemCell.${_}`, {
351
+ key: `${i[r.itemValue]}.${_}`,
352
+ itemCell: i.nest
351
353
  }, () => [
352
- i("td", Ue, [
353
- m(a.$slots, `itemCellContent.${c(s)[b]}`, {
354
- itemCellContent: u.nest
354
+ d("td", Ne, [
355
+ y(r.$slots, `itemCellContent.${c(s)[_]}`, {
356
+ itemCellContent: i.nest
355
357
  }, () => [
356
- G(P(u.flat[b]), 1)
358
+ J(P(i.flat[_]), 1)
357
359
  ])
358
360
  ])
359
361
  ])), 128))
@@ -363,54 +365,54 @@ const Oe = { class: "table__body" }, Re = {
363
365
  ])
364
366
  ]);
365
367
  }
366
- }), Ne = {
368
+ }), Ie = {
367
369
  columnHeaders: () => [],
368
370
  selectable: !1,
369
371
  select: "none"
370
- }, Ie = {
372
+ }, Te = {
371
373
  xmlns: "http://www.w3.org/2000/svg",
372
374
  width: "1em",
373
375
  height: "1em",
374
376
  viewBox: "0 0 16 16"
375
- }, Ae = ["opacity"], Te = ["opacity"], Ee = /* @__PURE__ */ M({
377
+ }, Ee = ["opacity"], ze = ["opacity"], Fe = /* @__PURE__ */ L({
376
378
  __name: "ArrowUpDownIcon",
377
379
  props: {
378
380
  down: Boolean
379
381
  },
380
382
  setup(t) {
381
- const n = t, e = v(() => ({
383
+ const n = t, e = m(() => ({
382
384
  up: n.down ? 0.5 : 1,
383
385
  down: n.down ? 1 : 0.5
384
386
  }));
385
- return (o, s) => (h(), g("svg", Ie, [
386
- i("path", {
387
+ return (o, s) => (g(), b("svg", Te, [
388
+ d("path", {
387
389
  opacity: c(e).up,
388
390
  fill: "currentColor",
389
391
  fillRule: "evenodd",
390
392
  d: "M2.22 5.53a.75.75 0 0 1 0-1.06l2.25-2.25a.75.75 0 0 1 1.06 0l2.25 2.25a.75.75 0 0 1-1.06 1.06l-.97-.97v5.69a.75.75 0 0 1-1.5 0V4.56l-.97.97a.75.75 0 0 1-1.06 0",
391
393
  clipRule: "evenodd"
392
- }, null, 8, Ae),
393
- i("path", {
394
+ }, null, 8, Ee),
395
+ d("path", {
394
396
  opacity: c(e).down,
395
397
  fill: "currentColor",
396
398
  fillRule: "evenodd",
397
399
  d: "M13.78 10.47a.75.75 0 0 1 0 1.06l-2.25 2.25a.75.75 0 0 1-1.06 0l-2.25-2.25a.75.75 0 1 1 1.06-1.06l.97.97V5.75a.75.75 0 0 1 1.5 0v5.69l.97-.97a.75.75 0 0 1 1.06 0",
398
400
  clipRule: "evenodd"
399
- }, null, 8, Te)
401
+ }, null, 8, ze)
400
402
  ]));
401
403
  }
402
- }), ze = { class: "table__head" }, Fe = ["colspan", "rowspan", "scope"], Qe = ["onClick"], We = /* @__PURE__ */ M({
404
+ }), Qe = { class: "table__head" }, We = ["colspan", "rowspan", "scope"], Ze = ["onClick"], Ge = /* @__PURE__ */ L({
403
405
  __name: "VueyeHead",
404
- props: H({
406
+ props: D({
405
407
  columnHeaders: {},
406
408
  selectable: { type: Boolean },
407
409
  select: {}
408
- }, Ne),
410
+ }, Ie),
409
411
  emits: ["update:select", "sort"],
410
412
  setup(t, { emit: n }) {
411
- const e = t, o = V(""), s = V(!1), r = (l) => {
413
+ const e = t, o = C(""), s = C(!1), a = (l) => {
412
414
  l.sortable && l.scope === "col" && (o.value === l.fullKey ? s.value = !s.value : (o.value = l.fullKey ?? "", s.value = !1), n("sort", { key: o.value, desc: s.value }));
413
- }, d = v(() => e.selectable ? [
415
+ }, u = m(() => e.selectable ? [
414
416
  [
415
417
  {
416
418
  key: "checkbox",
@@ -423,255 +425,260 @@ const Oe = { class: "table__body" }, Re = {
423
425
  ...e.columnHeaders[0]
424
426
  ],
425
427
  ...e.columnHeaders.slice(1)
426
- ] : e.columnHeaders), _ = v({
428
+ ] : e.columnHeaders), h = m({
427
429
  get() {
428
430
  return e.select;
429
431
  },
430
432
  set(l) {
431
433
  n("update:select", l);
432
434
  }
433
- }), a = (l) => {
434
- l.target.checked ? _.value = "all" : _.value = "none";
435
+ }), r = (l) => {
436
+ l.target.checked ? h.value = "all" : h.value = "none";
435
437
  };
436
- return (l, u) => m(l.$slots, "headers", { headers: l.columnHeaders }, () => [
437
- i("thead", ze, [
438
- (h(!0), g(L, null, B(c(d), (b, w) => (h(), g("tr", {
438
+ return (l, i) => y(l.$slots, "headers", { headers: l.columnHeaders }, () => [
439
+ d("thead", Qe, [
440
+ (g(!0), b(j, null, R(c(u), (_, v) => (g(), b("tr", {
439
441
  class: "table__row table__row",
440
- key: w
442
+ key: v
441
443
  }, [
442
- (h(!0), g(L, null, B(b, (p) => m(l.$slots, `headerCell.${p.key}`, {
444
+ (g(!0), b(j, null, R(_, (p) => y(l.$slots, `headerCell.${p.key}`, {
443
445
  key: p.key,
444
446
  headerItem: p
445
447
  }, () => [
446
- i("th", {
448
+ d("th", {
447
449
  colspan: p.colSpan,
448
450
  rowspan: p.rowSpan,
449
451
  scope: p.scope,
450
- class: S(["table__cell table__cell--head", p.className])
452
+ class: K(["table__cell table__cell--head", p.className])
451
453
  }, [
452
- p.key === "checkbox" && l.selectable ? m(l.$slots, "checkbox", { key: 0 }, () => [
453
- $(q, {
454
- indeterminate: c(_) === "indeterminate",
454
+ p.key === "checkbox" && l.selectable ? y(l.$slots, "checkbox", { key: 0 }, () => [
455
+ $(ee, {
456
+ indeterminate: c(h) === "indeterminate",
455
457
  type: "checkbox",
456
- checked: c(_) === "all",
457
- onChange: a,
458
+ checked: c(h) === "all",
459
+ onChange: r,
458
460
  "aria-label": "select all rows",
459
461
  class: "table__checkbox"
460
462
  }, null, 8, ["indeterminate", "checked"])
461
- ]) : m(l.$slots, `headerCellContent.${p.key}`, {
463
+ ]) : y(l.$slots, `headerCellContent.${p.key}`, {
462
464
  key: 1,
463
465
  headerItem: p
464
466
  }, () => [
465
- p.scope === "col" ? (h(), g("button", {
467
+ p.scope === "col" ? (g(), b("button", {
466
468
  key: 0,
467
- onClick: (C) => r(p),
469
+ onClick: (k) => a(p),
468
470
  class: "table__sort-button"
469
471
  }, [
470
- i("span", {
471
- class: S(["table__label table__label--head", p.labelClassName])
472
+ d("span", {
473
+ class: K(["table__label table__label--head", p.labelClassName])
472
474
  }, P(p.label), 3),
473
- $(Ee, {
474
- class: S([{ "table__sort-icon--show": c(o) === p.key }, "table__sort-icon"]),
475
+ $(Fe, {
476
+ class: K([{ "table__sort-icon--show": c(o) === p.key }, "table__sort-icon"]),
475
477
  down: c(s)
476
478
  }, null, 8, ["class", "down"])
477
- ], 8, Qe)) : (h(), g("span", {
479
+ ], 8, Ze)) : (g(), b("span", {
478
480
  key: 1,
479
- class: S(["table__label table__label--head", p.labelClassName])
481
+ class: K(["table__label table__label--head", p.labelClassName])
480
482
  }, P(p.label), 3))
481
483
  ])
482
- ], 10, Fe)
484
+ ], 10, We)
483
485
  ])), 128))
484
486
  ]))), 128))
485
487
  ])
486
488
  ]);
487
489
  }
488
490
  });
489
- const Ze = {}, Ge = {
491
+ const xe = {}, Je = {
490
492
  xmlns: "http://www.w3.org/2000/svg",
491
493
  width: "1em",
492
494
  height: "1em",
493
495
  viewBox: "0 0 24 24"
494
- }, xe = /* @__PURE__ */ i("path", {
496
+ }, Xe = /* @__PURE__ */ d("path", {
495
497
  fill: "none",
496
498
  stroke: "currentColor",
497
499
  "stroke-linecap": "round",
498
500
  "stroke-linejoin": "round",
499
501
  "stroke-width": "1.5",
500
502
  d: "m9 5l6 7l-6 7"
501
- }, null, -1), Je = [
502
- xe
503
+ }, null, -1), Ye = [
504
+ Xe
503
505
  ];
504
- function Xe(t, n) {
505
- return h(), g("svg", Ge, Je);
506
+ function qe(t, n) {
507
+ return g(), b("svg", Je, Ye);
506
508
  }
507
- const Ye = /* @__PURE__ */ U(Ze, [["render", Xe]]), qe = {}, et = {
509
+ const et = /* @__PURE__ */ U(xe, [["render", qe]]), tt = {}, nt = {
508
510
  xmlns: "http://www.w3.org/2000/svg",
509
511
  width: "1em",
510
512
  height: "1em",
511
513
  viewBox: "0 0 24 24"
512
- }, tt = /* @__PURE__ */ i("path", {
514
+ }, ot = /* @__PURE__ */ d("path", {
513
515
  fill: "none",
514
516
  stroke: "currentColor",
515
517
  "stroke-linecap": "round",
516
518
  "stroke-linejoin": "round",
517
519
  "stroke-width": "1.5",
518
520
  d: "m15 5l-6 7l6 7"
519
- }, null, -1), nt = [
520
- tt
521
+ }, null, -1), lt = [
522
+ ot
521
523
  ];
522
- function ot(t, n) {
523
- return h(), g("svg", et, nt);
524
+ function st(t, n) {
525
+ return g(), b("svg", nt, lt);
524
526
  }
525
- const lt = /* @__PURE__ */ U(qe, [["render", ot]]), st = {}, at = {
527
+ const at = /* @__PURE__ */ U(tt, [["render", st]]), rt = {}, ct = {
526
528
  xmlns: "http://www.w3.org/2000/svg",
527
529
  width: "1em",
528
530
  height: "1em",
529
531
  viewBox: "0 0 24 24"
530
- }, rt = /* @__PURE__ */ i("g", {
532
+ }, it = /* @__PURE__ */ d("g", {
531
533
  fill: "none",
532
534
  stroke: "currentColor",
533
535
  "stroke-linecap": "round",
534
536
  "stroke-linejoin": "round",
535
537
  "stroke-width": "1.5"
536
538
  }, [
537
- /* @__PURE__ */ i("path", { d: "m11 19l6-7l-6-7" }),
538
- /* @__PURE__ */ i("path", { d: "m7 19l6-7l-6-7" })
539
- ], -1), ct = [
540
- rt
539
+ /* @__PURE__ */ d("path", { d: "m11 19l6-7l-6-7" }),
540
+ /* @__PURE__ */ d("path", { d: "m7 19l6-7l-6-7" })
541
+ ], -1), ut = [
542
+ it
541
543
  ];
542
- function it(t, n) {
543
- return h(), g("svg", at, ct);
544
+ function dt(t, n) {
545
+ return g(), b("svg", ct, ut);
544
546
  }
545
- const ut = /* @__PURE__ */ U(st, [["render", it]]), dt = {}, pt = {
547
+ const pt = /* @__PURE__ */ U(rt, [["render", dt]]), _t = {}, ht = {
546
548
  xmlns: "http://www.w3.org/2000/svg",
547
549
  width: "1em",
548
550
  height: "1em",
549
551
  viewBox: "0 0 24 24"
550
- }, _t = /* @__PURE__ */ i("g", {
552
+ }, gt = /* @__PURE__ */ d("g", {
551
553
  fill: "none",
552
554
  stroke: "currentColor",
553
555
  "stroke-linecap": "round",
554
556
  "stroke-linejoin": "round",
555
557
  "stroke-width": "1.5"
556
558
  }, [
557
- /* @__PURE__ */ i("path", { d: "m13 19l-6-7l6-7" }),
558
- /* @__PURE__ */ i("path", { d: "m17 19l-6-7l6-7" })
559
- ], -1), ht = [
560
- _t
559
+ /* @__PURE__ */ d("path", { d: "m13 19l-6-7l6-7" }),
560
+ /* @__PURE__ */ d("path", { d: "m17 19l-6-7l6-7" })
561
+ ], -1), bt = [
562
+ gt
561
563
  ];
562
- function gt(t, n) {
563
- return h(), g("svg", pt, ht);
564
+ function ft(t, n) {
565
+ return g(), b("svg", ht, bt);
564
566
  }
565
- const bt = /* @__PURE__ */ U(dt, [["render", gt]]), ft = {
567
+ const mt = /* @__PURE__ */ U(_t, [["render", ft]]), yt = {
566
568
  perPage: 10,
567
569
  currentPage: 1,
568
570
  total: 0,
569
571
  perPageOptions: () => [10, 20, 30, 40, 50]
570
- }, mt = { class: "table__pagination-wrapper" }, vt = { class: "table__pagination-details" }, wt = { class: "table__pagination-btn-list" }, yt = ["disabled"], kt = ["disabled"], $t = ["onClick", "aria-label"], Pt = {
572
+ }, vt = { class: "table__pagination-wrapper" }, wt = { class: "table__pagination-details" }, kt = { class: "table__pagination-btn-list" }, $t = ["disabled"], Pt = ["disabled"], Ct = ["onClick", "aria-label"], Vt = {
571
573
  key: 1,
572
574
  class: "table__pagination-btn table__btn"
573
- }, Ct = ["disabled"], Vt = ["disabled"], St = /* @__PURE__ */ M({
575
+ }, St = ["disabled"], Kt = ["disabled"], Ot = /* @__PURE__ */ L({
574
576
  __name: "VueyePagination",
575
- props: H({
577
+ props: D({
576
578
  perPage: {},
577
579
  currentPage: {},
578
580
  total: {},
579
581
  perPageOptions: {}
580
- }, ft),
582
+ }, yt),
581
583
  emits: ["update:currentPage", "update:perPage"],
582
584
  setup(t, { emit: n }) {
583
- const e = t, o = v(() => Math.ceil(e.total / e.perPage)), s = v(() => e.perPageOptions.map((l) => ({
585
+ const e = t, o = m(() => Math.ceil(e.total / e.perPage)), s = m(() => e.perPageOptions.map((l) => ({
584
586
  content: l,
585
587
  label: l.toString()
586
- }))), r = v(() => s.value.find((l) => l.content === e.perPage)), d = v(() => Array.from({ length: o.value }, (l, u) => u + 1).reduce(
587
- (l, u) => (u === 1 || u === e.total || u >= e.currentPage - 2 && u <= e.currentPage + 2 ? l.push(u) : (u === e.currentPage - 3 || u === e.currentPage + 3) && l.push("..."), l),
588
+ }))), a = m(() => s.value.find((l) => l.content === e.perPage)), u = m(() => Array.from({ length: o.value }, (l, i) => i + 1).reduce(
589
+ (l, i) => (i === 1 || i === e.total || i >= e.currentPage - 2 && i <= e.currentPage + 2 ? l.push(i) : (i === e.currentPage - 3 || i === e.currentPage + 3) && l.push("..."), l),
588
590
  []
589
591
  ));
590
- function _(l) {
592
+ function h(l) {
591
593
  n("update:perPage", Number(l));
592
594
  }
593
- function a(l) {
595
+ function r(l) {
594
596
  l >= 1 && l <= o.value && n("update:currentPage", l);
595
597
  }
596
- return (l, u) => (h(), g("div", mt, [
597
- $(c($e), {
598
+ return (l, i) => (g(), b("div", vt, [
599
+ $(c(Ce), {
598
600
  options: c(s),
599
- "default-value": c(r),
601
+ "default-value": c(a),
600
602
  label: "Per page",
601
- "onUpdate:modelValue": _
603
+ "onUpdate:modelValue": h
602
604
  }, null, 8, ["options", "default-value"]),
603
- i("span", vt, P((l.currentPage - 1) * l.perPage + 1) + " - " + P(l.currentPage * l.perPage > l.total ? l.total : l.currentPage * l.perPage) + " of " + P(l.total), 1),
604
- i("ul", wt, [
605
- i("li", null, [
606
- i("button", {
605
+ d("span", wt, P((l.currentPage - 1) * l.perPage + 1) + " - " + P(l.currentPage * l.perPage > l.total ? l.total : l.currentPage * l.perPage) + " of " + P(l.total), 1),
606
+ d("ul", kt, [
607
+ d("li", null, [
608
+ d("button", {
607
609
  class: "table__pagination-btn table__btn",
608
- onClick: u[0] || (u[0] = (b) => a(1)),
610
+ onClick: i[0] || (i[0] = (_) => r(1)),
609
611
  disabled: l.currentPage === 1,
610
612
  "aria-label": "First page"
611
613
  }, [
612
- $(bt)
613
- ], 8, yt)
614
+ $(mt)
615
+ ], 8, $t)
614
616
  ]),
615
- i("li", null, [
616
- i("button", {
617
+ d("li", null, [
618
+ d("button", {
617
619
  class: "table__pagination-btn table__btn",
618
- onClick: u[1] || (u[1] = (b) => a(e.currentPage - 1)),
620
+ onClick: i[1] || (i[1] = (_) => r(e.currentPage - 1)),
619
621
  disabled: l.currentPage === 1,
620
622
  "aria-label": "Previous page"
621
623
  }, [
622
- $(lt)
623
- ], 8, kt)
624
+ $(at)
625
+ ], 8, Pt)
624
626
  ]),
625
- (h(!0), g(L, null, B(c(d), (b) => (h(), g("li", { key: b }, [
626
- typeof b == "number" ? (h(), g("button", {
627
+ (g(!0), b(j, null, R(c(u), (_) => (g(), b("li", { key: _ }, [
628
+ typeof _ == "number" ? (g(), b("button", {
627
629
  key: 0,
628
- class: S(["table__pagination-btn table__btn", { "table__pagination-btn--current ": b === l.currentPage }]),
629
- onClick: (w) => a(b),
630
- "aria-label": "Go to page " + b
631
- }, P(b), 11, $t)) : (h(), g("span", Pt, "..."))
630
+ class: K(["table__pagination-btn table__btn", { "table__pagination-btn--current ": _ === l.currentPage }]),
631
+ onClick: (v) => r(_),
632
+ "aria-label": "Go to page " + _
633
+ }, P(_), 11, Ct)) : (g(), b("span", Vt, "..."))
632
634
  ]))), 128)),
633
- i("li", null, [
634
- i("button", {
635
+ d("li", null, [
636
+ d("button", {
635
637
  class: "table__pagination-btn table__btn",
636
- onClick: u[2] || (u[2] = (b) => a(l.currentPage + 1)),
638
+ onClick: i[2] || (i[2] = (_) => r(l.currentPage + 1)),
637
639
  disabled: l.currentPage === c(o),
638
640
  "aria-label": "Next page"
639
641
  }, [
640
- $(Ye)
641
- ], 8, Ct)
642
+ $(et)
643
+ ], 8, St)
642
644
  ]),
643
- i("li", null, [
644
- i("button", {
645
+ d("li", null, [
646
+ d("button", {
645
647
  class: "table__pagination-btn table__btn",
646
- onClick: u[3] || (u[3] = (b) => a(l.total)),
648
+ onClick: i[3] || (i[3] = (_) => r(l.total)),
647
649
  disabled: l.currentPage === c(o),
648
650
  "aria-label": "Last page"
649
651
  }, [
650
- $(ut)
651
- ], 8, Vt)
652
+ $(pt)
653
+ ], 8, Kt)
652
654
  ])
653
655
  ])
654
656
  ]));
655
657
  }
656
658
  });
657
- function It(t) {
659
+ function Tt(t) {
658
660
  return {
659
- headerKeys: v(() => W(t.flat()))
661
+ headerKeys: m(() => I(t.flat()))
660
662
  };
661
663
  }
662
- function Ot(t = {}, n) {
663
- const e = V({
664
+ function Rt(t = {}, n) {
665
+ const e = C({
664
666
  perPage: t.perPage || 10,
665
667
  currentPage: t.currentPage || 1
666
668
  });
667
- J(() => {
669
+ Y(() => {
668
670
  e.value.perPage = t.perPage || 10, e.value.currentPage = t.currentPage || 1;
669
- });
670
- function o(r) {
671
- e.value.currentPage = r, n("update:currentPage", r);
671
+ }), se(
672
+ () => e.value.perPage,
673
+ (a, u) => {
674
+ a !== u && o(1);
675
+ }
676
+ );
677
+ function o(a) {
678
+ e.value.currentPage = a, n("update:currentPage", a);
672
679
  }
673
- function s(r) {
674
- e.value.perPage = r, n("update:perPage", r);
680
+ function s(a) {
681
+ e.value.perPage = a, n("update:perPage", a);
675
682
  }
676
683
  return {
677
684
  pagination: e,
@@ -679,50 +686,60 @@ function Ot(t = {}, n) {
679
686
  updatePerPage: s
680
687
  };
681
688
  }
682
- function Rt(t, n, e) {
683
- const o = V(), s = V(!1);
684
- function r({ key: _, desc: a }) {
685
- o.value = _, s.value = a;
689
+ function Bt(t, n, e) {
690
+ const o = C(), s = C(!1);
691
+ function a({ key: r, desc: l }) {
692
+ o.value = r, s.value = l;
686
693
  }
694
+ const u = m(() => {
695
+ const r = G(S(t.data)[0]), l = I(r), i = I(S(n)), _ = [], v = [...i];
696
+ for (const p of l)
697
+ i.includes(p) || (_.push(p), v.push(p));
698
+ return {
699
+ notListedKeys: _,
700
+ allKeys: v
701
+ };
702
+ });
687
703
  return {
688
- bodyRows: v(() => {
689
- const _ = O(e).perPage * (O(e).currentPage - 1), a = O(e).perPage * O(e).currentPage, l = re(O(t.data), O(n)), u = v(() => t.filterBy === void 0 || t.filterBy.length === 0 ? Object.keys(l[0]) : t.filterBy), b = l.filter((w) => {
690
- var p;
691
- return (p = t.filterMethod) == null ? void 0 : p.call(t, t.filterQuery, w, O(u));
704
+ bodyRows: m(() => {
705
+ const r = S(e).perPage * (S(e).currentPage - 1), l = S(e).perPage * S(e).currentPage, i = ie(S(t.data), u.value.allKeys), _ = m(() => t.filterBy === void 0 || t.filterBy.length === 0 ? Object.keys(i[0]) : t.filterBy), v = i.filter((p) => {
706
+ var k;
707
+ return (k = t.filterMethod) == null ? void 0 : k.call(t, t.filterQuery, p, S(_));
692
708
  });
693
- return o.value && b.sort((w, p) => {
709
+ return o.value && v.sort((p, k) => {
694
710
  if (!o.value)
695
711
  return 0;
696
- const C = w[o.value], k = p[o.value];
697
- return C < k ? s.value ? 1 : -1 : C > k ? s.value ? -1 : 1 : 0;
698
- }), ce(b, _, a);
712
+ const V = p[o.value], B = k[o.value];
713
+ return V < B ? s.value ? 1 : -1 : V > B ? s.value ? -1 : 1 : 0;
714
+ }), ue(v, r, l);
699
715
  }),
700
- rowsCount: v(() => O(t.data).length),
701
- onSort: r
716
+ notListedKeys: m(() => u.value.notListedKeys),
717
+ rowsCount: m(() => S(t.data).length),
718
+ onSort: a
702
719
  };
703
720
  }
704
- function Bt(t) {
721
+ function Lt(t) {
705
722
  const n = c(t) ?? [];
706
723
  return {
707
- headers: v(() => Q(n, z(n))),
708
- headersCount: F(n)
724
+ headers: m(() => Z(n, Q(n))),
725
+ headersCount: W(n)
709
726
  };
710
727
  }
711
728
  function Mt(t, n, e) {
712
- const o = v({
729
+ const o = m({
713
730
  get() {
714
- var r, d, _;
715
- return t.selected === null || ((r = t.selected) == null ? void 0 : r.length) === 0 ? "none" : ((d = t.selected) == null ? void 0 : d.length) === t.data.length || t.selectMode === "page" && ((_ = t.selected) == null ? void 0 : _.length) === n.value.length ? "all" : "indeterminate";
731
+ var a, u, h;
732
+ return t.selected === null || ((a = t.selected) == null ? void 0 : a.length) === 0 ? "none" : ((u = t.selected) == null ? void 0 : u.length) === t.data.length || t.selectMode === "page" && ((h = t.selected) == null ? void 0 : h.length) === n.value.length ? "all" : "indeterminate";
716
733
  },
717
- set(r) {
718
- r === "all" ? t.selectMode === "page" ? s.value = n.value.map((d) => Z(d)) : s.value = t.data : r === "none" && (s.value = []);
734
+ set(a) {
735
+ a === "all" ? t.selectMode === "page" ? s.value = n.value.map((u) => x(u)) : s.value = t.data : a === "none" && (s.value = []);
719
736
  }
720
- }), s = v({
737
+ }), s = m({
721
738
  get() {
722
739
  return t.selected;
723
740
  },
724
- set(r) {
725
- e("update:selected", r);
741
+ set(a) {
742
+ e("update:selected", a);
726
743
  }
727
744
  });
728
745
  return {
@@ -730,13 +747,13 @@ function Mt(t, n, e) {
730
747
  selected: s
731
748
  };
732
749
  }
733
- const jt = { class: "table__wrapper" }, Dt = {
750
+ const Ht = { class: "table__wrapper" }, jt = {
734
751
  key: 0,
735
752
  class: "table__caption"
736
- }, Lt = { class: "table__summary" }, At = /* @__PURE__ */ M({
753
+ }, Dt = { class: "table__summary" }, Et = /* @__PURE__ */ L({
737
754
  inheritAttrs: !1,
738
755
  __name: "VueyeTable",
739
- props: H({
756
+ props: D({
740
757
  data: {},
741
758
  columnHeaders: {},
742
759
  itemValue: {},
@@ -751,96 +768,97 @@ const jt = { class: "table__wrapper" }, Dt = {
751
768
  filterQuery: {},
752
769
  filterBy: {},
753
770
  filterMethod: { type: Function }
754
- }, de()),
771
+ }, _e()),
755
772
  emits: ["update:currentPage", "update:perPage", "update:loading", "update:selected"],
756
773
  setup(t, { emit: n }) {
757
- const e = t, o = v(
758
- () => e.columnHeaders.length === 0 ? Y(e.data[0]) : e.columnHeaders
759
- ), { headers: s, headersCount: r } = Bt(o), d = le(), _ = Object.keys(d).filter((f) => f.startsWith("headerCell")), a = Object.keys(d).filter((f) => f.startsWith("itemCell")), { pagination: l, updateCurrentPage: u, updatePerPage: b } = Ot(e, n), { bodyRows: w, rowsCount: p, onSort: C } = Rt(e, o, l), { selected: k, selectAll: K } = Mt(e, w, n);
760
- return (f, N) => (h(), g("div", jt, [
761
- i("table", {
762
- class: S(f.$attrs.class ?? "table")
774
+ const e = t, o = m(
775
+ () => e.columnHeaders.length === 0 ? G(e.data[0]) : e.columnHeaders
776
+ ), { headers: s, headersCount: a } = Lt(o), u = ae(), h = Object.keys(u).filter((f) => f.startsWith("headerCell")), r = Object.keys(u).filter((f) => f.startsWith("itemCell")), { pagination: l, updateCurrentPage: i, updatePerPage: _ } = Rt(e, n), { bodyRows: v, rowsCount: p, notListedKeys: k, onSort: V } = Bt(e, o, l), { selected: B, selectAll: T } = Mt(e, v, n);
777
+ return (f, N) => (g(), b("div", Ht, [
778
+ d("table", {
779
+ class: K(f.$attrs.class ?? "table")
763
780
  }, [
764
- m(f.$slots, "caption", {}, () => [
765
- f.caption ? (h(), g("caption", Dt, P(f.caption), 1)) : T("", !0)
781
+ y(f.$slots, "caption", {}, () => [
782
+ f.caption ? (g(), b("caption", jt, P(f.caption), 1)) : z("", !0)
766
783
  ]),
767
- $(c(We), {
784
+ $(c(Ge), {
768
785
  columnHeaders: c(s),
769
786
  selectable: f.selected !== null,
770
- select: c(K),
771
- "onUpdate:select": N[0] || (N[0] = (y) => I(K) ? K.value = y : null),
772
- onSort: c(C)
773
- }, x({
774
- headers: R((y) => [
775
- m(f.$slots, "headers", j(D(y)))
787
+ select: c(T),
788
+ "onUpdate:select": N[0] || (N[0] = (w) => A(T) ? T.value = w : null),
789
+ onSort: c(V)
790
+ }, X({
791
+ headers: O((w) => [
792
+ y(f.$slots, "headers", M(H(w)))
776
793
  ]),
777
794
  _: 2
778
795
  }, [
779
- B(c(_), (y) => ({
780
- name: y,
781
- fn: R((A) => [
782
- m(f.$slots, y, j(D(A)))
796
+ R(c(h), (w) => ({
797
+ name: w,
798
+ fn: O((E) => [
799
+ y(f.$slots, w, M(H(E)))
783
800
  ])
784
801
  }))
785
802
  ]), 1032, ["columnHeaders", "selectable", "select", "onSort"]),
786
- $(c(Ke), {
787
- selected: c(k),
788
- "onUpdate:selected": N[1] || (N[1] = (y) => I(k) ? k.value = y : null),
789
- bodyRows: c(w),
803
+ $(c(Ae), {
804
+ selected: c(B),
805
+ "onUpdate:selected": N[1] || (N[1] = (w) => A(B) ? B.value = w : null),
806
+ bodyRows: c(v),
790
807
  loading: f.loading,
791
808
  itemValue: f.itemValue,
792
- "columns-length": c(r)
793
- }, x({
794
- checkbox: R((y) => [
795
- m(f.$slots, "checkbox", j(D(y)))
809
+ "columns-length": c(a),
810
+ "not-listed-keys": c(k)
811
+ }, X({
812
+ checkbox: O((w) => [
813
+ y(f.$slots, "checkbox", M(H(w)))
796
814
  ]),
797
- loading: R(() => [
798
- m(f.$slots, "loading")
815
+ loading: O(() => [
816
+ y(f.$slots, "loading")
799
817
  ]),
800
- empty: R(() => [
801
- m(f.$slots, "empty")
818
+ empty: O(() => [
819
+ y(f.$slots, "empty")
802
820
  ]),
803
- rows: R((y) => [
804
- m(f.$slots, "rows", j(D(y)))
821
+ rows: O((w) => [
822
+ y(f.$slots, "rows", M(H(w)))
805
823
  ]),
806
- row: R((y) => [
807
- m(f.$slots, "row", j(D(y)))
824
+ row: O((w) => [
825
+ y(f.$slots, "row", M(H(w)))
808
826
  ]),
809
827
  _: 2
810
828
  }, [
811
- B(c(a), (y) => ({
812
- name: y,
813
- fn: R((A) => [
814
- m(f.$slots, y, j(D(A)))
829
+ R(c(r), (w) => ({
830
+ name: w,
831
+ fn: O((E) => [
832
+ y(f.$slots, w, M(H(E)))
815
833
  ])
816
834
  }))
817
- ]), 1032, ["selected", "bodyRows", "loading", "itemValue", "columns-length"]),
818
- m(f.$slots, "summary", {}, () => [
819
- i("caption", Lt, P(f.summary), 1)
835
+ ]), 1032, ["selected", "bodyRows", "loading", "itemValue", "columns-length", "not-listed-keys"]),
836
+ y(f.$slots, "summary", {}, () => [
837
+ d("caption", Dt, P(f.summary), 1)
820
838
  ])
821
839
  ], 2),
822
- m(f.$slots, "pagination", {
840
+ y(f.$slots, "pagination", {
823
841
  pagination: { ...c(l), perPageOptions: f.perPageOptions, total: c(p) }
824
842
  }, () => [
825
- E($(c(St), {
843
+ F($(c(Ot), {
826
844
  perPage: c(l).perPage,
827
845
  currentPage: c(l).currentPage,
828
846
  perPageOptions: f.perPageOptions,
829
847
  total: c(p),
830
- "onUpdate:currentPage": c(u),
831
- "onUpdate:perPage": c(b),
848
+ "onUpdate:currentPage": c(i),
849
+ "onUpdate:perPage": c(_),
832
850
  class: "table__pagination"
833
851
  }, null, 8, ["perPage", "currentPage", "perPageOptions", "total", "onUpdate:currentPage", "onUpdate:perPage"]), [
834
- [X, f.data.length > 0]
852
+ [q, f.data.length > 0]
835
853
  ])
836
854
  ])
837
855
  ]));
838
856
  }
839
857
  });
840
- function Ht(t) {
858
+ function Ut(t) {
841
859
  const n = [];
842
860
  for (const e of t) {
843
- const o = e.children ? Ht(e.children) : void 0;
861
+ const o = e.children ? Ut(e.children) : void 0;
844
862
  n.push({
845
863
  ...e,
846
864
  children: o
@@ -849,25 +867,25 @@ function Ht(t) {
849
867
  return n;
850
868
  }
851
869
  export {
852
- At as VueyeTable,
853
- ie as deepValues,
854
- Kt as defineColumnHeaders,
855
- Nt as defineFilterMethod,
856
- Ht as defineTableColumnHeaders,
857
- z as depthCount,
858
- Q as flatHeadersToRows,
859
- Y as generateColumns,
860
- re as getBodyRows,
861
- W as getHeaderKeys,
862
- de as getVueyeTablePropDefaults,
863
- se as humanize,
864
- ue as isPrimitive,
865
- F as leafCount,
866
- Z as nestedObjectTransformer,
867
- ce as paginateRows,
868
- Rt as useBodyRows,
869
- It as useHeaderKeys,
870
- Bt as useHeaders,
871
- Ot as usePagination,
870
+ Et as VueyeTable,
871
+ de as deepValues,
872
+ At as defineColumnHeaders,
873
+ It as defineFilterMethod,
874
+ Ut as defineTableColumnHeaders,
875
+ Q as depthCount,
876
+ Z as flatHeadersToRows,
877
+ G as generateColumns,
878
+ ie as getBodyRows,
879
+ I as getHeaderKeys,
880
+ _e as getVueyeTablePropDefaults,
881
+ re as humanize,
882
+ pe as isPrimitive,
883
+ W as leafCount,
884
+ x as nestedObjectTransformer,
885
+ ue as paginateRows,
886
+ Bt as useBodyRows,
887
+ Tt as useHeaderKeys,
888
+ Lt as useHeaders,
889
+ Rt as usePagination,
872
890
  Mt as useSelection
873
891
  };