@indielayer/ui 1.8.3 → 1.9.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/menu/usage.vue +1 -0
- package/docs/pages/component/select/usage.vue +17 -5
- package/docs/pages/component/table/index.vue +7 -0
- package/docs/pages/component/table/virtual.vue +53 -0
- package/lib/components/menu/MenuItem.vue.d.ts +3 -3
- package/lib/components/menu/MenuItem.vue.js +1 -1
- package/lib/components/menu/MenuItem.vue2.js +16 -16
- package/lib/components/menu/theme/MenuItem.base.theme.js +30 -30
- package/lib/components/select/Select.vue.d.ts +36 -0
- package/lib/components/select/Select.vue.js +224 -201
- package/lib/components/select/theme/Select.base.theme.js +1 -1
- package/lib/components/table/Table.vue.d.ts +91 -4
- package/lib/components/table/Table.vue.js +214 -180
- package/lib/components/table/TableHead.vue.d.ts +10 -2
- package/lib/components/table/TableHead.vue.js +16 -13
- package/lib/components/table/TableHeader.vue.d.ts +0 -4
- package/lib/components/table/TableHeader.vue.js +9 -10
- package/lib/components/table/theme/TableHead.base.theme.js +7 -4
- package/lib/components/table/theme/TableHead.carbon.theme.js +7 -4
- package/lib/components/table/theme/TableHeader.base.theme.js +3 -3
- package/lib/components/table/theme/TableHeader.carbon.theme.js +1 -1
- package/lib/composables/index.d.ts +1 -0
- package/lib/composables/useVirtualList.d.ts +48 -0
- package/lib/composables/useVirtualList.js +123 -0
- package/lib/index.js +35 -33
- package/lib/index.umd.js +4 -4
- package/lib/node_modules/.pnpm/@vueuse_core@10.2.0_vue@3.3.9_typescript@5.2.2_/node_modules/@vueuse/core/index.js +254 -221
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/package.json +1 -1
- package/src/components/menu/MenuItem.vue +1 -1
- package/src/components/menu/theme/MenuItem.base.theme.ts +8 -8
- package/src/components/select/Select.vue +56 -26
- package/src/components/select/theme/Select.base.theme.ts +1 -1
- package/src/components/table/Table.vue +152 -113
- package/src/components/table/TableHead.vue +6 -2
- package/src/components/table/TableHeader.vue +0 -1
- package/src/components/table/theme/TableHead.base.theme.ts +7 -1
- package/src/components/table/theme/TableHead.carbon.theme.ts +7 -1
- package/src/components/table/theme/TableHeader.base.theme.ts +0 -2
- package/src/components/table/theme/TableHeader.carbon.theme.ts +0 -2
- package/src/composables/index.ts +1 -0
- package/src/composables/useVirtualList.ts +286 -0
- package/src/version.ts +1 -1
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useTheme as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
1
|
+
import { defineComponent as W, computed as q, ref as G, watch as K, openBlock as i, createElementBlock as a, mergeProps as L, unref as n, renderSlot as p, createElementVNode as m, normalizeStyle as N, normalizeClass as c, createVNode as y, withCtx as f, createBlock as g, createCommentVNode as $, Fragment as k, renderList as h, createTextVNode as x, toDisplayString as C } from "vue";
|
|
2
|
+
import { useTheme as M } from "../../composables/useTheme.js";
|
|
3
|
+
import { useVirtualList as Q } from "../../composables/useVirtualList.js";
|
|
4
|
+
import R from "./TableHead.vue.js";
|
|
5
|
+
import H from "./TableHeader.vue.js";
|
|
6
|
+
import U from "./TableBody.js";
|
|
7
|
+
import S from "./TableRow.vue.js";
|
|
7
8
|
import _ from "./TableCell.vue.js";
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import { chevronDownIcon as
|
|
12
|
-
const
|
|
9
|
+
import Y from "../spinner/Spinner.vue.js";
|
|
10
|
+
import Z from "../skeleton/Skeleton.vue.js";
|
|
11
|
+
import j from "../icon/Icon.vue.js";
|
|
12
|
+
import { chevronDownIcon as ee } from "../../common/icons.js";
|
|
13
|
+
const te = { key: 1 }, se = { colspan: "999" }, ie = { key: 2 }, oe = { colspan: "999" }, le = ["onClick"], re = { colspan: "999" }, ae = {
|
|
13
14
|
headers: {
|
|
14
15
|
type: Array,
|
|
15
16
|
default: () => []
|
|
@@ -41,19 +42,30 @@ const Q = { key: 1 }, R = { colspan: "999" }, U = { key: 2 }, Y = { colspan: "99
|
|
|
41
42
|
type: Boolean,
|
|
42
43
|
default: !0
|
|
43
44
|
},
|
|
44
|
-
expandable: Boolean
|
|
45
|
-
|
|
46
|
-
|
|
45
|
+
expandable: Boolean,
|
|
46
|
+
virtualList: Boolean,
|
|
47
|
+
virtualListOffsetTop: Number,
|
|
48
|
+
virtualListOffsetBottom: Number,
|
|
49
|
+
virtualListItemHeight: {
|
|
50
|
+
type: Number,
|
|
51
|
+
default: 54
|
|
52
|
+
},
|
|
53
|
+
virtualListOverscan: {
|
|
54
|
+
type: Number,
|
|
55
|
+
default: 5
|
|
56
|
+
}
|
|
57
|
+
}, ne = { name: "XTable" }, $e = /* @__PURE__ */ W({
|
|
58
|
+
...ne,
|
|
47
59
|
props: {
|
|
48
|
-
...
|
|
60
|
+
...ae,
|
|
49
61
|
items: {
|
|
50
62
|
type: Array,
|
|
51
63
|
default: () => []
|
|
52
64
|
}
|
|
53
65
|
},
|
|
54
66
|
emits: ["update:sort", "click-row"],
|
|
55
|
-
setup(
|
|
56
|
-
const
|
|
67
|
+
setup(O, { emit: I }) {
|
|
68
|
+
const r = O;
|
|
57
69
|
function T(e) {
|
|
58
70
|
try {
|
|
59
71
|
return JSON.parse(JSON.stringify(e));
|
|
@@ -61,12 +73,21 @@ const Q = { key: 1 }, R = { colspan: "999" }, U = { key: 2 }, Y = { colspan: "99
|
|
|
61
73
|
return [];
|
|
62
74
|
}
|
|
63
75
|
}
|
|
64
|
-
const
|
|
65
|
-
|
|
66
|
-
|
|
76
|
+
const b = q(() => r.items), { list: z, containerProps: A, wrapperProps: V } = Q(
|
|
77
|
+
b,
|
|
78
|
+
{
|
|
79
|
+
disabled: !r.virtualList,
|
|
80
|
+
itemHeight: r.virtualListItemHeight || 54,
|
|
81
|
+
topOffset: r.virtualListOffsetTop || 0,
|
|
82
|
+
bottomOffset: r.virtualListOffsetBottom || 0,
|
|
83
|
+
overscan: r.virtualListOverscan
|
|
84
|
+
}
|
|
85
|
+
), v = G([]);
|
|
86
|
+
K(b, (e) => {
|
|
87
|
+
r.expandable && (v.value = T(e));
|
|
67
88
|
}, { immediate: !0 });
|
|
68
|
-
const
|
|
69
|
-
function
|
|
89
|
+
const P = I;
|
|
90
|
+
function D(e, o) {
|
|
70
91
|
if (e)
|
|
71
92
|
for (let t = 0; t < o.length; t++) {
|
|
72
93
|
const { 0: l, 1: s } = o[t].split(",");
|
|
@@ -74,182 +95,195 @@ const Q = { key: 1 }, R = { colspan: "999" }, U = { key: 2 }, Y = { colspan: "99
|
|
|
74
95
|
return parseInt(s) > 0 ? 1 : -1;
|
|
75
96
|
}
|
|
76
97
|
}
|
|
77
|
-
function
|
|
78
|
-
const o =
|
|
98
|
+
function E(e) {
|
|
99
|
+
const o = r.sort.slice(0);
|
|
79
100
|
let t = !1;
|
|
80
101
|
for (let l = 0; l < o.length; l++) {
|
|
81
|
-
const { 0: s, 1:
|
|
102
|
+
const { 0: s, 1: u } = o[l].split(",");
|
|
82
103
|
if (s === e.value) {
|
|
83
|
-
if (t = !0,
|
|
104
|
+
if (t = !0, u === "-1") {
|
|
84
105
|
o.splice(l, 1, `${e.value},1`);
|
|
85
106
|
break;
|
|
86
|
-
} else if (
|
|
107
|
+
} else if (u === "1") {
|
|
87
108
|
o.splice(l, 1);
|
|
88
109
|
break;
|
|
89
110
|
}
|
|
90
111
|
}
|
|
91
112
|
}
|
|
92
|
-
t || o.push(`${e.value},-1`),
|
|
113
|
+
t || o.push(`${e.value},-1`), P("update:sort", o);
|
|
93
114
|
}
|
|
94
|
-
function
|
|
115
|
+
function J(e, o) {
|
|
95
116
|
if (!o)
|
|
96
117
|
return "";
|
|
97
118
|
const t = Array.isArray(o) ? o : o.match(/([^[.\]])+/g);
|
|
98
|
-
return (t == null ? void 0 : t.reduce((s,
|
|
119
|
+
return (t == null ? void 0 : t.reduce((s, u) => s && s[u], e)) ?? "";
|
|
99
120
|
}
|
|
100
|
-
const { styles:
|
|
101
|
-
return (e, o) => (
|
|
102
|
-
class:
|
|
103
|
-
}, [
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
m("
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
"
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
121
|
+
const { styles: X, classes: w, className: F } = M("Table", {}, r);
|
|
122
|
+
return (e, o) => (i(), a("div", L({
|
|
123
|
+
class: [n(F), n(w).wrapper]
|
|
124
|
+
}, n(A)), [
|
|
125
|
+
p(e.$slots, "title"),
|
|
126
|
+
p(e.$slots, "actions"),
|
|
127
|
+
m("div", L(n(V), {
|
|
128
|
+
class: {
|
|
129
|
+
"!h-auto": r.loading
|
|
130
|
+
}
|
|
131
|
+
}), [
|
|
132
|
+
m("table", {
|
|
133
|
+
style: N(n(X)),
|
|
134
|
+
class: c(n(w).table)
|
|
135
|
+
}, [
|
|
136
|
+
y(R, { "sticky-header": e.stickyHeader }, {
|
|
137
|
+
default: f(() => [
|
|
138
|
+
e.expandable ? (i(), g(H, {
|
|
139
|
+
key: 0,
|
|
140
|
+
width: "48",
|
|
141
|
+
class: "!p-0"
|
|
142
|
+
})) : $("", !0),
|
|
143
|
+
(i(!0), a(k, null, h(e.headers, (t, l) => (i(), g(H, {
|
|
144
|
+
key: l,
|
|
145
|
+
"text-align": t.align,
|
|
146
|
+
sort: D(t.value, e.sort),
|
|
147
|
+
sortable: t.sortable,
|
|
148
|
+
width: t.width,
|
|
149
|
+
onClick: (s) => t.sortable ? E(t) : null
|
|
150
|
+
}, {
|
|
151
|
+
default: f(() => [
|
|
152
|
+
p(e.$slots, `header-${t.value}`, { header: t }, () => [
|
|
153
|
+
x(C(t.text), 1)
|
|
154
|
+
])
|
|
155
|
+
]),
|
|
156
|
+
_: 2
|
|
157
|
+
}, 1032, ["text-align", "sort", "sortable", "width", "onClick"]))), 128))
|
|
158
|
+
]),
|
|
159
|
+
_: 3
|
|
160
|
+
}, 8, ["sticky-header"]),
|
|
161
|
+
y(n(U), null, {
|
|
162
|
+
default: f(() => [
|
|
163
|
+
e.loading ? (i(!0), a(k, { key: 0 }, h(Number(e.loadingLines), (t, l) => (i(), g(S, {
|
|
164
|
+
key: l,
|
|
165
|
+
striped: e.striped
|
|
166
|
+
}, {
|
|
167
|
+
default: f(() => [
|
|
168
|
+
(i(!0), a(k, null, h(e.headers, (s, u) => (i(), g(_, {
|
|
169
|
+
key: u,
|
|
170
|
+
"text-align": s.align,
|
|
171
|
+
width: s.width,
|
|
172
|
+
dense: e.dense,
|
|
173
|
+
fixed: e.fixed
|
|
174
|
+
}, {
|
|
175
|
+
default: f(() => [
|
|
176
|
+
p(e.$slots, `loading-${s.value}`, { item: t }, () => [
|
|
177
|
+
y(Z, {
|
|
178
|
+
class: c(["max-w-[60%]", {
|
|
179
|
+
"mx-auto": s.align === "center",
|
|
180
|
+
"ml-auto": s.align === "right"
|
|
181
|
+
}]),
|
|
182
|
+
shape: s.skeletonShape || "line"
|
|
183
|
+
}, null, 8, ["shape", "class"])
|
|
184
|
+
])
|
|
185
|
+
]),
|
|
186
|
+
_: 2
|
|
187
|
+
}, 1032, ["text-align", "width", "dense", "fixed"]))), 128))
|
|
188
|
+
]),
|
|
189
|
+
_: 2
|
|
190
|
+
}, 1032, ["striped"]))), 128)) : e.error ? (i(), a("tr", te, [
|
|
191
|
+
m("td", se, [
|
|
192
|
+
p(e.$slots, "error")
|
|
193
|
+
])
|
|
194
|
+
])) : !b.value || b.value.length === 0 ? (i(), a("tr", ie, [
|
|
195
|
+
m("td", oe, [
|
|
196
|
+
p(e.$slots, "empty")
|
|
130
197
|
])
|
|
131
|
-
]),
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
198
|
+
])) : (i(!0), a(k, { key: 3 }, h(n(z), (t, l) => {
|
|
199
|
+
var s, u;
|
|
200
|
+
return i(), a(k, { key: l }, [
|
|
201
|
+
y(S, {
|
|
202
|
+
pointer: e.pointer,
|
|
203
|
+
striped: e.striped,
|
|
204
|
+
onClick: (d) => e.$emit("click-row", t.data)
|
|
205
|
+
}, {
|
|
206
|
+
default: f(() => [
|
|
207
|
+
e.expandable ? (i(), g(_, {
|
|
208
|
+
key: 0,
|
|
209
|
+
width: "48",
|
|
210
|
+
class: "!p-1"
|
|
211
|
+
}, {
|
|
212
|
+
default: f(() => {
|
|
213
|
+
var d;
|
|
214
|
+
return [
|
|
215
|
+
m("button", {
|
|
216
|
+
type: "button",
|
|
217
|
+
class: c(["px-3 p-2", [e.dense ? "p-0.5" : "px-3 py-2"]]),
|
|
218
|
+
onClick: (B) => v.value[t.index].__expanded = !v.value[t.index].__expanded
|
|
219
|
+
}, [
|
|
220
|
+
y(j, {
|
|
221
|
+
icon: n(ee),
|
|
222
|
+
size: e.dense ? "xs" : "md",
|
|
223
|
+
class: c(["transition-transform", {
|
|
224
|
+
"rotate-180": (d = v.value[t.index]) == null ? void 0 : d.__expanded
|
|
225
|
+
}])
|
|
226
|
+
}, null, 8, ["icon", "size", "class"])
|
|
227
|
+
], 10, le)
|
|
228
|
+
];
|
|
229
|
+
}),
|
|
230
|
+
_: 2
|
|
231
|
+
}, 1024)) : $("", !0),
|
|
232
|
+
(i(!0), a(k, null, h(e.headers, (d, B) => (i(), g(_, {
|
|
233
|
+
key: B,
|
|
234
|
+
"text-align": d.align,
|
|
235
|
+
truncate: d.truncate,
|
|
236
|
+
width: d.width,
|
|
237
|
+
dense: e.dense,
|
|
238
|
+
style: N([r.virtualListItemHeight ? {
|
|
239
|
+
height: `${r.virtualListItemHeight}px`,
|
|
240
|
+
maxHeight: `${r.virtualListItemHeight}px`,
|
|
241
|
+
overflow: "hidden",
|
|
242
|
+
whiteSpace: "nowrap"
|
|
243
|
+
} : {}])
|
|
244
|
+
}, {
|
|
245
|
+
default: f(() => [
|
|
246
|
+
p(e.$slots, `item-${d.value}`, {
|
|
247
|
+
item: t.data
|
|
248
|
+
}, () => [
|
|
249
|
+
x(C(J(t.data, d.value)), 1)
|
|
250
|
+
])
|
|
251
|
+
]),
|
|
252
|
+
_: 2
|
|
253
|
+
}, 1032, ["text-align", "truncate", "width", "dense", "style"]))), 128))
|
|
254
|
+
]),
|
|
255
|
+
_: 2
|
|
256
|
+
}, 1032, ["pointer", "striped", "onClick"]),
|
|
257
|
+
e.expandable ? (i(), a("tr", {
|
|
258
|
+
key: 0,
|
|
259
|
+
class: c({ hidden: !((s = v.value[t.index]) != null && s.__expanded) })
|
|
260
|
+
}, [
|
|
261
|
+
m("td", re, [
|
|
262
|
+
m("div", {
|
|
263
|
+
class: c(["overflow-hidden transition-opacity", [(u = v.value[t.index]) != null && u.__expanded ? "" : "opacity-0 max-h-0"]])
|
|
264
|
+
}, [
|
|
265
|
+
p(e.$slots, "expanded-row", {
|
|
266
|
+
item: t.data
|
|
267
|
+
})
|
|
268
|
+
], 2)
|
|
160
269
|
])
|
|
161
|
-
]),
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
return n(), r(g, { key: l }, [
|
|
177
|
-
y(z, {
|
|
178
|
-
pointer: e.pointer,
|
|
179
|
-
striped: e.striped,
|
|
180
|
-
onClick: (i) => e.$emit("click-row", t)
|
|
181
|
-
}, {
|
|
182
|
-
default: p(() => [
|
|
183
|
-
e.expandable ? (n(), k(_, {
|
|
184
|
-
key: 0,
|
|
185
|
-
width: "48",
|
|
186
|
-
class: "!p-1"
|
|
187
|
-
}, {
|
|
188
|
-
default: p(() => {
|
|
189
|
-
var i;
|
|
190
|
-
return [
|
|
191
|
-
m("button", {
|
|
192
|
-
type: "button",
|
|
193
|
-
class: d(["px-3 p-2", [e.dense ? "p-0.5" : "px-3 py-2"]]),
|
|
194
|
-
onClick: (B) => f.value[l].__expanded = !f.value[l].__expanded
|
|
195
|
-
}, [
|
|
196
|
-
y(K, {
|
|
197
|
-
icon: c(M),
|
|
198
|
-
size: e.dense ? "xs" : "md",
|
|
199
|
-
class: d(["transition-transform", {
|
|
200
|
-
"rotate-180": (i = f.value[l]) == null ? void 0 : i.__expanded
|
|
201
|
-
}])
|
|
202
|
-
}, null, 8, ["icon", "size", "class"])
|
|
203
|
-
], 10, Z)
|
|
204
|
-
];
|
|
205
|
-
}),
|
|
206
|
-
_: 2
|
|
207
|
-
}, 1024)) : h("", !0),
|
|
208
|
-
(n(!0), r(g, null, v(e.headers, (i, B) => (n(), k(_, {
|
|
209
|
-
key: B,
|
|
210
|
-
"text-align": i.align,
|
|
211
|
-
truncate: i.truncate,
|
|
212
|
-
width: i.width,
|
|
213
|
-
dense: e.dense,
|
|
214
|
-
fixed: e.fixed
|
|
215
|
-
}, {
|
|
216
|
-
default: p(() => [
|
|
217
|
-
u(e.$slots, `item-${i.value}`, { item: t }, () => [
|
|
218
|
-
C(N(L(t, i.value)), 1)
|
|
219
|
-
])
|
|
220
|
-
]),
|
|
221
|
-
_: 2
|
|
222
|
-
}, 1032, ["text-align", "truncate", "width", "dense", "fixed"]))), 128))
|
|
223
|
-
]),
|
|
224
|
-
_: 2
|
|
225
|
-
}, 1032, ["pointer", "striped", "onClick"]),
|
|
226
|
-
e.expandable ? (n(), r("tr", {
|
|
227
|
-
key: 0,
|
|
228
|
-
class: d({ hidden: !((s = f.value[l]) != null && s.__expanded) })
|
|
229
|
-
}, [
|
|
230
|
-
m("td", j, [
|
|
231
|
-
m("div", {
|
|
232
|
-
class: d(["overflow-hidden transition-opacity", [(a = f.value[l]) != null && a.__expanded ? "" : "opacity-0 max-h-0"]])
|
|
233
|
-
}, [
|
|
234
|
-
u(e.$slots, "expanded-row", { item: t })
|
|
235
|
-
], 2)
|
|
236
|
-
])
|
|
237
|
-
], 2)) : h("", !0)
|
|
238
|
-
], 64);
|
|
239
|
-
}), 128))
|
|
240
|
-
]),
|
|
241
|
-
_: 3
|
|
242
|
-
}),
|
|
243
|
-
e.loading ? (n(), r("div", {
|
|
244
|
-
key: 0,
|
|
245
|
-
class: d(c(w).loadingWrapper)
|
|
246
|
-
}, [
|
|
247
|
-
y(x, { size: "lg" })
|
|
248
|
-
], 2)) : h("", !0)
|
|
249
|
-
], 6)
|
|
250
|
-
], 2));
|
|
270
|
+
], 2)) : $("", !0)
|
|
271
|
+
], 64);
|
|
272
|
+
}), 128))
|
|
273
|
+
]),
|
|
274
|
+
_: 3
|
|
275
|
+
}),
|
|
276
|
+
e.loading ? (i(), a("div", {
|
|
277
|
+
key: 0,
|
|
278
|
+
class: c(n(w).loadingWrapper)
|
|
279
|
+
}, [
|
|
280
|
+
y(Y, { size: "lg" })
|
|
281
|
+
], 2)) : $("", !0)
|
|
282
|
+
], 6)
|
|
283
|
+
], 16)
|
|
284
|
+
], 16));
|
|
251
285
|
}
|
|
252
286
|
});
|
|
253
287
|
export {
|
|
254
|
-
|
|
288
|
+
$e as default
|
|
255
289
|
};
|
|
@@ -1,11 +1,19 @@
|
|
|
1
1
|
import type { ExtractPublicPropTypes } from 'vue';
|
|
2
2
|
import { type ThemeComponent } from '../../composables/useTheme';
|
|
3
|
-
declare const tableHeadProps: {
|
|
3
|
+
declare const tableHeadProps: {
|
|
4
|
+
stickyHeader: BooleanConstructor;
|
|
5
|
+
};
|
|
4
6
|
export type TableHeadProps = ExtractPublicPropTypes<typeof tableHeadProps>;
|
|
5
7
|
type InternalClasses = 'thead' | 'row';
|
|
6
8
|
export interface TableHeadTheme extends ThemeComponent<TableHeadProps, InternalClasses> {
|
|
7
9
|
}
|
|
8
|
-
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
10
|
+
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
11
|
+
stickyHeader: BooleanConstructor;
|
|
12
|
+
}, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
13
|
+
stickyHeader: BooleanConstructor;
|
|
14
|
+
}>>, {
|
|
15
|
+
stickyHeader: boolean;
|
|
16
|
+
}, {}>, {
|
|
9
17
|
default?(_: {}): any;
|
|
10
18
|
}>;
|
|
11
19
|
export default _default;
|
|
@@ -1,21 +1,24 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useTheme as
|
|
3
|
-
const
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
import { defineComponent as c, openBlock as m, createElementBlock as d, normalizeClass as t, unref as e, normalizeStyle as p, createElementVNode as f, renderSlot as u } from "vue";
|
|
2
|
+
import { useTheme as i } from "../../composables/useTheme.js";
|
|
3
|
+
const _ = {
|
|
4
|
+
stickyHeader: Boolean
|
|
5
|
+
}, h = { name: "XTableHead" }, k = /* @__PURE__ */ c({
|
|
6
|
+
...h,
|
|
7
|
+
props: _,
|
|
8
|
+
setup(a) {
|
|
9
|
+
const o = a, { styles: l, classes: s, className: r } = i("TableHead", {}, o);
|
|
10
|
+
return (n, y) => (m(), d("thead", {
|
|
11
|
+
class: t([e(r), e(s).thead]),
|
|
12
|
+
style: p(e(l))
|
|
10
13
|
}, [
|
|
11
|
-
|
|
12
|
-
class:
|
|
14
|
+
f("tr", {
|
|
15
|
+
class: t(e(s).row)
|
|
13
16
|
}, [
|
|
14
|
-
|
|
17
|
+
u(n.$slots, "default")
|
|
15
18
|
], 2)
|
|
16
19
|
], 6));
|
|
17
20
|
}
|
|
18
21
|
});
|
|
19
22
|
export {
|
|
20
|
-
|
|
23
|
+
k as default
|
|
21
24
|
};
|
|
@@ -15,7 +15,6 @@ declare const tableHeaderProps: {
|
|
|
15
15
|
default: string;
|
|
16
16
|
validator: (value: string) => boolean;
|
|
17
17
|
};
|
|
18
|
-
stickyHeader: BooleanConstructor;
|
|
19
18
|
};
|
|
20
19
|
export type TableHeaderSort = typeof validators.sort[number];
|
|
21
20
|
export type TableHeaderAlign = typeof validators.textAlign[number];
|
|
@@ -34,7 +33,6 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
34
33
|
default: string;
|
|
35
34
|
validator: (value: string) => boolean;
|
|
36
35
|
};
|
|
37
|
-
stickyHeader: BooleanConstructor;
|
|
38
36
|
}, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
39
37
|
sort: {
|
|
40
38
|
type: PropType<1 | -1 | undefined>;
|
|
@@ -46,9 +44,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
46
44
|
default: string;
|
|
47
45
|
validator: (value: string) => boolean;
|
|
48
46
|
};
|
|
49
|
-
stickyHeader: BooleanConstructor;
|
|
50
47
|
}>>, {
|
|
51
|
-
stickyHeader: boolean;
|
|
52
48
|
textAlign: "left" | "right" | "center" | "justify";
|
|
53
49
|
sortable: boolean;
|
|
54
50
|
}, {}>, {
|
|
@@ -5,18 +5,18 @@ const g = /* @__PURE__ */ n("line", {
|
|
|
5
5
|
y1: "5",
|
|
6
6
|
x2: "12",
|
|
7
7
|
y2: "19"
|
|
8
|
-
}, null, -1),
|
|
8
|
+
}, null, -1), v = /* @__PURE__ */ n("polyline", { points: "19 12 12 19 5 12" }, null, -1), k = /* @__PURE__ */ n("line", {
|
|
9
9
|
x1: "12",
|
|
10
10
|
y1: "19",
|
|
11
11
|
x2: "12",
|
|
12
12
|
y2: "5"
|
|
13
|
-
}, null, -1), b = /* @__PURE__ */ n("polyline", { points: "5 12 12 5 19 12" }, null, -1),
|
|
13
|
+
}, null, -1), b = /* @__PURE__ */ n("polyline", { points: "5 12 12 5 19 12" }, null, -1), x = {
|
|
14
14
|
key: 2,
|
|
15
15
|
d: "m3 9l4-4l4 4M7 5v14m14-4l-4 4l-4-4m4 4V5"
|
|
16
16
|
}, r = {
|
|
17
17
|
sort: [1, -1, void 0],
|
|
18
18
|
textAlign: ["left", "center", "right", "justify"]
|
|
19
|
-
},
|
|
19
|
+
}, B = {
|
|
20
20
|
sort: {
|
|
21
21
|
type: Number,
|
|
22
22
|
validator: (t) => r.sort.includes(t)
|
|
@@ -26,14 +26,13 @@ const g = /* @__PURE__ */ n("line", {
|
|
|
26
26
|
type: String,
|
|
27
27
|
default: "left",
|
|
28
28
|
validator: (t) => r.textAlign.includes(t)
|
|
29
|
-
}
|
|
30
|
-
stickyHeader: Boolean
|
|
29
|
+
}
|
|
31
30
|
}, C = { name: "XTableHeader", validators: r }, S = /* @__PURE__ */ m({
|
|
32
31
|
...C,
|
|
33
|
-
props:
|
|
32
|
+
props: B,
|
|
34
33
|
setup(t) {
|
|
35
34
|
const c = t, { styles: u, classes: i, className: p } = _("TableHeader", {}, c);
|
|
36
|
-
return (e,
|
|
35
|
+
return (e, N) => (o(), l("th", {
|
|
37
36
|
style: h(s(u)),
|
|
38
37
|
class: a([s(p), s(i).th, "group/th"])
|
|
39
38
|
}, [
|
|
@@ -55,11 +54,11 @@ const g = /* @__PURE__ */ n("line", {
|
|
|
55
54
|
}, [
|
|
56
55
|
e.sort === -1 ? (o(), l(d, { key: 0 }, [
|
|
57
56
|
g,
|
|
58
|
-
|
|
57
|
+
v
|
|
59
58
|
], 64)) : e.sort === 1 ? (o(), l(d, { key: 1 }, [
|
|
60
|
-
|
|
59
|
+
k,
|
|
61
60
|
b
|
|
62
|
-
], 64)) : (o(), l("path",
|
|
61
|
+
], 64)) : (o(), l("path", x))
|
|
63
62
|
], 2)) : f("", !0)
|
|
64
63
|
], 6));
|
|
65
64
|
}
|
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
const
|
|
1
|
+
const s = {
|
|
2
2
|
classes: {
|
|
3
|
-
thead:
|
|
3
|
+
thead: ({ props: t }) => {
|
|
4
|
+
const e = ["align-bottom bg-secondary-50 dark:bg-secondary-700"];
|
|
5
|
+
return t.stickyHeader && e.push("sticky top-0 z-10"), e;
|
|
6
|
+
},
|
|
4
7
|
row: "text-sm text-secondary-600 dark:text-secondary-200 border-b"
|
|
5
8
|
}
|
|
6
|
-
},
|
|
9
|
+
}, a = s;
|
|
7
10
|
export {
|
|
8
|
-
|
|
11
|
+
a as default
|
|
9
12
|
};
|
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
const
|
|
1
|
+
const s = {
|
|
2
2
|
classes: {
|
|
3
|
-
thead:
|
|
3
|
+
thead: ({ props: e }) => {
|
|
4
|
+
const t = ["align-bottom"];
|
|
5
|
+
return e.stickyHeader && t.push("sticky top-0 z-10"), t;
|
|
6
|
+
},
|
|
4
7
|
row: "text-secondary-900 dark:text-secondary-50"
|
|
5
8
|
}
|
|
6
|
-
},
|
|
9
|
+
}, a = s;
|
|
7
10
|
export {
|
|
8
|
-
|
|
11
|
+
a as default
|
|
9
12
|
};
|
|
@@ -2,11 +2,11 @@ const s = {
|
|
|
2
2
|
classes: {
|
|
3
3
|
th: ({ props: e }) => {
|
|
4
4
|
const t = ["relative py-3 font-semibold text-xs px-3"];
|
|
5
|
-
return e.sortable && t.push("cursor-pointer hover:text-secondary-800 dark:hover:text-secondary-300 transition-colors duration-150 ease-in-out"), e.
|
|
5
|
+
return e.sortable && t.push("cursor-pointer hover:text-secondary-800 dark:hover:text-secondary-300 transition-colors duration-150 ease-in-out"), e.textAlign === "left" && t.push("text-left"), e.textAlign === "right" && t.push("text-right"), e.textAlign === "center" && t.push("text-center"), e.textAlign === "justify" && t.push("text-justify"), t;
|
|
6
6
|
},
|
|
7
7
|
sortIcon: ({ props: e }) => ["absolute stroke-2 w-3 h-3 top-3.5 right-0.5"]
|
|
8
8
|
}
|
|
9
|
-
},
|
|
9
|
+
}, r = s;
|
|
10
10
|
export {
|
|
11
|
-
|
|
11
|
+
r as default
|
|
12
12
|
};
|
|
@@ -2,7 +2,7 @@ const s = {
|
|
|
2
2
|
classes: {
|
|
3
3
|
th: ({ props: e }) => {
|
|
4
4
|
const t = ["relative py-3.5 font-semibold text-sm px-3 bg-secondary-200 dark:bg-secondary-700 select-none"];
|
|
5
|
-
return e.sortable && t.push("cursor-pointer hover:bg-secondary-300 dark:hover:bg-secondary-600 transition-colors duration-150 ease-in-out pr-5"), e.
|
|
5
|
+
return e.sortable && t.push("cursor-pointer hover:bg-secondary-300 dark:hover:bg-secondary-600 transition-colors duration-150 ease-in-out pr-5"), e.textAlign === "left" && t.push("text-left"), e.textAlign === "right" && t.push("text-right"), e.textAlign === "center" && t.push("text-center"), e.textAlign === "justify" && t.push("text-justify"), t;
|
|
6
6
|
},
|
|
7
7
|
sortIcon: ({ props: e }) => ["absolute stroke-2 w-4 h-4 top-4 right-2"]
|
|
8
8
|
}
|