@indielayer/ui 1.15.3 → 1.17.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/components/menu/DocsMenu.vue +3 -0
- package/docs/pages/component/infiniteLoader/composable.vue +168 -0
- package/docs/pages/component/infiniteLoader/index.vue +36 -0
- package/docs/pages/component/infiniteLoader/usage.vue +161 -0
- package/docs/pages/component/table/usage.vue +13 -0
- package/docs/pages/component/virtualGrid/index.vue +29 -0
- package/docs/pages/component/virtualGrid/usage.vue +20 -0
- package/docs/pages/component/virtualList/dynamicHeight.vue +75 -0
- package/docs/pages/component/virtualList/index.vue +36 -0
- package/docs/pages/component/virtualList/usage.vue +17 -0
- package/docs/search/components.json +1 -1
- package/lib/components/select/Select.vue.js +35 -35
- package/lib/components/table/Table.vue.d.ts +9 -0
- package/lib/components/table/Table.vue.js +190 -160
- package/lib/components/tooltip/Tooltip.vue.js +64 -52
- package/lib/composables/useVirtualList.d.ts +1 -1
- package/lib/index.d.ts +1 -0
- package/lib/index.js +88 -76
- package/lib/index.umd.js +4 -4
- package/lib/install.js +15 -7
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/lib/virtual/components/infiniteLoader/InfiniteLoader.test.d.ts +1 -0
- package/lib/virtual/components/infiniteLoader/InfiniteLoader.vue.d.ts +49 -0
- package/lib/virtual/components/infiniteLoader/InfiniteLoader.vue.js +21 -0
- package/lib/virtual/components/infiniteLoader/InfiniteLoader.vue2.js +4 -0
- package/lib/virtual/components/virtualGrid/VirtualGrid.vue.d.ts +185 -0
- package/lib/virtual/components/virtualGrid/VirtualGrid.vue.js +241 -0
- package/lib/virtual/components/virtualGrid/VirtualGrid.vue2.js +4 -0
- package/lib/virtual/components/virtualGrid/types.d.ts +138 -0
- package/lib/virtual/components/virtualList/VirtualList.test.d.ts +1 -0
- package/lib/virtual/components/virtualList/VirtualList.vue.d.ts +135 -0
- package/lib/virtual/components/virtualList/VirtualList.vue.js +157 -0
- package/lib/virtual/components/virtualList/VirtualList.vue2.js +4 -0
- package/lib/virtual/components/virtualList/isDynamicRowHeight.d.ts +2 -0
- package/lib/virtual/components/virtualList/isDynamicRowHeight.js +6 -0
- package/lib/virtual/components/virtualList/types.d.ts +115 -0
- package/lib/virtual/components/virtualList/useDynamicRowHeight.d.ts +7 -0
- package/lib/virtual/components/virtualList/useDynamicRowHeight.js +69 -0
- package/lib/virtual/components/virtualList/useDynamicRowHeight.test.d.ts +1 -0
- package/lib/virtual/composables/infinite-loader/scanForUnloadedIndices.d.ts +8 -0
- package/lib/virtual/composables/infinite-loader/scanForUnloadedIndices.js +41 -0
- package/lib/virtual/composables/infinite-loader/scanForUnloadedIndices.test.d.ts +1 -0
- package/lib/virtual/composables/infinite-loader/types.d.ts +30 -0
- package/lib/virtual/composables/infinite-loader/useInfiniteLoader.d.ts +6 -0
- package/lib/virtual/composables/infinite-loader/useInfiniteLoader.js +42 -0
- package/lib/virtual/composables/infinite-loader/useInfiniteLoader.test.d.ts +1 -0
- package/lib/virtual/core/createCachedBounds.d.ts +6 -0
- package/lib/virtual/core/createCachedBounds.js +55 -0
- package/lib/virtual/core/getEstimatedSize.d.ts +6 -0
- package/lib/virtual/core/getEstimatedSize.js +22 -0
- package/lib/virtual/core/getOffsetForIndex.d.ts +11 -0
- package/lib/virtual/core/getOffsetForIndex.js +40 -0
- package/lib/virtual/core/getStartStopIndices.d.ts +13 -0
- package/lib/virtual/core/getStartStopIndices.js +31 -0
- package/lib/virtual/core/getStartStopIndices.test.d.ts +1 -0
- package/lib/virtual/core/types.d.ts +11 -0
- package/lib/virtual/core/useCachedBounds.d.ts +7 -0
- package/lib/virtual/core/useCachedBounds.js +18 -0
- package/lib/virtual/core/useIsRtl.d.ts +2 -0
- package/lib/virtual/core/useIsRtl.js +15 -0
- package/lib/virtual/core/useItemSize.d.ts +5 -0
- package/lib/virtual/core/useItemSize.js +27 -0
- package/lib/virtual/core/useVirtualizer.d.ts +33 -0
- package/lib/virtual/core/useVirtualizer.js +171 -0
- package/lib/virtual/index.d.ts +9 -0
- package/lib/virtual/test-utils/mockResizeObserver.d.ts +15 -0
- package/lib/virtual/types.d.ts +2 -0
- package/lib/virtual/utils/adjustScrollOffsetForRtl.d.ts +7 -0
- package/lib/virtual/utils/adjustScrollOffsetForRtl.js +24 -0
- package/lib/virtual/utils/areArraysEqual.d.ts +1 -0
- package/lib/virtual/utils/assert.d.ts +1 -0
- package/lib/virtual/utils/assert.js +7 -0
- package/lib/virtual/utils/getRTLOffsetType.d.ts +2 -0
- package/lib/virtual/utils/getRTLOffsetType.js +13 -0
- package/lib/virtual/utils/getScrollbarSize.d.ts +2 -0
- package/lib/virtual/utils/getScrollbarSize.js +11 -0
- package/lib/virtual/utils/isRtl.d.ts +1 -0
- package/lib/virtual/utils/isRtl.js +12 -0
- package/lib/virtual/utils/parseNumericStyleValue.d.ts +2 -0
- package/lib/virtual/utils/parseNumericStyleValue.js +15 -0
- package/lib/virtual/utils/shallowCompare.d.ts +1 -0
- package/lib/virtual/utils/shallowCompare.js +14 -0
- package/package.json +1 -1
- package/src/components/select/Select.vue +3 -2
- package/src/components/table/Table.vue +23 -2
- package/src/components/tooltip/Tooltip.vue +25 -5
- package/src/composables/useVirtualList.ts +1 -1
- package/src/index.ts +1 -0
- package/src/install.ts +9 -3
- package/src/version.ts +1 -1
- package/src/virtual/README.md +285 -0
- package/src/virtual/components/infiniteLoader/InfiniteLoader.test.ts +96 -0
- package/src/virtual/components/infiniteLoader/InfiniteLoader.vue +18 -0
- package/src/virtual/components/virtualGrid/VirtualGrid.vue +322 -0
- package/src/virtual/components/virtualGrid/types.ts +160 -0
- package/src/virtual/components/virtualList/VirtualList.test.ts +47 -0
- package/src/virtual/components/virtualList/VirtualList.vue +233 -0
- package/src/virtual/components/virtualList/isDynamicRowHeight.ts +13 -0
- package/src/virtual/components/virtualList/types.ts +127 -0
- package/src/virtual/components/virtualList/useDynamicRowHeight.test.ts +183 -0
- package/src/virtual/components/virtualList/useDynamicRowHeight.ts +147 -0
- package/src/virtual/composables/infinite-loader/scanForUnloadedIndices.test.ts +141 -0
- package/src/virtual/composables/infinite-loader/scanForUnloadedIndices.ts +82 -0
- package/src/virtual/composables/infinite-loader/types.ts +36 -0
- package/src/virtual/composables/infinite-loader/useInfiniteLoader.test.ts +236 -0
- package/src/virtual/composables/infinite-loader/useInfiniteLoader.ts +88 -0
- package/src/virtual/core/createCachedBounds.ts +72 -0
- package/src/virtual/core/getEstimatedSize.ts +29 -0
- package/src/virtual/core/getOffsetForIndex.ts +90 -0
- package/src/virtual/core/getStartStopIndices.test.ts +45 -0
- package/src/virtual/core/getStartStopIndices.ts +71 -0
- package/src/virtual/core/types.ts +17 -0
- package/src/virtual/core/useCachedBounds.ts +21 -0
- package/src/virtual/core/useIsRtl.ts +25 -0
- package/src/virtual/core/useItemSize.ts +34 -0
- package/src/virtual/core/useVirtualizer.ts +294 -0
- package/src/virtual/index.ts +25 -0
- package/src/virtual/test-utils/mockResizeObserver.ts +162 -0
- package/src/virtual/types.ts +3 -0
- package/src/virtual/utils/adjustScrollOffsetForRtl.ts +37 -0
- package/src/virtual/utils/areArraysEqual.ts +13 -0
- package/src/virtual/utils/assert.ts +10 -0
- package/src/virtual/utils/getRTLOffsetType.ts +51 -0
- package/src/virtual/utils/getScrollbarSize.ts +24 -0
- package/src/virtual/utils/isRtl.ts +13 -0
- package/src/virtual/utils/parseNumericStyleValue.ts +19 -0
- package/src/virtual/utils/shallowCompare.ts +29 -0
- package/volar.d.ts +3 -0
|
@@ -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: () => []
|
|
@@ -53,7 +53,7 @@ const me = { key: 1 }, he = ["colspan"], be = { key: 2 }, ke = ["colspan"], Se =
|
|
|
53
53
|
},
|
|
54
54
|
virtualListOverscan: {
|
|
55
55
|
type: Number,
|
|
56
|
-
default:
|
|
56
|
+
default: 10
|
|
57
57
|
},
|
|
58
58
|
keyProp: String,
|
|
59
59
|
selectable: Boolean,
|
|
@@ -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
|
};
|