@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.
- package/docs/pages/component/table/selectable.vue +2 -1
- package/lib/components/menu/MenuItem.vue.js +1 -1
- package/lib/components/menu/MenuItem.vue2.js +82 -84
- package/lib/components/table/Table.vue.js +256 -255
- package/lib/components/table/TableHeader.vue.d.ts +5 -5
- package/lib/components/table/TableHeader.vue.js +35 -32
- package/lib/components/table/theme/TableHeader.base.theme.js +9 -9
- package/lib/components/table/theme/TableHeader.carbon.theme.js +1 -1
- package/lib/index.js +1 -1
- package/lib/index.umd.js +4 -4
- 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 -0
- package/src/components/table/Table.vue +5 -4
- package/src/components/table/TableHeader.vue +6 -4
- package/src/components/table/theme/TableHeader.base.theme.ts +4 -3
- package/src/components/table/theme/TableHeader.carbon.theme.ts +0 -1
- package/src/version.ts +1 -1
|
@@ -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'
|
|
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-
|
|
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
|
|
2
|
-
import { useMutationObserver as
|
|
3
|
-
import { useColors as
|
|
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
|
|
5
|
+
import { useTheme as V } from "../../composables/useTheme.js";
|
|
6
6
|
import $ from "../icon/Icon.vue.js";
|
|
7
|
-
import
|
|
8
|
-
|
|
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
|
-
},
|
|
12
|
+
}, L = {
|
|
12
13
|
key: 3,
|
|
13
14
|
class: "flex-1 truncate"
|
|
14
|
-
},
|
|
15
|
+
}, q = { class: "ml-1 shrink-0" }, G = { key: 0 }, H = {
|
|
15
16
|
...C.props(),
|
|
16
|
-
...
|
|
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
|
-
},
|
|
53
|
+
}, J = {
|
|
53
54
|
name: "XMenuItem",
|
|
54
55
|
validators: {
|
|
55
56
|
...C.validators()
|
|
56
57
|
}
|
|
57
|
-
}, le = /* @__PURE__ */
|
|
58
|
-
...
|
|
59
|
-
props:
|
|
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
|
-
|
|
67
|
-
o.value && (g(), k.value === "router-link" &&
|
|
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 } =
|
|
92
|
-
return (t, i) => {
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
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
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
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 {
|