@scalar/components 0.14.16 → 0.14.18
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/ScalarCombobox/ScalarCombobox.stories.d.ts +6 -6
- package/dist/components/ScalarCombobox/ScalarCombobox.vue.d.ts +6 -7
- package/dist/components/ScalarCombobox/ScalarCombobox.vue.d.ts.map +1 -1
- package/dist/components/ScalarCombobox/ScalarComboboxOptions.vue.d.ts.map +1 -1
- package/dist/components/ScalarCombobox/ScalarComboboxOptions.vue.js +49 -49
- package/dist/components/ScalarCombobox/types.d.ts +3 -3
- package/dist/components/ScalarCombobox/types.d.ts.map +1 -1
- package/dist/components/ScalarDropdown/ScalarDropdown.stories.d.ts +16 -16
- package/dist/components/ScalarDropdown/ScalarDropdown.vue.d.ts +4 -4
- package/dist/components/ScalarDropdown/ScalarDropdown.vue.d.ts.map +1 -1
- package/dist/components/ScalarDropdown/ScalarDropdownMenu.vue.d.ts +4 -4
- package/dist/components/ScalarDropdown/ScalarDropdownMenu.vue.d.ts.map +1 -1
- package/dist/components/ScalarFileUpload/ScalarFileUpload.stories.d.ts +40 -40
- package/dist/components/ScalarFileUpload/ScalarFileUpload.vue.d.ts +10 -10
- package/dist/components/ScalarFileUpload/ScalarFileUpload.vue.d.ts.map +1 -1
- package/dist/components/ScalarFileUpload/types.d.ts +2 -2
- package/dist/components/ScalarFileUpload/types.d.ts.map +1 -1
- package/dist/components/ScalarFloating/ScalarFloating.vue.d.ts +4 -5
- package/dist/components/ScalarFloating/ScalarFloating.vue.d.ts.map +1 -1
- package/dist/components/ScalarHeader/ScalarHeader.stories.d.ts +26 -26
- package/dist/components/ScalarHeader/ScalarHeader.vue.d.ts +6 -6
- package/dist/components/ScalarHeader/ScalarHeader.vue.d.ts.map +1 -1
- package/dist/components/ScalarHeader/ScalarHeaderButton.vue.d.ts +2 -2
- package/dist/components/ScalarHeader/ScalarHeaderButton.vue.d.ts.map +1 -1
- package/dist/components/ScalarListbox/ScalarListbox.stories.d.ts +2 -2
- package/dist/components/ScalarListbox/ScalarListbox.vue.d.ts +2 -2
- package/dist/components/ScalarListbox/ScalarListbox.vue.d.ts.map +1 -1
- package/dist/components/ScalarMenu/ScalarMenu.stories.d.ts +32 -32
- package/dist/components/ScalarMenu/ScalarMenu.vue.d.ts +8 -8
- package/dist/components/ScalarMenu/ScalarMenu.vue.d.ts.map +1 -1
- package/dist/components/ScalarMenu/types.d.ts +2 -2
- package/dist/components/ScalarMenu/types.d.ts.map +1 -1
- package/dist/components/ScalarPopover/types.d.ts +3 -3
- package/dist/components/ScalarPopover/types.d.ts.map +1 -1
- package/dist/components/ScalarSidebar/ScalarSidebar.stories.d.ts +2 -1
- package/dist/components/ScalarSidebar/ScalarSidebar.stories.d.ts.map +1 -1
- package/dist/components/ScalarSidebar/ScalarSidebarButton.vue.d.ts.map +1 -1
- package/dist/components/ScalarSidebar/ScalarSidebarButton.vue.js +24 -18
- package/dist/components/ScalarSidebar/ScalarSidebarFooter.vue.d.ts +6 -6
- package/dist/components/ScalarSidebar/ScalarSidebarFooter.vue.d.ts.map +1 -1
- package/dist/components/ScalarSidebar/ScalarSidebarGroup.vue.d.ts +12 -12
- package/dist/components/ScalarSidebar/ScalarSidebarGroup.vue.d.ts.map +1 -1
- package/dist/components/ScalarSidebar/ScalarSidebarGroup.vue.js +26 -24
- package/dist/components/ScalarSidebar/ScalarSidebarGroup.vue2.js +4 -0
- package/dist/components/ScalarSidebar/ScalarSidebarGroupToggle.vue.d.ts +8 -8
- package/dist/components/ScalarSidebar/ScalarSidebarGroupToggle.vue.d.ts.map +1 -1
- package/dist/components/ScalarSidebar/ScalarSidebarGroupToggle.vue.js +26 -22
- package/dist/components/ScalarSidebar/ScalarSidebarIndent.vue.d.ts.map +1 -1
- package/dist/components/ScalarSidebar/ScalarSidebarIndent.vue.js +4 -4
- package/dist/components/ScalarSidebar/ScalarSidebarIndent.vue2.js +2 -2
- package/dist/components/ScalarSidebar/ScalarSidebarItem.vue.js +9 -8
- package/dist/components/ScalarSidebar/ScalarSidebarItems.vue.d.ts.map +1 -1
- package/dist/components/ScalarSidebar/ScalarSidebarItems.vue.js +16 -10
- package/dist/components/ScalarSidebar/{ScalarSidebarGroup.vue3.js → ScalarSidebarItems.vue3.js} +1 -1
- package/dist/components/ScalarSidebar/ScalarSidebarNestedItems.vue.d.ts +65 -0
- package/dist/components/ScalarSidebar/ScalarSidebarNestedItems.vue.d.ts.map +1 -0
- package/dist/components/ScalarSidebar/ScalarSidebarPlayground.vue.d.ts.map +1 -1
- package/dist/components/ScalarSidebar/ScalarSidebarSection.vue.d.ts +4 -4
- package/dist/components/ScalarSidebar/ScalarSidebarSection.vue.d.ts.map +1 -1
- package/dist/components/ScalarSidebar/ScalarSidebarSpacer.vue.d.ts +2 -2
- package/dist/components/ScalarSidebar/ScalarSidebarSpacer.vue.d.ts.map +1 -1
- package/dist/components/ScalarSidebar/findScrollContainer.d.ts +5 -0
- package/dist/components/ScalarSidebar/findScrollContainer.d.ts.map +1 -0
- package/dist/components/ScalarSidebar/findScrollContainer.test.d.ts +2 -0
- package/dist/components/ScalarSidebar/findScrollContainer.test.d.ts.map +1 -0
- package/dist/components/ScalarSidebar/types.d.ts +16 -5
- package/dist/components/ScalarSidebar/types.d.ts.map +1 -1
- package/dist/components/ScalarSidebar/useSidebarGroups.d.ts +10 -5
- package/dist/components/ScalarSidebar/useSidebarGroups.d.ts.map +1 -1
- package/dist/components/ScalarSidebar/useSidebarGroups.js +6 -8
- package/dist/components/ScalarSidebar/useSidebarNestedItems.d.ts +19 -0
- package/dist/components/ScalarSidebar/useSidebarNestedItems.d.ts.map +1 -0
- package/dist/components/ScalarSidebar/useSidebarNestedItems.js +12 -0
- package/dist/components/ScalarSidebar/useSidebarNestedItems.test.d.ts +2 -0
- package/dist/components/ScalarSidebar/useSidebarNestedItems.test.d.ts.map +1 -0
- package/dist/components/ScalarTeleport/ScalarTeleport.vue.d.ts +2 -2
- package/dist/components/ScalarTeleport/ScalarTeleport.vue.d.ts.map +1 -1
- package/dist/components/ScalarTeleport/ScalarTeleportRoot.vue.d.ts +2 -2
- package/dist/components/ScalarTeleport/ScalarTeleportRoot.vue.d.ts.map +1 -1
- package/dist/components/ScalarToggle/ScalarToggle.vue.js +2 -2
- package/dist/index.js +1 -1
- package/dist/style.css +1 -1
- package/package.json +5 -5
- package/dist/components/ScalarSidebar/ScalarSidebarItems.vue2.js +0 -4
|
@@ -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":"AAsFA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,kCAAkC,CAAA;AAM9E,OAAO,EAAE,KAAK,iBAAiB,EAAoB,MAAM,oBAAoB,CAAA;AAI7E;;;;;;;;;;;;;;GAcG;;iBAgCU,OAAO;;;;iBAAP,OAAO;;;;IAtBlB,qCAAqC;oBACrB;QAAE,IAAI,EAAE,OAAO,CAAA;KAAE,GAAG,OAAO;IAC3C,wCAAwC;mBACzB;QAAE,IAAI,EAAE,OAAO,CAAC;QAAC,KAAK,EAAE,iBAAiB,CAAA;KAAE,GAAG,OAAO;IACpE,mCAAmC;kBACrB;QAAE,IAAI,EAAE,OAAO,CAAA;KAAE,GAAG,OAAO;;IALzC,qCAAqC;oBACrB;QAAE,IAAI,EAAE,OAAO,CAAA;KAAE,GAAG,OAAO;IAC3C,wCAAwC;mBACzB;QAAE,IAAI,EAAE,OAAO,CAAC;QAAC,KAAK,EAAE,iBAAiB,CAAA;KAAE,GAAG,OAAO;IACpE,mCAAmC;kBACrB;QAAE,IAAI,EAAE,OAAO,CAAA;KAAE,GAAG,OAAO;;AAd3C,wBA+JC;AAWD,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
|
|
@@ -1,63 +1,65 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useBindCx as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import { useSidebarGroups as
|
|
7
|
-
const V = { class: "group/item contents" }, x = {}, A = /* @__PURE__ */
|
|
1
|
+
import { defineComponent as p, mergeModels as m, useModel as c, createElementBlock as f, openBlock as r, renderSlot as a, createBlock as v, createCommentVNode as b, unref as t, createVNode as s, withCtx as l, resolveDynamicComponent as B, normalizeProps as _, mergeProps as g } from "vue";
|
|
2
|
+
import { useBindCx as y } from "@scalar/use-hooks/useBindCx";
|
|
3
|
+
import C from "./ScalarSidebarButton.vue.js";
|
|
4
|
+
import S from "./ScalarSidebarGroupToggle.vue.js";
|
|
5
|
+
import $ from "./ScalarSidebarIndent.vue.js";
|
|
6
|
+
import { useSidebarGroups as k } from "./useSidebarGroups.js";
|
|
7
|
+
const V = { class: "group/item contents" }, x = {}, A = /* @__PURE__ */ p({
|
|
8
8
|
...x,
|
|
9
9
|
inheritAttrs: !1,
|
|
10
10
|
__name: "ScalarSidebarGroup",
|
|
11
|
-
props: /* @__PURE__ */
|
|
11
|
+
props: /* @__PURE__ */ m({
|
|
12
12
|
is: { default: "ul" },
|
|
13
13
|
icon: {},
|
|
14
|
+
active: { type: Boolean },
|
|
14
15
|
selected: { type: Boolean },
|
|
15
16
|
disabled: { type: Boolean },
|
|
16
17
|
indent: {}
|
|
17
18
|
}, {
|
|
18
|
-
modelValue: { type: Boolean },
|
|
19
|
+
modelValue: { type: Boolean, default: !1 },
|
|
19
20
|
modelModifiers: {}
|
|
20
21
|
}),
|
|
21
22
|
emits: ["update:modelValue"],
|
|
22
23
|
setup(d) {
|
|
23
|
-
const e = c(d, "modelValue"), { level:
|
|
24
|
-
return (o,
|
|
24
|
+
const e = c(d, "modelValue"), { level: n } = k({ increment: !0 }), { cx: u } = y();
|
|
25
|
+
return (o, i) => (r(), f("li", V, [
|
|
25
26
|
a(o.$slots, "button", {
|
|
26
|
-
level: n
|
|
27
|
+
level: t(n),
|
|
27
28
|
open: !!e.value
|
|
28
29
|
}, () => [
|
|
29
|
-
s(
|
|
30
|
+
s(C, {
|
|
30
31
|
is: "button",
|
|
31
32
|
class: "group/group-button",
|
|
32
33
|
"aria-expanded": e.value,
|
|
33
|
-
indent: n
|
|
34
|
+
indent: t(n),
|
|
35
|
+
active: o.active,
|
|
34
36
|
selected: o.selected,
|
|
35
37
|
disabled: o.disabled,
|
|
36
38
|
icon: o.icon,
|
|
37
|
-
onClick:
|
|
39
|
+
onClick: i[0] || (i[0] = (M) => e.value = !e.value)
|
|
38
40
|
}, {
|
|
39
|
-
indent:
|
|
40
|
-
s(
|
|
41
|
+
indent: l(() => [
|
|
42
|
+
s($, {
|
|
41
43
|
class: "mr-0",
|
|
42
|
-
indent: n
|
|
44
|
+
indent: t(n)
|
|
43
45
|
}, null, 8, ["indent"])
|
|
44
46
|
]),
|
|
45
|
-
icon:
|
|
46
|
-
s(
|
|
47
|
+
icon: l(() => [
|
|
48
|
+
s(S, {
|
|
47
49
|
class: "text-c-3",
|
|
48
50
|
open: e.value
|
|
49
51
|
}, null, 8, ["open"])
|
|
50
52
|
]),
|
|
51
|
-
default:
|
|
53
|
+
default: l(() => [
|
|
52
54
|
a(o.$slots, "default", {
|
|
53
55
|
open: !!e.value
|
|
54
56
|
})
|
|
55
57
|
]),
|
|
56
58
|
_: 3
|
|
57
|
-
}, 8, ["aria-expanded", "indent", "selected", "disabled", "icon"])
|
|
59
|
+
}, 8, ["aria-expanded", "indent", "active", "selected", "disabled", "icon"])
|
|
58
60
|
]),
|
|
59
|
-
e.value ? (
|
|
60
|
-
default:
|
|
61
|
+
e.value ? (r(), v(B(o.is), _(g({ key: 0 }, t(u)("group/items flex flex-col gap-px"))), {
|
|
62
|
+
default: l(() => [
|
|
61
63
|
a(o.$slots, "items", {
|
|
62
64
|
open: !!e.value
|
|
63
65
|
})
|
|
@@ -25,22 +25,22 @@ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
|
25
25
|
icon?: Icon | ScalarIconComponent;
|
|
26
26
|
}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, Readonly<{
|
|
27
27
|
/** Override the toggle icon */
|
|
28
|
-
default
|
|
28
|
+
default?(props: {
|
|
29
29
|
open: boolean;
|
|
30
|
-
})
|
|
30
|
+
}): unknown;
|
|
31
31
|
/** Override the screen reader label */
|
|
32
|
-
label
|
|
32
|
+
label?(props: {
|
|
33
33
|
open: boolean;
|
|
34
|
-
})
|
|
34
|
+
}): unknown;
|
|
35
35
|
}> & {
|
|
36
36
|
/** Override the toggle icon */
|
|
37
|
-
default
|
|
37
|
+
default?(props: {
|
|
38
38
|
open: boolean;
|
|
39
|
-
})
|
|
39
|
+
}): unknown;
|
|
40
40
|
/** Override the screen reader label */
|
|
41
|
-
label
|
|
41
|
+
label?(props: {
|
|
42
42
|
open: boolean;
|
|
43
|
-
})
|
|
43
|
+
}): unknown;
|
|
44
44
|
}>;
|
|
45
45
|
export default _default;
|
|
46
46
|
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScalarSidebarGroupToggle.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarSidebar/ScalarSidebarGroupToggle.vue"],"names":[],"mappings":"AAsEA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAA;AAG9D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,KAAK,CAAA;AAEpC,OAAO,EAAE,KAAK,IAAI,EAA2B,MAAM,eAAe,CAAA;AAIlE;;;;;;;GAOG;;IAID,+BAA+B;SAC1B,SAAS,GAAG,MAAM;IACvB,wCAAwC;WACjC,OAAO;IACd,yBAAyB;WAClB,IAAI,GAAG,mBAAmB;;IALjC,+BAA+B;SAC1B,SAAS,GAAG,MAAM;IACvB,wCAAwC;WACjC,OAAO;IACd,yBAAyB;WAClB,IAAI,GAAG,mBAAmB;;
|
|
1
|
+
{"version":3,"file":"ScalarSidebarGroupToggle.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarSidebar/ScalarSidebarGroupToggle.vue"],"names":[],"mappings":"AAsEA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAA;AAG9D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,KAAK,CAAA;AAEpC,OAAO,EAAE,KAAK,IAAI,EAA2B,MAAM,eAAe,CAAA;AAIlE;;;;;;;GAOG;;IAID,+BAA+B;SAC1B,SAAS,GAAG,MAAM;IACvB,wCAAwC;WACjC,OAAO;IACd,yBAAyB;WAClB,IAAI,GAAG,mBAAmB;;IALjC,+BAA+B;SAC1B,SAAS,GAAG,MAAM;IACvB,wCAAwC;WACjC,OAAO;IACd,yBAAyB;WAClB,IAAI,GAAG,mBAAmB;;IAMjC,+BAA+B;oBACf;QAAE,IAAI,EAAE,OAAO,CAAA;KAAE,GAAG,OAAO;IAC3C,uCAAuC;kBACzB;QAAE,IAAI,EAAE,OAAO,CAAA;KAAE,GAAG,OAAO;;IAHzC,+BAA+B;oBACf;QAAE,IAAI,EAAE,OAAO,CAAA;KAAE,GAAG,OAAO;IAC3C,uCAAuC;kBACzB;QAAE,IAAI,EAAE,OAAO,CAAA;KAAE,GAAG,OAAO;;AAjB3C,wBAwHC;AAWD,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
|
|
@@ -1,35 +1,39 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { ScalarIconCaretRight as
|
|
3
|
-
import { cva as
|
|
4
|
-
import
|
|
5
|
-
const
|
|
6
|
-
...
|
|
1
|
+
import { defineComponent as i, createBlock as n, openBlock as t, resolveDynamicComponent as l, mergeProps as p, unref as o, withCtx as f, renderSlot as r, createElementVNode as c, createTextVNode as u, toDisplayString as d } from "vue";
|
|
2
|
+
import { ScalarIconCaretRight as m } from "@scalar/icons";
|
|
3
|
+
import { cva as y, useBindCx as _ } from "@scalar/use-hooks/useBindCx";
|
|
4
|
+
import b from "../ScalarIcon/ScalarIconLegacyAdapter.vue.js";
|
|
5
|
+
const g = { class: "sr-only" }, h = {}, $ = /* @__PURE__ */ i({
|
|
6
|
+
...h,
|
|
7
7
|
inheritAttrs: !1,
|
|
8
8
|
__name: "ScalarSidebarGroupToggle",
|
|
9
9
|
props: {
|
|
10
10
|
is: { default: "div" },
|
|
11
11
|
open: { type: Boolean, default: !1 },
|
|
12
|
-
icon: {
|
|
12
|
+
icon: {}
|
|
13
13
|
},
|
|
14
|
-
setup(
|
|
15
|
-
const
|
|
16
|
-
base: "size-
|
|
14
|
+
setup(v) {
|
|
15
|
+
const s = y({
|
|
16
|
+
base: "size-4 flex items-center justify-center transition-transform duration-100",
|
|
17
17
|
variants: { open: { true: "rotate-90" } },
|
|
18
18
|
defaultVariants: { open: !1 }
|
|
19
|
-
}), { cx: a } =
|
|
20
|
-
return (e,
|
|
19
|
+
}), { cx: a } = _();
|
|
20
|
+
return (e, C) => (t(), n(l(e.is), p({
|
|
21
21
|
type: e.is === "button" ? "button" : void 0
|
|
22
|
-
}, o(a)(o(
|
|
23
|
-
default:
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
22
|
+
}, o(a)(o(s)({ open: e.open }))), {
|
|
23
|
+
default: f(() => [
|
|
24
|
+
r(e.$slots, "default", { open: e.open }, () => [
|
|
25
|
+
e.icon ? (t(), n(o(b), {
|
|
26
|
+
key: 0,
|
|
27
|
+
icon: e.icon
|
|
28
|
+
}, null, 8, ["icon"])) : (t(), n(o(m), {
|
|
29
|
+
key: 1,
|
|
30
|
+
class: "size-3",
|
|
27
31
|
weight: "bold"
|
|
28
|
-
}
|
|
32
|
+
}))
|
|
29
33
|
]),
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
34
|
+
c("span", g, [
|
|
35
|
+
r(e.$slots, "label", { open: e.open }, () => [
|
|
36
|
+
u(d(e.open ? "Close" : "Open") + " Group ", 1)
|
|
33
37
|
])
|
|
34
38
|
])
|
|
35
39
|
]),
|
|
@@ -38,5 +42,5 @@ const v = { class: "sr-only" }, y = {}, k = /* @__PURE__ */ r({
|
|
|
38
42
|
}
|
|
39
43
|
});
|
|
40
44
|
export {
|
|
41
|
-
|
|
45
|
+
$ as default
|
|
42
46
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScalarSidebarIndent.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarSidebar/ScalarSidebarIndent.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ScalarSidebarIndent.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarSidebar/ScalarSidebarIndent.vue"],"names":[],"mappings":"AAyFA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAA;AAI3D;;;;;GAKG;;IAID,iDAAiD;aACxC,iBAAiB;IAC1B,oDAAoD;eACzC,OAAO;IAClB,0DAA0D;eAC/C,OAAO;;IALlB,iDAAiD;aACxC,iBAAiB;IAC1B,oDAAoD;eACzC,OAAO;IAClB,0DAA0D;eAC/C,OAAO;;AARpB,wBAsHC"}
|
|
@@ -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
|
};
|
|
@@ -21,11 +21,11 @@ const _ = {}, C = /* @__PURE__ */ o({
|
|
|
21
21
|
key: l,
|
|
22
22
|
class: "relative w-[var(--scalar-sidebar-indent)]"
|
|
23
23
|
}, [
|
|
24
|
-
r[0] || (r[0] = v("div", { class: "scalar-sidebar-indent-border absolute left-
|
|
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
27
|
class: y([
|
|
28
|
-
"absolute left-
|
|
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
31
|
}, null, 2)) : g("", !0)
|
|
@@ -1,25 +1,26 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as r, useSlots as s, createElementBlock as i, openBlock as a, createVNode as l, mergeProps as p, unref as d, createSlots as c, renderList as _, withCtx as m, renderSlot as f } from "vue";
|
|
2
2
|
import u from "./ScalarSidebarButton.vue.js";
|
|
3
3
|
import { useSidebarGroups as S } from "./useSidebarGroups.js";
|
|
4
|
-
const
|
|
5
|
-
...
|
|
4
|
+
const B = { class: "group/item contents" }, h = {}, C = /* @__PURE__ */ r({
|
|
5
|
+
...h,
|
|
6
6
|
inheritAttrs: !1,
|
|
7
7
|
__name: "ScalarSidebarItem",
|
|
8
8
|
props: {
|
|
9
9
|
is: {},
|
|
10
10
|
icon: {},
|
|
11
|
+
active: { type: Boolean },
|
|
11
12
|
selected: { type: Boolean },
|
|
12
13
|
disabled: { type: Boolean },
|
|
13
14
|
indent: { default: () => {
|
|
14
15
|
} }
|
|
15
16
|
},
|
|
16
17
|
setup($) {
|
|
17
|
-
const o = s(), { level:
|
|
18
|
-
return (e, b) => (
|
|
19
|
-
|
|
20
|
-
indent: e.indent ??
|
|
18
|
+
const o = s(), { level: n } = S();
|
|
19
|
+
return (e, b) => (a(), i("li", B, [
|
|
20
|
+
l(u, p({ ...e.$attrs, ...e.$props }, {
|
|
21
|
+
indent: e.indent ?? d(n)
|
|
21
22
|
}), c({ _: 2 }, [
|
|
22
|
-
_(o, (
|
|
23
|
+
_(o, (v, t) => ({
|
|
23
24
|
name: t,
|
|
24
25
|
fn: m(() => [
|
|
25
26
|
f(e.$slots, t)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScalarSidebarItems.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarSidebar/ScalarSidebarItems.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ScalarSidebarItems.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarSidebar/ScalarSidebarItems.vue"],"names":[],"mappings":"AAuEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,KAAK,CAAA;AAMpC;;;;;;;;;;;;GAYG;;SAII,SAAS,GAAG,MAAM;;SAAlB,SAAS,GAAG,MAAM;;qBA0DI,GAAG;;AA7DhC,wBA8FC;AAWD,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
|
|
@@ -1,22 +1,28 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useBindCx as
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { defineComponent as a, createBlock as s, openBlock as n, resolveDynamicComponent as l, normalizeProps as i, guardReactiveProps as p, unref as t, withCtx as f, renderSlot as m } from "vue";
|
|
2
|
+
import { useBindCx as u } from "@scalar/use-hooks/useBindCx";
|
|
3
|
+
import { useSidebarNestedItems as c } from "./useSidebarNestedItems.js";
|
|
4
|
+
const d = {}, g = /* @__PURE__ */ a({
|
|
5
|
+
...d,
|
|
5
6
|
inheritAttrs: !1,
|
|
6
7
|
__name: "ScalarSidebarItems",
|
|
7
8
|
props: {
|
|
8
9
|
is: { default: "ul" }
|
|
9
10
|
},
|
|
10
|
-
setup(
|
|
11
|
-
const { cx:
|
|
12
|
-
return (e,
|
|
13
|
-
|
|
14
|
-
|
|
11
|
+
setup(_) {
|
|
12
|
+
const { open: r } = c(), { cx: o } = u();
|
|
13
|
+
return (e, x) => (n(), s(l(e.is), i(p(
|
|
14
|
+
t(o)(
|
|
15
|
+
"group/items relative flex flex-col text-base p-3 gap-px transition-transform duration-300",
|
|
16
|
+
t(r) ? "-translate-x-full" : "translate-x-0"
|
|
17
|
+
)
|
|
18
|
+
)), {
|
|
19
|
+
default: f(() => [
|
|
20
|
+
m(e.$slots, "default")
|
|
15
21
|
]),
|
|
16
22
|
_: 3
|
|
17
23
|
}, 16));
|
|
18
24
|
}
|
|
19
25
|
});
|
|
20
26
|
export {
|
|
21
|
-
|
|
27
|
+
g as default
|
|
22
28
|
};
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import type { ScalarSidebarItemProps } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Scalar Sidebar Nested Items component
|
|
4
|
+
*
|
|
5
|
+
* A provides list of items thats presented over the parent list
|
|
6
|
+
* Needs to be nested inside a ScalarSidebarItems component
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* <ScalarSidebarNestedItems v-model="open">
|
|
10
|
+
* <!-- Item text -->
|
|
11
|
+
* <template #items>
|
|
12
|
+
* <ScalarSidebarItem>...</ScalarSidebarItem>
|
|
13
|
+
* <ScalarSidebarItem>...</ScalarSidebarItem>
|
|
14
|
+
* <ScalarSidebarItem>...</ScalarSidebarItem>
|
|
15
|
+
* </template>
|
|
16
|
+
* </ScalarSidebarNestedItems>
|
|
17
|
+
*/
|
|
18
|
+
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
|
|
19
|
+
modelValue?: boolean;
|
|
20
|
+
} & ScalarSidebarItemProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
21
|
+
"update:modelValue": (value: boolean) => any;
|
|
22
|
+
}, string, import("vue").PublicProps, Readonly<{
|
|
23
|
+
modelValue?: boolean;
|
|
24
|
+
} & ScalarSidebarItemProps> & Readonly<{
|
|
25
|
+
"onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
|
|
26
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {
|
|
27
|
+
el: HTMLLIElement;
|
|
28
|
+
}, any>, Readonly<{
|
|
29
|
+
/** The text content of the button */
|
|
30
|
+
default?: () => unknown;
|
|
31
|
+
/** Override the entire button */
|
|
32
|
+
button?: () => unknown;
|
|
33
|
+
/** Override the icon */
|
|
34
|
+
icon?: () => unknown;
|
|
35
|
+
/** Override the aside slot */
|
|
36
|
+
aside?: () => unknown;
|
|
37
|
+
/** Override the back button */
|
|
38
|
+
back?: () => unknown;
|
|
39
|
+
/** Override the back button label */
|
|
40
|
+
'back-label'?: () => unknown;
|
|
41
|
+
/** The list of sidebar subitems */
|
|
42
|
+
items?: () => unknown;
|
|
43
|
+
}> & {
|
|
44
|
+
/** The text content of the button */
|
|
45
|
+
default?: () => unknown;
|
|
46
|
+
/** Override the entire button */
|
|
47
|
+
button?: () => unknown;
|
|
48
|
+
/** Override the icon */
|
|
49
|
+
icon?: () => unknown;
|
|
50
|
+
/** Override the aside slot */
|
|
51
|
+
aside?: () => unknown;
|
|
52
|
+
/** Override the back button */
|
|
53
|
+
back?: () => unknown;
|
|
54
|
+
/** Override the back button label */
|
|
55
|
+
'back-label'?: () => unknown;
|
|
56
|
+
/** The list of sidebar subitems */
|
|
57
|
+
items?: () => unknown;
|
|
58
|
+
}>;
|
|
59
|
+
export default _default;
|
|
60
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
61
|
+
new (): {
|
|
62
|
+
$slots: S;
|
|
63
|
+
};
|
|
64
|
+
};
|
|
65
|
+
//# sourceMappingURL=ScalarSidebarNestedItems.vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ScalarSidebarNestedItems.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarSidebar/ScalarSidebarNestedItems.vue"],"names":[],"mappings":"AAmKA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAA;AAMrD;;;;;;;;;;;;;;;GAeG;;iBAoEU,OAAO;;;;iBAAP,OAAO;;;;;;IAzDlB,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;;IAbvB,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;;AAvBzB,wBA+SC;AAWD,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScalarSidebarPlayground.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarSidebar/ScalarSidebarPlayground.vue"],"names":[],"mappings":"AAkDA,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,MAAM,CAAA;CACf,CAAC;AAaF,KAAK,iBAAiB,GAAG;IACzB,UAAU,CAAC,EAAE,MAAM,CAAC;CACnB,GAAG,WAAW,CAAC;AAKhB,iBAAS,cAAc;
|
|
1
|
+
{"version":3,"file":"ScalarSidebarPlayground.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarSidebar/ScalarSidebarPlayground.vue"],"names":[],"mappings":"AAkDA,KAAK,WAAW,GAAG;IACjB,MAAM,EAAE,MAAM,CAAA;CACf,CAAC;AAaF,KAAK,iBAAiB,GAAG;IACzB,UAAU,CAAC,EAAE,MAAM,CAAC;CACnB,GAAG,WAAW,CAAC;AAKhB,iBAAS,cAAc;WAyGT,OAAO,IAA6B;;wBAVtB,GAAG;yBACD,GAAG;wBACJ,GAAG;;;;EAa/B;AAaD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe;;;;6FAQnB,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAAnG,wBAAoG;AAWpG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
|
|
@@ -19,14 +19,14 @@ import type { ScalarSidebarItemProps } from './types';
|
|
|
19
19
|
*/
|
|
20
20
|
declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<ScalarSidebarItemProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<ScalarSidebarItemProps> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, Readonly<{
|
|
21
21
|
/** The text content of the toggle */
|
|
22
|
-
default
|
|
22
|
+
default?(): unknown;
|
|
23
23
|
/** The list of sidebar subitems */
|
|
24
|
-
items
|
|
24
|
+
items?(): unknown;
|
|
25
25
|
}> & {
|
|
26
26
|
/** The text content of the toggle */
|
|
27
|
-
default
|
|
27
|
+
default?(): unknown;
|
|
28
28
|
/** The list of sidebar subitems */
|
|
29
|
-
items
|
|
29
|
+
items?(): unknown;
|
|
30
30
|
}>;
|
|
31
31
|
export default _default;
|
|
32
32
|
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScalarSidebarSection.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarSidebar/ScalarSidebarSection.vue"],"names":[],"mappings":"AA0FA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAA;AAKrD;;;;;;;;;;;;;;;;;GAiBG;;IAQD,qCAAqC;
|
|
1
|
+
{"version":3,"file":"ScalarSidebarSection.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarSidebar/ScalarSidebarSection.vue"],"names":[],"mappings":"AA0FA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAA;AAKrD;;;;;;;;;;;;;;;;;GAiBG;;IAQD,qCAAqC;gBACzB,OAAO;IACnB,mCAAmC;cACzB,OAAO;;IAHjB,qCAAqC;gBACzB,OAAO;IACnB,mCAAmC;cACzB,OAAO;;AAVnB,wBAuHC;AAWD,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
|
|
@@ -10,9 +10,9 @@ import type { SidebarGroupLevel } from './useSidebarGroups.js';
|
|
|
10
10
|
* <ScalarSidebarSpacer />
|
|
11
11
|
*/
|
|
12
12
|
declare const _default: import("vue").DefineComponent<{
|
|
13
|
-
indent
|
|
13
|
+
indent?: SidebarGroupLevel;
|
|
14
14
|
}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{
|
|
15
|
-
indent
|
|
15
|
+
indent?: SidebarGroupLevel;
|
|
16
16
|
}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
17
17
|
export default _default;
|
|
18
18
|
//# sourceMappingURL=ScalarSidebarSpacer.vue.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScalarSidebarSpacer.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarSidebar/ScalarSidebarSpacer.vue"],"names":[],"mappings":"AAkCA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAA;AAI3D;;;;;;;;;GASG;;
|
|
1
|
+
{"version":3,"file":"ScalarSidebarSpacer.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarSidebar/ScalarSidebarSpacer.vue"],"names":[],"mappings":"AAkCA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAA;AAI3D;;;;;;;;;GASG;;aAG2B,iBAAiB;;aAAjB,iBAAiB;;AAF/C,wBA2EC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"findScrollContainer.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarSidebar/findScrollContainer.ts"],"names":[],"mappings":"AAaA;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,CAAC,EAAE,WAAW,GAAG,IAAI,EAAE,SAAS,GAAE,GAAG,GAAG,GAAS,eAiB3F"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"findScrollContainer.test.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarSidebar/findScrollContainer.test.ts"],"names":[],"mappings":""}
|
|
@@ -8,8 +8,19 @@ export type ScalarSidebarItemProps = {
|
|
|
8
8
|
is?: Component | string;
|
|
9
9
|
/** Sets the icon for the item */
|
|
10
10
|
icon?: Icon | ScalarIconComponent;
|
|
11
|
-
/**
|
|
11
|
+
/**
|
|
12
|
+
* Wether or not the item is active
|
|
13
|
+
*
|
|
14
|
+
* Should be true if the item or any of its children are being displayed on the page
|
|
15
|
+
*/
|
|
16
|
+
active?: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Wether or not the item is selected
|
|
19
|
+
*
|
|
20
|
+
* Should be true if the item is being displayed on the page
|
|
21
|
+
*/
|
|
12
22
|
selected?: boolean;
|
|
23
|
+
/** Wether or not the item is disabled */
|
|
13
24
|
disabled?: boolean;
|
|
14
25
|
/** The level of the sidebar group */
|
|
15
26
|
indent?: SidebarGroupLevel;
|
|
@@ -17,12 +28,12 @@ export type ScalarSidebarItemProps = {
|
|
|
17
28
|
/** Scalar Sidebar Item Slots */
|
|
18
29
|
export type ScalarSidebarItemSlots = {
|
|
19
30
|
/** The main text content of the button */
|
|
20
|
-
default
|
|
31
|
+
default?(): unknown;
|
|
21
32
|
/** Override the icon */
|
|
22
|
-
icon
|
|
33
|
+
icon?(): unknown;
|
|
23
34
|
/** The content to display to the right of the text content */
|
|
24
|
-
aside
|
|
35
|
+
aside?(): unknown;
|
|
25
36
|
/** The indent to display before content */
|
|
26
|
-
indent
|
|
37
|
+
indent?(): unknown;
|
|
27
38
|
};
|
|
28
39
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarSidebar/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,KAAK,CAAA;AAEpC,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,eAAe,CAAA;AACzC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAA;AAC3D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAA;AAE9D,gCAAgC;AAChC,MAAM,MAAM,sBAAsB,GAAG;IACnC,qCAAqC;IACrC,EAAE,CAAC,EAAE,SAAS,GAAG,MAAM,CAAA;IACvB,iCAAiC;IACjC,IAAI,CAAC,EAAE,IAAI,GAAG,mBAAmB,CAAA;IACjC,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarSidebar/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,KAAK,CAAA;AAEpC,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,eAAe,CAAA;AACzC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAA;AAC3D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAA;AAE9D,gCAAgC;AAChC,MAAM,MAAM,sBAAsB,GAAG;IACnC,qCAAqC;IACrC,EAAE,CAAC,EAAE,SAAS,GAAG,MAAM,CAAA;IACvB,iCAAiC;IACjC,IAAI,CAAC,EAAE,IAAI,GAAG,mBAAmB,CAAA;IACjC;;;;OAIG;IACH,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,yCAAyC;IACzC,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,qCAAqC;IACrC,MAAM,CAAC,EAAE,iBAAiB,CAAA;CAC3B,CAAA;AAED,gCAAgC;AAChC,MAAM,MAAM,sBAAsB,GAAG;IACnC,0CAA0C;IAC1C,OAAO,CAAC,IAAI,OAAO,CAAA;IACnB,wBAAwB;IACxB,IAAI,CAAC,IAAI,OAAO,CAAA;IAChB,8DAA8D;IAC9D,KAAK,CAAC,IAAI,OAAO,CAAA;IACjB,2CAA2C;IAC3C,MAAM,CAAC,IAAI,OAAO,CAAA;CACnB,CAAA"}
|
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
import { type InjectionKey } from 'vue';
|
|
2
|
+
type SidebarGroupOptions = {
|
|
3
|
+
/** Increment the level of the sidebar groups */
|
|
4
|
+
increment?: boolean;
|
|
5
|
+
/** Reset the level of the sidebar groups */
|
|
6
|
+
reset?: boolean;
|
|
7
|
+
};
|
|
2
8
|
/**
|
|
3
9
|
* The level of the sidebar groups
|
|
4
10
|
*
|
|
@@ -14,12 +20,11 @@ export declare const SIDEBAR_GROUPS_SYMBOL: InjectionKey<SidebarGroupLevel>;
|
|
|
14
20
|
/**
|
|
15
21
|
* Get the current level of the sidebar groups
|
|
16
22
|
*
|
|
17
|
-
* Optionally increments the level of the sidebar groups
|
|
23
|
+
* Optionally increments or resets the level of the sidebar groups
|
|
24
|
+
* Always returns the current level even if the level is incremented or reset
|
|
18
25
|
*/
|
|
19
|
-
export declare const useSidebarGroups: (
|
|
20
|
-
/** Whether to increment the level of the sidebar groups */
|
|
21
|
-
increment?: boolean;
|
|
22
|
-
}) => {
|
|
26
|
+
export declare const useSidebarGroups: (options?: SidebarGroupOptions) => {
|
|
23
27
|
level: SidebarGroupLevel;
|
|
24
28
|
};
|
|
29
|
+
export {};
|
|
25
30
|
//# sourceMappingURL=useSidebarGroups.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSidebarGroups.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarSidebar/useSidebarGroups.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,YAAY,EAAmB,MAAM,KAAK,CAAA;AAExD;;;;GAIG;AACH,MAAM,MAAM,iBAAiB,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;AAEzD;;;;GAIG;AACH,eAAO,MAAM,qBAAqB,EAAe,YAAY,CAAC,iBAAiB,CAAC,CAAA;AAEhF
|
|
1
|
+
{"version":3,"file":"useSidebarGroups.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarSidebar/useSidebarGroups.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,YAAY,EAAmB,MAAM,KAAK,CAAA;AAExD,KAAK,mBAAmB,GAAG;IACzB,gDAAgD;IAChD,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,4CAA4C;IAC5C,KAAK,CAAC,EAAE,OAAO,CAAA;CAChB,CAAA;AAED;;;;GAIG;AACH,MAAM,MAAM,iBAAiB,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;AAEzD;;;;GAIG;AACH,eAAO,MAAM,qBAAqB,EAAe,YAAY,CAAC,iBAAiB,CAAC,CAAA;AAEhF;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,aAAa,mBAAmB;;CAc5D,CAAA"}
|
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
import { inject as
|
|
2
|
-
const
|
|
3
|
-
increment:
|
|
4
|
-
|
|
5
|
-
const e = t(o, 0);
|
|
6
|
-
return s && e < 6 ? r(o, e + 1) : r(o, e), { level: e };
|
|
1
|
+
import { inject as i, provide as o } from "vue";
|
|
2
|
+
const s = Symbol(), c = (r = {}) => {
|
|
3
|
+
const { increment: t = !1, reset: n = !1 } = r, e = i(s, 0);
|
|
4
|
+
return n ? o(s, 0) : t && e < 6 ? o(s, e + 1) : o(s, e), { level: e };
|
|
7
5
|
};
|
|
8
6
|
export {
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
s as SIDEBAR_GROUPS_SYMBOL,
|
|
8
|
+
c as useSidebarGroups
|
|
11
9
|
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { type InjectionKey, type Ref } from 'vue';
|
|
2
|
+
/**
|
|
3
|
+
* Tracks the open state of the nearest nested child items
|
|
4
|
+
*
|
|
5
|
+
* @default false
|
|
6
|
+
*/
|
|
7
|
+
export declare const SIDEBAR_NESTED_ITEMS_SYMBOL: InjectionKey<Ref<Ref<boolean>[]>>;
|
|
8
|
+
/**
|
|
9
|
+
* Get the open / closed model for the nearest nested child items
|
|
10
|
+
*/
|
|
11
|
+
export declare const useSidebarNestedItem: (open: Ref<boolean>) => void;
|
|
12
|
+
/**
|
|
13
|
+
* Get whether or not any nested child items are open
|
|
14
|
+
*/
|
|
15
|
+
export declare const useSidebarNestedItems: () => {
|
|
16
|
+
/** Whether or not any nested child items are open */
|
|
17
|
+
open: import("vue").ComputedRef<boolean>;
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=useSidebarNestedItems.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useSidebarNestedItems.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarSidebar/useSidebarNestedItems.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmD,KAAK,YAAY,EAAE,KAAK,GAAG,EAAE,MAAM,KAAK,CAAA;AAElG;;;;GAIG;AACH,eAAO,MAAM,2BAA2B,EAAe,YAAY,CAAC,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,CAAA;AAExF;;GAEG;AACH,eAAO,MAAM,oBAAoB,SAEzB,GAAG,CAAC,OAAO,CAAC,SAYnB,CAAA;AACD;;GAEG;AACH,eAAO,MAAM,qBAAqB;IAO9B,qDAAqD;;CAGxD,CAAA"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ref as r, computed as s, provide as n } from "vue";
|
|
2
|
+
const c = Symbol(), S = () => {
|
|
3
|
+
const e = r([]), o = s(() => e.value.some((t) => t.value));
|
|
4
|
+
return n(c, e), {
|
|
5
|
+
/** Whether or not any nested child items are open */
|
|
6
|
+
open: o
|
|
7
|
+
};
|
|
8
|
+
};
|
|
9
|
+
export {
|
|
10
|
+
c as SIDEBAR_NESTED_ITEMS_SYMBOL,
|
|
11
|
+
S as useSidebarNestedItems
|
|
12
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useSidebarNestedItems.test.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarSidebar/useSidebarNestedItems.test.ts"],"names":[],"mappings":""}
|