@scalar/components 0.16.20 → 0.16.23
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/ScalarButton/ScalarButton.vue.js +28 -28
- package/dist/components/ScalarCheckboxInput/ScalarCheckbox.vue.js +7 -7
- package/dist/components/ScalarCheckboxInput/ScalarCheckboxGroup.vue.js +15 -15
- package/dist/components/ScalarCheckboxInput/ScalarCheckboxInput.vue.js +10 -10
- package/dist/components/ScalarCheckboxInput/ScalarCheckboxRadioGroup.vue.js +15 -15
- package/dist/components/ScalarCodeBlock/ScalarCodeBlock.vue.js +6 -6
- package/dist/components/ScalarCodeBlock/ScalarCodeBlockCopy.vue2.js +20 -20
- package/dist/components/ScalarColorModeToggle/ScalarColorModeToggle.vue.js +7 -7
- package/dist/components/ScalarColorModeToggle/ScalarColorModeToggleIcon.vue2.js +13 -13
- package/dist/components/ScalarCombobox/ScalarCombobox.vue.js +20 -20
- package/dist/components/ScalarCombobox/ScalarComboboxMultiselect.vue.js +25 -25
- package/dist/components/ScalarCombobox/ScalarComboboxOption.vue.js +9 -9
- package/dist/components/ScalarCombobox/ScalarComboboxOptionGroup.vue.js +9 -9
- package/dist/components/ScalarCombobox/ScalarComboboxOptions.vue.js +51 -51
- package/dist/components/ScalarContextMenu/ScalarContextMenu.vue.js +8 -8
- package/dist/components/ScalarDropdown/ScalarDropdown.vue.js +36 -36
- package/dist/components/ScalarDropdown/ScalarDropdownButton.vue2.js +11 -11
- package/dist/components/ScalarDropdown/ScalarDropdownItem.vue2.js +14 -14
- package/dist/components/ScalarDropdown/ScalarDropdownMenu.vue.js +12 -12
- package/dist/components/ScalarFileUpload/ScalarFileUpload.vue.js +47 -47
- package/dist/components/ScalarFileUpload/ScalarFileUploadInput.vue.js +23 -23
- package/dist/components/ScalarFileUpload/ScalarFileUploadInputCompact.vue.js +17 -17
- package/dist/components/ScalarFileUpload/ScalarFileUploadLoading.vue.js +9 -9
- package/dist/components/ScalarFloating/ScalarFloating.vue.js +30 -30
- package/dist/components/ScalarForm/ScalarFormError.vue.js +8 -8
- package/dist/components/ScalarForm/ScalarFormField.vue.js +14 -14
- package/dist/components/ScalarForm/ScalarFormInput.vue.js +9 -9
- package/dist/components/ScalarForm/ScalarFormInputGroup.vue.js +8 -8
- package/dist/components/ScalarHeader/ScalarHeaderButton.vue.js +12 -12
- package/dist/components/ScalarIcon/ScalarIcon.vue2.js +8 -8
- package/dist/components/ScalarIcon/ScalarIconLegacyAdapter.vue.js +10 -10
- package/dist/components/ScalarIconButton/ScalarIconButton.vue.js +18 -18
- package/dist/components/ScalarListbox/ScalarListbox.vue.js +28 -28
- package/dist/components/ScalarListbox/ScalarListboxCheckbox.vue.js +9 -9
- package/dist/components/ScalarListbox/ScalarListboxInput.vue.js +11 -11
- package/dist/components/ScalarListbox/ScalarListboxItem.vue.js +10 -10
- package/dist/components/ScalarLoading/ScalarLoading.vue2.js +13 -13
- package/dist/components/ScalarMarkdown/ScalarMarkdown.vue.js +13 -13
- package/dist/components/ScalarMarkdown/ScalarMarkdownSummary.vue.js +16 -16
- package/dist/components/ScalarMenu/ScalarMenuButton.vue.js +16 -16
- package/dist/components/ScalarMenu/ScalarMenuLink.vue.js +17 -17
- package/dist/components/ScalarMenu/ScalarMenuProduct.vue.js +11 -11
- package/dist/components/ScalarMenu/ScalarMenuProducts.vue.js +24 -24
- package/dist/components/ScalarMenu/ScalarMenuTeamPicker.vue.js +17 -17
- package/dist/components/ScalarMenu/ScalarMenuTeamProfile.vue.js +14 -14
- package/dist/components/ScalarMenu/ScalarMenuWorkspacePicker.vue.js +8 -8
- package/dist/components/ScalarModal/ScalarModal.vue2.js +34 -34
- package/dist/components/ScalarPopover/ScalarPopover.vue.js +25 -25
- package/dist/components/ScalarSearchInput/ScalarSearchInput.vue.js +26 -26
- package/dist/components/ScalarSearchResults/ScalarSearchResultItem.vue.js +30 -30
- package/dist/components/ScalarSearchResults/ScalarSearchResultList.vue.js +8 -8
- package/dist/components/ScalarSidebar/ScalarSidebarButton.vue.js +24 -24
- package/dist/components/ScalarSidebar/ScalarSidebarGroup.vue.js +51 -51
- package/dist/components/ScalarSidebar/ScalarSidebarGroupToggle.vue.js +18 -18
- package/dist/components/ScalarSidebar/ScalarSidebarIndent.vue2.js +14 -14
- package/dist/components/ScalarSidebar/ScalarSidebarItem.vue.js +7 -7
- package/dist/components/ScalarSidebar/ScalarSidebarItems.vue.js +12 -12
- package/dist/components/ScalarSidebar/ScalarSidebarNestedItems.vue.js +46 -46
- package/dist/components/ScalarSidebar/ScalarSidebarSearchInput.vue.js +30 -30
- package/dist/components/ScalarSidebar/ScalarSidebarSection.vue.js +18 -18
- package/dist/components/ScalarSidebar/ScalarSidebarSpacer.vue.js +8 -8
- package/dist/components/ScalarTeleport/ScalarTeleport.vue.js +12 -12
- package/dist/components/ScalarTextInput/ScalarTextInput.vue.js +34 -34
- package/dist/components/ScalarToggle/ScalarToggle.vue.js +20 -20
- package/dist/components/ScalarToggle/ScalarToggleGroup.vue.js +14 -14
- package/dist/components/ScalarVirtualText/ScalarVirtualText.vue.js +25 -25
- package/package.json +8 -8
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as h, mergeModels as f, useModel as T, useTemplateRef as
|
|
1
|
+
import { defineComponent as h, mergeModels as f, useModel as T, useTemplateRef as x, ref as z, createElementBlock as m, openBlock as c, normalizeStyle as N, normalizeClass as A, renderSlot as o, createVNode as s, mergeProps as I, unref as i, createSlots as w, withCtx as l, createBlock as M, createCommentVNode as p, Transition as P, normalizeProps as R, guardReactiveProps as V, createTextVNode as q, nextTick as b } from "vue";
|
|
2
2
|
import { ScalarIconArrowRight as E, ScalarIconCaretLeft as L } from "@scalar/icons";
|
|
3
3
|
import v from "./ScalarSidebarButton.vue.js";
|
|
4
4
|
import O from "./ScalarSidebarItems.vue.js";
|
|
@@ -7,12 +7,12 @@ import j from "./ScalarSidebarSpacer.vue.js";
|
|
|
7
7
|
import { findScrollContainer as k } from "./findScrollContainer.js";
|
|
8
8
|
import { useSidebarGroups as F } from "./useSidebarGroups.js";
|
|
9
9
|
import { useSidebarNestedItem as G } from "./useSidebarNestedItems.js";
|
|
10
|
-
import
|
|
11
|
-
const
|
|
10
|
+
import D from "../ScalarIcon/ScalarIconLegacyAdapter.vue.js";
|
|
11
|
+
const H = {
|
|
12
12
|
key: 0,
|
|
13
13
|
class: "absolute inset-0 translate-x-full"
|
|
14
|
-
},
|
|
15
|
-
...
|
|
14
|
+
}, J = {}, oe = /* @__PURE__ */ h({
|
|
15
|
+
...J,
|
|
16
16
|
inheritAttrs: !1,
|
|
17
17
|
__name: "ScalarSidebarNestedItems",
|
|
18
18
|
props: /* @__PURE__ */ f({
|
|
@@ -29,56 +29,56 @@ const D = {
|
|
|
29
29
|
openModifiers: {}
|
|
30
30
|
}),
|
|
31
31
|
emits: /* @__PURE__ */ f(["click", "back"], ["update:open"]),
|
|
32
|
-
setup(
|
|
33
|
-
const d = y,
|
|
34
|
-
G(
|
|
35
|
-
const { level: $ } = F({ reset: !0 }),
|
|
32
|
+
setup(t, { emit: y }) {
|
|
33
|
+
const d = y, n = T(t, "open");
|
|
34
|
+
G(n);
|
|
35
|
+
const { level: $ } = F({ reset: !0 }), a = x("el"), r = z(0);
|
|
36
36
|
function S() {
|
|
37
|
-
|
|
38
|
-
() =>
|
|
37
|
+
r.value = k(a.value).scrollTop ?? 0, b(
|
|
38
|
+
() => a.value?.querySelector('button:not([aria-expanded="true"])')?.focus({ preventScroll: !0 })
|
|
39
39
|
);
|
|
40
40
|
}
|
|
41
41
|
function C() {
|
|
42
42
|
b(() => {
|
|
43
|
-
|
|
43
|
+
a.value?.querySelector("button")?.focus({ preventScroll: !0 }), k(a.value).scrollTop = r.value;
|
|
44
44
|
});
|
|
45
45
|
}
|
|
46
46
|
const B = (e) => {
|
|
47
|
-
d("click", e),
|
|
47
|
+
d("click", e), t.controlled || (n.value = !0);
|
|
48
48
|
}, g = (e) => {
|
|
49
|
-
d("back", e),
|
|
49
|
+
d("back", e), t.controlled || (n.value = !1);
|
|
50
50
|
};
|
|
51
51
|
return (e, u) => (c(), m("li", {
|
|
52
52
|
ref_key: "el",
|
|
53
|
-
ref:
|
|
54
|
-
class:
|
|
55
|
-
style:
|
|
53
|
+
ref: a,
|
|
54
|
+
class: A(["group/item group/nested-items contents", { "group/nested-items-open": n.value }]),
|
|
55
|
+
style: N({ "--nested-items-offset": `${r.value}px` })
|
|
56
56
|
}, [
|
|
57
|
-
|
|
58
|
-
|
|
57
|
+
o(e.$slots, "button", {}, () => [
|
|
58
|
+
s(v, I({
|
|
59
59
|
is: "button",
|
|
60
|
-
"aria-expanded":
|
|
61
|
-
disabled:
|
|
62
|
-
indent:
|
|
63
|
-
selected:
|
|
60
|
+
"aria-expanded": n.value,
|
|
61
|
+
disabled: t.disabled,
|
|
62
|
+
indent: i($),
|
|
63
|
+
selected: t.selected
|
|
64
64
|
}, e.$attrs, { onClick: B }), w({
|
|
65
|
-
aside:
|
|
66
|
-
|
|
67
|
-
|
|
65
|
+
aside: l(() => [
|
|
66
|
+
o(e.$slots, "aside", {}, () => [
|
|
67
|
+
s(i(E), { class: "size-4 text-sidebar-c-2" })
|
|
68
68
|
])
|
|
69
69
|
]),
|
|
70
|
-
default:
|
|
71
|
-
|
|
70
|
+
default: l(() => [
|
|
71
|
+
o(e.$slots, "default")
|
|
72
72
|
]),
|
|
73
73
|
_: 2
|
|
74
74
|
}, [
|
|
75
|
-
|
|
75
|
+
t.icon || e.$slots.icon ? {
|
|
76
76
|
name: "icon",
|
|
77
|
-
fn:
|
|
78
|
-
|
|
79
|
-
|
|
77
|
+
fn: l(() => [
|
|
78
|
+
o(e.$slots, "icon", {}, () => [
|
|
79
|
+
t.icon ? (c(), M(i(D), {
|
|
80
80
|
key: 0,
|
|
81
|
-
icon:
|
|
81
|
+
icon: t.icon,
|
|
82
82
|
weight: "bold"
|
|
83
83
|
}, null, 8, ["icon"])) : p("", !0)
|
|
84
84
|
])
|
|
@@ -87,36 +87,36 @@ const D = {
|
|
|
87
87
|
} : void 0
|
|
88
88
|
]), 1040, ["aria-expanded", "disabled", "indent", "selected"])
|
|
89
89
|
]),
|
|
90
|
-
|
|
90
|
+
s(P, {
|
|
91
91
|
duration: 300,
|
|
92
92
|
enterActiveClass: "top-(--nested-items-offset)",
|
|
93
93
|
leaveActiveClass: "top-(--nested-items-offset)",
|
|
94
94
|
onEnter: S,
|
|
95
95
|
onLeave: C
|
|
96
96
|
}, {
|
|
97
|
-
default:
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
default:
|
|
101
|
-
|
|
102
|
-
|
|
97
|
+
default: l(() => [
|
|
98
|
+
n.value ? (c(), m("div", H, [
|
|
99
|
+
s(O, R(V(e.$attrs)), {
|
|
100
|
+
default: l(() => [
|
|
101
|
+
o(e.$slots, "back", {}, () => [
|
|
102
|
+
s(v, {
|
|
103
103
|
is: "button",
|
|
104
104
|
class: "text-sidebar-c-1 font-sidebar-active hover:text-sidebar-c-1",
|
|
105
105
|
onClick: g
|
|
106
106
|
}, {
|
|
107
|
-
icon:
|
|
108
|
-
|
|
107
|
+
icon: l(() => [
|
|
108
|
+
s(i(L), { class: "size-4 -m-px text-sidebar-c-2" })
|
|
109
109
|
]),
|
|
110
|
-
default:
|
|
111
|
-
|
|
110
|
+
default: l(() => [
|
|
111
|
+
o(e.$slots, "back-label", {}, () => [
|
|
112
112
|
u[0] || (u[0] = q("Back", -1))
|
|
113
113
|
])
|
|
114
114
|
]),
|
|
115
115
|
_: 3
|
|
116
116
|
})
|
|
117
117
|
]),
|
|
118
|
-
|
|
119
|
-
|
|
118
|
+
s(j, { class: "h-3" }),
|
|
119
|
+
o(e.$slots, "items")
|
|
120
120
|
]),
|
|
121
121
|
_: 3
|
|
122
122
|
}, 16)
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { ScalarIconMagnifyingGlass as
|
|
3
|
-
import { useBindCx as
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
const
|
|
1
|
+
import { defineComponent as u, mergeModels as f, ref as m, useModel as b, onMounted as p, createElementBlock as h, openBlock as l, normalizeProps as v, guardReactiveProps as g, unref as a, createVNode as x, withDirectives as k, createBlock as s, createCommentVNode as y, createElementVNode as S, mergeProps as C, vModelText as M, withModifiers as V } from "vue";
|
|
2
|
+
import { ScalarIconMagnifyingGlass as z, ScalarIconX as B } from "@scalar/icons";
|
|
3
|
+
import { useBindCx as A } from "@scalar/use-hooks/useBindCx";
|
|
4
|
+
import w from "../ScalarLoading/ScalarLoading.vue.js";
|
|
5
|
+
import E from "../ScalarIconButton/ScalarIconButton.vue.js";
|
|
6
|
+
const I = ["aria-label"], L = /* @__PURE__ */ u({
|
|
7
7
|
inheritAttrs: !1,
|
|
8
8
|
__name: "ScalarSidebarSearchInput",
|
|
9
|
-
props: /* @__PURE__ */
|
|
9
|
+
props: /* @__PURE__ */ f({
|
|
10
10
|
autofocus: { type: Boolean },
|
|
11
11
|
loader: {},
|
|
12
12
|
label: {}
|
|
@@ -15,26 +15,26 @@ const N = ["aria-label"], G = /* @__PURE__ */ f({
|
|
|
15
15
|
modelModifiers: {}
|
|
16
16
|
}),
|
|
17
17
|
emits: ["update:modelValue"],
|
|
18
|
-
setup(
|
|
19
|
-
const
|
|
20
|
-
function
|
|
21
|
-
|
|
18
|
+
setup(e) {
|
|
19
|
+
const o = m(null), r = b(e, "modelValue");
|
|
20
|
+
function n() {
|
|
21
|
+
r.value = "", o.value && o.value.focus();
|
|
22
22
|
}
|
|
23
|
-
const { stylingAttrsCx: c, otherAttrs:
|
|
24
|
-
return
|
|
25
|
-
|
|
23
|
+
const { stylingAttrsCx: c, otherAttrs: i } = A();
|
|
24
|
+
return p(() => e.autofocus && o.value?.focus()), (N, t) => (l(), h("label", v(g(
|
|
25
|
+
a(c)(
|
|
26
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
|
-
|
|
28
|
+
r.value ? "text-sidebar-c-1" : "text-sidebar-c-search"
|
|
29
29
|
)
|
|
30
30
|
)), [
|
|
31
|
-
|
|
32
|
-
S(
|
|
31
|
+
x(a(z), { class: "text-sidebar-c-search size-4" }),
|
|
32
|
+
k(S("input", C({
|
|
33
33
|
ref_key: "inputRef",
|
|
34
|
-
ref:
|
|
35
|
-
},
|
|
36
|
-
"onUpdate:modelValue":
|
|
37
|
-
"aria-label":
|
|
34
|
+
ref: o
|
|
35
|
+
}, a(i), {
|
|
36
|
+
"onUpdate:modelValue": t[0] || (t[0] = (d) => r.value = d),
|
|
37
|
+
"aria-label": e.label ?? "Enter search query",
|
|
38
38
|
autocapitalize: "off",
|
|
39
39
|
autocomplete: "off",
|
|
40
40
|
autocorrect: "off",
|
|
@@ -42,25 +42,25 @@ const N = ["aria-label"], G = /* @__PURE__ */ f({
|
|
|
42
42
|
placeholder: "Search...",
|
|
43
43
|
spellcheck: "false",
|
|
44
44
|
type: "search"
|
|
45
|
-
}), null, 16,
|
|
46
|
-
[
|
|
45
|
+
}), null, 16, I), [
|
|
46
|
+
[M, r.value]
|
|
47
47
|
]),
|
|
48
|
-
|
|
48
|
+
e.loader && e.loader.isActive ? (l(), s(a(w), {
|
|
49
49
|
key: 0,
|
|
50
50
|
class: "mr-3 self-center",
|
|
51
|
-
loader:
|
|
51
|
+
loader: e.loader,
|
|
52
52
|
size: "md"
|
|
53
|
-
}, null, 8, ["loader"])) :
|
|
53
|
+
}, null, 8, ["loader"])) : r.value ? (l(), s(a(E), {
|
|
54
54
|
key: 1,
|
|
55
55
|
class: "p-0.25 size-4",
|
|
56
|
-
icon:
|
|
56
|
+
icon: a(B),
|
|
57
57
|
label: "Clear Search",
|
|
58
58
|
weight: "bold",
|
|
59
|
-
onClick:
|
|
60
|
-
}, null, 8, ["icon"])) :
|
|
59
|
+
onClick: V(n, ["stop", "prevent"])
|
|
60
|
+
}, null, 8, ["icon"])) : y("", !0)
|
|
61
61
|
], 16));
|
|
62
62
|
}
|
|
63
63
|
});
|
|
64
64
|
export {
|
|
65
|
-
|
|
65
|
+
L as default
|
|
66
66
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useBindCx as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
1
|
+
import { defineComponent as c, createBlock as d, openBlock as p, resolveDynamicComponent as f, normalizeProps as m, guardReactiveProps as u, unref as e, withCtx as s, createVNode as n, createElementVNode as _, renderSlot as r } from "vue";
|
|
2
|
+
import { useBindCx as b } from "@scalar/use-hooks/useBindCx";
|
|
3
|
+
import x from "./ScalarSidebarButton.vue.js";
|
|
4
|
+
import a from "./ScalarSidebarSpacer.vue.js";
|
|
5
5
|
import { useSidebarGroups as g } from "./useSidebarGroups.js";
|
|
6
|
-
const h = { class: "flex flex-col gap-px" }, y = {}, N = /* @__PURE__ */
|
|
6
|
+
const h = { class: "flex flex-col gap-px" }, y = {}, N = /* @__PURE__ */ c({
|
|
7
7
|
...y,
|
|
8
8
|
inheritAttrs: !1,
|
|
9
9
|
__name: "ScalarSidebarSection",
|
|
@@ -15,32 +15,32 @@ const h = { class: "flex flex-col gap-px" }, y = {}, N = /* @__PURE__ */ l({
|
|
|
15
15
|
disabled: { type: Boolean },
|
|
16
16
|
indent: {}
|
|
17
17
|
},
|
|
18
|
-
setup(
|
|
19
|
-
const { level:
|
|
20
|
-
return (
|
|
18
|
+
setup(o) {
|
|
19
|
+
const { level: t } = g({ increment: !1 }), { cx: l } = b();
|
|
20
|
+
return (i, B) => (p(), d(f(o.is), m(u(e(l)("group/item group/sidebar-section contents"))), {
|
|
21
21
|
default: s(() => [
|
|
22
|
-
n(
|
|
22
|
+
n(a, {
|
|
23
23
|
class: "group/spacer-before h-3",
|
|
24
|
-
indent: t
|
|
24
|
+
indent: e(t)
|
|
25
25
|
}, null, 8, ["indent"]),
|
|
26
|
-
n(
|
|
26
|
+
n(x, {
|
|
27
27
|
is: "div",
|
|
28
28
|
class: "text-sm/5 py-1.75 font-bold",
|
|
29
29
|
disabled: "",
|
|
30
|
-
icon:
|
|
31
|
-
indent: t
|
|
30
|
+
icon: o.icon,
|
|
31
|
+
indent: e(t)
|
|
32
32
|
}, {
|
|
33
33
|
default: s(() => [
|
|
34
|
-
i
|
|
34
|
+
r(i.$slots, "default")
|
|
35
35
|
]),
|
|
36
36
|
_: 3
|
|
37
37
|
}, 8, ["icon", "indent"]),
|
|
38
|
-
|
|
39
|
-
i
|
|
38
|
+
_("ul", h, [
|
|
39
|
+
r(i.$slots, "items")
|
|
40
40
|
]),
|
|
41
|
-
n(
|
|
41
|
+
n(a, {
|
|
42
42
|
class: "group/spacer-after h-3",
|
|
43
|
-
indent: t
|
|
43
|
+
indent: e(t)
|
|
44
44
|
}, null, 8, ["indent"])
|
|
45
45
|
]),
|
|
46
46
|
_: 3
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useBindCx as
|
|
3
|
-
import
|
|
4
|
-
const s = {}, S = /* @__PURE__ */
|
|
1
|
+
import { defineComponent as t, createElementBlock as r, openBlock as a, normalizeProps as o, guardReactiveProps as i, unref as c, createVNode as d } from "vue";
|
|
2
|
+
import { useBindCx as l } from "@scalar/use-hooks/useBindCx";
|
|
3
|
+
import p from "./ScalarSidebarIndent.vue.js";
|
|
4
|
+
const s = {}, S = /* @__PURE__ */ t({
|
|
5
5
|
...s,
|
|
6
6
|
inheritAttrs: !1,
|
|
7
7
|
__name: "ScalarSidebarSpacer",
|
|
8
8
|
props: {
|
|
9
9
|
indent: { default: 0 }
|
|
10
10
|
},
|
|
11
|
-
setup(
|
|
12
|
-
const { cx:
|
|
13
|
-
return (
|
|
14
|
-
d(
|
|
11
|
+
setup(e) {
|
|
12
|
+
const { cx: n } = l();
|
|
13
|
+
return (f, m) => (a(), r("div", o(i(c(n)("flex px-2 h-1"))), [
|
|
14
|
+
d(p, { indent: e.indent }, null, 8, ["indent"])
|
|
15
15
|
], 16));
|
|
16
16
|
}
|
|
17
17
|
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useTeleport as
|
|
3
|
-
const
|
|
4
|
-
...
|
|
1
|
+
import { defineComponent as a, createBlock as r, openBlock as l, Teleport as s, unref as d, createElementVNode as n, mergeProps as i, renderSlot as c } from "vue";
|
|
2
|
+
import { useTeleport as m } from "./useTeleport.js";
|
|
3
|
+
const p = {}, y = /* @__PURE__ */ a({
|
|
4
|
+
...p,
|
|
5
5
|
inheritAttrs: !1,
|
|
6
6
|
__name: "ScalarTeleport",
|
|
7
7
|
props: {
|
|
@@ -9,22 +9,22 @@ const m = {}, b = /* @__PURE__ */ o({
|
|
|
9
9
|
immediate: { type: Boolean },
|
|
10
10
|
disabled: { type: Boolean }
|
|
11
11
|
},
|
|
12
|
-
setup(
|
|
13
|
-
const
|
|
14
|
-
return (
|
|
12
|
+
setup(e) {
|
|
13
|
+
const o = m();
|
|
14
|
+
return (t, f) => (l(), r(s, {
|
|
15
15
|
defer: !e.immediate,
|
|
16
16
|
disabled: e.disabled,
|
|
17
|
-
to: e.to ||
|
|
17
|
+
to: e.to || d(o)
|
|
18
18
|
}, [
|
|
19
|
-
|
|
19
|
+
n("div", i({
|
|
20
20
|
class: "scalar-app",
|
|
21
21
|
style: { display: "contents" }
|
|
22
|
-
},
|
|
23
|
-
|
|
22
|
+
}, t.$attrs), [
|
|
23
|
+
c(t.$slots, "default")
|
|
24
24
|
], 16)
|
|
25
25
|
], 8, ["defer", "disabled", "to"]));
|
|
26
26
|
}
|
|
27
27
|
});
|
|
28
28
|
export {
|
|
29
|
-
|
|
29
|
+
y as default
|
|
30
30
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as y, mergeModels as
|
|
1
|
+
import { defineComponent as y, mergeModels as x, useModel as v, ref as $, onMounted as k, createBlock as w, openBlock as s, unref as i, mergeProps as f, withCtx as _, createElementVNode as d, renderSlot as n, createElementBlock as l, createCommentVNode as a, withDirectives as C, vModelDynamic as g, toDisplayString as V } from "vue";
|
|
2
2
|
import { useBindCx as b } from "@scalar/use-hooks/useBindCx";
|
|
3
3
|
import B from "../ScalarForm/ScalarFormInput.vue.js";
|
|
4
4
|
const M = { class: "flex flex-1 relative" }, A = {
|
|
@@ -17,55 +17,55 @@ const M = { class: "flex flex-1 relative" }, A = {
|
|
|
17
17
|
...I,
|
|
18
18
|
inheritAttrs: !1,
|
|
19
19
|
__name: "ScalarTextInput",
|
|
20
|
-
props: /* @__PURE__ */
|
|
20
|
+
props: /* @__PURE__ */ x({
|
|
21
21
|
readonly: { type: Boolean }
|
|
22
22
|
}, {
|
|
23
23
|
modelValue: {},
|
|
24
24
|
modelModifiers: {}
|
|
25
25
|
}),
|
|
26
26
|
emits: ["update:modelValue"],
|
|
27
|
-
setup(
|
|
28
|
-
const
|
|
29
|
-
|
|
30
|
-
"autofocus" in u.value &&
|
|
27
|
+
setup(t) {
|
|
28
|
+
const r = v(t, "modelValue"), o = $(), { stylingAttrsCx: m, otherAttrs: u } = b();
|
|
29
|
+
k(() => {
|
|
30
|
+
"autofocus" in u.value && o.value?.focus();
|
|
31
31
|
});
|
|
32
|
-
function
|
|
33
|
-
|
|
32
|
+
function p() {
|
|
33
|
+
t.readonly ? o.value?.select() : o.value?.focus();
|
|
34
34
|
}
|
|
35
|
-
return (e,
|
|
35
|
+
return (e, c) => (s(), w(i(B), f(
|
|
36
36
|
{ is: "div" },
|
|
37
|
-
|
|
37
|
+
i(m)(
|
|
38
38
|
"cursor-text text-c-1",
|
|
39
|
-
|
|
39
|
+
t.readonly ? "" : "focus-within:bg-b-1"
|
|
40
40
|
),
|
|
41
|
-
{ onClick:
|
|
41
|
+
{ onClick: p }
|
|
42
42
|
), {
|
|
43
|
-
default:
|
|
44
|
-
|
|
45
|
-
e.$slots.prefix ? (
|
|
46
|
-
|
|
47
|
-
])) :
|
|
48
|
-
C(
|
|
43
|
+
default: _(() => [
|
|
44
|
+
d("div", M, [
|
|
45
|
+
e.$slots.prefix ? (s(), l("span", A, [
|
|
46
|
+
n(e.$slots, "prefix")
|
|
47
|
+
])) : a("", !0),
|
|
48
|
+
C(d("input", f({
|
|
49
49
|
ref_key: "input",
|
|
50
|
-
ref:
|
|
51
|
-
"onUpdate:modelValue":
|
|
52
|
-
"aria-readonly":
|
|
50
|
+
ref: o,
|
|
51
|
+
"onUpdate:modelValue": c[0] || (c[0] = (h) => r.value = h),
|
|
52
|
+
"aria-readonly": t.readonly || void 0,
|
|
53
53
|
class: "z-1 min-w-0 flex-1 border-none bg-transparent text-sm placeholder:font-[inherit] focus-within:outline-none",
|
|
54
|
-
readonly:
|
|
55
|
-
},
|
|
56
|
-
[g,
|
|
54
|
+
readonly: t.readonly
|
|
55
|
+
}, i(u)), null, 16, D), [
|
|
56
|
+
[g, r.value]
|
|
57
57
|
]),
|
|
58
|
-
e.$slots.prefix || e.$slots.suffix ? (
|
|
59
|
-
e.$slots.prefix ? (
|
|
60
|
-
|
|
61
|
-
])) :
|
|
62
|
-
|
|
63
|
-
e.$slots.suffix ? (
|
|
64
|
-
|
|
65
|
-
])) :
|
|
66
|
-
])) :
|
|
58
|
+
e.$slots.prefix || e.$slots.suffix ? (s(), l("div", S, [
|
|
59
|
+
e.$slots.prefix ? (s(), l("span", E, [
|
|
60
|
+
n(e.$slots, "prefix")
|
|
61
|
+
])) : a("", !0),
|
|
62
|
+
d("span", N, V(r.value || e.$attrs.placeholder), 1),
|
|
63
|
+
e.$slots.suffix ? (s(), l("span", z, [
|
|
64
|
+
n(e.$slots, "suffix")
|
|
65
|
+
])) : a("", !0)
|
|
66
|
+
])) : a("", !0)
|
|
67
67
|
]),
|
|
68
|
-
|
|
68
|
+
n(e.$slots, "aside")
|
|
69
69
|
]),
|
|
70
70
|
_: 3
|
|
71
71
|
}, 16));
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { cva as
|
|
3
|
-
const
|
|
1
|
+
import { defineComponent as d, mergeModels as i, useModel as u, createElementBlock as t, openBlock as l, normalizeClass as o, unref as n, createElementVNode as m, createCommentVNode as b, toDisplayString as f } from "vue";
|
|
2
|
+
import { cva as p, cx as h } from "@scalar/use-hooks/useBindCx";
|
|
3
|
+
const v = ["aria-checked", "aria-disabled"], g = {
|
|
4
4
|
key: 0,
|
|
5
5
|
class: "sr-only"
|
|
6
|
-
},
|
|
6
|
+
}, V = /* @__PURE__ */ d({
|
|
7
7
|
__name: "ScalarToggle",
|
|
8
|
-
props: /* @__PURE__ */
|
|
8
|
+
props: /* @__PURE__ */ i({
|
|
9
9
|
disabled: { type: Boolean },
|
|
10
10
|
label: {}
|
|
11
11
|
}, {
|
|
@@ -13,33 +13,33 @@ const g = ["aria-checked", "aria-disabled"], k = {
|
|
|
13
13
|
modelModifiers: {}
|
|
14
14
|
}),
|
|
15
15
|
emits: ["update:modelValue"],
|
|
16
|
-
setup(
|
|
17
|
-
const
|
|
18
|
-
function
|
|
19
|
-
|
|
16
|
+
setup(e) {
|
|
17
|
+
const r = e, a = u(e, "modelValue");
|
|
18
|
+
function s() {
|
|
19
|
+
r.disabled || (a.value = !a.value);
|
|
20
20
|
}
|
|
21
|
-
const
|
|
21
|
+
const c = p({
|
|
22
22
|
base: "relative h-3.5 min-w-6 w-6 cursor-pointer rounded-full bg-b-3 transition-colors duration-300",
|
|
23
23
|
variants: {
|
|
24
24
|
checked: { true: "bg-c-accent" },
|
|
25
25
|
disabled: { true: "cursor-not-allowed opacity-40" }
|
|
26
26
|
}
|
|
27
27
|
});
|
|
28
|
-
return (
|
|
29
|
-
"aria-checked":
|
|
30
|
-
"aria-disabled":
|
|
31
|
-
class: n(
|
|
28
|
+
return (k, x) => (l(), t("button", {
|
|
29
|
+
"aria-checked": a.value,
|
|
30
|
+
"aria-disabled": e.disabled,
|
|
31
|
+
class: o(n(h)(n(c)({ checked: a.value, disabled: e.disabled }))),
|
|
32
32
|
role: "switch",
|
|
33
33
|
type: "button",
|
|
34
|
-
onClick:
|
|
34
|
+
onClick: s
|
|
35
35
|
}, [
|
|
36
|
-
|
|
37
|
-
class:
|
|
36
|
+
m("div", {
|
|
37
|
+
class: o(["absolute left-px top-px flex h-3 w-3 items-center justify-center rounded-full bg-b-1 text-c-accent transition-transform duration-300", { "translate-x-2.5": a.value }])
|
|
38
38
|
}, null, 2),
|
|
39
|
-
|
|
40
|
-
], 10,
|
|
39
|
+
e.label ? (l(), t("span", g, f(e.label), 1)) : b("", !0)
|
|
40
|
+
], 10, v));
|
|
41
41
|
}
|
|
42
42
|
});
|
|
43
43
|
export {
|
|
44
|
-
|
|
44
|
+
V as default
|
|
45
45
|
};
|
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
const
|
|
5
|
-
...
|
|
1
|
+
import { defineComponent as d, mergeModels as n, useModel as s, createBlock as u, openBlock as t, unref as c, withCtx as r, createElementBlock as f, Fragment as _, renderList as i, createTextVNode as p, toDisplayString as V } from "vue";
|
|
2
|
+
import v from "./ScalarToggleInput.vue.js";
|
|
3
|
+
import g from "../ScalarForm/ScalarFormInputGroup.vue.js";
|
|
4
|
+
const k = {}, C = /* @__PURE__ */ d({
|
|
5
|
+
...k,
|
|
6
6
|
__name: "ScalarToggleGroup",
|
|
7
|
-
props: /* @__PURE__ */
|
|
7
|
+
props: /* @__PURE__ */ n({
|
|
8
8
|
options: { default: () => [] }
|
|
9
9
|
}, {
|
|
10
10
|
modelValue: { default: [] },
|
|
11
11
|
modelModifiers: {}
|
|
12
12
|
}),
|
|
13
13
|
emits: ["update:modelValue"],
|
|
14
|
-
setup(
|
|
15
|
-
const l =
|
|
16
|
-
return (
|
|
17
|
-
default:
|
|
18
|
-
(t(!0), _
|
|
14
|
+
setup(o) {
|
|
15
|
+
const l = s(o, "modelValue");
|
|
16
|
+
return (x, B) => (t(), u(c(g), null, {
|
|
17
|
+
default: r(() => [
|
|
18
|
+
(t(!0), f(_, null, i(o.options, (e) => (t(), u(v, {
|
|
19
19
|
key: e.value,
|
|
20
20
|
modelValue: l.value?.some(({ value: a }) => a === e.value),
|
|
21
|
-
"onUpdate:modelValue": (a) => l.value = a ? [...l.value, e] : l.value.filter(({ value:
|
|
21
|
+
"onUpdate:modelValue": (a) => l.value = a ? [...l.value, e] : l.value.filter(({ value: m }) => m !== e.value)
|
|
22
22
|
}, {
|
|
23
|
-
default:
|
|
24
|
-
V(
|
|
23
|
+
default: r(() => [
|
|
24
|
+
p(V(e.label), 1)
|
|
25
25
|
]),
|
|
26
26
|
_: 2
|
|
27
27
|
}, 1032, ["modelValue", "onUpdate:modelValue"]))), 128))
|