@oneb/ui-vue 0.2.24 → 0.2.26

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,852 +0,0 @@
1
- import { openBlock as l, createElementBlock as n, createElementVNode as c, defineComponent as ee, computed as f, normalizeClass as v, toDisplayString as _, Fragment as S, renderList as q, createCommentVNode as g, createBlock as k, resolveDynamicComponent as C, unref as p, useSlots as be, ref as N, provide as ze, watch as V, withDirectives as je, renderSlot as B, vShow as Ne, normalizeStyle as J, createTextVNode as Q, withModifiers as pe, createVNode as Ae, inject as Ke, onBeforeUnmount as Te } from "vue";
2
- import { b as me, r as Ve, a as ce } from "./ChevronRightIcon-8df1af46.js";
3
- import { S as fe } from "./SpinnerIcon-24e552a8.js";
4
- import { _ as We } from "./_plugin-vue_export-helper-dad06003.js";
5
- function ye(i, d) {
6
- return l(), n("svg", {
7
- xmlns: "http://www.w3.org/2000/svg",
8
- fill: "none",
9
- viewBox: "0 0 24 24",
10
- "stroke-width": "1.8",
11
- stroke: "currentColor",
12
- "aria-hidden": "true"
13
- }, [
14
- c("path", {
15
- "stroke-linecap": "round",
16
- "stroke-linejoin": "round",
17
- d: "M4.5 12.75l6 6 9-13.5"
18
- })
19
- ]);
20
- }
21
- function Ue(i, d) {
22
- return l(), n("svg", {
23
- xmlns: "http://www.w3.org/2000/svg",
24
- fill: "none",
25
- viewBox: "0 0 24 24",
26
- "stroke-width": "1.8",
27
- stroke: "currentColor",
28
- "aria-hidden": "true"
29
- }, [
30
- c("path", {
31
- "stroke-linecap": "round",
32
- "stroke-linejoin": "round",
33
- d: "M15.75 19.5L8.25 12l7.5-7.5"
34
- })
35
- ]);
36
- }
37
- function ge(i, d) {
38
- return l(), n("svg", {
39
- xmlns: "http://www.w3.org/2000/svg",
40
- fill: "none",
41
- viewBox: "0 0 24 24",
42
- "stroke-width": "1.8",
43
- stroke: "currentColor",
44
- "aria-hidden": "true"
45
- }, [
46
- c("path", {
47
- "stroke-linecap": "round",
48
- "stroke-linejoin": "round",
49
- d: "M8.25 15L12 18.75 15.75 15m-7.5-6L12 5.25 15.75 9"
50
- })
51
- ]);
52
- }
53
- const He = {
54
- field: {
55
- type: String,
56
- required: !1
57
- },
58
- header: {
59
- type: String,
60
- required: !1
61
- },
62
- sortable: {
63
- type: Boolean,
64
- default: !1
65
- },
66
- sortField: {
67
- type: String,
68
- required: !1
69
- },
70
- filterable: {
71
- type: Boolean,
72
- default: !1
73
- },
74
- filterField: {
75
- type: String,
76
- required: !1
77
- },
78
- expander: {
79
- type: Boolean,
80
- default: !1
81
- },
82
- width: {
83
- type: String,
84
- required: !1
85
- },
86
- headerClass: {
87
- type: String,
88
- required: !1
89
- },
90
- bodyClass: {
91
- type: String,
92
- required: !1
93
- },
94
- headerStyle: {
95
- type: [String, Object],
96
- required: !1
97
- },
98
- bodyStyle: {
99
- type: [String, Object],
100
- required: !1
101
- }
102
- }, Ie = {
103
- value: {
104
- type: Array,
105
- default: () => []
106
- },
107
- dataKey: {
108
- type: String,
109
- required: !1
110
- },
111
- lazy: {
112
- type: Boolean,
113
- default: !1
114
- },
115
- paginator: {
116
- type: Boolean,
117
- default: !1
118
- },
119
- rows: {
120
- type: Number,
121
- default: 10
122
- },
123
- first: {
124
- type: Number,
125
- default: 0
126
- },
127
- totalRecords: {
128
- type: Number,
129
- required: !1
130
- },
131
- rowsPerPageOptions: {
132
- type: Array,
133
- default: () => [10, 25, 50, 100]
134
- },
135
- sortField: {
136
- type: String,
137
- required: !1
138
- },
139
- sortOrder: {
140
- type: Number,
141
- default: null
142
- },
143
- selectionMode: {
144
- type: String,
145
- required: !1
146
- },
147
- selection: {
148
- type: [Object, Array],
149
- required: !1
150
- },
151
- expandedRows: {
152
- type: [Array, Object],
153
- default: () => []
154
- },
155
- filters: {
156
- type: Object,
157
- required: !1
158
- },
159
- filterDisplay: {
160
- type: String,
161
- default: null
162
- },
163
- globalFilterFields: {
164
- type: Array,
165
- required: !1
166
- },
167
- loading: {
168
- type: Boolean,
169
- default: !1
170
- },
171
- striped: {
172
- type: Boolean,
173
- default: !1
174
- },
175
- hoverable: {
176
- type: Boolean,
177
- default: !0
178
- },
179
- bordered: {
180
- type: Boolean,
181
- default: !1
182
- },
183
- size: {
184
- type: String,
185
- default: "md"
186
- },
187
- tableClass: {
188
- type: String,
189
- required: !1
190
- },
191
- hasNextPage: {
192
- type: Boolean,
193
- default: !1
194
- },
195
- loadingNext: {
196
- type: Boolean,
197
- default: !1
198
- },
199
- loadMoreLabel: {
200
- type: String,
201
- default: "Show more"
202
- },
203
- colWidths: {
204
- type: [Array, Function],
205
- required: !1
206
- },
207
- verticalBorders: {
208
- type: String,
209
- default: "none"
210
- },
211
- headerVariant: {
212
- type: String,
213
- default: "default"
214
- },
215
- wrapperClass: {
216
- type: String,
217
- required: !1
218
- },
219
- wrapperBordered: {
220
- type: Boolean,
221
- default: !0
222
- }
223
- }, we = Symbol("OneDataTable"), he = {
224
- contains: (i, d) => String(i ?? "").toLowerCase().includes(String(d).toLowerCase()),
225
- startsWith: (i, d) => String(i ?? "").toLowerCase().startsWith(String(d).toLowerCase()),
226
- endsWith: (i, d) => String(i ?? "").toLowerCase().endsWith(String(d).toLowerCase()),
227
- equals: (i, d) => String(i ?? "").toLowerCase() === String(d).toLowerCase(),
228
- notEquals: (i, d) => String(i ?? "").toLowerCase() !== String(d).toLowerCase()
229
- }, Ge = (i = !0) => {
230
- const d = ["overflow-x-auto", "w-full"];
231
- return i && d.push("border", "border-gray-100", "rounded"), d;
232
- }, Je = (i) => {
233
- const d = ["min-w-full", "text-left", "relative"];
234
- return i === "sm" ? d.push("text-xs") : i === "lg" ? d.push("text-base") : d.push("text-sm"), d;
235
- }, X = (i, d, t = "none", o = "default") => {
236
- const y = [];
237
- return o === "minimal" ? y.push(
238
- "bg-gray-50",
239
- "text-gray-700",
240
- "font-medium",
241
- "text-sm",
242
- "normal-case",
243
- "border-b",
244
- "border-gray-200"
245
- ) : y.push(
246
- "bg-gray-100",
247
- "text-gray-600",
248
- "font-semibold",
249
- "text-xs",
250
- "uppercase",
251
- "tracking-wide",
252
- "border-b",
253
- "border-gray-200",
254
- "whitespace-nowrap"
255
- ), d && y.push("cursor-pointer", "select-none", "hover:text-primary-base", "transition-colors"), t === "always" ? y.push("border-r", "border-r-gray-200", "last:border-r-0") : (t === "hover" || t === "hover-table") && y.push("border-r", "border-r-transparent", "last:border-r-0"), i === "sm" ? y.push("px-1.5", "py-1") : i === "lg" ? y.push("px-4", "py-3") : y.push("p-2"), y;
256
- }, Y = (i, d, t = "none") => {
257
- const o = ["border-b", "border-gray-100", "text-gray-900"];
258
- return d && o.push("border-r"), t === "always" ? o.push("border-r", "border-r-gray-200", "last:border-r-0") : (t === "hover" || t === "hover-table") && o.push("border-r", "border-r-transparent", "last:border-r-0"), i === "sm" ? o.push("px-1.5", "py-1") : i === "lg" ? o.push("px-4", "py-3") : o.push("px-2", "py-1.5"), o;
259
- }, Qe = (i, d, t, o, y = !1) => {
260
- const h = [];
261
- return y && h.push("group"), o ? h.push("bg-primary-25") : i && t && h.push("bg-gray-50"), d && (o ? h.push("hover:bg-primary-25-hover", "transition-colors") : h.push("hover:bg-gray-50", "transition-colors")), h;
262
- }, W = (i, d) => {
263
- const t = ["w-3.5", "h-3.5", "inline-block", "ml-1"];
264
- return i ? (t.push("text-primary-base"), d === -1 && t.push("rotate-180")) : t.push("text-gray-400"), t.push("transition-transform", "duration-200"), t;
265
- }, D = (i) => {
266
- const d = ["text-center"];
267
- return i === "sm" ? d.push("w-8") : i === "lg" ? d.push("w-14") : d.push("w-12"), d;
268
- }, ve = (i) => D(i), Xe = () => [
269
- "flex",
270
- "items-center",
271
- "justify-between",
272
- "px-2",
273
- "py-2",
274
- "border-t",
275
- "border-gray-100",
276
- "bg-white",
277
- "text-sm"
278
- ], Z = (i) => {
279
- const d = ["bg-gray-100", "border-b", "border-gray-200"];
280
- return i === "sm" ? d.push("px-1.5", "py-1") : i === "lg" ? d.push("px-4", "py-2") : d.push("px-2", "py-1.5"), d;
281
- }, Ye = { class: "flex items-center gap-4" }, Ze = { class: "text-gray-600" }, De = ["value"], et = ["value"], tt = { class: "flex items-center gap-1" }, rt = ["disabled"], st = { class: "px-2 text-gray-600" }, lt = ["disabled"], ot = /* @__PURE__ */ ee({
282
- __name: "OneDataTablePaginator",
283
- props: {
284
- first: {
285
- type: Number,
286
- required: !0
287
- },
288
- rows: {
289
- type: Number,
290
- required: !0
291
- },
292
- totalRecords: {
293
- type: Number,
294
- required: !0
295
- },
296
- rowsPerPageOptions: {
297
- type: Array,
298
- default: () => [10, 25, 50, 100]
299
- }
300
- },
301
- emits: ["update:first", "update:rows", "page"],
302
- setup(i, { emit: d }) {
303
- const t = i, o = d, y = f(() => Math.ceil(t.totalRecords / t.rows)), h = f(() => Math.floor(t.first / t.rows) + 1), U = f(() => t.totalRecords === 0 ? 0 : t.first + 1), te = f(() => Math.min(t.first + t.rows, t.totalRecords)), R = f(() => t.first === 0), E = f(() => t.first + t.rows >= t.totalRecords), z = f(() => Xe()), P = (m) => {
304
- m < 0 || m >= t.totalRecords || (o("update:first", m), o("page", {
305
- first: m,
306
- rows: t.rows,
307
- page: Math.floor(m / t.rows),
308
- pageCount: y.value
309
- }));
310
- }, A = () => {
311
- P(Math.max(0, t.first - t.rows));
312
- }, K = () => {
313
- P(t.first + t.rows);
314
- }, F = (m) => {
315
- const w = parseInt(m.target.value);
316
- o("update:rows", w), o("update:first", 0), o("page", {
317
- first: 0,
318
- rows: w,
319
- page: 0,
320
- pageCount: Math.ceil(t.totalRecords / w)
321
- });
322
- };
323
- return (m, w) => (l(), n("div", {
324
- class: v(z.value)
325
- }, [
326
- c("div", Ye, [
327
- c("span", Ze, _(U.value) + "–" + _(te.value) + " of " + _(i.totalRecords), 1),
328
- i.rowsPerPageOptions.length > 1 ? (l(), n("select", {
329
- key: 0,
330
- value: i.rows,
331
- class: "border border-gray-300 rounded px-2 py-1 text-sm bg-white focus:outline-none focus:ring-1 focus:ring-primary-glow",
332
- onChange: F
333
- }, [
334
- (l(!0), n(S, null, q(i.rowsPerPageOptions, (O) => (l(), n("option", {
335
- key: O,
336
- value: O
337
- }, _(O) + " / page", 9, et))), 128))
338
- ], 40, De)) : g("", !0)
339
- ]),
340
- c("div", tt, [
341
- c("button", {
342
- disabled: R.value,
343
- class: "p-1.5 rounded hover:bg-gray-100 disabled:opacity-30 disabled:cursor-default transition-colors",
344
- onClick: A
345
- }, [
346
- (l(), k(C(p(Ue)), { class: "w-4 h-4 text-gray-600" }))
347
- ], 8, rt),
348
- c("span", st, _(h.value) + " / " + _(y.value), 1),
349
- c("button", {
350
- disabled: E.value,
351
- class: "p-1.5 rounded hover:bg-gray-100 disabled:opacity-30 disabled:cursor-default transition-colors",
352
- onClick: K
353
- }, [
354
- (l(), k(C(p(me)), { class: "w-4 h-4 text-gray-600" }))
355
- ], 8, lt)
356
- ])
357
- ], 2));
358
- }
359
- }), at = {
360
- key: 0,
361
- class: "mb-3"
362
- }, nt = { key: 0 }, it = {
363
- key: 0,
364
- class: "w-5 h-5 rounded bg-primary-base flex items-center justify-center text-white"
365
- }, dt = {
366
- key: 1,
367
- class: "w-5 h-5 rounded border border-gray-300 bg-white"
368
- }, ut = ["onClick"], pt = {
369
- key: 1,
370
- class: "inline-flex items-center gap-1"
371
- }, ct = { key: 0 }, ft = ["value", "placeholder", "onInput"], yt = { key: 1 }, gt = ["onClick"], ht = ["onClick"], vt = {
372
- key: 0,
373
- class: "w-5 h-5 rounded bg-primary-base flex items-center justify-center text-white"
374
- }, bt = {
375
- key: 1,
376
- class: "w-5 h-5 rounded border border-gray-300 bg-white"
377
- }, mt = ["onClick"], wt = {
378
- key: 0,
379
- class: "w-5 h-5 rounded-full bg-primary-base flex items-center justify-center"
380
- }, kt = {
381
- key: 1,
382
- class: "w-5 h-5 rounded-full border border-gray-300 bg-white"
383
- }, Ct = ["onClick"], xt = { key: 0 }, St = ["colspan"], _t = { key: 2 }, Rt = ["colspan"], Ft = { class: "flex items-center justify-center gap-2 text-gray-500" }, Mt = { key: 3 }, Bt = ["colspan"], Pt = { key: 4 }, Ot = ["colspan"], $t = ["disabled"], Lt = {
384
- key: 2,
385
- class: "mt-3"
386
- }, qt = /* @__PURE__ */ ee({
387
- __name: "OneDataTable",
388
- props: Ie,
389
- emits: [
390
- "update:selection",
391
- "update:expandedRows",
392
- "update:first",
393
- "update:rows",
394
- "update:sortField",
395
- "update:sortOrder",
396
- "update:filters",
397
- "sort",
398
- "page",
399
- "filter",
400
- "row-click",
401
- "row-select",
402
- "row-unselect",
403
- "row-expand",
404
- "row-collapse",
405
- "load:next"
406
- ],
407
- setup(i, { emit: d }) {
408
- const t = i, o = d, y = be(), h = N([]);
409
- ze(we, { registerColumn: (e) => {
410
- h.value.push(e);
411
- }, unregisterColumn: (e) => {
412
- const s = h.value.indexOf(e);
413
- s > -1 && h.value.splice(s, 1);
414
- } });
415
- const R = N(t.first), E = N(t.rows), z = N(t.sortField), P = N(t.sortOrder);
416
- V(
417
- () => t.first,
418
- (e) => {
419
- R.value = e;
420
- }
421
- ), V(
422
- () => t.rows,
423
- (e) => {
424
- E.value = e;
425
- }
426
- ), V(
427
- () => t.sortField,
428
- (e) => {
429
- z.value = e;
430
- }
431
- ), V(
432
- () => t.sortOrder,
433
- (e) => {
434
- P.value = e;
435
- }
436
- );
437
- const A = f(() => R.value), K = f(() => E.value), F = f(() => z.value), m = f(() => P.value), w = (e, s) => s ? s.split(".").reduce((r, u) => r == null ? void 0 : r[u], e) : e, O = (e) => t.dataKey ? w(e, t.dataKey) : e, x = (e, s) => e == null || s == null ? e === s : t.dataKey ? w(e, t.dataKey) === w(s, t.dataKey) : e === s, ke = (e, s) => t.dataKey ? w(e, t.dataKey) : s, M = f(() => h.value.some((e) => e.props.expander)), $ = f(() => !!t.selectionMode), re = f(() => t.selectionMode === "multiple"), j = f(() => h.value.filter((e) => !e.props.expander)), T = f(
438
- () => h.value.length + ($.value ? 1 : 0) + (M.value ? 1 : 0)
439
- ), se = f(() => {
440
- var r, u;
441
- if (t.lazy || !t.filters)
442
- return t.value;
443
- let e = [...t.value];
444
- const s = t.filters;
445
- if ((r = s.global) != null && r.value && ((u = t.globalFilterFields) != null && u.length)) {
446
- const a = s.global.value;
447
- e = e.filter(
448
- (b) => t.globalFilterFields.some(
449
- (G) => he.contains(w(b, G), a)
450
- )
451
- );
452
- }
453
- for (const [a, b] of Object.entries(s)) {
454
- if (a === "global" || !b.value)
455
- continue;
456
- const G = b.matchMode || "contains", ue = he[G];
457
- ue && (e = e.filter((Ee) => ue(w(Ee, a), b.value)));
458
- }
459
- return e;
460
- }), Ce = f(() => {
461
- const e = se.value;
462
- return t.lazy || !F.value || !m.value ? e : [...e].sort((s, r) => {
463
- const u = w(s, F.value), a = w(r, F.value);
464
- if (u == null && a == null)
465
- return 0;
466
- if (u == null)
467
- return 1;
468
- if (a == null)
469
- return -1;
470
- let b;
471
- return typeof u == "number" && typeof a == "number" ? b = u - a : b = String(u).localeCompare(String(a)), m.value === 1 ? b : -b;
472
- });
473
- }), le = f(() => t.totalRecords ?? se.value.length), L = f(() => {
474
- const e = Ce.value;
475
- if (t.paginator && !t.lazy) {
476
- const s = A.value, r = s + K.value;
477
- return e.slice(s, r);
478
- }
479
- return e;
480
- }), xe = (e) => {
481
- let s;
482
- F.value === e ? m.value === 1 ? s = -1 : m.value === -1 ? s = null : s = 1 : s = 1, z.value = e, P.value = s, o("update:sortField", e), o("update:sortOrder", s), o("sort", { field: e, order: s }), !t.lazy && t.paginator && (R.value = 0, o("update:first", 0));
483
- }, oe = (e) => e.props.sortField || e.props.field, Se = (e) => F.value === oe(e), H = (e) => t.selection ? t.selectionMode === "single" ? x(t.selection, e) : t.selectionMode === "multiple" ? t.selection.some((s) => x(s, e)) : !1 : !1, ae = (e, s, r) => {
484
- if (o("row-click", { originalEvent: e, data: s, index: r }), t.selectionMode === "single") {
485
- const u = x(t.selection, s) ? null : s;
486
- o("update:selection", u), u ? o("row-select", { originalEvent: e, data: s }) : o("row-unselect", { originalEvent: e, data: s });
487
- }
488
- }, _e = (e, s) => {
489
- if (e.stopPropagation(), t.selectionMode === "multiple") {
490
- const r = t.selection || [], u = r.some((b) => x(b, s));
491
- let a;
492
- u ? (a = r.filter((b) => !x(b, s)), o("row-unselect", { originalEvent: e, data: s })) : (a = [...r, s], o("row-select", { originalEvent: e, data: s })), o("update:selection", a);
493
- }
494
- }, ne = f(() => {
495
- if (t.selectionMode !== "multiple" || !t.selection)
496
- return !1;
497
- const e = t.selection;
498
- return L.value.length > 0 && L.value.every((s) => e.some((r) => x(r, s)));
499
- }), Re = (e) => {
500
- e.stopPropagation();
501
- const s = t.selection || [];
502
- if (ne.value) {
503
- const r = s.filter(
504
- (u) => !L.value.some((a) => x(u, a))
505
- );
506
- o("update:selection", r);
507
- } else {
508
- const r = [...s];
509
- L.value.forEach((u) => {
510
- r.some((a) => x(a, u)) || r.push(u);
511
- }), o("update:selection", r);
512
- }
513
- }, I = (e) => {
514
- if (!t.expandedRows)
515
- return !1;
516
- if (Array.isArray(t.expandedRows))
517
- return t.expandedRows.some((s) => x(s, e));
518
- if (t.dataKey) {
519
- const s = String(O(e));
520
- return !!t.expandedRows[s];
521
- }
522
- return !1;
523
- }, Fe = (e, s) => {
524
- e.stopPropagation();
525
- const r = I(s);
526
- if (Array.isArray(t.expandedRows)) {
527
- let u;
528
- r ? (u = t.expandedRows.filter((a) => !x(a, s)), o("row-collapse", { originalEvent: e, data: s })) : (u = [...t.expandedRows, s], o("row-expand", { originalEvent: e, data: s })), o("update:expandedRows", u);
529
- } else if (t.dataKey) {
530
- const u = String(O(s)), a = { ...t.expandedRows };
531
- r ? (delete a[u], o("row-collapse", { originalEvent: e, data: s })) : (a[u] = !0, o("row-expand", { originalEvent: e, data: s })), o("update:expandedRows", a);
532
- }
533
- }, Me = (e, s, r) => {
534
- var a;
535
- if (!t.filters)
536
- return;
537
- const u = {
538
- ...t.filters,
539
- [e]: { value: s, matchMode: r || ((a = t.filters[e]) == null ? void 0 : a.matchMode) || "contains" }
540
- };
541
- o("update:filters", u), t.lazy && o("filter", { filters: u }), t.paginator && (R.value = 0, o("update:first", 0));
542
- }, ie = (e) => {
543
- var s;
544
- return ((s = t.filters) == null ? void 0 : s[e]) || { value: null };
545
- }, Be = (e) => () => {
546
- t.filters && (o("update:filters", { ...t.filters }), t.lazy && o("filter", { filters: t.filters }), t.paginator && (R.value = 0, o("update:first", 0)));
547
- }, Pe = (e) => {
548
- R.value = e, o("update:first", e);
549
- }, Oe = (e) => {
550
- E.value = e, o("update:rows", e);
551
- }, de = f(() => {
552
- const e = [];
553
- if (t.colWidths) {
554
- if (typeof t.colWidths == "function") {
555
- const s = t.colWidths(j.value), r = [];
556
- return $.value && r.push(""), M.value && r.push(""), [...r, ...s];
557
- }
558
- return t.colWidths;
559
- }
560
- return $.value && e.push(""), M.value && e.push(""), j.value.forEach((s) => {
561
- e.push(s.props.width || "");
562
- }), e;
563
- }), $e = f(() => de.value.some((e) => e !== "" && e != null)), Le = f(() => t.wrapperClass ? ["overflow-x-auto", "w-full", t.wrapperClass] : t.verticalBorders === "hover-table" ? ["overflow-x-auto", "w-full", "border", "border-transparent", "rounded"] : Ge(t.wrapperBordered)), qe = f(() => {
564
- const e = Je(t.size);
565
- return t.tableClass && e.push(t.tableClass), t.bordered && e.push("border", "border-gray-100"), e;
566
- });
567
- return (e, s) => (l(), n("div", null, [
568
- je(c("div", null, [
569
- B(e.$slots, "default", {}, void 0, !0)
570
- ], 512), [
571
- [Ne, !1]
572
- ]),
573
- p(y).header ? (l(), n("div", at, [
574
- B(e.$slots, "header", {}, void 0, !0)
575
- ])) : g("", !0),
576
- c("div", {
577
- class: v([...Le.value, e.verticalBorders === "hover-table" ? "vb-hover" : ""])
578
- }, [
579
- c("table", {
580
- class: v([
581
- ...qe.value,
582
- e.verticalBorders !== "none" ? "border-separate border-spacing-0" : "border-collapse",
583
- e.verticalBorders === "hover" ? "vb-hover" : ""
584
- ])
585
- }, [
586
- $e.value ? (l(), n("colgroup", nt, [
587
- (l(!0), n(S, null, q(de.value, (r, u) => (l(), n("col", {
588
- key: `col-${u}`,
589
- style: J(r ? { width: r } : {})
590
- }, null, 4))), 128))
591
- ])) : g("", !0),
592
- c("thead", null, [
593
- c("tr", null, [
594
- $.value ? (l(), n("th", {
595
- key: 0,
596
- class: v([
597
- ...p(X)(e.size, !1, e.verticalBorders, e.headerVariant),
598
- ...p(D)(e.size)
599
- ])
600
- }, [
601
- re.value ? (l(), n("div", {
602
- key: 0,
603
- class: "flex items-center justify-center cursor-pointer",
604
- onClick: s[0] || (s[0] = (r) => Re(r))
605
- }, [
606
- ne.value ? (l(), n("div", it, [
607
- (l(), k(C(p(ye)), { class: "w-3.5 h-3.5" }))
608
- ])) : (l(), n("div", dt))
609
- ])) : g("", !0)
610
- ], 2)) : g("", !0),
611
- M.value ? (l(), n("th", {
612
- key: 1,
613
- class: v([
614
- ...p(X)(e.size, !1, e.verticalBorders, e.headerVariant),
615
- ...p(ve)(e.size)
616
- ])
617
- }, null, 2)) : g("", !0),
618
- (l(!0), n(S, null, q(j.value, (r, u) => (l(), n("th", {
619
- key: u,
620
- class: v([
621
- ...p(X)(e.size, r.props.sortable, e.verticalBorders, e.headerVariant),
622
- r.props.headerClass
623
- ]),
624
- style: J([r.props.headerStyle, r.props.width ? { width: r.props.width } : {}]),
625
- onClick: (a) => r.props.sortable ? xe(oe(r)) : void 0
626
- }, [
627
- r.slots.header ? (l(), k(C(r.slots.header), { key: 0 })) : (l(), n("span", pt, [
628
- Q(_(r.props.header) + " ", 1),
629
- r.props.sortable ? (l(), n(S, { key: 0 }, [
630
- Se(r) ? m.value === 1 ? (l(), k(C(p(Ve)), {
631
- key: 1,
632
- class: v(p(W)(!0, 1))
633
- }, null, 8, ["class"])) : m.value === -1 ? (l(), k(C(p(ce)), {
634
- key: 2,
635
- class: v(p(W)(!0, -1))
636
- }, null, 8, ["class"])) : (l(), k(C(p(ge)), {
637
- key: 3,
638
- class: v(p(W)(!1, null))
639
- }, null, 8, ["class"])) : (l(), k(C(p(ge)), {
640
- key: 0,
641
- class: v(p(W)(!1, null))
642
- }, null, 8, ["class"]))
643
- ], 64)) : g("", !0)
644
- ]))
645
- ], 14, ut))), 128))
646
- ]),
647
- e.filterDisplay === "row" ? (l(), n("tr", ct, [
648
- $.value ? (l(), n("th", {
649
- key: 0,
650
- class: v(p(Z)(e.size))
651
- }, null, 2)) : g("", !0),
652
- M.value ? (l(), n("th", {
653
- key: 1,
654
- class: v(p(Z)(e.size))
655
- }, null, 2)) : g("", !0),
656
- (l(!0), n(S, null, q(j.value, (r, u) => (l(), n("th", {
657
- key: `filter-${u}`,
658
- class: v(p(Z)(e.size))
659
- }, [
660
- r.props.filterable && r.slots.filter ? (l(), k(C(r.slots.filter), {
661
- key: 0,
662
- filterModel: ie(
663
- r.props.filterField || r.props.field
664
- ),
665
- filterCallback: Be(
666
- r.props.filterField || r.props.field
667
- )
668
- }, null, 8, ["filterModel", "filterCallback"])) : r.props.filterable && r.props.field ? (l(), n("input", {
669
- key: 1,
670
- type: "text",
671
- value: ie(
672
- r.props.filterField || r.props.field
673
- ).value || "",
674
- class: "w-full border border-gray-300 rounded px-2 py-1 text-sm focus:outline-none focus:ring-1 focus:ring-primary-glow",
675
- placeholder: `Filter ${r.props.header || r.props.field}`,
676
- onInput: (a) => Me(
677
- r.props.filterField || r.props.field,
678
- a.target.value
679
- )
680
- }, null, 40, ft)) : g("", !0)
681
- ], 2))), 128))
682
- ])) : g("", !0)
683
- ]),
684
- !e.loading && L.value.length > 0 ? (l(), n("tbody", yt, [
685
- (l(!0), n(S, null, q(L.value, (r, u) => (l(), n(S, {
686
- key: ke(r, u)
687
- }, [
688
- c("tr", {
689
- class: v([
690
- ...p(Qe)(
691
- e.striped,
692
- e.hoverable,
693
- u % 2 === 1,
694
- H(r),
695
- !1
696
- ),
697
- e.selectionMode ? "cursor-pointer" : ""
698
- ]),
699
- onClick: (a) => ae(a, r, u)
700
- }, [
701
- $.value ? (l(), n("td", {
702
- key: 0,
703
- class: v([
704
- ...p(Y)(e.size, e.bordered, e.verticalBorders),
705
- ...p(D)(e.size)
706
- ])
707
- }, [
708
- re.value ? (l(), n("div", {
709
- key: 0,
710
- class: "flex items-center justify-center cursor-pointer",
711
- onClick: pe((a) => _e(a, r), ["stop"])
712
- }, [
713
- H(r) ? (l(), n("div", vt, [
714
- (l(), k(C(p(ye)), { class: "w-3.5 h-3.5" }))
715
- ])) : (l(), n("div", bt))
716
- ], 8, ht)) : (l(), n("div", {
717
- key: 1,
718
- class: "flex items-center justify-center cursor-pointer",
719
- onClick: pe((a) => ae(a, r, u), ["stop"])
720
- }, [
721
- H(r) ? (l(), n("div", wt, s[3] || (s[3] = [
722
- c("div", { class: "w-2 h-2 rounded-full bg-white" }, null, -1)
723
- ]))) : (l(), n("div", kt))
724
- ], 8, mt))
725
- ], 2)) : g("", !0),
726
- M.value ? (l(), n("td", {
727
- key: 1,
728
- class: v([
729
- ...p(Y)(e.size, e.bordered, e.verticalBorders),
730
- ...p(ve)(e.size)
731
- ])
732
- }, [
733
- c("button", {
734
- class: "p-1 rounded hover:bg-gray-100 transition-colors",
735
- onClick: (a) => Fe(a, r)
736
- }, [
737
- (l(), k(C(I(r) ? p(ce) : p(me)), { class: "w-4 h-4 text-gray-500" }))
738
- ], 8, Ct)
739
- ], 2)) : g("", !0),
740
- (l(!0), n(S, null, q(j.value, (a, b) => (l(), n("td", {
741
- key: b,
742
- class: v([
743
- ...p(Y)(e.size, e.bordered, e.verticalBorders),
744
- a.props.bodyClass
745
- ]),
746
- style: J(a.props.bodyStyle)
747
- }, [
748
- a.slots.body ? (l(), k(C(a.slots.body), {
749
- key: 0,
750
- data: r,
751
- field: a.props.field,
752
- index: u
753
- }, null, 8, ["data", "field", "index"])) : a.props.field ? (l(), n(S, { key: 1 }, [
754
- Q(_(w(r, a.props.field)), 1)
755
- ], 64)) : g("", !0)
756
- ], 6))), 128))
757
- ], 10, gt),
758
- M.value && I(r) ? (l(), n("tr", xt, [
759
- c("td", {
760
- colspan: T.value,
761
- class: "p-0"
762
- }, [
763
- B(e.$slots, "expansion", {
764
- data: r,
765
- index: u
766
- }, void 0, !0)
767
- ], 8, St)
768
- ])) : g("", !0)
769
- ], 64))), 128))
770
- ])) : e.loading ? (l(), n("tbody", _t, [
771
- c("tr", null, [
772
- c("td", {
773
- colspan: T.value,
774
- class: "text-center py-12"
775
- }, [
776
- B(e.$slots, "loading", {}, () => [
777
- c("div", Ft, [
778
- Ae(fe, { class: "w-5 h-5" }),
779
- s[4] || (s[4] = c("span", null, "Loading...", -1))
780
- ])
781
- ], !0)
782
- ], 8, Rt)
783
- ])
784
- ])) : (l(), n("tbody", Mt, [
785
- c("tr", null, [
786
- c("td", {
787
- colspan: T.value,
788
- class: "text-center py-12"
789
- }, [
790
- B(e.$slots, "empty", {}, () => [
791
- s[5] || (s[5] = c("span", { class: "text-gray-400" }, "No records found", -1))
792
- ], !0)
793
- ], 8, Bt)
794
- ])
795
- ])),
796
- e.hasNextPage && !e.loading ? (l(), n("tfoot", Pt, [
797
- c("tr", null, [
798
- c("td", {
799
- colspan: T.value,
800
- class: "px-3 pb-3 pt-2"
801
- }, [
802
- c("button", {
803
- class: "w-full p-2 rounded bg-primary-base bg-opacity-10 text-primary-base text-sm font-medium hover:bg-opacity-20 transition-colors disabled:opacity-50 disabled:cursor-default flex items-center justify-center gap-2",
804
- disabled: e.loadingNext,
805
- onClick: s[1] || (s[1] = (r) => o("load:next"))
806
- }, [
807
- e.loadingNext ? (l(), k(fe, {
808
- key: 0,
809
- class: "w-4 h-4"
810
- })) : g("", !0),
811
- Q(" " + _(e.loadMoreLabel), 1)
812
- ], 8, $t)
813
- ], 8, Ot)
814
- ])
815
- ])) : g("", !0)
816
- ], 2)
817
- ], 2),
818
- e.paginator && le.value > 0 ? (l(), k(ot, {
819
- key: 1,
820
- first: A.value,
821
- rows: K.value,
822
- "total-records": le.value,
823
- "rows-per-page-options": e.rowsPerPageOptions,
824
- "onUpdate:first": Pe,
825
- "onUpdate:rows": Oe,
826
- onPage: s[2] || (s[2] = (r) => o("page", r))
827
- }, null, 8, ["first", "rows", "total-records", "rows-per-page-options"])) : g("", !0),
828
- p(y).footer ? (l(), n("div", Lt, [
829
- B(e.$slots, "footer", {}, void 0, !0)
830
- ])) : g("", !0)
831
- ]));
832
- }
833
- });
834
- const At = /* @__PURE__ */ We(qt, [["__scopeId", "data-v-0ec9072c"]]), Kt = /* @__PURE__ */ ee({
835
- __name: "OneColumn",
836
- props: He,
837
- setup(i) {
838
- const d = i, t = be(), o = Ke(we), y = {
839
- props: d,
840
- slots: t
841
- };
842
- return o && o.registerColumn(y), Te(() => {
843
- o && o.unregisterColumn(y);
844
- }), (h, U) => B(h.$slots, "default");
845
- }
846
- });
847
- export {
848
- At as O,
849
- Kt as _,
850
- ot as a,
851
- ye as r
852
- };