vlite3 0.7.6 → 0.7.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
- import o from "./ColorIro.vue.js";
2
- /* empty css */
1
+ import o from "./ColorIro.vue2.js";
2
+ /* empty css */
3
3
  export {
4
4
  o as default
5
5
  };
@@ -5,8 +5,8 @@ import O from "../Input.vue.js";
5
5
  /* empty css */
6
6
  import "../../core/config.js";
7
7
  import y from "../Button.vue.js";
8
- import E from "./ColorIro.vue.js";
9
- /* empty css */
8
+ import E from "./ColorIro.vue2.js";
9
+ /* empty css */
10
10
  import { useEyeDropper as P } from "@vueuse/core";
11
11
  const I = {
12
12
  key: 0,
@@ -1,24 +1,24 @@
1
- import { defineComponent as me, inject as ve, computed as n, ref as b, watch as g, openBlock as r, createElementBlock as u, createBlock as R, normalizeClass as S, createSlots as M, withCtx as T, renderSlot as D, createCommentVNode as x, createElementVNode as f, createVNode as z, Fragment as A, renderList as $, normalizeStyle as L, mergeProps as Y, unref as W } from "vue";
2
- import he from "../CheckBox.vue.js";
3
- import ge from "../Button.vue.js";
4
- import pe from "../ConfirmationModal.vue.js";
5
- import be from "../Pagination/Pagination.vue.js";
6
- import ye from "../Empty/Empty.vue.js";
7
- import we from "./DataTableHeader.vue.js";
8
- import Pe from "./DataTableRow.vue.js";
9
- import Ce from "./DataTableToolbar.vue.js";
10
- import { $t as P } from "../../utils/i18n.js";
11
- import { SCREEN_CONTEXT_KEY as ke } from "./types.js";
12
- const Ie = { class: "space-y-6.5" }, Se = { class: "overflow-x-auto w-full" }, Te = { class: "hover:bg-transparent" }, De = {
1
+ import { defineComponent as me, inject as fe, computed as r, ref as b, watch as v, openBlock as i, createElementBlock as u, createBlock as A, normalizeClass as C, createSlots as N, withCtx as k, renderSlot as I, createVNode as S, createCommentVNode as $, createElementVNode as m, Fragment as B, renderList as T, normalizeStyle as O, mergeProps as K, unref as L } from "vue";
2
+ import ve from "../CheckBox.vue.js";
3
+ import he from "../Button.vue.js";
4
+ import ge from "../ConfirmationModal.vue.js";
5
+ import pe from "../Pagination/Pagination.vue.js";
6
+ import be from "../Empty/Empty.vue.js";
7
+ import ye from "./DataTableHeader.vue.js";
8
+ import we from "./DataTableRow.vue.js";
9
+ import Pe from "./DataTableToolbar.vue.js";
10
+ import { $t as y } from "../../utils/i18n.js";
11
+ import { SCREEN_CONTEXT_KEY as Ce } from "./types.js";
12
+ const ke = { class: "space-y-6.5" }, Ie = { class: "overflow-x-auto w-full" }, Se = { class: "hover:bg-transparent" }, Te = {
13
13
  key: 0,
14
14
  scope: "col",
15
15
  class: "w-[48px] px-0 text-center font-medium text-muted-foreground",
16
16
  style: { width: "48px" }
17
- }, xe = { class: "flex items-center justify-center" }, $e = { class: "[&_tr:last-child]:border-0" }, Be = {
17
+ }, De = { class: "flex items-center justify-center" }, xe = { class: "[&_tr:last-child]:border-0" }, $e = {
18
18
  key: 0,
19
19
  class: "w-[48px] px-0 py-4 align-middle text-center",
20
20
  style: { width: "48px" }
21
- }, Ee = { key: 2 }, Re = ["colspan"], ze = { key: 1 }, We = /* @__PURE__ */ me({
21
+ }, Be = { key: 2 }, Ee = ["colspan"], Re = { key: 1 }, Ye = /* @__PURE__ */ me({
22
22
  __name: "DataTable",
23
23
  props: {
24
24
  rows: { default: () => [] },
@@ -57,321 +57,283 @@ const Ie = { class: "space-y-6.5" }, Se = { class: "overflow-x-auto w-full" }, T
57
57
  variant: { default: "default" }
58
58
  },
59
59
  emits: ["change", "select", "rowClick", "update:itemsPerPage", "update:selectedRows", "delete"],
60
- setup(o, { emit: X }) {
61
- const q = (e, t) => {
60
+ setup(o, { emit: Y }) {
61
+ const W = (e, t) => {
62
62
  if (!(!e || !t))
63
- return t.includes(".") ? t.split(".").reduce((a, c) => a?.[c], e) : e[t];
64
- }, m = (e, t) => q(e, t), G = (e, t) => {
63
+ return t.includes(".") ? t.split(".").reduce((a, n) => a?.[n], e) : e[t];
64
+ }, f = (e, t) => W(e, t), X = (e, t) => {
65
65
  const a = ["id", "_id"];
66
66
  if (t && t !== "auto") return t;
67
67
  if (e && e.length > 0) {
68
- for (const c of a)
69
- if (c in e[0]) return c;
68
+ for (const n of a)
69
+ if (n in e[0]) return n;
70
70
  }
71
71
  return "_id";
72
- }, l = o, y = X, j = ve(ke, null), O = n(() => j?.disableSearch ? !1 : l.showSearch), B = n(() => !!(l.selectable || j?.forceSelectable)), i = n(() => G(l.rows, l.keyField)), d = b({ field: "", order: "" }), C = b(
72
+ }, l = o, g = Y, E = fe(Ce, null), U = r(() => E?.disableSearch ? !1 : l.showSearch), D = r(() => l.selectable || !!E?.forceSelectable), d = r(() => X(l.rows, l.keyField)), c = b({ field: "", order: "" }), w = b(
73
73
  l.pageInfo?.itemsPerPage || l.paginationProps?.itemsPerPage || 10
74
- ), p = b(l.pageInfo?.currentPage || 1), w = b(l.search || ""), k = b(!1), I = b("initial"), H = n(() => l.loading);
75
- g(
74
+ ), h = b(l.pageInfo?.currentPage || 1), p = b(l.search || ""), P = b(!1), q = r(() => l.loading);
75
+ v(
76
76
  () => l.loading,
77
77
  (e, t) => {
78
- !e && t && (I.value = "idle");
79
78
  }
80
- ), g(
79
+ ), v(
81
80
  () => l.search,
82
81
  (e) => {
83
- e !== void 0 && e !== w.value && (w.value = e);
82
+ e !== void 0 && e !== p.value && (p.value = e);
84
83
  }
85
84
  );
86
- let N = null;
87
- g(w, () => {
88
- N && clearTimeout(N), N = setTimeout(() => {
89
- p.value = 1, I.value = "search", E();
85
+ let R = null;
86
+ v(p, () => {
87
+ R && clearTimeout(R), R = setTimeout(() => {
88
+ h.value = 1, x();
90
89
  }, 300);
91
- }), g(
92
- () => l.pageInfo?.itemsPerPage,
93
- (e) => {
94
- e !== void 0 && (C.value = e);
95
- }
96
- ), g(
97
- () => l.paginationProps?.itemsPerPage,
98
- (e) => {
99
- e !== void 0 && (C.value = e);
100
- }
101
- ), g(
102
- () => l.pageInfo?.currentPage,
103
- (e) => {
104
- e && (p.value = e);
105
- }
106
- );
90
+ }), v(() => l.pageInfo?.itemsPerPage, (e) => {
91
+ e !== void 0 && (w.value = e);
92
+ }), v(() => l.paginationProps?.itemsPerPage, (e) => {
93
+ e !== void 0 && (w.value = e);
94
+ }), v(() => l.pageInfo?.currentPage, (e) => {
95
+ e && (h.value = e);
96
+ });
107
97
  const s = b(/* @__PURE__ */ new Set());
108
- g(
98
+ v(
109
99
  () => l.selectedRows,
110
100
  (e) => {
111
- const t = new Set(
112
- (e || []).map((a) => m(a, i.value))
113
- );
101
+ const t = new Set((e || []).map((a) => f(a, d.value)));
114
102
  (t.size !== s.value.size || [...t].some((a) => !s.value.has(a))) && (s.value = t);
115
103
  },
116
104
  { immediate: !0, deep: !0 }
117
105
  );
118
- const U = n(() => l.rows.length === 0 ? !1 : l.rows.every(
119
- (e) => s.value.has(m(e, i.value))
120
- )), V = n(
121
- () => s.value.size > 0 && !U.value
122
- ), J = n(() => {
106
+ const z = r(
107
+ () => l.rows.length > 0 && l.rows.every((e) => s.value.has(f(e, d.value)))
108
+ ), F = r(() => s.value.size > 0 && !z.value), G = r(() => {
123
109
  const e = [...l.selectedRows || [], ...l.rows], t = /* @__PURE__ */ new Map();
124
- return e.forEach((a) => t.set(m(a, i.value), a)), Array.from(s.value).map((a) => t.get(a)).filter(Boolean);
125
- }), Q = (e) => {
126
- e ? l.rows.forEach(
127
- (t) => s.value.add(m(t, i.value))
128
- ) : s.value.size > 0 && l.rows.forEach(
129
- (t) => s.value.delete(m(t, i.value))
130
- ), K();
110
+ return e.forEach((a) => t.set(f(a, d.value), a)), Array.from(s.value).map((a) => t.get(a)).filter(Boolean);
111
+ }), H = (e) => {
112
+ e ? l.rows.forEach((t) => s.value.add(f(t, d.value))) : l.rows.forEach((t) => s.value.delete(f(t, d.value))), M();
113
+ }, J = (e) => {
114
+ s.value.has(e) ? s.value.delete(e) : s.value.add(e), M();
115
+ }, M = () => {
116
+ const e = /* @__PURE__ */ new Set(), t = [];
117
+ l.rows.forEach((a) => {
118
+ const n = f(a, d.value);
119
+ s.value.has(n) && (t.push(a), e.add(n));
120
+ }), (l.selectedRows || []).forEach((a) => {
121
+ const n = f(a, d.value);
122
+ !e.has(n) && s.value.has(n) && (t.push(a), e.add(n));
123
+ }), g("select", { selected: t, all: z.value, indeterminate: F.value }), g("update:selectedRows", t);
124
+ }, Q = (e) => {
125
+ c.value.field === e ? c.value.order === "asc" ? c.value.order = "desc" : c.value.order === "desc" ? (c.value.order = "", c.value.field = "") : c.value.order = "asc" : (c.value.field = e, c.value.order = "asc"), h.value = 1, x();
131
126
  }, Z = (e) => {
132
- s.value.has(e) ? s.value.delete(e) : s.value.add(e), K();
133
- }, K = () => {
134
- const e = l.selectedRows || [], t = /* @__PURE__ */ new Set(), a = [];
135
- l.rows.forEach((v) => {
136
- const h = m(v, i.value);
137
- s.value.has(h) && (a.push(v), t.add(h));
138
- }), e.forEach((v) => {
139
- const h = m(v, i.value);
140
- !t.has(h) && s.value.has(h) && (a.push(v), t.add(h));
141
- });
142
- const c = {
143
- selected: a,
144
- all: U.value,
145
- indeterminate: V.value
146
- };
147
- y("select", c), y("update:selectedRows", a);
127
+ h.value = e, x();
148
128
  }, _ = (e) => {
149
- d.value.field === e ? d.value.order === "asc" ? d.value.order = "desc" : d.value.order === "desc" ? (d.value.order = "", d.value.field = "") : d.value.order = "asc" : (d.value.field = e, d.value.order = "asc"), p.value = 1, I.value = "sort", E();
150
- }, ee = (e) => {
151
- p.value = e, I.value = "page", E();
152
- }, te = (e) => {
153
- C.value = e, p.value = 1, I.value = "limit", y("update:itemsPerPage", e), E();
154
- }, le = (e) => {
155
- y("rowClick", e);
156
- }, ae = () => {
157
- const e = J.value;
158
- y("delete", e), k.value = !1;
129
+ w.value = e, h.value = 1, g("update:itemsPerPage", e), x();
130
+ }, ee = (e) => g("rowClick", e), te = () => {
131
+ g("delete", G.value), P.value = !1;
159
132
  };
160
- let F = null;
161
- const E = () => {
162
- F && clearTimeout(F), F = setTimeout(() => {
163
- y("change", {
164
- pagination: {
165
- page: p.value,
166
- limit: C.value
167
- },
168
- sort: { ...d.value },
169
- search: w.value,
133
+ let V = null;
134
+ const x = () => {
135
+ V && clearTimeout(V), V = setTimeout(() => {
136
+ const e = {
137
+ pagination: { page: h.value, limit: w.value },
138
+ sort: { ...c.value },
139
+ search: p.value,
170
140
  filter: {}
171
- });
141
+ };
142
+ g("change", e), E?.onTableChange?.(e);
172
143
  }, 10);
173
144
  };
174
- g(
145
+ v(
175
146
  () => l.rows,
176
147
  () => {
177
- const e = new Set(
178
- l.rows.map((t) => m(t, i.value))
179
- );
148
+ const e = new Set(l.rows.map((t) => f(t, d.value)));
180
149
  s.value = new Set([...s.value].filter((t) => e.has(t)));
181
150
  }
182
151
  );
183
- const oe = n(() => [
152
+ const le = r(() => [
184
153
  "w-full flex flex-col",
185
154
  l.variant === "raised" ? "bg-background shadow-sm p-2 rounded-lg" : "bg-background rounded",
186
155
  "overflow-hidden",
187
156
  l.bordered ? "border border-border" : "",
188
157
  l.class
189
- ].join(" ")), se = n(
190
- () => ["w-full caption-bottom -text-fs-1", l.tableClass].join(" ")
191
- ), ne = (e) => e.width || "auto", re = n(
192
- () => l.emptyTitleI18n ? P(l.emptyTitleI18n) : l.emptyTitle
193
- ), ie = n(
194
- () => l.emptyDescriptionI18n ? P(l.emptyDescriptionI18n) : l.emptyDescription
195
- ), de = n(() => {
196
- const e = P("vlite.dataTable.confirmDeleteTitle");
158
+ ].join(" ")), ae = r(() => ["w-full caption-bottom -text-fs-1", l.tableClass].join(" ")), oe = (e) => e.width || "auto", se = r(() => l.emptyTitleI18n ? y(l.emptyTitleI18n) : l.emptyTitle), ne = r(() => l.emptyDescriptionI18n ? y(l.emptyDescriptionI18n) : l.emptyDescription), re = r(() => {
159
+ const e = y("vlite.dataTable.confirmDeleteTitle");
197
160
  return e !== "vlite.dataTable.confirmDeleteTitle" ? e : "Confirm Deletion";
198
- }), ce = n(() => {
199
- const e = P("vlite.dataTable.confirmDeleteDesc");
161
+ }), ie = r(() => {
162
+ const e = y("vlite.dataTable.confirmDeleteDesc");
200
163
  return e !== "vlite.dataTable.confirmDeleteDesc" ? e : "Are you sure you want to delete the selected items?";
201
- }), ue = n(() => {
202
- const e = P("vlite.dataTable.deleteBtn");
164
+ }), de = r(() => {
165
+ const e = y("vlite.dataTable.deleteBtn");
203
166
  return e !== "vlite.dataTable.deleteBtn" ? e : "Delete";
204
- }), fe = n(() => {
205
- const e = P("vlite.dataTable.cancelBtn");
167
+ }), ce = r(() => {
168
+ const e = y("vlite.dataTable.cancelBtn");
206
169
  return e !== "vlite.dataTable.cancelBtn" ? e : "Cancel";
207
170
  });
208
- return (e, t) => (r(), u("div", Ie, [
209
- O.value || e.$slots?.["toolbar-left"] || e.$slots?.["toolbar-right"] ? (r(), R(Ce, {
171
+ return (e, t) => (i(), u("div", ke, [
172
+ U.value || e.$slots?.["toolbar-left"] || e.$slots?.["toolbar-right"] ? (i(), A(Pe, {
210
173
  key: 0,
211
- modelValue: w.value,
212
- "onUpdate:modelValue": t[1] || (t[1] = (a) => w.value = a),
213
- "show-search": O.value,
174
+ modelValue: p.value,
175
+ "onUpdate:modelValue": t[1] || (t[1] = (a) => p.value = a),
176
+ "show-search": U.value,
214
177
  placeholder: o.searchPlaceholder,
215
178
  placeholderI18n: o.searchPlaceholderI18n,
216
- class: S(o.toolbarClass),
179
+ class: C(o.toolbarClass),
217
180
  "search-class": o.toolbarSearchClass
218
- }, M({ _: 2 }, [
181
+ }, N({ _: 2 }, [
219
182
  e.$slots?.["toolbar-left"] ? {
220
183
  name: "left",
221
- fn: T(() => [
222
- D(e.$slots, "toolbar-left")
184
+ fn: k(() => [
185
+ I(e.$slots, "toolbar-left")
223
186
  ]),
224
187
  key: "0"
225
188
  } : void 0,
226
189
  s.value.size > 0 ? {
227
190
  name: "delete",
228
- fn: T(() => [
229
- s.value.size > 0 ? (r(), R(ge, {
230
- key: 0,
191
+ fn: k(() => [
192
+ S(he, {
231
193
  rounded: "full",
232
194
  variant: "outline",
233
195
  size: "lg",
234
196
  icon: "lucide:trash-2",
235
- onClick: t[0] || (t[0] = (a) => k.value = !0)
236
- })) : x("", !0)
197
+ onClick: t[0] || (t[0] = (a) => P.value = !0)
198
+ })
237
199
  ]),
238
200
  key: "1"
239
201
  } : void 0,
240
202
  e.$slots?.["toolbar-right"] ? {
241
203
  name: "right",
242
- fn: T(() => [
243
- D(e.$slots, "toolbar-right")
204
+ fn: k(() => [
205
+ I(e.$slots, "toolbar-right")
244
206
  ]),
245
207
  key: "2"
246
208
  } : void 0
247
- ]), 1032, ["modelValue", "show-search", "placeholder", "placeholderI18n", "class", "search-class"])) : x("", !0),
248
- f("div", {
249
- class: S(oe.value)
209
+ ]), 1032, ["modelValue", "show-search", "placeholder", "placeholderI18n", "class", "search-class"])) : $("", !0),
210
+ m("div", {
211
+ class: C(le.value)
250
212
  }, [
251
- f("div", Se, [
252
- f("table", {
253
- class: S([se.value, "data-table"])
213
+ m("div", Ie, [
214
+ m("table", {
215
+ class: C([ae.value, "data-table"])
254
216
  }, [
255
- f("thead", {
256
- class: S([
217
+ m("thead", {
218
+ class: C([
257
219
  "[&_tr]:border-b [&_tr]:border-border bg-muted",
258
220
  o.variant === "raised" ? "[&_th:first-child]:rounded-tl-lg [&_th:last-child]:rounded-tr-lg" : ""
259
221
  ])
260
222
  }, [
261
- f("tr", Te, [
262
- B.value ? (r(), u("th", De, [
263
- f("div", xe, [
264
- z(he, {
265
- "model-value": U.value,
266
- indeterminate: V.value,
223
+ m("tr", Se, [
224
+ D.value ? (i(), u("th", Te, [
225
+ m("div", De, [
226
+ S(ve, {
227
+ "model-value": z.value,
228
+ indeterminate: F.value,
267
229
  size: "xs",
268
- "onUpdate:modelValue": Q
230
+ "onUpdate:modelValue": H
269
231
  }, null, 8, ["model-value", "indeterminate"])
270
232
  ])
271
- ])) : x("", !0),
272
- (r(!0), u(A, null, $(o.headers, (a) => (r(), R(we, {
233
+ ])) : $("", !0),
234
+ (i(!0), u(B, null, T(o.headers, (a) => (i(), A(ye, {
273
235
  key: a.field,
274
236
  header: a,
275
- "sort-config": d.value,
237
+ "sort-config": c.value,
276
238
  compact: o.compact,
277
239
  "table-sortable": o.sortable,
278
- onSort: _,
240
+ onSort: Q,
279
241
  class: "last:pr-5!",
280
- style: L({ width: ne(a) })
242
+ style: O({ width: oe(a) })
281
243
  }, null, 8, ["header", "sort-config", "compact", "table-sortable", "style"]))), 128))
282
244
  ])
283
245
  ], 2),
284
- f("tbody", $e, [
285
- H.value ? (r(!0), u(A, { key: 0 }, $(Math.min(C.value, 15), (a) => (r(), u("tr", {
246
+ m("tbody", xe, [
247
+ q.value ? (i(!0), u(B, { key: 0 }, T(Math.min(w.value, 15), (a) => (i(), u("tr", {
286
248
  key: "skeleton-" + a,
287
249
  class: "border-b border-border/70 bg-background transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted"
288
250
  }, [
289
- B.value ? (r(), u("td", Be, [...t[4] || (t[4] = [
290
- f("div", { class: "flex items-center justify-center" }, [
291
- f("div", { class: "h-4 w-4 rounded-[4px] bg-muted/50 animate-pulse" })
251
+ D.value ? (i(), u("td", $e, [...t[4] || (t[4] = [
252
+ m("div", { class: "flex items-center justify-center" }, [
253
+ m("div", { class: "h-4 w-4 rounded-[4px] bg-muted/50 animate-pulse" })
292
254
  ], -1)
293
- ])])) : x("", !0),
294
- (r(!0), u(A, null, $(o.headers, (c) => (r(), u("td", {
295
- key: c.field,
296
- class: S(["p-5! align-middle last:pr-6!", [c.hideOnMobile ? "hidden md:table-cell" : ""]])
255
+ ])])) : $("", !0),
256
+ (i(!0), u(B, null, T(o.headers, (n) => (i(), u("td", {
257
+ key: n.field,
258
+ class: C(["p-5! align-middle last:pr-6!", [n.hideOnMobile ? "hidden md:table-cell" : ""]])
297
259
  }, [
298
- f("div", {
299
- class: "rounded-md bg-muted/50 animate-pulse h-4 w-full",
300
- style: L({ width: `${50 + Math.random() * 40}%` })
260
+ m("div", {
261
+ class: "rounded-md bg-muted/50 animate-pulse h-4",
262
+ style: O({ width: `${50 + Math.random() * 40}%` })
301
263
  }, null, 4)
302
264
  ], 2))), 128))
303
- ]))), 128)) : o.rows.length > 0 ? (r(!0), u(A, { key: 1 }, $(o.rows, (a, c) => (r(), R(Pe, {
304
- key: m(a, i.value),
265
+ ]))), 128)) : o.rows.length > 0 ? (i(!0), u(B, { key: 1 }, T(o.rows, (a, n) => (i(), A(we, {
266
+ key: f(a, d.value),
305
267
  row: a,
306
268
  headers: o.headers,
307
- index: c,
308
- "key-field": i.value,
309
- selectable: B.value,
310
- "is-selected": s.value.has(m(a, i.value)),
269
+ index: n,
270
+ "key-field": d.value,
271
+ selectable: D.value,
272
+ "is-selected": s.value.has(f(a, d.value)),
311
273
  hoverable: o.hoverable,
312
274
  striped: o.striped,
313
275
  compact: o.compact,
314
- onSelect: Z,
315
- onRowClick: le,
276
+ onSelect: J,
277
+ onRowClick: ee,
316
278
  class: "[&_td:last-child]:pr-3.5!"
317
- }, M({ _: 2 }, [
318
- $(o.headers, (v) => ({
319
- name: v.field,
320
- fn: T((h) => [
321
- D(e.$slots, v.field, Y({ ref_for: !0 }, h))
279
+ }, N({ _: 2 }, [
280
+ T(o.headers, (j) => ({
281
+ name: j.field,
282
+ fn: k((ue) => [
283
+ I(e.$slots, j.field, K({ ref_for: !0 }, ue))
322
284
  ])
323
285
  }))
324
- ]), 1032, ["row", "headers", "index", "key-field", "selectable", "is-selected", "hoverable", "striped", "compact"]))), 128)) : (r(), u("tr", Ee, [
325
- f("td", {
326
- colspan: B.value ? o.headers.length + 1 : o.headers.length,
286
+ ]), 1032, ["row", "headers", "index", "key-field", "selectable", "is-selected", "hoverable", "striped", "compact"]))), 128)) : (i(), u("tr", Be, [
287
+ m("td", {
288
+ colspan: D.value ? o.headers.length + 1 : o.headers.length,
327
289
  class: "align-middle hover:bg-transparent"
328
290
  }, [
329
- D(e.$slots, "empty", {}, () => [
330
- z(W(ye), {
331
- title: re.value,
332
- description: ie.value,
291
+ I(e.$slots, "empty", {}, () => [
292
+ S(L(be), {
293
+ title: se.value,
294
+ description: ne.value,
333
295
  icon: o.emptyIcon,
334
296
  class: "border-none! bg-transparent! py-16!"
335
- }, M({ _: 2 }, [
297
+ }, N({ _: 2 }, [
336
298
  e.$slots["empty-action"] ? {
337
299
  name: "action",
338
- fn: T(() => [
339
- D(e.$slots, "empty-action")
300
+ fn: k(() => [
301
+ I(e.$slots, "empty-action")
340
302
  ]),
341
303
  key: "0"
342
304
  } : void 0
343
305
  ]), 1032, ["title", "description", "icon"])
344
306
  ])
345
- ], 8, Re)
307
+ ], 8, Ee)
346
308
  ]))
347
309
  ])
348
310
  ], 2)
349
311
  ])
350
312
  ], 2),
351
- o.showPagination && o.pageInfo && o.pageInfo.totalPages > 1 ? (r(), u("div", ze, [
352
- z(W(be), Y({
353
- "current-page": p.value,
313
+ o.showPagination && o.pageInfo && o.pageInfo.totalPages > 1 ? (i(), u("div", Re, [
314
+ S(L(pe), K({
315
+ "current-page": h.value,
354
316
  "total-pages": o.pageInfo.totalPages,
355
317
  "total-items": o.pageInfo.totalItems
356
318
  }, o.paginationProps, {
357
- onChange: ee,
358
- "onUpdate:itemsPerPage": te
319
+ onChange: Z,
320
+ "onUpdate:itemsPerPage": _
359
321
  }), null, 16, ["current-page", "total-pages", "total-items"])
360
- ])) : x("", !0),
361
- z(pe, {
362
- show: k.value,
363
- "onUpdate:show": t[2] || (t[2] = (a) => k.value = a),
364
- title: de.value,
365
- description: ce.value,
366
- "confirm-text": ue.value,
367
- "cancel-text": fe.value,
322
+ ])) : $("", !0),
323
+ S(ge, {
324
+ show: P.value,
325
+ "onUpdate:show": t[2] || (t[2] = (a) => P.value = a),
326
+ title: re.value,
327
+ description: ie.value,
328
+ "confirm-text": de.value,
329
+ "cancel-text": ce.value,
368
330
  variant: "danger",
369
- onConfirm: ae,
370
- onCancel: t[3] || (t[3] = (a) => k.value = !1)
331
+ onConfirm: te,
332
+ onCancel: t[3] || (t[3] = (a) => P.value = !1)
371
333
  }, null, 8, ["show", "title", "description", "confirm-text", "cancel-text"])
372
334
  ]));
373
335
  }
374
336
  });
375
337
  export {
376
- We as default
338
+ Ye as default
377
339
  };
@@ -50,10 +50,7 @@ export interface DataTableProps {
50
50
  headers: TableHeader[];
51
51
  /**
52
52
  * Unique row identifier field.
53
- * When set to the sentinel value 'auto' (the internal default), DataTable will
54
- * automatically pick the first matching key from ['id', '_id'] found on the
55
- * first row. Explicitly passing 'id' or '_id' (or any other string) pins the
56
- * field to that exact value.
53
+ * 'auto' picks first of ['id','_id'] found on first row, fallback '_id'.
57
54
  */
58
55
  keyField?: string;
59
56
  loading?: boolean;
@@ -84,11 +81,18 @@ export interface RowClickPayload {
84
81
  row: any;
85
82
  index: number;
86
83
  }
87
- /** Shape provided by Screen to deeply nested components */
84
+ /**
85
+ * Shape provided by Screen to all deeply nested components via provide/inject.
86
+ *
87
+ * - disableSearch → DataTable hides its own search toolbar (Screen owns search)
88
+ * - forceSelectable → DataTable enables row selection for bulk-delete
89
+ * - onTableChange → DataTable calls this whenever sort/pagination/search changes
90
+ * so Screen can merge the state and call its own refetch.
91
+ * Undefined when DataTable is used standalone (outside Screen).
92
+ */
88
93
  export interface ScreenContext {
89
- /** When true, DataTable should hide its own search toolbar */
90
94
  disableSearch: boolean;
91
- /** When true, DataTable should enable row selection */
92
95
  forceSelectable: boolean;
96
+ onTableChange?: (state: TableState) => void;
93
97
  }
94
98
  export declare const SCREEN_CONTEXT_KEY: unique symbol;