@indielayer/ui 1.13.0 → 1.13.2

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.
@@ -8,7 +8,7 @@ const headers: TableHeader[] = [
8
8
  { text: '#', value: 'id', sortable: true, align: 'center' },
9
9
  { text: 'Title', value: 'title' },
10
10
  { text: 'Description', value: 'description', truncate: true, width: 400 },
11
- { text: 'Published', value: 'published', sortable: true, tooltip: 'Published date' },
11
+ { text: 'Published', value: 'published', sortable: true, tooltip: 'Published date', align: 'center' },
12
12
  { text: 'Status', value: 'status' },
13
13
  ]
14
14
 
@@ -256,7 +256,7 @@ const ol = { class: "relative" }, sl = {
256
256
  if (!N.value)
257
257
  return 0;
258
258
  const e = N.value.querySelectorAll(".x-tag"), t = Array.from(e);
259
- let l = 0, a = 0;
259
+ let l = 0, a = 1;
260
260
  const h = N.value.offsetWidth - 30;
261
261
  for (let p = 0; p < t.length; p++) {
262
262
  const f = t[p];
@@ -20,7 +20,7 @@ declare const tableHeaderProps: {
20
20
  export type TableHeaderSort = typeof validators.sort[number];
21
21
  export type TableHeaderAlign = typeof validators.textAlign[number];
22
22
  export type TableHeaderProps = ExtractPublicPropTypes<typeof tableHeaderProps>;
23
- type InternalClasses = 'th' | 'sortIcon';
23
+ type InternalClasses = 'th' | 'sortIcon' | 'header';
24
24
  export interface TableHeaderTheme extends ThemeComponent<TableHeaderProps, InternalClasses> {
25
25
  }
26
26
  declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<import("vue").ExtractPropTypes<{
@@ -1,43 +1,45 @@
1
- import { defineComponent as g, openBlock as o, createElementBlock as n, normalizeStyle as k, unref as s, normalizeClass as p, createElementVNode as r, renderSlot as c, createBlock as v, createCommentVNode as d, Fragment as u } from "vue";
2
- import { useTheme as b } from "../../composables/useTheme.js";
1
+ import { defineComponent as k, openBlock as o, createElementBlock as r, normalizeStyle as g, unref as n, normalizeClass as a, createElementVNode as s, renderSlot as v, createBlock as b, createCommentVNode as d, Fragment as u } from "vue";
2
+ import { useTheme as c } from "../../composables/useTheme.js";
3
3
  import h from "../tooltip/ToggleTip.vue.js";
4
- const B = { class: "flex items-center gap-1 select-none" }, C = {
4
+ const B = {
5
5
  key: 2,
6
6
  d: "m3 9l4-4l4 4M7 5v14m14-4l-4 4l-4-4m4 4V5"
7
- }, i = {
7
+ }, p = {
8
8
  sort: [1, -1, void 0],
9
9
  textAlign: ["left", "center", "right", "justify"]
10
- }, N = {
10
+ }, C = {
11
11
  sort: {
12
12
  type: Number,
13
- validator: (l) => i.sort.includes(l)
13
+ validator: (l) => p.sort.includes(l)
14
14
  },
15
15
  sortable: Boolean,
16
16
  textAlign: {
17
17
  type: String,
18
18
  default: "left",
19
- validator: (l) => i.textAlign.includes(l)
19
+ validator: (l) => p.textAlign.includes(l)
20
20
  },
21
21
  tooltip: String
22
- }, S = { name: "XTableHeader", validators: i }, T = /* @__PURE__ */ g({
23
- ...S,
24
- props: N,
22
+ }, N = { name: "XTableHeader", validators: p }, T = /* @__PURE__ */ k({
23
+ ...N,
24
+ props: C,
25
25
  setup(l) {
26
- const m = l, { styles: y, classes: a, className: f } = b("TableHeader", {}, m);
27
- return (e, t) => (o(), n("th", {
28
- style: k(s(y)),
29
- class: p([s(f), s(a).th, "group/th"])
26
+ const m = l, { styles: y, classes: i, className: f } = c("TableHeader", {}, m);
27
+ return (e, t) => (o(), r("th", {
28
+ style: g(n(y)),
29
+ class: a([n(f), n(i).th, "group/th"])
30
30
  }, [
31
- r("div", B, [
32
- c(e.$slots, "default"),
33
- e.tooltip ? (o(), v(h, {
31
+ s("div", {
32
+ class: a(n(i).header)
33
+ }, [
34
+ v(e.$slots, "default"),
35
+ e.tooltip ? (o(), b(h, {
34
36
  key: 0,
35
37
  content: e.tooltip
36
38
  }, null, 8, ["content"])) : d("", !0),
37
- e.sortable ? (o(), n("svg", {
39
+ e.sortable ? (o(), r("svg", {
38
40
  key: 1,
39
- class: p(["shrink-0", [
40
- s(a).sortIcon,
41
+ class: a(["shrink-0", [
42
+ n(i).sortIcon,
41
43
  [e.sort && [1, -1].includes(e.sort) ? "" : "invisible group-hover/th:visible"],
42
44
  [e.sort !== -1 && e.sort !== 1 ? "text-secondary-400" : "text-primary-700"]
43
45
  ]]),
@@ -50,25 +52,25 @@ const B = { class: "flex items-center gap-1 select-none" }, C = {
50
52
  fill: "none",
51
53
  role: "presentation"
52
54
  }, [
53
- e.sort === -1 ? (o(), n(u, { key: 0 }, [
54
- t[0] || (t[0] = r("line", {
55
+ e.sort === -1 ? (o(), r(u, { key: 0 }, [
56
+ t[0] || (t[0] = s("line", {
55
57
  x1: "12",
56
58
  y1: "5",
57
59
  x2: "12",
58
60
  y2: "19"
59
61
  }, null, -1)),
60
- t[1] || (t[1] = r("polyline", { points: "19 12 12 19 5 12" }, null, -1))
61
- ], 64)) : e.sort === 1 ? (o(), n(u, { key: 1 }, [
62
- t[2] || (t[2] = r("line", {
62
+ t[1] || (t[1] = s("polyline", { points: "19 12 12 19 5 12" }, null, -1))
63
+ ], 64)) : e.sort === 1 ? (o(), r(u, { key: 1 }, [
64
+ t[2] || (t[2] = s("line", {
63
65
  x1: "12",
64
66
  y1: "19",
65
67
  x2: "12",
66
68
  y2: "5"
67
69
  }, null, -1)),
68
- t[3] || (t[3] = r("polyline", { points: "5 12 12 5 19 12" }, null, -1))
69
- ], 64)) : (o(), n("path", C))
70
+ t[3] || (t[3] = s("polyline", { points: "5 12 12 5 19 12" }, null, -1))
71
+ ], 64)) : (o(), r("path", B))
70
72
  ], 2)) : d("", !0)
71
- ])
73
+ ], 2)
72
74
  ], 6));
73
75
  }
74
76
  });
@@ -2,7 +2,11 @@ const s = {
2
2
  classes: {
3
3
  th: ({ props: e }) => {
4
4
  const t = ["relative p-2.5 font-medium"];
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;
5
+ return e.sortable && t.push("cursor-pointer hover:text-secondary-800 dark:hover:text-secondary-300 transition-colors duration-150 ease-in-out"), t;
6
+ },
7
+ header: ({ props: e }) => {
8
+ const t = ["flex items-center gap-1 select-none"];
9
+ return e.textAlign === "left" && t.push("justify-start"), e.textAlign === "right" && t.push("justify-end"), e.textAlign === "center" && t.push("justify-center"), e.textAlign === "justify" && t.push("justify-center"), t;
6
10
  },
7
11
  sortIcon: ({ props: e }) => ["stroke-2 w-3 h-3"]
8
12
  }