@scalar/components 0.16.7 → 0.16.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/components/ScalarModal/ScalarModal.vue.js +1 -1
- package/dist/components/ScalarModal/ScalarModal.vue2.js +4 -4
- package/dist/components/ScalarSidebar/ScalarSidebarButton.vue.d.ts +2 -2
- package/dist/components/ScalarSidebar/ScalarSidebarButton.vue.d.ts.map +1 -1
- package/dist/components/ScalarSidebar/ScalarSidebarButton.vue.js +23 -16
- package/dist/components/ScalarSidebar/ScalarSidebarFooter.vue.js +11 -11
- 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 +92 -57
- package/dist/components/ScalarSidebar/ScalarSidebarIndent.vue.js +4 -4
- package/dist/components/ScalarSidebar/ScalarSidebarIndent.vue2.js +4 -4
- package/dist/components/ScalarSidebar/ScalarSidebarItem.vue.d.ts +8 -0
- package/dist/components/ScalarSidebar/ScalarSidebarItem.vue.d.ts.map +1 -1
- package/dist/components/ScalarSidebar/ScalarSidebarItem.vue.js +41 -22
- 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 +28 -27
- package/dist/components/ScalarSidebar/ScalarSidebarPlayground.vue.d.ts +170 -17
- package/dist/components/ScalarSidebar/ScalarSidebarPlayground.vue.d.ts.map +1 -1
- package/dist/components/ScalarSidebar/ScalarSidebarSearchInput.vue.js +12 -12
- package/dist/components/ScalarSidebar/types.d.ts +31 -8
- package/dist/components/ScalarSidebar/types.d.ts.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +8 -8
|
@@ -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),
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ScalarSidebarButtonSlots, ScalarSidebarItemProps } from './types';
|
|
2
2
|
/**
|
|
3
3
|
* Scalar Sidebar Button component
|
|
4
4
|
*
|
|
@@ -21,7 +21,7 @@ import type { ScalarSidebarItemProps, ScalarSidebarItemSlots } from './types';
|
|
|
21
21
|
* </template>
|
|
22
22
|
* </ScalarSidebarButton>
|
|
23
23
|
*/
|
|
24
|
-
declare const _default: __VLS_WithSlots<import("vue").DefineComponent<ScalarSidebarItemProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<ScalarSidebarItemProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>,
|
|
24
|
+
declare const _default: __VLS_WithSlots<import("vue").DefineComponent<ScalarSidebarItemProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<ScalarSidebarItemProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, ScalarSidebarButtonSlots>;
|
|
25
25
|
export default _default;
|
|
26
26
|
type __VLS_WithSlots<T, S> = T & {
|
|
27
27
|
new (): {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScalarSidebarButton.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarSidebar/ScalarSidebarButton.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ScalarSidebarButton.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarSidebar/ScalarSidebarButton.vue"],"names":[],"mappings":"AA8FA,OAAO,KAAK,EAAE,wBAAwB,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAA;AAG/E;;;;;;;;;;;;;;;;;;;;;GAqBG;;AACH,wBAoIC;AAOD,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as r, createBlock as o, openBlock as a, resolveDynamicComponent as l, mergeProps as c, unref as s, withCtx as u, renderSlot as t, createElementBlock as b, createCommentVNode as i, createElementVNode as f, createVNode as p } from "vue";
|
|
2
2
|
import { cva as m, useBindCx as v } from "@scalar/use-hooks/useBindCx";
|
|
3
3
|
import h from "./ScalarSidebarIndent.vue.js";
|
|
4
4
|
import y from "../ScalarIcon/ScalarIconLegacyAdapter.vue.js";
|
|
5
5
|
const B = {
|
|
6
6
|
key: 0,
|
|
7
7
|
class: "h-[1lh] *:size-4 mr-1"
|
|
8
|
-
}, k = { class: "flex-1 min-w-0" }, $ = {}, E = /* @__PURE__ */
|
|
8
|
+
}, k = { class: "flex-1 min-w-0" }, $ = {}, E = /* @__PURE__ */ r({
|
|
9
9
|
...$,
|
|
10
10
|
inheritAttrs: !1,
|
|
11
11
|
__name: "ScalarSidebarButton",
|
|
@@ -18,42 +18,49 @@ const B = {
|
|
|
18
18
|
indent: { default: 0 }
|
|
19
19
|
},
|
|
20
20
|
setup(g) {
|
|
21
|
-
const
|
|
21
|
+
const d = m({
|
|
22
22
|
base: [
|
|
23
|
-
"group/button flex items-stretch rounded p-2 ",
|
|
24
|
-
"font-sidebar leading-5 text-c-2 no-underline wrap-break-word"
|
|
23
|
+
"group/button peer/button flex items-stretch rounded p-2 ",
|
|
24
|
+
"font-sidebar leading-5 text-sidebar-c-2 no-underline wrap-break-word"
|
|
25
25
|
],
|
|
26
26
|
variants: {
|
|
27
|
-
active: { true: "text-c-
|
|
27
|
+
active: { true: "text-sidebar-c-active font-sidebar-active" },
|
|
28
28
|
disabled: { true: "cursor-auto" },
|
|
29
|
-
selected: {
|
|
29
|
+
selected: {
|
|
30
|
+
true: "cursor-auto bg-sidebar-b-active text-sidebar-c-active font-sidebar-active"
|
|
31
|
+
}
|
|
30
32
|
},
|
|
31
33
|
compoundVariants: [
|
|
32
|
-
{
|
|
34
|
+
{
|
|
35
|
+
selected: !1,
|
|
36
|
+
disabled: !1,
|
|
37
|
+
class: "hover:bg-sidebar-b-hover hover:text-sidebar-c-hover"
|
|
38
|
+
}
|
|
33
39
|
],
|
|
34
40
|
defaultVariants: { selected: !1, disabled: !1, active: !1 }
|
|
35
|
-
}), { cx:
|
|
36
|
-
return (e, C) => (
|
|
41
|
+
}), { cx: n } = v();
|
|
42
|
+
return (e, C) => (a(), o(l(e.is), c({
|
|
37
43
|
"aria-selected": e.selected,
|
|
38
44
|
type: e.is === "button" ? "button" : void 0
|
|
39
|
-
},
|
|
45
|
+
}, s(n)(s(d)({ selected: e.selected, disabled: e.disabled, active: e.active }))), {
|
|
40
46
|
default: u(() => [
|
|
41
47
|
t(e.$slots, "indent", {}, () => [
|
|
42
48
|
p(h, {
|
|
49
|
+
class: "-my-2",
|
|
43
50
|
disabled: e.disabled,
|
|
44
51
|
indent: e.indent,
|
|
45
52
|
selected: e.selected
|
|
46
53
|
}, null, 8, ["disabled", "indent", "selected"])
|
|
47
54
|
]),
|
|
48
|
-
e.icon || e.$slots.icon ? (
|
|
55
|
+
e.icon || e.$slots.icon ? (a(), b("div", B, [
|
|
49
56
|
t(e.$slots, "icon", {}, () => [
|
|
50
|
-
e.icon ? (
|
|
57
|
+
e.icon ? (a(), o(s(y), {
|
|
51
58
|
key: 0,
|
|
52
59
|
icon: e.icon
|
|
53
|
-
}, null, 8, ["icon"])) :
|
|
60
|
+
}, null, 8, ["icon"])) : i("", !0)
|
|
54
61
|
])
|
|
55
|
-
])) :
|
|
56
|
-
|
|
62
|
+
])) : i("", !0),
|
|
63
|
+
f("div", k, [
|
|
57
64
|
t(e.$slots, "default")
|
|
58
65
|
]),
|
|
59
66
|
t(e.$slots, "aside")
|
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as a, createElementBlock as l, openBlock as i, normalizeProps as d, guardReactiveProps as c, unref as s, renderSlot as r, createElementVNode as t, createVNode as m } from "vue";
|
|
2
2
|
import { useBindCx as f } from "@scalar/use-hooks/useBindCx";
|
|
3
3
|
import p from "../ScalarColorModeToggle/ScalarColorModeToggle.vue.js";
|
|
4
|
-
const _ = { class: "flex items-center" }, u = { class: "flex-1 min-w-0 flex items-center text-sm text-sidebar-c-2" },
|
|
5
|
-
...
|
|
4
|
+
const _ = { class: "flex items-center" }, u = { class: "flex-1 min-w-0 flex items-center text-sm text-sidebar-c-2" }, b = {}, w = /* @__PURE__ */ a({
|
|
5
|
+
...b,
|
|
6
6
|
inheritAttrs: !1,
|
|
7
7
|
__name: "ScalarSidebarFooter",
|
|
8
|
-
setup(
|
|
8
|
+
setup(x) {
|
|
9
9
|
const { cx: n } = f();
|
|
10
|
-
return (e, o) => (i(),
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
o[0] || (o[0] =
|
|
10
|
+
return (e, o) => (i(), l("div", d(c(s(n)("flex flex-col gap-3 p-3 border-t border-sidebar-border"))), [
|
|
11
|
+
r(e.$slots, "default"),
|
|
12
|
+
t("div", _, [
|
|
13
|
+
t("div", u, [
|
|
14
|
+
r(e.$slots, "description", {}, () => [
|
|
15
|
+
o[0] || (o[0] = t("a", {
|
|
16
16
|
class: "no-underline hover:underline",
|
|
17
17
|
href: "https://www.scalar.com",
|
|
18
18
|
target: "_blank"
|
|
19
19
|
}, " Powered by Scalar ", -1))
|
|
20
20
|
])
|
|
21
21
|
]),
|
|
22
|
-
|
|
22
|
+
r(e.$slots, "toggle", {}, () => [
|
|
23
23
|
m(s(p))
|
|
24
24
|
])
|
|
25
25
|
])
|
|
@@ -24,18 +24,22 @@ 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;
|
|
42
|
+
onToggle?: ((event: MouseEvent) => any) | undefined;
|
|
39
43
|
"onUpdate:open"?: ((value: boolean) => any) | undefined;
|
|
40
44
|
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, ScalarSidebarGroupSlots>;
|
|
41
45
|
export default _default;
|
|
@@ -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,85 +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
|
|
29
|
-
|
|
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,
|
|
37
|
+
return (e, A) => (i(), k($(e.is), B(C(n(f)("group/item flex flex-col gap-px"))), {
|
|
32
38
|
default: t(() => [
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
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,
|
|
64
|
+
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
|
+
])
|
|
72
|
+
]),
|
|
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
|
+
}, [
|
|
54
94
|
l(e.$slots, "icon", { open: o.value }, () => [
|
|
55
|
-
|
|
56
|
-
|
|
95
|
+
d(v, {
|
|
96
|
+
icon: e.icon,
|
|
57
97
|
open: o.value
|
|
58
|
-
},
|
|
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"])
|
|
59
105
|
])
|
|
60
|
-
]),
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
]),
|
|
64
|
-
_: 2
|
|
65
|
-
}, [
|
|
66
|
-
e.$slots.aside ? {
|
|
67
|
-
name: "aside",
|
|
68
|
-
fn: t(() => [
|
|
69
|
-
l(e.$slots, "aside", { open: o.value })
|
|
70
|
-
]),
|
|
71
|
-
key: "0"
|
|
72
|
-
} : void 0
|
|
73
|
-
]), 1032, ["active", "aria-expanded", "disabled", "indent", "selected"])
|
|
106
|
+
], 12, T)) : p("", !0)
|
|
107
|
+
]),
|
|
108
|
+
l(e.$slots, "after", { open: o.value })
|
|
74
109
|
]),
|
|
75
|
-
o.value ? (
|
|
110
|
+
o.value ? (i(), r("ul", j, [
|
|
76
111
|
l(e.$slots, "items", { open: o.value })
|
|
77
|
-
])) :
|
|
112
|
+
])) : p("", !0)
|
|
78
113
|
]),
|
|
79
114
|
_: 3
|
|
80
115
|
}, 16));
|
|
81
116
|
}
|
|
82
117
|
});
|
|
83
118
|
export {
|
|
84
|
-
|
|
119
|
+
K as default
|
|
85
120
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import o from "./ScalarSidebarIndent.vue2.js";
|
|
2
2
|
/* empty css */
|
|
3
|
-
import
|
|
4
|
-
const
|
|
3
|
+
import r from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
+
const c = /* @__PURE__ */ r(o, [["__scopeId", "data-v-3e080c68"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
c as default
|
|
7
7
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as o, computed as c, createElementBlock as t, openBlock as n, normalizeProps as u, guardReactiveProps as b, unref as m, Fragment as f, renderList as p, createElementVNode as v, createCommentVNode as
|
|
1
|
+
import { defineComponent as o, computed as c, createElementBlock as t, openBlock as n, normalizeProps as u, guardReactiveProps as b, unref as m, Fragment as f, renderList as p, createElementVNode as v, createCommentVNode as g, normalizeClass as y } from "vue";
|
|
2
2
|
import { useBindCx as B } from "@scalar/use-hooks/useBindCx";
|
|
3
3
|
const _ = {}, C = /* @__PURE__ */ o({
|
|
4
4
|
..._,
|
|
@@ -12,7 +12,7 @@ const _ = {}, C = /* @__PURE__ */ o({
|
|
|
12
12
|
setup(d) {
|
|
13
13
|
const a = c(() => Array.from({ length: d.indent }, (e, r) => r)), { cx: s } = B();
|
|
14
14
|
return (e, r) => (n(), t("div", u(b(
|
|
15
|
-
m(s)("scalar-sidebar-indent
|
|
15
|
+
m(s)("scalar-sidebar-indent flex justify-center", {
|
|
16
16
|
"mr-[calc(20px-var(--scalar-sidebar-indent))]": e.indent > 0,
|
|
17
17
|
"scalar-sidebar-indent-selected": e.selected
|
|
18
18
|
})
|
|
@@ -24,11 +24,11 @@ const _ = {}, C = /* @__PURE__ */ o({
|
|
|
24
24
|
r[0] || (r[0] = v("div", { class: "scalar-sidebar-indent-border absolute left-2 inset-y-0 w-border bg-sidebar-indent-border" }, null, -1)),
|
|
25
25
|
i === a.value.length - 1 ? (n(), t("div", {
|
|
26
26
|
key: 0,
|
|
27
|
-
class:
|
|
27
|
+
class: y([
|
|
28
28
|
"absolute left-2 inset-y-0 w-border",
|
|
29
29
|
e.disabled ? "" : e.selected ? "bg-sidebar-indent-border-active" : "group-hover/button:bg-sidebar-indent-border-hover"
|
|
30
30
|
])
|
|
31
|
-
}, null, 2)) :
|
|
31
|
+
}, null, 2)) : g("", !0)
|
|
32
32
|
]))), 128))
|
|
33
33
|
], 16));
|
|
34
34
|
}
|
|
@@ -15,6 +15,14 @@ import type { ScalarSidebarItemProps, ScalarSidebarItemSlots } from './types';
|
|
|
15
15
|
* <template #aside>
|
|
16
16
|
* <!-- After the button text -->
|
|
17
17
|
* </template>
|
|
18
|
+
* <!-- Content to display before the button but inside the list item -->
|
|
19
|
+
* <template #before>
|
|
20
|
+
* <!-- Before the button -->
|
|
21
|
+
* </template>
|
|
22
|
+
* <!-- Content to display after the button but inside the list item -->
|
|
23
|
+
* <template #after>
|
|
24
|
+
* <!-- After the button -->
|
|
25
|
+
* </template>
|
|
18
26
|
* </ScalarSidebarItem>
|
|
19
27
|
*/
|
|
20
28
|
declare const _default: __VLS_WithSlots<import("vue").DefineComponent<ScalarSidebarItemProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<ScalarSidebarItemProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, ScalarSidebarItemSlots>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScalarSidebarItem.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarSidebar/ScalarSidebarItem.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ScalarSidebarItem.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarSidebar/ScalarSidebarItem.vue"],"names":[],"mappings":"AAgFA,OAAO,KAAK,EAAE,sBAAsB,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAA;AAI7E;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;;AACH,wBA6FC;AAOD,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { defineComponent as a, createElementBlock as d, openBlock as f, normalizeProps as p, guardReactiveProps as m, unref as t, renderSlot as o, createVNode as c, mergeProps as u, createSlots as $, withCtx as n } from "vue";
|
|
2
|
+
import { useBindCx as v } from "@scalar/use-hooks/useBindCx";
|
|
3
|
+
import y from "./ScalarSidebarButton.vue.js";
|
|
4
|
+
import { useSidebarGroups as b } from "./useSidebarGroups.js";
|
|
5
|
+
const B = {}, P = /* @__PURE__ */ a({
|
|
6
|
+
...B,
|
|
6
7
|
inheritAttrs: !1,
|
|
7
8
|
__name: "ScalarSidebarItem",
|
|
8
9
|
props: {
|
|
@@ -11,25 +12,43 @@ const B = { class: "group/item contents" }, b = {}, C = /* @__PURE__ */ r({
|
|
|
11
12
|
active: { type: Boolean },
|
|
12
13
|
selected: { type: Boolean },
|
|
13
14
|
disabled: { type: Boolean },
|
|
14
|
-
indent: {
|
|
15
|
-
} }
|
|
15
|
+
indent: {}
|
|
16
16
|
},
|
|
17
|
-
setup(
|
|
18
|
-
const
|
|
19
|
-
return (e,
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
17
|
+
setup(r) {
|
|
18
|
+
const i = r, { level: s } = b(), { cx: l } = v();
|
|
19
|
+
return (e, k) => (f(), d("li", p(m(t(l)("group/item flex flex-col"))), [
|
|
20
|
+
o(e.$slots, "before"),
|
|
21
|
+
o(e.$slots, "button", { level: t(s) }, () => [
|
|
22
|
+
c(y, u(i, {
|
|
23
|
+
indent: e.indent ?? t(s)
|
|
24
|
+
}), $({ _: 2 }, [
|
|
25
|
+
e.$slots.default ? {
|
|
26
|
+
name: "default",
|
|
27
|
+
fn: n(() => [
|
|
28
|
+
o(e.$slots, "default")
|
|
29
|
+
]),
|
|
30
|
+
key: "0"
|
|
31
|
+
} : void 0,
|
|
32
|
+
e.$slots.icon ? {
|
|
33
|
+
name: "icon",
|
|
34
|
+
fn: n(() => [
|
|
35
|
+
o(e.$slots, "icon")
|
|
36
|
+
]),
|
|
37
|
+
key: "1"
|
|
38
|
+
} : void 0,
|
|
39
|
+
e.$slots.aside ? {
|
|
40
|
+
name: "aside",
|
|
41
|
+
fn: n(() => [
|
|
42
|
+
o(e.$slots, "aside")
|
|
43
|
+
]),
|
|
44
|
+
key: "2"
|
|
45
|
+
} : void 0
|
|
46
|
+
]), 1040, ["indent"])
|
|
47
|
+
]),
|
|
48
|
+
o(e.$slots, "after")
|
|
49
|
+
], 16));
|
|
31
50
|
}
|
|
32
51
|
});
|
|
33
52
|
export {
|
|
34
|
-
|
|
53
|
+
P as default
|
|
35
54
|
};
|
|
@@ -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"}
|