@scalar/components 0.16.8 → 0.16.12
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/components/ScalarDropdown/ScalarDropdown.vue.d.ts +13 -6
- package/dist/components/ScalarDropdown/ScalarDropdown.vue.d.ts.map +1 -1
- package/dist/components/ScalarDropdown/ScalarDropdown.vue.js +119 -40
- package/dist/components/ScalarDropdown/ScalarDropdownButton.vue.d.ts.map +1 -1
- package/dist/components/ScalarDropdown/ScalarDropdownButton.vue.js +2 -2
- package/dist/components/ScalarDropdown/ScalarDropdownButton.vue2.js +15 -13
- package/dist/components/ScalarDropdown/ScalarDropdownItem.vue.d.ts +2 -0
- package/dist/components/ScalarDropdown/ScalarDropdownItem.vue.d.ts.map +1 -1
- package/dist/components/ScalarDropdown/ScalarDropdownItem.vue.js +1 -1
- package/dist/components/ScalarDropdown/ScalarDropdownItem.vue2.js +19 -18
- package/dist/components/ScalarDropdown/ScalarDropdownMenu.vue.d.ts +4 -2
- package/dist/components/ScalarDropdown/ScalarDropdownMenu.vue.d.ts.map +1 -1
- package/dist/components/ScalarDropdown/ScalarDropdownMenu.vue.js +15 -16
- package/dist/components/ScalarDropdown/useDropdown.d.ts +10 -0
- package/dist/components/ScalarDropdown/useDropdown.d.ts.map +1 -0
- package/dist/components/ScalarDropdown/useDropdown.js +14 -0
- package/dist/components/ScalarFloating/ScalarFloating.vue.d.ts +4 -1
- package/dist/components/ScalarFloating/ScalarFloating.vue.d.ts.map +1 -1
- package/dist/components/ScalarFloating/ScalarFloating.vue.js +38 -34
- package/dist/components/ScalarFloating/types.d.ts +4 -3
- package/dist/components/ScalarFloating/types.d.ts.map +1 -1
- package/dist/components/ScalarModal/ScalarModal.vue.js +1 -1
- package/dist/components/ScalarModal/ScalarModal.vue2.js +4 -4
- package/dist/components/ScalarSidebar/ScalarSidebarGroup.vue.d.ts +4 -0
- package/dist/components/ScalarSidebar/ScalarSidebarGroup.vue.d.ts.map +1 -1
- package/dist/components/ScalarSidebar/ScalarSidebarGroup.vue.js +95 -62
- package/dist/components/ScalarSidebar/ScalarSidebarNestedItems.vue.d.ts +2 -0
- package/dist/components/ScalarSidebar/ScalarSidebarNestedItems.vue.d.ts.map +1 -1
- package/dist/components/ScalarSidebar/ScalarSidebarNestedItems.vue.js +17 -16
- package/dist/components/ScalarSidebar/types.d.ts +9 -0
- package/dist/components/ScalarSidebar/types.d.ts.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +7 -7
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarFloating/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,aAAa,EAAE,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarFloating/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,UAAU,EAAE,aAAa,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAA;AACzF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,KAAK,CAAA;AAE3C,iDAAiD;AACjD,MAAM,MAAM,eAAe,GAAG;IAC5B;;;;;OAKG;IACH,SAAS,CAAC,EAAE,IAAI,GAAG,gBAAgB,CAAA;IACnC;;;;;OAKG;IACH,MAAM,CAAC,EAAE,aAAa,CAAA;IACtB;;;;;OAKG;IACH,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB;;;;;OAKG;IACH,MAAM,CAAC,EAAE,gBAAgB,CAAC,WAAW,GAAG,MAAM,CAAC,CAAA;IAC/C;;;;;;;;;;;OAWG;IACH,UAAU,CAAC,EAAE,UAAU,EAAE,CAAA;IACzB;;;;;;OAMG;IACH,QAAQ,CAAC,EAAE,OAAO,GAAG,MAAM,CAAA;CAC5B,CAAA"}
|
|
@@ -2,7 +2,7 @@ import o from "./ScalarModal.vue2.js";
|
|
|
2
2
|
import { useModal as f } from "./ScalarModal.vue2.js";
|
|
3
3
|
/* empty css */
|
|
4
4
|
import r from "../../_virtual/_plugin-vue_export-helper.js";
|
|
5
|
-
const m = /* @__PURE__ */ r(o, [["__scopeId", "data-v-
|
|
5
|
+
const m = /* @__PURE__ */ r(o, [["__scopeId", "data-v-c1e93776"]]);
|
|
6
6
|
export {
|
|
7
7
|
m as default,
|
|
8
8
|
f as useModal
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as x, createBlock as i, openBlock as l, unref as a, withCtx as t, createElementVNode as w, normalizeClass as o, createVNode as m, createElementBlock as r, createCommentVNode as d, normalizeStyle as
|
|
1
|
+
import { defineComponent as x, createBlock as i, openBlock as l, unref as a, withCtx as t, createElementVNode as w, normalizeClass as o, createVNode as m, createElementBlock as r, createCommentVNode as d, normalizeStyle as y, createTextVNode as b, toDisplayString as g, renderSlot as n, reactive as z } from "vue";
|
|
2
2
|
import { Dialog as k, DialogPanel as C, DialogTitle as S } from "@headlessui/vue";
|
|
3
3
|
import { cva as f, cx as v } from "@scalar/use-hooks/useBindCx";
|
|
4
4
|
import D from "../ScalarIconButton/ScalarIconButton.vue.js";
|
|
@@ -81,7 +81,7 @@ const T = /* @__PURE__ */ x({
|
|
|
81
81
|
a(v)(
|
|
82
82
|
e.size === "full" ? "scalar-modal-layout-full" : "scalar-modal-layout",
|
|
83
83
|
"fixed left-0 top-0 flex items-start justify-center",
|
|
84
|
-
"z-
|
|
84
|
+
"z-overlay h-dvh w-dvw",
|
|
85
85
|
"bg-backdrop opacity-0 dark:bg-backdrop-dark",
|
|
86
86
|
e.size === "full" && "flex"
|
|
87
87
|
)
|
|
@@ -89,7 +89,7 @@ const T = /* @__PURE__ */ x({
|
|
|
89
89
|
}, [
|
|
90
90
|
m(a(C), {
|
|
91
91
|
class: o(a(h)({ size: e.size, variant: e.variant })),
|
|
92
|
-
style:
|
|
92
|
+
style: y({ maxWidth: e.maxWidth })
|
|
93
93
|
}, {
|
|
94
94
|
default: t(() => [
|
|
95
95
|
e.title ? (l(), i(a(S), {
|
|
@@ -97,7 +97,7 @@ const T = /* @__PURE__ */ x({
|
|
|
97
97
|
class: "scalar-modal-header m-0 -mb-1 rounded-lg pt-3 px-3 text-left text-sm font-medium text-c-1"
|
|
98
98
|
}, {
|
|
99
99
|
default: t(() => [
|
|
100
|
-
|
|
100
|
+
b(g(e.title), 1)
|
|
101
101
|
]),
|
|
102
102
|
_: 1
|
|
103
103
|
})) : d("", !0),
|
|
@@ -24,19 +24,23 @@ import type { ScalarSidebarGroupSlots } from './types';
|
|
|
24
24
|
*/
|
|
25
25
|
declare const _default: __VLS_WithSlots<import("vue").DefineComponent<import("./types").ScalarSidebarItemProps & {
|
|
26
26
|
controlled?: boolean;
|
|
27
|
+
discrete?: boolean;
|
|
27
28
|
} & {
|
|
28
29
|
open?: boolean;
|
|
29
30
|
}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
30
31
|
"update:open": (value: boolean) => any;
|
|
31
32
|
} & {
|
|
32
33
|
click: (event: MouseEvent) => any;
|
|
34
|
+
toggle: (event: MouseEvent) => any;
|
|
33
35
|
}, string, import("vue").PublicProps, Readonly<import("./types").ScalarSidebarItemProps & {
|
|
34
36
|
controlled?: boolean;
|
|
37
|
+
discrete?: boolean;
|
|
35
38
|
} & {
|
|
36
39
|
open?: boolean;
|
|
37
40
|
}> & Readonly<{
|
|
38
41
|
onClick?: ((event: MouseEvent) => any) | undefined;
|
|
39
42
|
"onUpdate:open"?: ((value: boolean) => any) | undefined;
|
|
43
|
+
onToggle?: ((event: MouseEvent) => any) | undefined;
|
|
40
44
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, ScalarSidebarGroupSlots>;
|
|
41
45
|
export default _default;
|
|
42
46
|
type __VLS_WithSlots<T, S> = T & {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScalarSidebarGroup.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarSidebar/ScalarSidebarGroup.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ScalarSidebarGroup.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarSidebar/ScalarSidebarGroup.vue"],"names":[],"mappings":"AAyKA,OAAO,KAAK,EAA2B,uBAAuB,EAAE,MAAM,SAAS,CAAA;AAI/E;;;;;;;;;;;;;;;;;;;;;;GAsBG;;;;;WAwDM,OAAO;;;;;;;;;;WAAP,OAAO;;;;;;AAvDhB,wBAyQC;AAOD,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
|
|
@@ -1,87 +1,120 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useBindCx as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import { useSidebarGroups as
|
|
7
|
-
const
|
|
1
|
+
import { defineComponent as g, mergeModels as u, useModel as h, createBlock as k, openBlock as i, resolveDynamicComponent as $, normalizeProps as B, guardReactiveProps as C, unref as n, withCtx as t, createElementVNode as S, createElementBlock as r, createCommentVNode as p, renderSlot as l, createVNode as d, createSlots as N, normalizeStyle as V, createTextVNode as x, toDisplayString as z } from "vue";
|
|
2
|
+
import { useBindCx as M } from "@scalar/use-hooks/useBindCx";
|
|
3
|
+
import D from "./ScalarSidebarButton.vue.js";
|
|
4
|
+
import v from "./ScalarSidebarGroupToggle.vue.js";
|
|
5
|
+
import E from "./ScalarSidebarIndent.vue.js";
|
|
6
|
+
import { useSidebarGroups as G } from "./useSidebarGroups.js";
|
|
7
|
+
const O = { class: "group/group-button relative flex flex-col" }, P = {
|
|
8
|
+
key: 0,
|
|
9
|
+
class: "size-4"
|
|
10
|
+
}, T = ["aria-expanded"], j = {
|
|
8
11
|
key: 0,
|
|
9
12
|
class: "group/items flex flex-col gap-px"
|
|
10
|
-
},
|
|
11
|
-
...
|
|
13
|
+
}, w = {}, K = /* @__PURE__ */ g({
|
|
14
|
+
...w,
|
|
12
15
|
inheritAttrs: !1,
|
|
13
16
|
__name: "ScalarSidebarGroup",
|
|
14
|
-
props: /* @__PURE__ */
|
|
17
|
+
props: /* @__PURE__ */ u({
|
|
15
18
|
is: { default: "li" },
|
|
16
19
|
icon: { type: [Object, Function] },
|
|
17
20
|
active: { type: Boolean },
|
|
18
21
|
selected: { type: Boolean },
|
|
19
22
|
disabled: { type: Boolean },
|
|
20
23
|
indent: {},
|
|
21
|
-
controlled: { type: Boolean }
|
|
24
|
+
controlled: { type: Boolean },
|
|
25
|
+
discrete: { type: Boolean }
|
|
22
26
|
}, {
|
|
23
27
|
open: { type: Boolean, default: !1 },
|
|
24
28
|
openModifiers: {}
|
|
25
29
|
}),
|
|
26
|
-
emits: /* @__PURE__ */
|
|
27
|
-
setup(
|
|
28
|
-
const c =
|
|
29
|
-
c("click", e),
|
|
30
|
+
emits: /* @__PURE__ */ u(["click", "toggle"], ["update:open"]),
|
|
31
|
+
setup(a, { emit: m }) {
|
|
32
|
+
const c = m, o = h(a, "open"), { level: s } = G({ increment: !0 }), { cx: f } = M(), b = (e) => {
|
|
33
|
+
c("click", e), !a.controlled && !a.discrete && (o.value = !o.value);
|
|
34
|
+
}, y = (e) => {
|
|
35
|
+
c("toggle", e), !a.controlled && a.discrete && (o.value = !o.value);
|
|
30
36
|
};
|
|
31
|
-
return (e,
|
|
32
|
-
default:
|
|
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
|
-
|
|
37
|
+
return (e, A) => (i(), k($(e.is), B(C(n(f)("group/item flex flex-col gap-px"))), {
|
|
38
|
+
default: t(() => [
|
|
39
|
+
S("div", O, [
|
|
40
|
+
l(e.$slots, "before", { open: o.value }),
|
|
41
|
+
l(e.$slots, "button", {
|
|
42
|
+
level: n(s),
|
|
43
|
+
open: o.value
|
|
44
|
+
}, () => [
|
|
45
|
+
d(D, {
|
|
46
|
+
is: "button",
|
|
47
|
+
active: e.active,
|
|
48
|
+
"aria-expanded": o.value,
|
|
49
|
+
disabled: e.disabled,
|
|
50
|
+
indent: n(s),
|
|
51
|
+
selected: e.selected,
|
|
52
|
+
onClick: b
|
|
53
|
+
}, N({
|
|
54
|
+
indent: t(() => [
|
|
55
|
+
d(E, {
|
|
56
|
+
class: "mr-0 -my-2",
|
|
57
|
+
indent: n(s),
|
|
58
|
+
selected: e.selected
|
|
59
|
+
}, null, 8, ["indent", "selected"])
|
|
60
|
+
]),
|
|
61
|
+
icon: t(() => [
|
|
62
|
+
e.discrete ? (i(), r("div", P)) : l(e.$slots, "icon", {
|
|
63
|
+
key: 1,
|
|
58
64
|
open: o.value
|
|
59
|
-
},
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
}, [
|
|
67
|
-
e.$slots.aside ? {
|
|
68
|
-
name: "aside",
|
|
69
|
-
fn: l(() => [
|
|
70
|
-
t(e.$slots, "aside", { open: o.value })
|
|
65
|
+
}, () => [
|
|
66
|
+
d(v, {
|
|
67
|
+
icon: e.icon,
|
|
68
|
+
class: "text-c-3",
|
|
69
|
+
open: o.value
|
|
70
|
+
}, null, 8, ["icon", "open"])
|
|
71
|
+
])
|
|
71
72
|
]),
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
73
|
+
default: t(() => [
|
|
74
|
+
l(e.$slots, "default", { open: o.value })
|
|
75
|
+
]),
|
|
76
|
+
_: 2
|
|
77
|
+
}, [
|
|
78
|
+
e.$slots.aside ? {
|
|
79
|
+
name: "aside",
|
|
80
|
+
fn: t(() => [
|
|
81
|
+
l(e.$slots, "aside", { open: o.value })
|
|
82
|
+
]),
|
|
83
|
+
key: "0"
|
|
84
|
+
} : void 0
|
|
85
|
+
]), 1032, ["active", "aria-expanded", "disabled", "indent", "selected"]),
|
|
86
|
+
e.discrete ? (i(), r("button", {
|
|
87
|
+
key: 0,
|
|
88
|
+
type: "button",
|
|
89
|
+
"aria-expanded": o.value,
|
|
90
|
+
class: "absolute top-[1lh] -translate-y-1/2 p-0.75 rounded hover:bg-sidebar-b-hover left-[calc(4px+var(--scalar-sidebar-indent)*var(--scalar-sidebar-level))] text-c-3 hover:text-sidebar-c-1",
|
|
91
|
+
style: V({ "--scalar-sidebar-level": n(s) }),
|
|
92
|
+
onClick: y
|
|
93
|
+
}, [
|
|
94
|
+
l(e.$slots, "icon", { open: o.value }, () => [
|
|
95
|
+
d(v, {
|
|
96
|
+
icon: e.icon,
|
|
97
|
+
open: o.value
|
|
98
|
+
}, {
|
|
99
|
+
label: t(() => [
|
|
100
|
+
x(z(o.value ? "Close" : "Open") + " ", 1),
|
|
101
|
+
l(e.$slots, "default", { open: o.value })
|
|
102
|
+
]),
|
|
103
|
+
_: 3
|
|
104
|
+
}, 8, ["icon", "open"])
|
|
105
|
+
])
|
|
106
|
+
], 12, T)) : p("", !0)
|
|
107
|
+
]),
|
|
108
|
+
l(e.$slots, "after", { open: o.value })
|
|
75
109
|
]),
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
])) : g("", !0)
|
|
110
|
+
o.value ? (i(), r("ul", j, [
|
|
111
|
+
l(e.$slots, "items", { open: o.value })
|
|
112
|
+
])) : p("", !0)
|
|
80
113
|
]),
|
|
81
114
|
_: 3
|
|
82
115
|
}, 16));
|
|
83
116
|
}
|
|
84
117
|
});
|
|
85
118
|
export {
|
|
86
|
-
|
|
119
|
+
K as default
|
|
87
120
|
};
|
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
*/
|
|
17
17
|
declare const _default: __VLS_WithSlots<import("vue").DefineComponent<import("./types").ScalarSidebarItemProps & {
|
|
18
18
|
controlled?: boolean;
|
|
19
|
+
discrete?: boolean;
|
|
19
20
|
} & {
|
|
20
21
|
open?: boolean;
|
|
21
22
|
}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
@@ -24,6 +25,7 @@ declare const _default: __VLS_WithSlots<import("vue").DefineComponent<import("./
|
|
|
24
25
|
click: (event: MouseEvent) => any;
|
|
25
26
|
}, string, import("vue").PublicProps, Readonly<import("./types").ScalarSidebarItemProps & {
|
|
26
27
|
controlled?: boolean;
|
|
28
|
+
discrete?: boolean;
|
|
27
29
|
} & {
|
|
28
30
|
open?: boolean;
|
|
29
31
|
}> & Readonly<{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScalarSidebarNestedItems.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarSidebar/ScalarSidebarNestedItems.vue"],"names":[],"mappings":"AAyLA;;;;;;;;;;;;;;;GAeG
|
|
1
|
+
{"version":3,"file":"ScalarSidebarNestedItems.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarSidebar/ScalarSidebarNestedItems.vue"],"names":[],"mappings":"AAyLA;;;;;;;;;;;;;;;GAeG;;;;;WAiFM,OAAO;;;;;;;;;WAAP,OAAO;;;;;IAjEd,qCAAqC;cACzB,MAAM,OAAO;IACzB,iCAAiC;aACtB,MAAM,OAAO;IACxB,wBAAwB;WACf,MAAM,OAAO;IACtB,8BAA8B;YACpB,MAAM,OAAO;IACvB,+BAA+B;WACtB,MAAM,OAAO;IACtB,qCAAqC;mBACtB,MAAM,OAAO;IAC5B,mCAAmC;YACzB,MAAM,OAAO;;AA5BzB,wBAmTC;AAOD,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { ScalarIconArrowRight as
|
|
1
|
+
import { defineComponent as B, mergeModels as c, useModel as g, useTemplateRef as h, ref as T, createElementBlock as u, openBlock as f, normalizeStyle as _, normalizeClass as z, renderSlot as s, createVNode as t, mergeProps as I, unref as r, withCtx as l, Transition as N, createCommentVNode as A, normalizeProps as w, guardReactiveProps as x, createTextVNode as L, nextTick as m } from "vue";
|
|
2
|
+
import { ScalarIconArrowRight as M, ScalarIconCaretLeft as P, ScalarIconListDashes as R } from "@scalar/icons";
|
|
3
3
|
import p from "./ScalarSidebarButton.vue.js";
|
|
4
|
-
import
|
|
4
|
+
import V from "./ScalarSidebarItems.vue.js";
|
|
5
5
|
/* empty css */
|
|
6
|
-
import
|
|
6
|
+
import q from "./ScalarSidebarSpacer.vue.js";
|
|
7
7
|
import { findScrollContainer as v } from "./findScrollContainer.js";
|
|
8
8
|
import { useSidebarGroups as E } from "./useSidebarGroups.js";
|
|
9
9
|
import { useSidebarNestedItem as O } from "./useSidebarNestedItems.js";
|
|
@@ -11,27 +11,28 @@ import j from "../ScalarIcon/ScalarIconLegacyAdapter.vue.js";
|
|
|
11
11
|
const D = {
|
|
12
12
|
key: 0,
|
|
13
13
|
class: "absolute inset-0 translate-x-full"
|
|
14
|
-
}, F = {}, te = /* @__PURE__ */
|
|
14
|
+
}, F = {}, te = /* @__PURE__ */ B({
|
|
15
15
|
...F,
|
|
16
16
|
inheritAttrs: !1,
|
|
17
17
|
__name: "ScalarSidebarNestedItems",
|
|
18
18
|
props: /* @__PURE__ */ c({
|
|
19
19
|
is: {},
|
|
20
|
-
icon: { type: [Object, Function], default:
|
|
20
|
+
icon: { type: [Object, Function], default: R },
|
|
21
21
|
active: { type: Boolean },
|
|
22
22
|
selected: { type: Boolean },
|
|
23
23
|
disabled: { type: Boolean },
|
|
24
24
|
indent: {},
|
|
25
|
-
controlled: { type: Boolean }
|
|
25
|
+
controlled: { type: Boolean },
|
|
26
|
+
discrete: { type: Boolean }
|
|
26
27
|
}, {
|
|
27
28
|
open: { type: Boolean, default: !1 },
|
|
28
29
|
openModifiers: {}
|
|
29
30
|
}),
|
|
30
31
|
emits: /* @__PURE__ */ c(["click"], ["update:open"]),
|
|
31
32
|
setup(d, { emit: b }) {
|
|
32
|
-
const $ = b, o =
|
|
33
|
+
const $ = b, o = g(d, "open");
|
|
33
34
|
O(o);
|
|
34
|
-
const { level: S } = E({ reset: !0 }), a =
|
|
35
|
+
const { level: S } = E({ reset: !0 }), a = h("el"), i = T(0);
|
|
35
36
|
function k() {
|
|
36
37
|
i.value = v(a.value).scrollTop ?? 0, m(
|
|
37
38
|
() => a.value?.querySelector('button:not([aria-expanded="true"])')?.focus({ preventScroll: !0 })
|
|
@@ -49,13 +50,13 @@ const D = {
|
|
|
49
50
|
ref_key: "el",
|
|
50
51
|
ref: a,
|
|
51
52
|
class: z(["group/item group/nested-items contents", { "group/nested-items-open": o.value }]),
|
|
52
|
-
style:
|
|
53
|
+
style: _({ "--nested-items-offset": `${i.value}px` })
|
|
53
54
|
}, [
|
|
54
55
|
s(e.$slots, "button", {}, () => [
|
|
55
56
|
t(p, I({
|
|
56
57
|
is: "button",
|
|
57
58
|
"aria-expanded": o.value,
|
|
58
|
-
class: "text-sidebar-c-1 font-sidebar-active",
|
|
59
|
+
class: "text-sidebar-c-1 font-sidebar-active hover:text-sidebar-c-1",
|
|
59
60
|
disabled: e.disabled,
|
|
60
61
|
indent: r(S),
|
|
61
62
|
selected: e.selected
|
|
@@ -70,7 +71,7 @@ const D = {
|
|
|
70
71
|
]),
|
|
71
72
|
aside: l(() => [
|
|
72
73
|
s(e.$slots, "aside", {}, () => [
|
|
73
|
-
t(r(
|
|
74
|
+
t(r(M), { class: "size-4 text-sidebar-c-2" })
|
|
74
75
|
])
|
|
75
76
|
]),
|
|
76
77
|
default: l(() => [
|
|
@@ -88,7 +89,7 @@ const D = {
|
|
|
88
89
|
}, {
|
|
89
90
|
default: l(() => [
|
|
90
91
|
o.value ? (f(), u("div", D, [
|
|
91
|
-
t(
|
|
92
|
+
t(V, w(x(e.$attrs)), {
|
|
92
93
|
default: l(() => [
|
|
93
94
|
s(e.$slots, "back", {}, () => [
|
|
94
95
|
t(p, {
|
|
@@ -97,17 +98,17 @@ const D = {
|
|
|
97
98
|
onClick: n[0] || (n[0] = (G) => !e.controlled && (o.value = !1))
|
|
98
99
|
}, {
|
|
99
100
|
icon: l(() => [
|
|
100
|
-
t(r(
|
|
101
|
+
t(r(P), { class: "size-4 -m-px text-sidebar-c-2" })
|
|
101
102
|
]),
|
|
102
103
|
default: l(() => [
|
|
103
104
|
s(e.$slots, "back-label", {}, () => [
|
|
104
|
-
n[1] || (n[1] =
|
|
105
|
+
n[1] || (n[1] = L("Back", -1))
|
|
105
106
|
])
|
|
106
107
|
]),
|
|
107
108
|
_: 3
|
|
108
109
|
})
|
|
109
110
|
]),
|
|
110
|
-
t(
|
|
111
|
+
t(q, { class: "h-3" }),
|
|
111
112
|
s(e.$slots, "items")
|
|
112
113
|
]),
|
|
113
114
|
_: 3
|
|
@@ -47,6 +47,15 @@ export type ScalarSidebarGroupProps = ScalarSidebarItemProps & {
|
|
|
47
47
|
* </template>
|
|
48
48
|
*/
|
|
49
49
|
controlled?: boolean;
|
|
50
|
+
/**
|
|
51
|
+
* Enables separate buttons and events for the group toggle and item label
|
|
52
|
+
*
|
|
53
|
+
* @example
|
|
54
|
+
* <ScalarSidebarGroup discrete>
|
|
55
|
+
* ...
|
|
56
|
+
* </ScalarSidebarGroup>
|
|
57
|
+
*/
|
|
58
|
+
discrete?: boolean;
|
|
50
59
|
};
|
|
51
60
|
/** Scalar Sidebar Item Slots */
|
|
52
61
|
export type ScalarSidebarButtonSlots = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarSidebar/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,E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