@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
|
@@ -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,51 +11,52 @@ 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
|
-
props: /* @__PURE__ */
|
|
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
|
-
emits: /* @__PURE__ */
|
|
31
|
-
setup(
|
|
32
|
-
const $ = b, o =
|
|
31
|
+
emits: /* @__PURE__ */ c(["click"], ["update:open"]),
|
|
32
|
+
setup(d, { emit: b }) {
|
|
33
|
+
const $ = b, o = g(d, "open");
|
|
33
34
|
O(o);
|
|
34
|
-
const { level: S } = E({ reset: !0 }),
|
|
35
|
+
const { level: S } = E({ reset: !0 }), a = h("el"), i = T(0);
|
|
35
36
|
function k() {
|
|
36
|
-
i.value = v(
|
|
37
|
-
() =>
|
|
37
|
+
i.value = v(a.value).scrollTop ?? 0, m(
|
|
38
|
+
() => a.value?.querySelector('button:not([aria-expanded="true"])')?.focus({ preventScroll: !0 })
|
|
38
39
|
);
|
|
39
40
|
}
|
|
40
41
|
function y() {
|
|
41
42
|
m(() => {
|
|
42
|
-
|
|
43
|
+
a.value?.querySelector("button")?.focus({ preventScroll: !0 }), v(a.value).scrollTop = i.value;
|
|
43
44
|
});
|
|
44
45
|
}
|
|
45
46
|
const C = (e) => {
|
|
46
|
-
$("click", e),
|
|
47
|
+
$("click", e), d.controlled || (o.value = !o.value);
|
|
47
48
|
};
|
|
48
|
-
return (e,
|
|
49
|
+
return (e, n) => (f(), u("li", {
|
|
49
50
|
ref_key: "el",
|
|
50
|
-
ref:
|
|
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-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,26 +89,26 @@ 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, {
|
|
95
96
|
is: "button",
|
|
96
|
-
class: "text-c-1 font-sidebar-active",
|
|
97
|
-
onClick:
|
|
97
|
+
class: "text-sidebar-c-1 font-sidebar-active",
|
|
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
|
-
|
|
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
|
|
@@ -1,23 +1,176 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
declare
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Scalar Sidebar Playground component
|
|
3
|
+
*
|
|
4
|
+
* THIS IS A TESTING COMPONENT FOR THE SIDEBAR.
|
|
5
|
+
* IT IS NOT INTENDED TO BE USED IN PRODUCTION.
|
|
6
|
+
*/
|
|
7
|
+
declare const _default: __VLS_WithSlots<import("vue").DefineComponent<{
|
|
8
|
+
/**
|
|
9
|
+
* Overrides --scalar-sidebar-indent
|
|
10
|
+
* @default 20 (px)
|
|
11
|
+
*/
|
|
12
|
+
indent?: number;
|
|
13
|
+
/**
|
|
14
|
+
* Sets --scalar-sidebar-background-1
|
|
15
|
+
* @default var(--scalar-background-1)
|
|
16
|
+
*/
|
|
17
|
+
backgroundOne?: string;
|
|
18
|
+
/**
|
|
19
|
+
* Sets --scalar-sidebar-color-1
|
|
20
|
+
* @default var(--scalar-color-1)
|
|
21
|
+
*/
|
|
22
|
+
colorOne?: string;
|
|
23
|
+
/**
|
|
24
|
+
* Sets --scalar-sidebar-color-2
|
|
25
|
+
* @default var(--scalar-color-2)
|
|
26
|
+
*/
|
|
27
|
+
colorTwo?: string;
|
|
28
|
+
/**
|
|
29
|
+
* Sets --scalar-sidebar-border-color
|
|
30
|
+
* @default var(--scalar-border-color)
|
|
31
|
+
*/
|
|
32
|
+
borderColor?: string;
|
|
33
|
+
/**
|
|
34
|
+
* Sets --scalar-sidebar-item-hover-background
|
|
35
|
+
* @default var(--scalar-background-2)
|
|
36
|
+
*/
|
|
37
|
+
itemHoverBackground?: string;
|
|
38
|
+
/**
|
|
39
|
+
* Sets --scalar-sidebar-item-hover-color
|
|
40
|
+
* @default currentColor
|
|
41
|
+
*/
|
|
42
|
+
itemHoverColor?: string;
|
|
43
|
+
/**
|
|
44
|
+
* Sets --scalar-sidebar-item-active-background
|
|
45
|
+
* @default var(--scalar-background-2)
|
|
46
|
+
*/
|
|
47
|
+
itemActiveBackground?: string;
|
|
48
|
+
/**
|
|
49
|
+
* Sets --scalar-sidebar-color-active
|
|
50
|
+
* @default var(--scalar-color-1)
|
|
51
|
+
*/
|
|
52
|
+
itemActiveColor?: string;
|
|
53
|
+
/**
|
|
54
|
+
* Sets --scalar-sidebar-indent-border
|
|
55
|
+
* @default var(--scalar-border-color)
|
|
56
|
+
*/
|
|
57
|
+
indentBorder?: string;
|
|
58
|
+
/**
|
|
59
|
+
* Sets --scalar-sidebar-indent-border-hover
|
|
60
|
+
* @default var(--scalar-border-color)
|
|
61
|
+
*/
|
|
62
|
+
indentBorderHover?: string;
|
|
63
|
+
/**
|
|
64
|
+
* Sets --scalar-sidebar-indent-border-active
|
|
65
|
+
* @default var(--scalar-color-accent)
|
|
66
|
+
*/
|
|
67
|
+
indentBorderActive?: string;
|
|
68
|
+
/**
|
|
69
|
+
* Sets --scalar-sidebar-search-background
|
|
70
|
+
* @default transparent
|
|
71
|
+
*/
|
|
72
|
+
searchBackground?: string;
|
|
73
|
+
/**
|
|
74
|
+
* Sets --scalar-sidebar-search-color
|
|
75
|
+
* @default var(--scalar-color-3)
|
|
76
|
+
*/
|
|
77
|
+
searchColor?: string;
|
|
78
|
+
/**
|
|
79
|
+
* Sets --scalar-sidebar-search-border-color
|
|
80
|
+
* @default var(--scalar-border-color)
|
|
81
|
+
*/
|
|
82
|
+
searchBorderColor?: string;
|
|
10
83
|
} & {
|
|
11
|
-
|
|
12
|
-
}
|
|
13
|
-
footer?: (props: typeof __VLS_11) => any;
|
|
14
|
-
};
|
|
15
|
-
declare const __VLS_component: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
84
|
+
selected?: string;
|
|
85
|
+
}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
16
86
|
"update:selected": (value: string | undefined) => any;
|
|
17
|
-
}, string, import("vue").PublicProps, Readonly<
|
|
87
|
+
}, string, import("vue").PublicProps, Readonly<{
|
|
88
|
+
/**
|
|
89
|
+
* Overrides --scalar-sidebar-indent
|
|
90
|
+
* @default 20 (px)
|
|
91
|
+
*/
|
|
92
|
+
indent?: number;
|
|
93
|
+
/**
|
|
94
|
+
* Sets --scalar-sidebar-background-1
|
|
95
|
+
* @default var(--scalar-background-1)
|
|
96
|
+
*/
|
|
97
|
+
backgroundOne?: string;
|
|
98
|
+
/**
|
|
99
|
+
* Sets --scalar-sidebar-color-1
|
|
100
|
+
* @default var(--scalar-color-1)
|
|
101
|
+
*/
|
|
102
|
+
colorOne?: string;
|
|
103
|
+
/**
|
|
104
|
+
* Sets --scalar-sidebar-color-2
|
|
105
|
+
* @default var(--scalar-color-2)
|
|
106
|
+
*/
|
|
107
|
+
colorTwo?: string;
|
|
108
|
+
/**
|
|
109
|
+
* Sets --scalar-sidebar-border-color
|
|
110
|
+
* @default var(--scalar-border-color)
|
|
111
|
+
*/
|
|
112
|
+
borderColor?: string;
|
|
113
|
+
/**
|
|
114
|
+
* Sets --scalar-sidebar-item-hover-background
|
|
115
|
+
* @default var(--scalar-background-2)
|
|
116
|
+
*/
|
|
117
|
+
itemHoverBackground?: string;
|
|
118
|
+
/**
|
|
119
|
+
* Sets --scalar-sidebar-item-hover-color
|
|
120
|
+
* @default currentColor
|
|
121
|
+
*/
|
|
122
|
+
itemHoverColor?: string;
|
|
123
|
+
/**
|
|
124
|
+
* Sets --scalar-sidebar-item-active-background
|
|
125
|
+
* @default var(--scalar-background-2)
|
|
126
|
+
*/
|
|
127
|
+
itemActiveBackground?: string;
|
|
128
|
+
/**
|
|
129
|
+
* Sets --scalar-sidebar-color-active
|
|
130
|
+
* @default var(--scalar-color-1)
|
|
131
|
+
*/
|
|
132
|
+
itemActiveColor?: string;
|
|
133
|
+
/**
|
|
134
|
+
* Sets --scalar-sidebar-indent-border
|
|
135
|
+
* @default var(--scalar-border-color)
|
|
136
|
+
*/
|
|
137
|
+
indentBorder?: string;
|
|
138
|
+
/**
|
|
139
|
+
* Sets --scalar-sidebar-indent-border-hover
|
|
140
|
+
* @default var(--scalar-border-color)
|
|
141
|
+
*/
|
|
142
|
+
indentBorderHover?: string;
|
|
143
|
+
/**
|
|
144
|
+
* Sets --scalar-sidebar-indent-border-active
|
|
145
|
+
* @default var(--scalar-color-accent)
|
|
146
|
+
*/
|
|
147
|
+
indentBorderActive?: string;
|
|
148
|
+
/**
|
|
149
|
+
* Sets --scalar-sidebar-search-background
|
|
150
|
+
* @default transparent
|
|
151
|
+
*/
|
|
152
|
+
searchBackground?: string;
|
|
153
|
+
/**
|
|
154
|
+
* Sets --scalar-sidebar-search-color
|
|
155
|
+
* @default var(--scalar-color-3)
|
|
156
|
+
*/
|
|
157
|
+
searchColor?: string;
|
|
158
|
+
/**
|
|
159
|
+
* Sets --scalar-sidebar-search-border-color
|
|
160
|
+
* @default var(--scalar-border-color)
|
|
161
|
+
*/
|
|
162
|
+
searchBorderColor?: string;
|
|
163
|
+
} & {
|
|
164
|
+
selected?: string;
|
|
165
|
+
}> & Readonly<{
|
|
18
166
|
"onUpdate:selected"?: ((value: string | undefined) => any) | undefined;
|
|
19
|
-
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any
|
|
20
|
-
|
|
167
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, {
|
|
168
|
+
search?: (props: {}) => any;
|
|
169
|
+
} & {
|
|
170
|
+
default?: (props: {}) => any;
|
|
171
|
+
} & {
|
|
172
|
+
footer?: (props: {}) => any;
|
|
173
|
+
}>;
|
|
21
174
|
export default _default;
|
|
22
175
|
type __VLS_WithSlots<T, S> = T & {
|
|
23
176
|
new (): {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScalarSidebarPlayground.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarSidebar/ScalarSidebarPlayground.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ScalarSidebarPlayground.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarSidebar/ScalarSidebarPlayground.vue"],"names":[],"mappings":"AAgJA;;;;;GAKG;;IAGD;;;OAGG;aACM,MAAM;IACf;;;OAGG;oBACa,MAAM;IACtB;;;OAGG;eACQ,MAAM;IACjB;;;OAGG;eACQ,MAAM;IACjB;;;OAGG;kBACW,MAAM;IACpB;;;OAGG;0BACmB,MAAM;IAC5B;;;OAGG;qBACc,MAAM;IACvB;;;OAGG;2BACoB,MAAM;IAC7B;;;OAGG;sBACe,MAAM;IACxB;;;OAGG;mBACY,MAAM;IACrB;;;OAGG;wBACiB,MAAM;IAC1B;;;OAGG;yBACkB,MAAM;IAC3B;;;OAGG;uBACgB,MAAM;IACzB;;;OAGG;kBACW,MAAM;IACpB;;;OAGG;wBACiB,MAAM;;eAWf,MAAM;;;;IArFjB;;;OAGG;aACM,MAAM;IACf;;;OAGG;oBACa,MAAM;IACtB;;;OAGG;eACQ,MAAM;IACjB;;;OAGG;eACQ,MAAM;IACjB;;;OAGG;kBACW,MAAM;IACpB;;;OAGG;0BACmB,MAAM;IAC5B;;;OAGG;qBACc,MAAM;IACvB;;;OAGG;2BACoB,MAAM;IAC7B;;;OAGG;sBACe,MAAM;IACxB;;;OAGG;mBACY,MAAM;IACrB;;;OAGG;wBACiB,MAAM;IAC1B;;;OAGG;yBACkB,MAAM;IAC3B;;;OAGG;uBACgB,MAAM;IACzB;;;OAGG;kBACW,MAAM;IACpB;;;OAGG;wBACiB,MAAM;;eAWf,MAAM;;;;aA2HN,CAAC,KAAK,IAAgB,KAAK,GAAG;;cAC7B,CAAC,KAAK,IAAgB,KAAK,GAAG;;aAC/B,CAAC,KAAK,IAAiB,KAAK,GAAG;;AApN5C,wBAsPC;AAOD,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
|
|
@@ -16,23 +16,23 @@ const N = ["aria-label"], G = /* @__PURE__ */ f({
|
|
|
16
16
|
}),
|
|
17
17
|
emits: ["update:modelValue"],
|
|
18
18
|
setup(t) {
|
|
19
|
-
const
|
|
19
|
+
const r = m(null), a = b(t, "modelValue");
|
|
20
20
|
function i() {
|
|
21
|
-
a.value = "",
|
|
21
|
+
a.value = "", r.value && r.value.focus();
|
|
22
22
|
}
|
|
23
|
-
const { stylingAttrsCx: c, otherAttrs:
|
|
24
|
-
return h(() => t.autofocus &&
|
|
23
|
+
const { stylingAttrsCx: c, otherAttrs: d } = w();
|
|
24
|
+
return h(() => t.autofocus && r.value?.focus()), (o, s) => (l(), v("label", g(k(
|
|
25
25
|
e(c)(
|
|
26
|
-
"flex items-center rounded border text-base has-[:focus-visible]:bg-b-1 has-[:focus-visible]:outline h-8 gap-1 pl-2 pr-1.5",
|
|
26
|
+
"flex items-center rounded border text-base has-[:focus-visible]:bg-sidebar-b-1 has-[:focus-visible]:outline h-8 gap-1 pl-2 pr-1.5",
|
|
27
27
|
"bg-sidebar-b-search border-sidebar-border-search",
|
|
28
|
-
a.value ? "text-c-1" : "text-sidebar-c-search"
|
|
28
|
+
a.value ? "text-sidebar-c-1" : "text-sidebar-c-search"
|
|
29
29
|
)
|
|
30
30
|
)), [
|
|
31
31
|
y(e(B), { class: "text-sidebar-c-search size-4" }),
|
|
32
32
|
S(C("input", M({
|
|
33
33
|
ref_key: "inputRef",
|
|
34
|
-
ref:
|
|
35
|
-
"aria-label":
|
|
34
|
+
ref: r,
|
|
35
|
+
"aria-label": o.label ?? "Enter search query",
|
|
36
36
|
autocapitalize: "off",
|
|
37
37
|
autocomplete: "off",
|
|
38
38
|
autocorrect: "off",
|
|
@@ -40,15 +40,15 @@ const N = ["aria-label"], G = /* @__PURE__ */ f({
|
|
|
40
40
|
placeholder: "Search...",
|
|
41
41
|
spellcheck: "false",
|
|
42
42
|
type: "search"
|
|
43
|
-
}, e(
|
|
44
|
-
"onUpdate:modelValue": s[0] || (s[0] = (
|
|
43
|
+
}, e(d), {
|
|
44
|
+
"onUpdate:modelValue": s[0] || (s[0] = (u) => a.value = u)
|
|
45
45
|
}), null, 16, N), [
|
|
46
46
|
[V, a.value]
|
|
47
47
|
]),
|
|
48
|
-
|
|
48
|
+
o.loader && o.loader.isActive ? (l(), n(e(E), {
|
|
49
49
|
key: 0,
|
|
50
50
|
class: "mr-3 self-center",
|
|
51
|
-
loader:
|
|
51
|
+
loader: o.loader,
|
|
52
52
|
size: "md"
|
|
53
53
|
}, null, 8, ["loader"])) : a.value ? (l(), n(e(I), {
|
|
54
54
|
key: 1,
|
|
@@ -47,17 +47,37 @@ 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
|
-
export type
|
|
61
|
+
export type ScalarSidebarButtonSlots = {
|
|
53
62
|
/** The main text content of the button */
|
|
54
63
|
default?(): unknown;
|
|
64
|
+
/** The indent to display before content */
|
|
65
|
+
indent?(): unknown;
|
|
55
66
|
/** Override the icon */
|
|
56
67
|
icon?(): unknown;
|
|
57
68
|
/** The content to display to the right of the text content */
|
|
58
69
|
aside?(): unknown;
|
|
59
|
-
|
|
60
|
-
|
|
70
|
+
};
|
|
71
|
+
/** Scalar Sidebar Item Slots */
|
|
72
|
+
export type ScalarSidebarItemSlots = Omit<ScalarSidebarButtonSlots, 'indent'> & {
|
|
73
|
+
/** Override the entire button */
|
|
74
|
+
button?(props: {
|
|
75
|
+
level: SidebarGroupLevel;
|
|
76
|
+
}): unknown;
|
|
77
|
+
/** Content to display before the button but inside the list item */
|
|
78
|
+
before?(): unknown;
|
|
79
|
+
/** Content to display after the button but inside the list item */
|
|
80
|
+
after?(): unknown;
|
|
61
81
|
};
|
|
62
82
|
/** Scalar Sidebar Item Slots */
|
|
63
83
|
export type ScalarSidebarGroupSlots = {
|
|
@@ -74,13 +94,16 @@ export type ScalarSidebarGroupSlots = {
|
|
|
74
94
|
icon?(props: {
|
|
75
95
|
open: boolean;
|
|
76
96
|
}): unknown;
|
|
77
|
-
/**
|
|
78
|
-
|
|
97
|
+
/** Content to display to the right of the text content */
|
|
98
|
+
aside?(props: {
|
|
79
99
|
open: boolean;
|
|
80
|
-
level: SidebarGroupLevel;
|
|
81
100
|
}): unknown;
|
|
82
|
-
/**
|
|
83
|
-
|
|
101
|
+
/** Content to display before the button */
|
|
102
|
+
before?(props: {
|
|
103
|
+
open: boolean;
|
|
104
|
+
}): unknown;
|
|
105
|
+
/** Content to display after the button */
|
|
106
|
+
after?(props: {
|
|
84
107
|
open: boolean;
|
|
85
108
|
}): unknown;
|
|
86
109
|
/** The list of sidebar subitems */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarSidebar/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAA;AAC9D,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;AAE3D,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,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