@indielayer/ui 1.15.3 → 1.16.0
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.
- package/docs/pages/component/table/usage.vue +13 -0
- package/lib/components/table/Table.vue.d.ts +9 -0
- package/lib/components/table/Table.vue.js +189 -159
- package/lib/components/tooltip/Tooltip.vue.js +64 -52
- package/lib/index.js +1 -1
- package/lib/index.umd.js +4 -4
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/package.json +1 -1
- package/src/components/table/Table.vue +22 -1
- package/src/components/tooltip/Tooltip.vue +25 -5
- package/src/version.ts +1 -1
|
@@ -78,9 +78,22 @@ const itemsSorted = computed<Book[]>(() => {
|
|
|
78
78
|
<template #item-published="{ item }">
|
|
79
79
|
{{ formatDate(item.published) }}
|
|
80
80
|
</template>
|
|
81
|
+
|
|
81
82
|
<template #item-status="{ item }">
|
|
82
83
|
<x-tag size="xs" color="primary" rounded>{{ item.status }}</x-tag>
|
|
83
84
|
</template>
|
|
85
|
+
|
|
86
|
+
<template #footer>
|
|
87
|
+
<tfoot>
|
|
88
|
+
<tr>
|
|
89
|
+
<td colspan="6" class="text-center py-2">
|
|
90
|
+
<p class="text-sm text-gray-500 font-medium">
|
|
91
|
+
Footer content
|
|
92
|
+
</p>
|
|
93
|
+
</td>
|
|
94
|
+
</tr>
|
|
95
|
+
</tfoot>
|
|
96
|
+
</template>
|
|
84
97
|
</x-table>
|
|
85
98
|
</x-card>
|
|
86
99
|
|
|
@@ -300,6 +300,8 @@ declare const _default: <T>(__VLS_props: Partial<{
|
|
|
300
300
|
item: number;
|
|
301
301
|
}) => any>> & Partial<Record<string, (_: {
|
|
302
302
|
item: T;
|
|
303
|
+
}) => any>> & Partial<Record<string, (_: {
|
|
304
|
+
header: TableHeader;
|
|
303
305
|
}) => any>> & {
|
|
304
306
|
title?(_: {}): any;
|
|
305
307
|
actions?(_: {}): any;
|
|
@@ -308,6 +310,7 @@ declare const _default: <T>(__VLS_props: Partial<{
|
|
|
308
310
|
"expanded-row"?(_: {
|
|
309
311
|
item: T;
|
|
310
312
|
}): any;
|
|
313
|
+
footer?(_: {}): any;
|
|
311
314
|
};
|
|
312
315
|
emit: {
|
|
313
316
|
(e: 'update:sort', sortValues: string[]): void;
|
|
@@ -432,6 +435,8 @@ declare const _default: <T>(__VLS_props: Partial<{
|
|
|
432
435
|
item: number;
|
|
433
436
|
}) => any>> & Partial<Record<string, (_: {
|
|
434
437
|
item: T;
|
|
438
|
+
}) => any>> & Partial<Record<string, (_: {
|
|
439
|
+
header: TableHeader;
|
|
435
440
|
}) => any>> & {
|
|
436
441
|
title?(_: {}): any;
|
|
437
442
|
actions?(_: {}): any;
|
|
@@ -440,6 +445,7 @@ declare const _default: <T>(__VLS_props: Partial<{
|
|
|
440
445
|
"expanded-row"?(_: {
|
|
441
446
|
item: T;
|
|
442
447
|
}): any;
|
|
448
|
+
footer?(_: {}): any;
|
|
443
449
|
};
|
|
444
450
|
emit: {
|
|
445
451
|
(e: 'update:sort', sortValues: string[]): void;
|
|
@@ -567,6 +573,8 @@ declare const _default: <T>(__VLS_props: Partial<{
|
|
|
567
573
|
item: number;
|
|
568
574
|
}) => any>> & Partial<Record<string, (_: {
|
|
569
575
|
item: T;
|
|
576
|
+
}) => any>> & Partial<Record<string, (_: {
|
|
577
|
+
header: TableHeader;
|
|
570
578
|
}) => any>> & {
|
|
571
579
|
title?(_: {}): any;
|
|
572
580
|
actions?(_: {}): any;
|
|
@@ -575,6 +583,7 @@ declare const _default: <T>(__VLS_props: Partial<{
|
|
|
575
583
|
"expanded-row"?(_: {
|
|
576
584
|
item: T;
|
|
577
585
|
}): any;
|
|
586
|
+
footer?(_: {}): any;
|
|
578
587
|
};
|
|
579
588
|
emit: {
|
|
580
589
|
(e: 'update:sort', sortValues: string[]): void;
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useTheme as
|
|
3
|
-
import { useVirtualList as
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import { chevronDownIcon as
|
|
14
|
-
const
|
|
1
|
+
import { defineComponent as oe, mergeModels as D, useModel as ie, ref as ue, computed as m, watch as de, useSlots as ce, openBlock as s, createElementBlock as i, mergeProps as W, unref as p, renderSlot as g, createElementVNode as h, normalizeStyle as K, normalizeClass as k, createVNode as v, withCtx as u, createBlock as d, withModifiers as L, createCommentVNode as y, Fragment as b, renderList as $, createTextVNode as j, toDisplayString as q } from "vue";
|
|
2
|
+
import { useTheme as fe } from "../../composables/useTheme.js";
|
|
3
|
+
import { useVirtualList as pe } from "../../composables/useVirtualList.js";
|
|
4
|
+
import ge from "./TableHead.vue.js";
|
|
5
|
+
import O from "./TableHeader.vue.js";
|
|
6
|
+
import ve from "./TableBody.js";
|
|
7
|
+
import E from "./TableRow.vue.js";
|
|
8
|
+
import w from "./TableCell.vue.js";
|
|
9
|
+
import ye from "../spinner/Spinner.vue.js";
|
|
10
|
+
import me from "../skeleton/Skeleton.vue.js";
|
|
11
|
+
import he from "../icon/Icon.vue.js";
|
|
12
|
+
import G from "../checkbox/Checkbox.vue.js";
|
|
13
|
+
import { chevronDownIcon as ke } from "../../common/icons.js";
|
|
14
|
+
const be = { key: 1 }, we = ["colspan"], Se = { key: 2 }, $e = ["colspan"], Ce = ["onClick"], Be = ["colspan"], Fe = { key: 0 }, Le = {
|
|
15
15
|
headers: {
|
|
16
16
|
type: Array,
|
|
17
17
|
default: () => []
|
|
@@ -65,10 +65,10 @@ const me = { key: 1 }, he = ["colspan"], be = { key: 2 }, ke = ["colspan"], Se =
|
|
|
65
65
|
toFn: Function,
|
|
66
66
|
hrefFn: Function,
|
|
67
67
|
hrefTarget: String
|
|
68
|
-
},
|
|
69
|
-
...
|
|
70
|
-
props: /* @__PURE__ */
|
|
71
|
-
|
|
68
|
+
}, Ae = { name: "XTable" }, De = /* @__PURE__ */ oe({
|
|
69
|
+
...Ae,
|
|
70
|
+
props: /* @__PURE__ */ D({
|
|
71
|
+
...Le,
|
|
72
72
|
items: {
|
|
73
73
|
type: Array,
|
|
74
74
|
default: () => []
|
|
@@ -80,10 +80,10 @@ const me = { key: 1 }, he = ["colspan"], be = { key: 2 }, ke = ["colspan"], Se =
|
|
|
80
80
|
selected: {},
|
|
81
81
|
selectedModifiers: {}
|
|
82
82
|
}),
|
|
83
|
-
emits: /* @__PURE__ */
|
|
84
|
-
setup(
|
|
85
|
-
const l =
|
|
86
|
-
|
|
83
|
+
emits: /* @__PURE__ */ D(["update:sort", "click-row"], ["update:selected"]),
|
|
84
|
+
setup(c, { emit: J }) {
|
|
85
|
+
const l = c, r = ie(c, "selected"), C = ue(/* @__PURE__ */ new Map()), B = m(() => l.items), { list: Q, containerProps: U, wrapperProps: Y } = pe(
|
|
86
|
+
B,
|
|
87
87
|
{
|
|
88
88
|
disabled: !l.virtualList,
|
|
89
89
|
itemHeight: l.virtualListItemHeight || 54,
|
|
@@ -92,152 +92,152 @@ const me = { key: 1 }, he = ["colspan"], be = { key: 2 }, ke = ["colspan"], Se =
|
|
|
92
92
|
overscan: l.virtualListOverscan
|
|
93
93
|
}
|
|
94
94
|
);
|
|
95
|
-
function
|
|
95
|
+
function f(e, n) {
|
|
96
96
|
if (!l.keyProp || !e || typeof e != "object" || e === null)
|
|
97
|
-
return
|
|
97
|
+
return n;
|
|
98
98
|
const t = e[l.keyProp];
|
|
99
|
-
return t == null ? (console.warn(`[XTable] keyProp "${l.keyProp}" is undefined/null for item at index ${
|
|
99
|
+
return t == null ? (console.warn(`[XTable] keyProp "${l.keyProp}" is undefined/null for item at index ${n}. Falling back to index.`), n) : typeof t != "string" && typeof t != "number" ? (console.warn(`[XTable] keyProp "${l.keyProp}" must be a string or number, got ${typeof t}. Falling back to index.`), n) : t;
|
|
100
100
|
}
|
|
101
|
-
function
|
|
101
|
+
function F(e) {
|
|
102
102
|
return e.index;
|
|
103
103
|
}
|
|
104
|
-
const M =
|
|
105
|
-
function
|
|
104
|
+
const M = J;
|
|
105
|
+
function Z(e, n) {
|
|
106
106
|
if (e)
|
|
107
|
-
for (let t = 0; t <
|
|
108
|
-
const { 0:
|
|
109
|
-
if (e ===
|
|
107
|
+
for (let t = 0; t < n.length; t++) {
|
|
108
|
+
const { 0: a, 1: o } = n[t].split(",");
|
|
109
|
+
if (e === a)
|
|
110
110
|
return parseInt(o) > 0 ? 1 : -1;
|
|
111
111
|
}
|
|
112
112
|
}
|
|
113
113
|
function _(e) {
|
|
114
|
-
const
|
|
114
|
+
const n = l.sort.slice(0);
|
|
115
115
|
let t = !1;
|
|
116
|
-
for (let
|
|
117
|
-
const { 0: o, 1:
|
|
116
|
+
for (let a = 0; a < n.length; a++) {
|
|
117
|
+
const { 0: o, 1: S } = n[a].split(",");
|
|
118
118
|
if (o === e.value) {
|
|
119
|
-
if (t = !0,
|
|
120
|
-
|
|
119
|
+
if (t = !0, S === "-1") {
|
|
120
|
+
n.splice(a, 1, `${e.value},1`);
|
|
121
121
|
break;
|
|
122
|
-
} else if (
|
|
123
|
-
|
|
122
|
+
} else if (S === "1") {
|
|
123
|
+
n.splice(a, 1);
|
|
124
124
|
break;
|
|
125
125
|
}
|
|
126
126
|
}
|
|
127
127
|
}
|
|
128
|
-
t ||
|
|
128
|
+
t || n.push(`${e.value},-1`), M("update:sort", n);
|
|
129
129
|
}
|
|
130
|
-
const
|
|
131
|
-
function ee(e,
|
|
132
|
-
if (!
|
|
130
|
+
const A = /* @__PURE__ */ new Map();
|
|
131
|
+
function ee(e, n) {
|
|
132
|
+
if (!n || !e)
|
|
133
133
|
return "";
|
|
134
134
|
let t;
|
|
135
|
-
return Array.isArray(
|
|
135
|
+
return Array.isArray(n) ? t = n : A.has(n) ? t = A.get(n) : (t = n.match(/([^[.\]])+/g), t && A.set(n, t)), !t || t.length === 0 ? "" : t.reduce((o, S) => o == null || typeof o != "object" ? null : o[S], e) ?? "";
|
|
136
136
|
}
|
|
137
|
-
const x =
|
|
137
|
+
const x = m(() => l.selectable ? B.value.map((e, n) => f(e, n)) : []), V = m(() => !l.selectable || l.singleSelect ? /* @__PURE__ */ new Set() : Array.isArray(r.value) ? new Set(r.value) : /* @__PURE__ */ new Set()), z = m(() => {
|
|
138
138
|
if (!l.selectable || l.singleSelect || !Array.isArray(r.value) || r.value.length === 0)
|
|
139
139
|
return !1;
|
|
140
140
|
const e = x.value.length;
|
|
141
141
|
return e === 0 ? !1 : r.value.length === e;
|
|
142
|
-
}), T =
|
|
142
|
+
}), T = m(() => {
|
|
143
143
|
if (!l.selectable || l.singleSelect || !Array.isArray(r.value) || r.value.length === 0)
|
|
144
144
|
return !1;
|
|
145
145
|
const e = x.value.length;
|
|
146
146
|
return e === 0 ? !1 : r.value.length > 0 && r.value.length !== e;
|
|
147
147
|
});
|
|
148
|
-
function
|
|
149
|
-
return l.selectable ? l.singleSelect ? r.value === e :
|
|
148
|
+
function R(e) {
|
|
149
|
+
return l.selectable ? l.singleSelect ? r.value === e : V.value.has(e) : !1;
|
|
150
150
|
}
|
|
151
151
|
function N(e) {
|
|
152
|
-
l.selectable && (l.singleSelect ? r.value = r.value === e ? void 0 : e : (Array.isArray(r.value) || (r.value = []),
|
|
152
|
+
l.selectable && (l.singleSelect ? r.value = r.value === e ? void 0 : e : (Array.isArray(r.value) || (r.value = []), V.value.has(e) ? r.value = r.value.filter((n) => n !== e) : r.value = [...r.value, e]));
|
|
153
153
|
}
|
|
154
|
-
function
|
|
155
|
-
!l.selectable || l.singleSelect || (
|
|
154
|
+
function X() {
|
|
155
|
+
!l.selectable || l.singleSelect || (z.value || T.value ? r.value = [] : r.value = x.value);
|
|
156
156
|
}
|
|
157
157
|
function te(e) {
|
|
158
158
|
if (!l.expandable)
|
|
159
159
|
return;
|
|
160
|
-
const
|
|
161
|
-
|
|
160
|
+
const n = f(e.data, F(e));
|
|
161
|
+
C.value.set(n, !C.value.get(n));
|
|
162
162
|
}
|
|
163
163
|
function P(e) {
|
|
164
164
|
if (!l.expandable)
|
|
165
165
|
return !1;
|
|
166
|
-
const
|
|
167
|
-
return
|
|
166
|
+
const n = f(e.data, F(e));
|
|
167
|
+
return C.value.get(n) ?? !1;
|
|
168
168
|
}
|
|
169
|
-
function le(e,
|
|
170
|
-
const t =
|
|
169
|
+
function le(e, n) {
|
|
170
|
+
const t = F(n);
|
|
171
171
|
if (l.selectable && l.singleSelect) {
|
|
172
|
-
const
|
|
173
|
-
N(
|
|
172
|
+
const a = f(e, t);
|
|
173
|
+
N(a);
|
|
174
174
|
}
|
|
175
175
|
M("click-row", e, t);
|
|
176
176
|
}
|
|
177
|
-
const H =
|
|
177
|
+
const H = m(() => {
|
|
178
178
|
let e = l.headers.length;
|
|
179
179
|
return l.selectable && !l.singleSelect && e++, l.expandable && e++, e;
|
|
180
180
|
});
|
|
181
|
-
|
|
182
|
-
const
|
|
183
|
-
e.forEach((t,
|
|
184
|
-
|
|
185
|
-
}), l.expandable &&
|
|
186
|
-
|
|
187
|
-
}), l.selectable && l.autoClearSelected && (l.singleSelect ?
|
|
181
|
+
de(B, (e) => {
|
|
182
|
+
const n = /* @__PURE__ */ new Set();
|
|
183
|
+
e.forEach((t, a) => {
|
|
184
|
+
n.add(f(t, a));
|
|
185
|
+
}), l.expandable && C.value.forEach((t, a) => {
|
|
186
|
+
n.has(a) || C.value.delete(a);
|
|
187
|
+
}), l.selectable && l.autoClearSelected && (l.singleSelect ? n.has(r.value) || (r.value = void 0) : Array.isArray(r.value) && r.value.length > 0 && (r.value = r.value.filter((t) => n.has(t))));
|
|
188
188
|
}, { immediate: !0 });
|
|
189
|
-
const { styles:
|
|
190
|
-
return (e,
|
|
191
|
-
class: [
|
|
192
|
-
},
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
189
|
+
const ne = ce(), ae = m(() => Object.keys(ne).some((e) => e.startsWith("footer-"))), { styles: re, classes: I, className: se } = fe("Table", {}, l);
|
|
190
|
+
return (e, n) => (s(), i("div", W({
|
|
191
|
+
class: [p(se), p(I).wrapper]
|
|
192
|
+
}, p(U)), [
|
|
193
|
+
g(e.$slots, "title"),
|
|
194
|
+
g(e.$slots, "actions"),
|
|
195
|
+
h("div", W(p(Y), {
|
|
196
196
|
class: ["relative", {
|
|
197
197
|
"!h-auto": l.loading
|
|
198
198
|
}]
|
|
199
199
|
}), [
|
|
200
|
-
|
|
201
|
-
style: K(
|
|
202
|
-
class:
|
|
200
|
+
h("table", {
|
|
201
|
+
style: K(p(re)),
|
|
202
|
+
class: k(p(I).table)
|
|
203
203
|
}, [
|
|
204
|
-
v(
|
|
205
|
-
default:
|
|
206
|
-
l.selectable && !l.singleSelect ? (s(),
|
|
204
|
+
v(ge, { "sticky-header": e.stickyHeader }, {
|
|
205
|
+
default: u(() => [
|
|
206
|
+
l.selectable && !l.singleSelect ? (s(), d(O, {
|
|
207
207
|
key: 0,
|
|
208
208
|
width: "40",
|
|
209
209
|
class: "!pl-3.5 !pr-0.5 !py-2.5 cursor-pointer",
|
|
210
|
-
onClick:
|
|
210
|
+
onClick: X
|
|
211
211
|
}, {
|
|
212
|
-
default:
|
|
213
|
-
v(
|
|
214
|
-
"model-value":
|
|
212
|
+
default: u(() => [
|
|
213
|
+
v(G, {
|
|
214
|
+
"model-value": z.value || T.value,
|
|
215
215
|
indeterminate: T.value,
|
|
216
216
|
"hide-footer": "",
|
|
217
217
|
"aria-label": "Select all rows",
|
|
218
218
|
"skip-form-registry": "",
|
|
219
|
-
onClick: L(
|
|
219
|
+
onClick: L(X, ["prevent", "stop"])
|
|
220
220
|
}, null, 8, ["model-value", "indeterminate"])
|
|
221
221
|
]),
|
|
222
222
|
_: 1
|
|
223
|
-
})) :
|
|
224
|
-
e.expandable ? (s(),
|
|
223
|
+
})) : y("", !0),
|
|
224
|
+
e.expandable ? (s(), d(O, {
|
|
225
225
|
key: 1,
|
|
226
226
|
width: "48",
|
|
227
227
|
class: "!p-0"
|
|
228
|
-
})) :
|
|
229
|
-
(s(!0), i(
|
|
230
|
-
key:
|
|
228
|
+
})) : y("", !0),
|
|
229
|
+
(s(!0), i(b, null, $(e.headers, (t, a) => (s(), d(O, {
|
|
230
|
+
key: a,
|
|
231
231
|
"text-align": t.align,
|
|
232
|
-
sort:
|
|
232
|
+
sort: Z(t.value, e.sort),
|
|
233
233
|
sortable: t.sortable,
|
|
234
234
|
width: t.width,
|
|
235
235
|
tooltip: t.tooltip,
|
|
236
236
|
onClick: (o) => t.sortable ? _(t) : null
|
|
237
237
|
}, {
|
|
238
|
-
default:
|
|
239
|
-
|
|
240
|
-
|
|
238
|
+
default: u(() => [
|
|
239
|
+
g(e.$slots, `header-${t.value}`, { header: t }, () => [
|
|
240
|
+
j(q(t.text), 1)
|
|
241
241
|
])
|
|
242
242
|
]),
|
|
243
243
|
_: 2
|
|
@@ -245,24 +245,24 @@ const me = { key: 1 }, he = ["colspan"], be = { key: 2 }, ke = ["colspan"], Se =
|
|
|
245
245
|
]),
|
|
246
246
|
_: 3
|
|
247
247
|
}, 8, ["sticky-header"]),
|
|
248
|
-
v(
|
|
249
|
-
default:
|
|
250
|
-
e.loading ? (s(!0), i(
|
|
251
|
-
key:
|
|
248
|
+
v(p(ve), null, {
|
|
249
|
+
default: u(() => [
|
|
250
|
+
e.loading ? (s(!0), i(b, { key: 0 }, $(Number(e.loadingLines), (t, a) => (s(), d(E, {
|
|
251
|
+
key: a,
|
|
252
252
|
striped: e.striped
|
|
253
253
|
}, {
|
|
254
|
-
default:
|
|
255
|
-
(s(!0), i(
|
|
256
|
-
key:
|
|
254
|
+
default: u(() => [
|
|
255
|
+
(s(!0), i(b, null, $(e.headers, (o, S) => (s(), d(w, {
|
|
256
|
+
key: S,
|
|
257
257
|
"text-align": o.align,
|
|
258
258
|
width: o.width,
|
|
259
259
|
dense: e.dense,
|
|
260
260
|
fixed: e.fixed
|
|
261
261
|
}, {
|
|
262
|
-
default:
|
|
263
|
-
|
|
264
|
-
v(
|
|
265
|
-
class:
|
|
262
|
+
default: u(() => [
|
|
263
|
+
g(e.$slots, `loading-${o.value}`, { item: t }, () => [
|
|
264
|
+
v(me, {
|
|
265
|
+
class: k(["max-w-[60%]", {
|
|
266
266
|
"mx-auto": o.align === "center",
|
|
267
267
|
"ml-auto": o.align === "right"
|
|
268
268
|
}]),
|
|
@@ -274,69 +274,69 @@ const me = { key: 1 }, he = ["colspan"], be = { key: 2 }, ke = ["colspan"], Se =
|
|
|
274
274
|
}, 1032, ["text-align", "width", "dense", "fixed"]))), 128))
|
|
275
275
|
]),
|
|
276
276
|
_: 2
|
|
277
|
-
}, 1032, ["striped"]))), 128)) : e.error ? (s(), i("tr",
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
], 8,
|
|
281
|
-
])) :
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
], 8,
|
|
285
|
-
])) : (s(!0), i(
|
|
286
|
-
key:
|
|
277
|
+
}, 1032, ["striped"]))), 128)) : e.error ? (s(), i("tr", be, [
|
|
278
|
+
h("td", { colspan: H.value }, [
|
|
279
|
+
g(e.$slots, "error")
|
|
280
|
+
], 8, we)
|
|
281
|
+
])) : !B.value || B.value.length === 0 ? (s(), i("tr", Se, [
|
|
282
|
+
h("td", { colspan: H.value }, [
|
|
283
|
+
g(e.$slots, "empty")
|
|
284
|
+
], 8, $e)
|
|
285
|
+
])) : (s(!0), i(b, { key: 3 }, $(p(Q), (t) => (s(), i(b, {
|
|
286
|
+
key: f(t.data, t.index)
|
|
287
287
|
}, [
|
|
288
|
-
v(
|
|
289
|
-
pointer: e.pointer || !!
|
|
288
|
+
v(E, {
|
|
289
|
+
pointer: e.pointer || !!c.toFn || !!c.hrefFn,
|
|
290
290
|
striped: e.striped,
|
|
291
|
-
selected:
|
|
291
|
+
selected: R(f(t.data, t.index)),
|
|
292
292
|
"single-select": e.singleSelect,
|
|
293
|
-
onClick: (
|
|
293
|
+
onClick: (a) => le(t.data, t)
|
|
294
294
|
}, {
|
|
295
|
-
default:
|
|
296
|
-
l.selectable && !e.singleSelect ? (s(),
|
|
295
|
+
default: u(() => [
|
|
296
|
+
l.selectable && !e.singleSelect ? (s(), d(w, {
|
|
297
297
|
key: 0,
|
|
298
298
|
width: "40",
|
|
299
299
|
class: "!pl-3.5 !pr-0.5 cursor-pointer",
|
|
300
|
-
onClick: L((
|
|
300
|
+
onClick: L((a) => N(f(t.data, t.index)), ["stop"])
|
|
301
301
|
}, {
|
|
302
|
-
default:
|
|
303
|
-
v(
|
|
304
|
-
"model-value":
|
|
302
|
+
default: u(() => [
|
|
303
|
+
v(G, {
|
|
304
|
+
"model-value": R(f(t.data, t.index)),
|
|
305
305
|
"hide-footer": "",
|
|
306
|
-
"aria-label": `Select row ${
|
|
306
|
+
"aria-label": `Select row ${F(t) + 1}`,
|
|
307
307
|
"skip-form-registry": "",
|
|
308
|
-
onClick: L((
|
|
308
|
+
onClick: L((a) => N(f(t.data, t.index)), ["prevent", "stop"])
|
|
309
309
|
}, null, 8, ["model-value", "aria-label", "onClick"])
|
|
310
310
|
]),
|
|
311
311
|
_: 2
|
|
312
|
-
}, 1032, ["onClick"])) :
|
|
313
|
-
e.expandable ? (s(),
|
|
312
|
+
}, 1032, ["onClick"])) : y("", !0),
|
|
313
|
+
e.expandable ? (s(), d(w, {
|
|
314
314
|
key: 1,
|
|
315
315
|
width: "48",
|
|
316
316
|
class: "!p-1"
|
|
317
317
|
}, {
|
|
318
|
-
default:
|
|
319
|
-
|
|
318
|
+
default: u(() => [
|
|
319
|
+
h("button", {
|
|
320
320
|
type: "button",
|
|
321
|
-
class:
|
|
322
|
-
onClick: L((
|
|
321
|
+
class: k(["px-3 p-2", [e.dense ? "p-0.5" : "px-3 py-2"]]),
|
|
322
|
+
onClick: L((a) => te(t), ["stop"])
|
|
323
323
|
}, [
|
|
324
|
-
v(
|
|
325
|
-
icon:
|
|
324
|
+
v(he, {
|
|
325
|
+
icon: p(ke),
|
|
326
326
|
size: e.dense ? "xs" : "md",
|
|
327
|
-
class:
|
|
327
|
+
class: k(["transition-transform", {
|
|
328
328
|
"rotate-180": P(t)
|
|
329
329
|
}])
|
|
330
330
|
}, null, 8, ["icon", "size", "class"])
|
|
331
|
-
], 10,
|
|
331
|
+
], 10, Ce)
|
|
332
332
|
]),
|
|
333
333
|
_: 2
|
|
334
|
-
}, 1024)) :
|
|
335
|
-
(s(!0), i(
|
|
334
|
+
}, 1024)) : y("", !0),
|
|
335
|
+
(s(!0), i(b, null, $(e.headers, (a, o) => (s(), d(w, {
|
|
336
336
|
key: o,
|
|
337
|
-
"text-align":
|
|
338
|
-
truncate:
|
|
339
|
-
width:
|
|
337
|
+
"text-align": a.align,
|
|
338
|
+
truncate: a.truncate,
|
|
339
|
+
width: a.width,
|
|
340
340
|
dense: e.dense,
|
|
341
341
|
style: K([l.virtualList ? {
|
|
342
342
|
height: `${l.virtualListItemHeight}px`,
|
|
@@ -344,15 +344,15 @@ const me = { key: 1 }, he = ["colspan"], be = { key: 2 }, ke = ["colspan"], Se =
|
|
|
344
344
|
overflow: "hidden",
|
|
345
345
|
whiteSpace: "nowrap"
|
|
346
346
|
} : {}]),
|
|
347
|
-
href:
|
|
348
|
-
to:
|
|
349
|
-
target:
|
|
347
|
+
href: c.hrefFn ? c.hrefFn(t.data) : void 0,
|
|
348
|
+
to: c.toFn ? c.toFn(t.data) : void 0,
|
|
349
|
+
target: c.hrefFn ? c.hrefTarget : void 0
|
|
350
350
|
}, {
|
|
351
|
-
default:
|
|
352
|
-
|
|
351
|
+
default: u(() => [
|
|
352
|
+
g(e.$slots, `item-${a.value}`, {
|
|
353
353
|
item: t.data
|
|
354
354
|
}, () => [
|
|
355
|
-
|
|
355
|
+
j(q(ee(t.data, a.value)), 1)
|
|
356
356
|
])
|
|
357
357
|
]),
|
|
358
358
|
_: 2
|
|
@@ -362,33 +362,63 @@ const me = { key: 1 }, he = ["colspan"], be = { key: 2 }, ke = ["colspan"], Se =
|
|
|
362
362
|
}, 1032, ["pointer", "striped", "selected", "single-select", "onClick"]),
|
|
363
363
|
e.expandable ? (s(), i("tr", {
|
|
364
364
|
key: 0,
|
|
365
|
-
class:
|
|
365
|
+
class: k({ hidden: !P(t) })
|
|
366
366
|
}, [
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
class:
|
|
367
|
+
h("td", { colspan: H.value }, [
|
|
368
|
+
h("div", {
|
|
369
|
+
class: k(["overflow-hidden transition-opacity", [P(t) ? "" : "opacity-0 max-h-0"]])
|
|
370
370
|
}, [
|
|
371
|
-
|
|
371
|
+
g(e.$slots, "expanded-row", {
|
|
372
372
|
item: t.data
|
|
373
373
|
})
|
|
374
374
|
], 2)
|
|
375
|
-
], 8,
|
|
376
|
-
], 2)) :
|
|
375
|
+
], 8, Be)
|
|
376
|
+
], 2)) : y("", !0)
|
|
377
377
|
], 64))), 128))
|
|
378
378
|
]),
|
|
379
379
|
_: 3
|
|
380
|
-
})
|
|
380
|
+
}),
|
|
381
|
+
g(e.$slots, "footer", {}, () => [
|
|
382
|
+
ae.value && !e.loading ? (s(), i("tfoot", Fe, [
|
|
383
|
+
v(E, null, {
|
|
384
|
+
default: u(() => [
|
|
385
|
+
l.selectable && !l.singleSelect ? (s(), d(w, {
|
|
386
|
+
key: 0,
|
|
387
|
+
width: "40",
|
|
388
|
+
class: "!pl-3.5 !pr-0.5"
|
|
389
|
+
})) : y("", !0),
|
|
390
|
+
e.expandable ? (s(), d(w, {
|
|
391
|
+
key: 1,
|
|
392
|
+
width: "48",
|
|
393
|
+
class: "!p-0"
|
|
394
|
+
})) : y("", !0),
|
|
395
|
+
(s(!0), i(b, null, $(e.headers, (t, a) => (s(), d(w, {
|
|
396
|
+
key: a,
|
|
397
|
+
"text-align": t.align,
|
|
398
|
+
width: t.width,
|
|
399
|
+
dense: e.dense
|
|
400
|
+
}, {
|
|
401
|
+
default: u(() => [
|
|
402
|
+
g(e.$slots, `footer-${t.value}`, { header: t })
|
|
403
|
+
]),
|
|
404
|
+
_: 2
|
|
405
|
+
}, 1032, ["text-align", "width", "dense"]))), 128))
|
|
406
|
+
]),
|
|
407
|
+
_: 3
|
|
408
|
+
})
|
|
409
|
+
])) : y("", !0)
|
|
410
|
+
])
|
|
381
411
|
], 6),
|
|
382
412
|
e.loading ? (s(), i("div", {
|
|
383
413
|
key: 0,
|
|
384
|
-
class:
|
|
414
|
+
class: k(p(I).loadingWrapper)
|
|
385
415
|
}, [
|
|
386
|
-
v(
|
|
387
|
-
], 2)) :
|
|
416
|
+
v(ye, { size: "lg" })
|
|
417
|
+
], 2)) : y("", !0)
|
|
388
418
|
], 16)
|
|
389
419
|
], 16));
|
|
390
420
|
}
|
|
391
421
|
});
|
|
392
422
|
export {
|
|
393
|
-
|
|
423
|
+
De as default
|
|
394
424
|
};
|