@indielayer/ui 1.10.4 → 1.11.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/select/multiple.vue +8 -0
- package/lib/components/button/theme/Button.base.theme.js +1 -1
- package/lib/components/menu/MenuItem.vue.d.ts +6 -1
- package/lib/components/menu/MenuItem.vue.js +2 -2
- package/lib/components/menu/MenuItem.vue2.js +110 -99
- package/lib/components/menu/theme/MenuItem.base.theme.js +15 -15
- package/lib/components/select/Select.vue.d.ts +676 -0
- package/lib/components/select/Select.vue.js +275 -258
- package/lib/components/table/theme/TableCell.base.theme.js +1 -1
- package/lib/components/tooltip/Tooltip.vue.d.ts +3 -0
- package/lib/components/tooltip/Tooltip.vue.js +12 -9
- package/lib/index.js +1 -1
- package/lib/index.umd.js +3 -3
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/package.json +1 -1
- package/src/components/button/theme/Button.base.theme.ts +3 -3
- package/src/components/menu/MenuItem.vue +14 -5
- package/src/components/menu/theme/MenuItem.base.theme.ts +1 -1
- package/src/components/select/Select.vue +62 -43
- package/src/components/table/theme/TableCell.base.theme.ts +1 -1
- package/src/components/tooltip/Tooltip.vue +2 -1
- package/src/version.ts +1 -1
|
@@ -2,7 +2,7 @@ const g = {
|
|
|
2
2
|
classes: {
|
|
3
3
|
wrapper({ props: e, slots: n, data: i }) {
|
|
4
4
|
const l = ["relative transition duration-150 focus:outline-none inline-flex items-center justify-center font-medium whitespace-nowrap overflow-hidden align-middle active:!shadow-none border appearance-none shrink-0"];
|
|
5
|
-
return i.isButtonGroup || l.push(e.rounded ? "rounded-full" : "rounded-md"), !e.flat && !e.light && !e.ghost && !e.disabled && !e.loading && l.push("shadow-sm"), e.size === "xs" ? l.push(n.default ? `py-1 text-xs ${e.icon, "px-2"}` : "leading-none p-1") : e.size === "sm" ? l.push(n.default ? `py-1.5 text-sm ${e.icon, "px-3"}` : "leading-none p-1.5") : e.size === "lg" ? l.push(n.default ? `py-3 text-lg ${e.icon ? "px-4" : "px-
|
|
5
|
+
return i.isButtonGroup || l.push(e.rounded ? "rounded-full" : "rounded-md"), !e.flat && !e.light && !e.ghost && !e.disabled && !e.loading && l.push("shadow-sm"), e.size === "xs" ? l.push(n.default ? `py-1 text-xs ${e.icon, "px-2"}` : "leading-none p-1") : e.size === "sm" ? l.push(n.default ? `py-1.5 text-sm ${e.icon, "px-3"}` : "leading-none p-1.5") : e.size === "lg" ? l.push(n.default ? `py-3 text-lg ${e.icon ? "px-4" : "px-5"}` : "leading-none p-3") : e.size === "xl" ? l.push(n.default ? "py-4 text-xl px-6" : "leading-none p-3.5") : l.push(n.default ? "py-2 px-4" : "leading-none p-[0.532rem]"), e.disabled ? l.push("cursor-not-allowed") : e.loading ? l.push("cursor-default") : l.push("cursor-pointer"), l;
|
|
6
6
|
},
|
|
7
7
|
iconLeft: ({ slots: e }) => e.default ? "mr-2" : "m-0.5",
|
|
8
8
|
iconRight: ({ slots: e }) => e.default ? "ml-2" : "m-0.5"
|
|
@@ -34,6 +34,7 @@ declare const menuItemProps: {
|
|
|
34
34
|
minimal: BooleanConstructor;
|
|
35
35
|
prefix: StringConstructor;
|
|
36
36
|
suffix: StringConstructor;
|
|
37
|
+
checkbox: BooleanConstructor;
|
|
37
38
|
color: {
|
|
38
39
|
readonly type: StringConstructor;
|
|
39
40
|
readonly default: string | undefined;
|
|
@@ -84,6 +85,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<im
|
|
|
84
85
|
minimal: BooleanConstructor;
|
|
85
86
|
prefix: StringConstructor;
|
|
86
87
|
suffix: StringConstructor;
|
|
88
|
+
checkbox: BooleanConstructor;
|
|
87
89
|
color: {
|
|
88
90
|
readonly type: StringConstructor;
|
|
89
91
|
readonly default: string | undefined;
|
|
@@ -93,7 +95,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<im
|
|
|
93
95
|
readonly default: "md";
|
|
94
96
|
readonly validator: (value: string) => boolean;
|
|
95
97
|
};
|
|
96
|
-
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("click" | "active")[], "click" | "active", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
98
|
+
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("click" | "active" | "checkbox-click")[], "click" | "active" | "checkbox-click", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
97
99
|
item: {
|
|
98
100
|
type: PropType<MenuArrayItem>;
|
|
99
101
|
default: () => void;
|
|
@@ -126,6 +128,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<im
|
|
|
126
128
|
minimal: BooleanConstructor;
|
|
127
129
|
prefix: StringConstructor;
|
|
128
130
|
suffix: StringConstructor;
|
|
131
|
+
checkbox: BooleanConstructor;
|
|
129
132
|
color: {
|
|
130
133
|
readonly type: StringConstructor;
|
|
131
134
|
readonly default: string | undefined;
|
|
@@ -138,6 +141,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<im
|
|
|
138
141
|
}>> & Readonly<{
|
|
139
142
|
onClick?: ((...args: any[]) => any) | undefined;
|
|
140
143
|
onActive?: ((...args: any[]) => any) | undefined;
|
|
144
|
+
"onCheckbox-click"?: ((...args: any[]) => any) | undefined;
|
|
141
145
|
}>, {
|
|
142
146
|
disabled: boolean;
|
|
143
147
|
color: string;
|
|
@@ -151,6 +155,7 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<im
|
|
|
151
155
|
attrs: Record<string, any>;
|
|
152
156
|
exact: boolean;
|
|
153
157
|
selected: boolean;
|
|
158
|
+
checkbox: boolean;
|
|
154
159
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>, {
|
|
155
160
|
prefix?(_: {
|
|
156
161
|
item: MenuItemProps;
|
|
@@ -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
|
-
},
|
|
6
|
+
}, _ = /* @__PURE__ */ t(s, [["__cssModules", e], ["__scopeId", "data-v-4c0f9774"]]);
|
|
7
7
|
export {
|
|
8
|
-
|
|
8
|
+
_ as default
|
|
9
9
|
};
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useMutationObserver as
|
|
3
|
-
import { useColors as
|
|
4
|
-
import { useCommon as
|
|
5
|
-
import { useTheme as
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
const
|
|
9
|
-
key:
|
|
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";
|
|
4
|
+
import { useCommon as C } from "../../composables/useCommon.js";
|
|
5
|
+
import { useTheme as A } from "../../composables/useTheme.js";
|
|
6
|
+
import $ from "../icon/Icon.vue.js";
|
|
7
|
+
import L from "../spinner/Spinner.vue.js";
|
|
8
|
+
const X = {
|
|
9
|
+
key: 1,
|
|
10
10
|
class: "mr-2 shrink-0"
|
|
11
|
-
},
|
|
12
|
-
key:
|
|
11
|
+
}, q = {
|
|
12
|
+
key: 3,
|
|
13
13
|
class: "flex-1 truncate"
|
|
14
|
-
},
|
|
15
|
-
|
|
16
|
-
...
|
|
14
|
+
}, G = { class: "ml-1 shrink-0" }, H = { key: 0 }, J = {
|
|
15
|
+
...C.props(),
|
|
16
|
+
...E.props("secondary"),
|
|
17
17
|
item: {
|
|
18
18
|
type: Object,
|
|
19
19
|
default: () => {
|
|
@@ -47,108 +47,119 @@ const T = {
|
|
|
47
47
|
disabled: Boolean,
|
|
48
48
|
minimal: Boolean,
|
|
49
49
|
prefix: String,
|
|
50
|
-
suffix: String
|
|
51
|
-
|
|
50
|
+
suffix: String,
|
|
51
|
+
checkbox: Boolean
|
|
52
|
+
}, K = {
|
|
52
53
|
name: "XMenuItem",
|
|
53
54
|
validators: {
|
|
54
|
-
|
|
55
|
+
...C.validators()
|
|
55
56
|
}
|
|
56
|
-
},
|
|
57
|
-
...
|
|
58
|
-
props:
|
|
59
|
-
emits: ["active", "click"],
|
|
60
|
-
setup(
|
|
61
|
-
const
|
|
62
|
-
...
|
|
63
|
-
...
|
|
64
|
-
})),
|
|
65
|
-
|
|
66
|
-
|
|
57
|
+
}, le = /* @__PURE__ */ R({
|
|
58
|
+
...K,
|
|
59
|
+
props: J,
|
|
60
|
+
emits: ["active", "click", "checkbox-click"],
|
|
61
|
+
setup(B, { emit: S }) {
|
|
62
|
+
const p = B, d = S, o = y(), a = y(!1), e = b(() => ({
|
|
63
|
+
...p,
|
|
64
|
+
...p.item
|
|
65
|
+
})), 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
68
|
attributes: !0,
|
|
68
69
|
attributeFilter: ["class"]
|
|
69
70
|
}));
|
|
70
71
|
});
|
|
71
|
-
function
|
|
72
|
+
function h(t, i) {
|
|
72
73
|
if (e.value.disabled) {
|
|
73
74
|
t.stopPropagation(), t.preventDefault();
|
|
74
75
|
return;
|
|
75
76
|
}
|
|
76
|
-
e.value.onClick && e.value.onClick(t),
|
|
77
|
+
e.value.onClick && e.value.onClick(t), d(i, t);
|
|
77
78
|
}
|
|
78
|
-
function
|
|
79
|
-
if (
|
|
80
|
-
const t =
|
|
81
|
-
|
|
79
|
+
function g() {
|
|
80
|
+
if (o.value && o.value.$el && (e.value.href || e.value.to)) {
|
|
81
|
+
const t = o.value.$el.classList.contains(e.value.exact ? "router-link-exact-active" : "router-link-active") || !1;
|
|
82
|
+
a.value = t;
|
|
82
83
|
} else
|
|
83
|
-
|
|
84
|
+
a.value = !!e.value.active;
|
|
84
85
|
}
|
|
85
|
-
|
|
86
|
-
t &&
|
|
87
|
-
}),
|
|
88
|
-
|
|
86
|
+
x(() => a.value, (t) => {
|
|
87
|
+
t && d("active");
|
|
88
|
+
}), x(() => e.value.active, (t) => {
|
|
89
|
+
a.value = !!t;
|
|
89
90
|
});
|
|
90
|
-
const { styles:
|
|
91
|
-
return (t,
|
|
92
|
-
|
|
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
|
-
], !0)
|
|
120
|
-
])) : e.value.icon ? (l(), i(y, {
|
|
121
|
-
key: 1,
|
|
122
|
-
size: e.value.size,
|
|
123
|
-
icon: e.value.icon,
|
|
124
|
-
class: "mr-2"
|
|
125
|
-
}, null, 8, ["size", "icon"])) : f("", !0),
|
|
126
|
-
t.minimal ? f("", !0) : (l(), r("span", V, [
|
|
127
|
-
n(t.$slots, "default", { item: e.value }, () => [
|
|
128
|
-
u(c(e.value.label), 1)
|
|
129
|
-
], !0)
|
|
130
|
-
])),
|
|
131
|
-
O("span", E, [
|
|
132
|
-
e.value.loading ? (l(), i(F, {
|
|
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, {
|
|
133
120
|
key: 0,
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
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
|
+
};
|
|
150
161
|
}
|
|
151
162
|
});
|
|
152
163
|
export {
|
|
153
|
-
|
|
164
|
+
le as default
|
|
154
165
|
};
|
|
@@ -5,15 +5,15 @@ const l = {
|
|
|
5
5
|
return s.disabled || t.push("cursor-pointer"), r.isActive && t.push("font-medium"), s.rounded && t.push("rounded"), s.size === "xs" ? t.push("py-1 text-xs") : s.size === "sm" ? t.push("py-1.5 text-sm") : s.size === "lg" ? t.push("py-3") : s.size === "xl" ? t.push("py-4 text-lg") : t.push("py-1.5"), t;
|
|
6
6
|
}
|
|
7
7
|
},
|
|
8
|
-
styles: ({ colors: s, props: r, css: t, data:
|
|
9
|
-
const e = s.getPalette(r.color || "gray"),
|
|
8
|
+
styles: ({ colors: s, props: r, css: t, data: i }) => {
|
|
9
|
+
const e = s.getPalette(r.color || "gray"), a = s.getPalette("secondary");
|
|
10
10
|
return r.disabled ? t.variables({
|
|
11
|
-
text:
|
|
11
|
+
text: a[300],
|
|
12
12
|
dark: {
|
|
13
|
-
text:
|
|
13
|
+
text: a[600]
|
|
14
14
|
}
|
|
15
|
-
}) : r.filled ?
|
|
16
|
-
bg: r.selected ? e[100] : e[200],
|
|
15
|
+
}) : r.filled ? i.isActive ? t.variables({
|
|
16
|
+
bg: r.selected ? e[100] : r.checkbox ? "transparent" : e[200],
|
|
17
17
|
text: e[800],
|
|
18
18
|
hover: {
|
|
19
19
|
bg: (r.selected, e[200]),
|
|
@@ -42,7 +42,7 @@ const l = {
|
|
|
42
42
|
text: e[100]
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
|
-
}) :
|
|
45
|
+
}) : i.isActive ? t.variables({
|
|
46
46
|
text: e[500],
|
|
47
47
|
hover: {
|
|
48
48
|
text: e[500],
|
|
@@ -56,21 +56,21 @@ const l = {
|
|
|
56
56
|
}
|
|
57
57
|
}
|
|
58
58
|
}) : t.variables({
|
|
59
|
-
text:
|
|
59
|
+
text: a[800],
|
|
60
60
|
hover: {
|
|
61
|
-
text:
|
|
62
|
-
border:
|
|
61
|
+
text: a[900],
|
|
62
|
+
border: a[300]
|
|
63
63
|
},
|
|
64
64
|
dark: {
|
|
65
|
-
text:
|
|
65
|
+
text: a[300],
|
|
66
66
|
hover: {
|
|
67
|
-
text:
|
|
68
|
-
border:
|
|
67
|
+
text: a[200],
|
|
68
|
+
border: a[800]
|
|
69
69
|
}
|
|
70
70
|
}
|
|
71
71
|
});
|
|
72
72
|
}
|
|
73
|
-
},
|
|
73
|
+
}, x = l;
|
|
74
74
|
export {
|
|
75
|
-
|
|
75
|
+
x as default
|
|
76
76
|
};
|