@septkit/ui 0.0.9 → 0.0.11
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/dist/dropdown/dropdown.vue.js +72 -72
- package/dist/index.d.ts +2 -0
- package/package.json +1 -1
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
import { defineComponent as h, useTemplateRef as
|
|
2
|
-
import { VOnClickOutside as
|
|
3
|
-
const
|
|
4
|
-
"data-testid": "dropdown-menu",
|
|
5
|
-
class: "menu dropdown-content bg-base-100 z-1 w-52 p-2 shadow-sm"
|
|
6
|
-
}, $ = /* @__PURE__ */ h({
|
|
1
|
+
import { defineComponent as h, useTemplateRef as S, ref as C, computed as n, createElementBlock as i, openBlock as c, createElementVNode as O, withDirectives as x, normalizeClass as l, withModifiers as B, renderSlot as d, unref as D } from "vue";
|
|
2
|
+
import { VOnClickOutside as _ } from "../external/.pnpm/@vueuse_components@13.5.0_vue@3.5.17_typescript@5.8.3_/node_modules/@vueuse/components/index.js";
|
|
3
|
+
const q = ["open"], $ = /* @__PURE__ */ h({
|
|
7
4
|
__name: "dropdown",
|
|
8
5
|
props: {
|
|
9
6
|
color: {},
|
|
@@ -12,98 +9,101 @@ const x = ["open"], q = {
|
|
|
12
9
|
active: { type: Boolean },
|
|
13
10
|
disabled: { type: Boolean },
|
|
14
11
|
modifier: {},
|
|
12
|
+
background: {},
|
|
15
13
|
id: {}
|
|
16
14
|
},
|
|
17
15
|
emits: ["open", "close"],
|
|
18
|
-
setup(
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
)
|
|
58
|
-
|
|
59
|
-
d.value && (d.value.open = e.value);
|
|
16
|
+
setup(b, { expose: u, emit: p }) {
|
|
17
|
+
const e = b, a = p, s = S("details-ref"), o = C(!1), m = n(() => ({
|
|
18
|
+
"bg-neutral": e.background === "neutral",
|
|
19
|
+
"bg-primary": e.background === "primary",
|
|
20
|
+
"bg-secondary": e.background === "secondary",
|
|
21
|
+
"bg-accent": e.background === "accent",
|
|
22
|
+
"bg-info": e.background === "info",
|
|
23
|
+
"bg-success": e.background === "success",
|
|
24
|
+
"bg-warning": e.background === "warning",
|
|
25
|
+
"bg-error": e.background === "error",
|
|
26
|
+
"bg-base-100": e.background === "base",
|
|
27
|
+
"bg-white": !e.background
|
|
28
|
+
})), g = n(() => ({
|
|
29
|
+
"btn-neutral": e.color === "neutral" || !e.color,
|
|
30
|
+
"btn-primary": e.color === "primary",
|
|
31
|
+
"btn-secondary": e.color === "secondary",
|
|
32
|
+
"btn-accent": e.color === "accent",
|
|
33
|
+
"btn-info": e.color === "info",
|
|
34
|
+
"btn-success": e.color === "success",
|
|
35
|
+
"btn-warning": e.color === "warning",
|
|
36
|
+
"btn-error": e.color === "error"
|
|
37
|
+
})), f = n(() => ({
|
|
38
|
+
"btn-outline": e.variant === "outline",
|
|
39
|
+
"btn-dash": e.variant === "dash",
|
|
40
|
+
"btn-soft": e.variant === "soft",
|
|
41
|
+
"btn-ghost": e.variant === "ghost" || !e.variant,
|
|
42
|
+
"btn-link": e.variant === "link"
|
|
43
|
+
})), v = n(() => ({
|
|
44
|
+
"btn-xs": e.size === "xs",
|
|
45
|
+
"btn-sm": e.size === "sm" || !e.size,
|
|
46
|
+
"btn-md": e.size === "md",
|
|
47
|
+
"btn-lg": e.size === "lg",
|
|
48
|
+
"btn-xl": e.size === "xl"
|
|
49
|
+
})), w = n(() => ({
|
|
50
|
+
"btn-wide": e.modifier === "wide" || !e.modifier,
|
|
51
|
+
"btn-block": e.modifier === "block",
|
|
52
|
+
"btn-square": e.modifier === "square",
|
|
53
|
+
"btn-circle": e.modifier === "circle"
|
|
54
|
+
}));
|
|
55
|
+
function k() {
|
|
56
|
+
s.value && (s.value.open = o.value);
|
|
60
57
|
}
|
|
61
|
-
function
|
|
62
|
-
|
|
63
|
-
}
|
|
64
|
-
function g() {
|
|
65
|
-
e.value = !0, i("open");
|
|
58
|
+
function r() {
|
|
59
|
+
o.value = !1, a("close");
|
|
66
60
|
}
|
|
67
61
|
function y() {
|
|
68
|
-
|
|
62
|
+
o.value = !0, a("open");
|
|
63
|
+
}
|
|
64
|
+
function z() {
|
|
65
|
+
o.value ? r() : y();
|
|
69
66
|
}
|
|
70
67
|
return u({
|
|
71
68
|
/** Method to close the dropdown */
|
|
72
|
-
close:
|
|
69
|
+
close: r,
|
|
73
70
|
/** Reactive boolean of the dropdown state */
|
|
74
|
-
isOpen:
|
|
75
|
-
id:
|
|
76
|
-
}), (t, E) => (
|
|
71
|
+
isOpen: o,
|
|
72
|
+
id: e.id
|
|
73
|
+
}), (t, E) => (c(), i("details", {
|
|
77
74
|
"data-testid": "dropdown-wrapper",
|
|
78
75
|
ref: "details-ref",
|
|
79
76
|
class: "dropdown",
|
|
80
|
-
open:
|
|
81
|
-
onToggle:
|
|
77
|
+
open: o.value,
|
|
78
|
+
onToggle: k
|
|
82
79
|
}, [
|
|
83
|
-
|
|
80
|
+
O("summary", {
|
|
84
81
|
"data-testid": "dropdown-trigger",
|
|
85
|
-
onClick:
|
|
86
|
-
class:
|
|
87
|
-
|
|
82
|
+
onClick: B(z, ["stop"]),
|
|
83
|
+
class: l(["btn", [
|
|
84
|
+
g.value,
|
|
88
85
|
f.value,
|
|
89
|
-
m.value,
|
|
90
86
|
v.value,
|
|
87
|
+
w.value,
|
|
91
88
|
{ "btn-active": t.active, "btn-disabled": t.disabled }
|
|
92
89
|
]])
|
|
93
90
|
}, [
|
|
94
|
-
|
|
91
|
+
d(t.$slots, "label")
|
|
95
92
|
], 2),
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
93
|
+
x((c(), i("ul", {
|
|
94
|
+
"data-testid": "dropdown-menu",
|
|
95
|
+
class: l([[m.value], "menu dropdown-content z-1 w-52 p-2 shadow-sm size-max"])
|
|
96
|
+
}, [
|
|
97
|
+
d(t.$slots, "items")
|
|
98
|
+
], 2)), [
|
|
99
99
|
[
|
|
100
|
-
|
|
101
|
-
|
|
100
|
+
D(_),
|
|
101
|
+
r,
|
|
102
102
|
void 0,
|
|
103
103
|
{ bubble: !0 }
|
|
104
104
|
]
|
|
105
105
|
])
|
|
106
|
-
], 40,
|
|
106
|
+
], 40, q));
|
|
107
107
|
}
|
|
108
108
|
});
|
|
109
109
|
export {
|
package/dist/index.d.ts
CHANGED
|
@@ -45,6 +45,8 @@ declare type __VLS_Props_2 = {
|
|
|
45
45
|
disabled?: boolean;
|
|
46
46
|
/** Trigger modifier */
|
|
47
47
|
modifier?: 'wide' | 'block' | 'square' | 'circle';
|
|
48
|
+
/** Menu background */
|
|
49
|
+
background?: 'neutral' | 'primary' | 'secondary' | 'accent' | 'info' | 'success' | 'warning' | 'error' | 'base' | 'white';
|
|
48
50
|
id?: string;
|
|
49
51
|
};
|
|
50
52
|
|