@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.
Files changed (44) hide show
  1. package/docs/pages/component/menu/usage.vue +1 -0
  2. package/docs/pages/component/select/usage.vue +17 -5
  3. package/docs/pages/component/table/index.vue +7 -0
  4. package/docs/pages/component/table/virtual.vue +53 -0
  5. package/lib/components/menu/MenuItem.vue.d.ts +3 -3
  6. package/lib/components/menu/MenuItem.vue.js +1 -1
  7. package/lib/components/menu/MenuItem.vue2.js +16 -16
  8. package/lib/components/menu/theme/MenuItem.base.theme.js +30 -30
  9. package/lib/components/select/Select.vue.d.ts +36 -0
  10. package/lib/components/select/Select.vue.js +224 -201
  11. package/lib/components/select/theme/Select.base.theme.js +1 -1
  12. package/lib/components/table/Table.vue.d.ts +91 -4
  13. package/lib/components/table/Table.vue.js +214 -180
  14. package/lib/components/table/TableHead.vue.d.ts +10 -2
  15. package/lib/components/table/TableHead.vue.js +16 -13
  16. package/lib/components/table/TableHeader.vue.d.ts +0 -4
  17. package/lib/components/table/TableHeader.vue.js +9 -10
  18. package/lib/components/table/theme/TableHead.base.theme.js +7 -4
  19. package/lib/components/table/theme/TableHead.carbon.theme.js +7 -4
  20. package/lib/components/table/theme/TableHeader.base.theme.js +3 -3
  21. package/lib/components/table/theme/TableHeader.carbon.theme.js +1 -1
  22. package/lib/composables/index.d.ts +1 -0
  23. package/lib/composables/useVirtualList.d.ts +48 -0
  24. package/lib/composables/useVirtualList.js +123 -0
  25. package/lib/index.js +35 -33
  26. package/lib/index.umd.js +4 -4
  27. 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
  28. package/lib/version.d.ts +1 -1
  29. package/lib/version.js +1 -1
  30. package/package.json +1 -1
  31. package/src/components/menu/MenuItem.vue +1 -1
  32. package/src/components/menu/theme/MenuItem.base.theme.ts +8 -8
  33. package/src/components/select/Select.vue +56 -26
  34. package/src/components/select/theme/Select.base.theme.ts +1 -1
  35. package/src/components/table/Table.vue +152 -113
  36. package/src/components/table/TableHead.vue +6 -2
  37. package/src/components/table/TableHeader.vue +0 -1
  38. package/src/components/table/theme/TableHead.base.theme.ts +7 -1
  39. package/src/components/table/theme/TableHead.carbon.theme.ts +7 -1
  40. package/src/components/table/theme/TableHeader.base.theme.ts +0 -2
  41. package/src/components/table/theme/TableHeader.carbon.theme.ts +0 -2
  42. package/src/composables/index.ts +1 -0
  43. package/src/composables/useVirtualList.ts +286 -0
  44. package/src/version.ts +1 -1
@@ -1,15 +1,16 @@
1
- import { defineComponent as J, ref as X, watch as F, openBlock as n, createElementBlock as r, normalizeClass as d, unref as c, renderSlot as u, createElementVNode as m, normalizeStyle as O, createVNode as y, withCtx as p, createBlock as k, createCommentVNode as h, Fragment as g, renderList as v, createTextVNode as C, toDisplayString as N } from "vue";
2
- import { useTheme as P } from "../../composables/useTheme.js";
3
- import W from "./TableHead.vue.js";
4
- import S from "./TableHeader.vue.js";
5
- import q from "./TableBody.js";
6
- import z from "./TableRow.vue.js";
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 x from "../spinner/Spinner.vue.js";
9
- import G from "../skeleton/Skeleton.vue.js";
10
- import K from "../icon/Icon.vue.js";
11
- import { chevronDownIcon as M } from "../../common/icons.js";
12
- const Q = { key: 1 }, R = { colspan: "999" }, U = { key: 2 }, Y = { colspan: "999" }, Z = ["onClick"], j = { colspan: "999" }, ee = {
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
- }, te = { name: "XTable" }, fe = /* @__PURE__ */ J({
46
- ...te,
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
- ...ee,
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($, { emit: A }) {
56
- const b = $;
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 f = X([]);
65
- F(() => b.items, (e) => {
66
- b.expandable && (f.value = T(e));
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 H = A;
69
- function V(e, o) {
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 I(e) {
78
- const o = b.sort.slice(0);
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: a } = o[l].split(",");
102
+ const { 0: s, 1: u } = o[l].split(",");
82
103
  if (s === e.value) {
83
- if (t = !0, a === "-1") {
104
+ if (t = !0, u === "-1") {
84
105
  o.splice(l, 1, `${e.value},1`);
85
106
  break;
86
- } else if (a === "1") {
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`), H("update:sort", o);
113
+ t || o.push(`${e.value},-1`), P("update:sort", o);
93
114
  }
94
- function L(e, o) {
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, a) => s && s[a], e)) ?? "";
119
+ return (t == null ? void 0 : t.reduce((s, u) => s && s[u], e)) ?? "";
99
120
  }
100
- const { styles: D, classes: w, className: E } = P("Table", {}, b);
101
- return (e, o) => (n(), r("div", {
102
- class: d([c(E), c(w).wrapper])
103
- }, [
104
- u(e.$slots, "title"),
105
- u(e.$slots, "actions"),
106
- m("table", {
107
- style: O(c(D)),
108
- class: d(c(w).table)
109
- }, [
110
- y(W, null, {
111
- default: p(() => [
112
- e.expandable ? (n(), k(S, {
113
- key: 0,
114
- width: "48",
115
- class: "!p-0",
116
- "sticky-header": e.stickyHeader
117
- }, null, 8, ["sticky-header"])) : h("", !0),
118
- (n(!0), r(g, null, v(e.headers, (t, l) => (n(), k(S, {
119
- key: l,
120
- "sticky-header": e.stickyHeader,
121
- "text-align": t.align,
122
- sort: V(t.value, e.sort),
123
- sortable: t.sortable,
124
- width: t.width,
125
- onClick: (s) => t.sortable ? I(t) : null
126
- }, {
127
- default: p(() => [
128
- u(e.$slots, `header-${t.value}`, { header: t }, () => [
129
- C(N(t.text), 1)
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
- _: 2
133
- }, 1032, ["sticky-header", "text-align", "sort", "sortable", "width", "onClick"]))), 128))
134
- ]),
135
- _: 3
136
- }),
137
- y(c(q), null, {
138
- default: p(() => [
139
- e.loading ? (n(!0), r(g, { key: 0 }, v(Number(e.loadingLines), (t, l) => (n(), k(z, {
140
- key: l,
141
- striped: e.striped
142
- }, {
143
- default: p(() => [
144
- (n(!0), r(g, null, v(e.headers, (s, a) => (n(), k(_, {
145
- key: a,
146
- "text-align": s.align,
147
- width: s.width,
148
- dense: e.dense,
149
- fixed: e.fixed
150
- }, {
151
- default: p(() => [
152
- u(e.$slots, `loading-${s.value}`, { item: t }, () => [
153
- y(G, {
154
- class: d(["max-w-[60%]", {
155
- "mx-auto": s.align === "center",
156
- "ml-auto": s.align === "right"
157
- }]),
158
- shape: s.skeletonShape || "line"
159
- }, null, 8, ["shape", "class"])
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
- _: 2
163
- }, 1032, ["text-align", "width", "dense", "fixed"]))), 128))
164
- ]),
165
- _: 2
166
- }, 1032, ["striped"]))), 128)) : e.error ? (n(), r("tr", Q, [
167
- m("td", R, [
168
- u(e.$slots, "error")
169
- ])
170
- ])) : !$.items || $.items.length === 0 ? (n(), r("tr", U, [
171
- m("td", Y, [
172
- u(e.$slots, "empty")
173
- ])
174
- ])) : (n(!0), r(g, { key: 3 }, v($.items, (t, l) => {
175
- var s, a;
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
- fe as default
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<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}, {}>, {
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 r, openBlock as n, createElementBlock as c, normalizeClass as s, unref as e, normalizeStyle as m, createElementVNode as d, renderSlot as _ } from "vue";
2
- import { useTheme as f } from "../../composables/useTheme.js";
3
- const p = { name: "XTableHead" }, T = /* @__PURE__ */ r({
4
- ...p,
5
- setup(u) {
6
- const { styles: a, classes: t, className: l } = f("TableHead", {}, {});
7
- return (o, i) => (n(), c("thead", {
8
- class: s([e(l), e(t).thead]),
9
- style: m(e(a))
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
- d("tr", {
12
- class: s(e(t).row)
14
+ f("tr", {
15
+ class: t(e(s).row)
13
16
  }, [
14
- _(o.$slots, "default")
17
+ u(n.$slots, "default")
15
18
  ], 2)
16
19
  ], 6));
17
20
  }
18
21
  });
19
22
  export {
20
- T as default
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), k = /* @__PURE__ */ n("polyline", { points: "19 12 12 19 5 12" }, null, -1), v = /* @__PURE__ */ n("line", {
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), B = {
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
- }, x = {
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: x,
32
+ props: B,
34
33
  setup(t) {
35
34
  const c = t, { styles: u, classes: i, className: p } = _("TableHeader", {}, c);
36
- return (e, H) => (o(), l("th", {
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
- k
57
+ v
59
58
  ], 64)) : e.sort === 1 ? (o(), l(d, { key: 1 }, [
60
- v,
59
+ k,
61
60
  b
62
- ], 64)) : (o(), l("path", B))
61
+ ], 64)) : (o(), l("path", x))
63
62
  ], 2)) : f("", !0)
64
63
  ], 6));
65
64
  }
@@ -1,9 +1,12 @@
1
- const e = {
1
+ const s = {
2
2
  classes: {
3
- thead: "align-bottom bg-secondary-50 dark:bg-secondary-700",
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
- }, t = e;
9
+ }, a = s;
7
10
  export {
8
- t as default
11
+ a as default
9
12
  };
@@ -1,9 +1,12 @@
1
- const t = {
1
+ const s = {
2
2
  classes: {
3
- thead: "align-bottom",
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
- }, e = t;
9
+ }, a = s;
7
10
  export {
8
- e as default
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.stickyHeader && t.push("sticky top-0"), 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;
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
- }, i = s;
9
+ }, r = s;
10
10
  export {
11
- i as default
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.stickyHeader && t.push("sticky top-0"), 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;
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
  }