@indielayer/ui 1.14.0 → 1.14.1

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.
@@ -3,7 +3,7 @@ import { ref } from 'vue'
3
3
  import { type TableHeader } from '@indielayer/ui'
4
4
 
5
5
  const headers: TableHeader[] = [
6
- { text: '#', value: 'id', align: 'center' },
6
+ { text: '#', value: 'id' },
7
7
  { text: 'Title', value: 'title' },
8
8
  { text: 'Description', value: 'description', truncate: true, width: 400 },
9
9
  { text: 'Published', value: 'published', align: 'center' },
@@ -50,6 +50,7 @@ const singleSelected = ref<number>(2)
50
50
  selectable
51
51
  :headers="headers"
52
52
  :items="items"
53
+ @click-row="(item) => console.log('Row clicked:', item)"
53
54
  />
54
55
  </x-card>
55
56
  <x-card>
@@ -3,7 +3,7 @@ import o from "./MenuItem.vue3.js";
3
3
  import t from "../../_virtual/_plugin-vue_export-helper.js";
4
4
  const e = {
5
5
  $style: o
6
- }, _ = /* @__PURE__ */ t(s, [["__cssModules", e], ["__scopeId", "data-v-4c0f9774"]]);
6
+ }, _ = /* @__PURE__ */ t(s, [["__cssModules", e], ["__scopeId", "data-v-418dd6c3"]]);
7
7
  export {
8
8
  _ as default
9
9
  };
@@ -1,19 +1,20 @@
1
- import { defineComponent as R, ref as y, computed as b, onMounted as w, watch as x, resolveComponent as I, openBlock as l, createBlock as r, resolveDynamicComponent as O, mergeProps as P, unref as c, withCtx as j, withModifiers as D, createCommentVNode as s, createElementBlock as n, renderSlot as v, createTextVNode as f, toDisplayString as m, createElementVNode as F, Fragment as T } from "vue";
2
- import { useMutationObserver as V } from "../../node_modules/.pnpm/@vueuse_core@11.1.0_vue@3.5.10_typescript@5.2.2_/node_modules/@vueuse/core/index.js";
3
- import { useColors as E } from "../../composables/useColors.js";
1
+ import { defineComponent as N, ref as y, computed as b, onMounted as R, watch as x, openBlock as l, createBlock as r, resolveDynamicComponent as w, mergeProps as I, unref as c, withCtx as O, withModifiers as P, createCommentVNode as s, createElementBlock as n, renderSlot as f, createTextVNode as v, toDisplayString as m, createElementVNode as j, Fragment as D } from "vue";
2
+ import { useMutationObserver as F } from "../../node_modules/.pnpm/@vueuse_core@11.1.0_vue@3.5.10_typescript@5.2.2_/node_modules/@vueuse/core/index.js";
3
+ import { useColors as T } from "../../composables/useColors.js";
4
4
  import { useCommon as C } from "../../composables/useCommon.js";
5
- import { useTheme as A } from "../../composables/useTheme.js";
5
+ import { useTheme as V } from "../../composables/useTheme.js";
6
6
  import $ from "../icon/Icon.vue.js";
7
- import L from "../spinner/Spinner.vue.js";
8
- const X = {
7
+ import E from "../spinner/Spinner.vue.js";
8
+ import X from "../checkbox/Checkbox.vue.js";
9
+ const A = {
9
10
  key: 1,
10
11
  class: "mr-2 shrink-0"
11
- }, q = {
12
+ }, L = {
12
13
  key: 3,
13
14
  class: "flex-1 truncate"
14
- }, G = { class: "ml-1 shrink-0" }, H = { key: 0 }, J = {
15
+ }, q = { class: "ml-1 shrink-0" }, G = { key: 0 }, H = {
15
16
  ...C.props(),
16
- ...E.props("secondary"),
17
+ ...T.props("secondary"),
17
18
  item: {
18
19
  type: Object,
19
20
  default: () => {
@@ -49,22 +50,22 @@ const X = {
49
50
  prefix: String,
50
51
  suffix: String,
51
52
  checkbox: Boolean
52
- }, K = {
53
+ }, J = {
53
54
  name: "XMenuItem",
54
55
  validators: {
55
56
  ...C.validators()
56
57
  }
57
- }, le = /* @__PURE__ */ R({
58
- ...K,
59
- props: J,
58
+ }, le = /* @__PURE__ */ N({
59
+ ...J,
60
+ props: H,
60
61
  emits: ["active", "click", "checkbox-click"],
61
62
  setup(B, { emit: S }) {
62
63
  const p = B, d = S, o = y(), a = y(!1), e = b(() => ({
63
64
  ...p,
64
65
  ...p.item
65
66
  })), k = b(() => e.value.to ? "router-link" : e.value.href ? "a" : "div");
66
- w(() => {
67
- o.value && (g(), k.value === "router-link" && V(o.value.$el, g, {
67
+ R(() => {
68
+ o.value && (g(), k.value === "router-link" && F(o.value.$el, g, {
68
69
  attributes: !0,
69
70
  attributeFilter: ["class"]
70
71
  }));
@@ -88,76 +89,73 @@ const X = {
88
89
  }), x(() => e.value.active, (t) => {
89
90
  a.value = !!t;
90
91
  });
91
- const { styles: z, classes: _, className: M } = A("MenuItem", {}, e, { isActive: a });
92
- return (t, i) => {
93
- const N = I("x-checkbox");
94
- return l(), r(O(k.value), P({
95
- ref_key: "elRef",
96
- ref: o
97
- }, {
98
- ...e.value.href ? { href: e.value.href } : {},
99
- ...e.value.attrs
100
- }, {
101
- to: e.value.to,
102
- target: e.value.target,
103
- color: e.value.color,
104
- style: c(z),
105
- class: [
106
- c(M),
107
- t.$style["menu-item"],
108
- [a.value && !t.checkbox ? t.$style["menu-item--active"] : ""],
109
- c(_).wrapper,
110
- {
111
- "flex items-center": t.$slots.prefix || t.$slots.suffix
112
- }
113
- ],
114
- title: e.value.label,
115
- alt: e.value.label,
116
- onClick: i[1] || (i[1] = (u) => h(u, "click"))
117
- }), {
118
- default: j(() => [
119
- t.checkbox ? (l(), r(N, {
92
+ const { styles: z, classes: _, className: M } = V("MenuItem", {}, e, { isActive: a });
93
+ return (t, i) => (l(), r(w(k.value), I({
94
+ ref_key: "elRef",
95
+ ref: o
96
+ }, {
97
+ ...e.value.href ? { href: e.value.href } : {},
98
+ ...e.value.attrs
99
+ }, {
100
+ to: e.value.to,
101
+ target: e.value.target,
102
+ color: e.value.color,
103
+ style: c(z),
104
+ class: [
105
+ c(M),
106
+ t.$style["menu-item"],
107
+ [a.value && !t.checkbox ? t.$style["menu-item--active"] : ""],
108
+ c(_).wrapper,
109
+ {
110
+ "flex items-center": t.$slots.prefix || t.$slots.suffix
111
+ }
112
+ ],
113
+ title: e.value.label,
114
+ alt: e.value.label,
115
+ onClick: i[1] || (i[1] = (u) => h(u, "click"))
116
+ }), {
117
+ default: O(() => [
118
+ t.checkbox ? (l(), r(X, {
119
+ key: 0,
120
+ "model-value": e.value.active,
121
+ "hide-footer": "",
122
+ "skip-form-registry": "",
123
+ onClick: i[0] || (i[0] = P((u) => h(u, "checkbox-click"), ["stop", "prevent"]))
124
+ }, null, 8, ["model-value"])) : s("", !0),
125
+ t.$slots.prefix || e.value.prefix ? (l(), n("span", A, [
126
+ f(t.$slots, "prefix", { item: e.value }, () => [
127
+ v(m(e.value.prefix), 1)
128
+ ], !0)
129
+ ])) : e.value.icon ? (l(), r($, {
130
+ key: 2,
131
+ size: e.value.size,
132
+ icon: e.value.icon,
133
+ class: "mr-2"
134
+ }, null, 8, ["size", "icon"])) : s("", !0),
135
+ t.minimal ? s("", !0) : (l(), n("span", L, [
136
+ f(t.$slots, "default", { item: e.value }, () => [
137
+ v(m(e.value.label), 1)
138
+ ], !0)
139
+ ])),
140
+ j("span", q, [
141
+ e.value.loading ? (l(), r(E, {
120
142
  key: 0,
121
- "model-value": e.value.active,
122
- "hide-footer": "",
123
- "skip-form-registry": "",
124
- onClick: i[0] || (i[0] = D((u) => h(u, "checkbox-click"), ["stop", "prevent"]))
125
- }, null, 8, ["model-value"])) : s("", !0),
126
- t.$slots.prefix || e.value.prefix ? (l(), n("span", X, [
127
- v(t.$slots, "prefix", { item: e.value }, () => [
128
- f(m(e.value.prefix), 1)
129
- ], !0)
130
- ])) : e.value.icon ? (l(), r($, {
131
- key: 2,
132
- size: e.value.size,
133
- icon: e.value.icon,
134
- class: "mr-2"
135
- }, null, 8, ["size", "icon"])) : s("", !0),
136
- t.minimal ? s("", !0) : (l(), n("span", q, [
137
- v(t.$slots, "default", { item: e.value }, () => [
138
- f(m(e.value.label), 1)
139
- ], !0)
140
- ])),
141
- F("span", G, [
142
- e.value.loading ? (l(), r(L, {
143
- key: 0,
144
- size: e.value.size
145
- }, null, 8, ["size"])) : (l(), n(T, { key: 1 }, [
146
- t.$slots.suffix || e.value.suffix ? (l(), n("span", H, [
147
- v(t.$slots, "suffix", { item: e.value }, () => [
148
- f(m(e.value.suffix), 1)
149
- ], !0)
150
- ])) : e.value.iconRight ? (l(), r($, {
151
- key: 1,
152
- size: e.value.size,
153
- icon: e.value.iconRight
154
- }, null, 8, ["size", "icon"])) : s("", !0)
155
- ], 64))
156
- ])
157
- ]),
158
- _: 3
159
- }, 16, ["to", "target", "color", "style", "class", "title", "alt"]);
160
- };
143
+ size: e.value.size
144
+ }, null, 8, ["size"])) : (l(), n(D, { key: 1 }, [
145
+ t.$slots.suffix || e.value.suffix ? (l(), n("span", G, [
146
+ f(t.$slots, "suffix", { item: e.value }, () => [
147
+ v(m(e.value.suffix), 1)
148
+ ], !0)
149
+ ])) : e.value.iconRight ? (l(), r($, {
150
+ key: 1,
151
+ size: e.value.size,
152
+ icon: e.value.iconRight
153
+ }, null, 8, ["size", "icon"])) : s("", !0)
154
+ ], 64))
155
+ ])
156
+ ]),
157
+ _: 3
158
+ }, 16, ["to", "target", "color", "style", "class", "title", "alt"]));
161
159
  }
162
160
  });
163
161
  export {