@scalar/components 0.14.32 → 0.14.34
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 +37 -40
- package/dist/components/ScalarCodeBlock/ScalarCodeBlock.vue3.js +1 -1
- package/dist/components/ScalarCodeBlock/ScalarCodeBlockCopy.vue.js +1 -1
- package/dist/components/ScalarColorModeToggle/ScalarColorModeToggleIcon.vue.js +1 -1
- package/dist/components/ScalarCombobox/ScalarComboboxMultiselect.vue.js +46 -49
- package/dist/components/ScalarCombobox/ScalarComboboxOptions.vue.js +144 -160
- package/dist/components/ScalarCombobox/ScalarComboboxPopover.vue.js +26 -27
- package/dist/components/ScalarCombobox/types.js +6 -6
- package/dist/components/ScalarDropdown/ScalarDropdownButton.vue.js +1 -1
- package/dist/components/ScalarDropdown/ScalarDropdownItem.vue.js +1 -1
- package/dist/components/ScalarErrorBoundary/ScalarErrorBoundary.vue.js +11 -14
- package/dist/components/ScalarFileUpload/ScalarFileUpload.vue.js +86 -91
- package/dist/components/ScalarFloating/ScalarFloating.vue.d.ts.map +1 -1
- package/dist/components/ScalarFloating/ScalarFloating.vue.js +22 -23
- package/dist/components/ScalarFloating/useResizeWithTarget.js +12 -13
- package/dist/components/ScalarIcon/ScalarIcon.vue.js +1 -1
- package/dist/components/ScalarLoading/ScalarLoading.vue.js +1 -1
- package/dist/components/ScalarMarkdown/ScalarMarkdown.vue.js +20 -21
- package/dist/components/ScalarMarkdown/ScalarMarkdown.vue3.js +1 -1
- package/dist/components/ScalarMarkdown/ScalarMarkdownSummary.vue.js +22 -26
- package/dist/components/ScalarMarkdown/ScalarMarkdownSummary.vue3.js +1 -1
- package/dist/components/ScalarMenu/ScalarMenuLink.vue.d.ts.map +1 -1
- package/dist/components/ScalarMenu/ScalarMenuLink.vue.js +6 -3
- package/dist/components/ScalarMenu/ScalarMenuProducts.vue.js +45 -48
- package/dist/components/ScalarMenu/ScalarMenuTeamPicker.vue.js +20 -23
- package/dist/components/ScalarModal/ScalarModal.vue.js +1 -1
- package/dist/components/ScalarSidebar/ScalarSidebarIndent.vue.js +1 -1
- package/dist/components/ScalarSidebar/ScalarSidebarItems.vue3.js +1 -1
- package/dist/components/ScalarSidebar/ScalarSidebarSearchInput.vue.js +16 -19
- package/dist/components/ScalarTextArea/ScalarTextArea.vue.d.ts.map +1 -1
- package/dist/components/ScalarTextArea/ScalarTextArea.vue.js +19 -22
- package/dist/components/ScalarTextInput/ScalarTextInput.vue.js +25 -29
- package/dist/components/ScalarTooltip/ScalarHotkeyTooltip.vue.js +12 -15
- package/dist/components/ScalarTooltip/ScalarTooltip.vue.js +20 -23
- package/dist/components/ScalarTooltip/ScalarTooltip.vue3.js +1 -1
- package/dist/components/ScalarTooltip/useTooltip.js +24 -31
- package/dist/index.d.ts +1 -1
- package/dist/index.js +6 -6
- package/dist/style.css +1 -1
- package/package.json +13 -13
- package/dist/components/ScalarCodeBlock/ScalarCodeBlock.vue2.js +0 -4
- package/dist/components/ScalarCodeBlock/ScalarCodeBlockCopy.vue3.js +0 -4
- package/dist/components/ScalarColorModeToggle/ScalarColorModeToggleIcon.vue3.js +0 -4
- package/dist/components/ScalarDropdown/ScalarDropdownButton.vue3.js +0 -4
- package/dist/components/ScalarDropdown/ScalarDropdownItem.vue3.js +0 -4
- package/dist/components/ScalarIcon/ScalarIcon.vue3.js +0 -4
- package/dist/components/ScalarLoading/ScalarLoading.vue3.js +0 -4
- package/dist/components/ScalarMarkdown/ScalarMarkdown.vue2.js +0 -4
- package/dist/components/ScalarMarkdown/ScalarMarkdownSummary.vue2.js +0 -4
- package/dist/components/ScalarModal/ScalarModal.vue3.js +0 -4
- package/dist/components/ScalarSidebar/ScalarSidebarIndent.vue3.js +0 -4
- package/dist/components/ScalarSidebar/ScalarSidebarItems.vue2.js +0 -4
- package/dist/components/ScalarTooltip/ScalarTooltip.vue2.js +0 -4
- package/dist/style.css.js +0 -4
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { defineComponent as p, mergeModels as f, createPropsRestProxy as v, useId as h, useModel as y, useTemplateRef as w, ref as k, onMounted as x, createElementBlock as u, openBlock as m, normalizeProps as g, guardReactiveProps as B, unref as
|
|
1
|
+
import { defineComponent as p, mergeModels as f, createPropsRestProxy as v, useId as h, useModel as y, useTemplateRef as w, ref as k, onMounted as x, createElementBlock as u, openBlock as m, normalizeProps as g, guardReactiveProps as B, unref as a, createVNode as M, createCommentVNode as P, mergeProps as V, normalizeClass as b, renderSlot as C, createTextVNode as S, toDisplayString as T } from "vue";
|
|
2
2
|
import { useBindCx as R } from "@scalar/use-hooks/useBindCx";
|
|
3
3
|
import { useResizeObserver as _ } from "@vueuse/core";
|
|
4
4
|
import z from "./ScalarMarkdown.vue.js";
|
|
5
|
-
|
|
5
|
+
/* empty css */
|
|
6
6
|
const N = ["aria-controls", "aria-expanded"], E = /* @__PURE__ */ p({
|
|
7
7
|
inheritAttrs: !1,
|
|
8
8
|
__name: "ScalarMarkdownSummary",
|
|
@@ -19,40 +19,36 @@ const N = ["aria-controls", "aria-expanded"], E = /* @__PURE__ */ p({
|
|
|
19
19
|
modelModifiers: {}
|
|
20
20
|
}),
|
|
21
21
|
emits: ["update:modelValue"],
|
|
22
|
-
setup(
|
|
23
|
-
const c = v(
|
|
24
|
-
_(() =>
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
function i() {
|
|
29
|
-
var a;
|
|
30
|
-
const e = (a = n.value) == null ? void 0 : a.el;
|
|
31
|
-
e && (s.value = e.scrollHeight > e.clientHeight || e.scrollWidth > e.clientWidth);
|
|
22
|
+
setup(r) {
|
|
23
|
+
const c = v(r, ["clamp"]), t = h(), e = y(r, "modelValue"), l = w("scalar-markdown"), n = k(!1);
|
|
24
|
+
_(() => l.value?.el, s);
|
|
25
|
+
function s() {
|
|
26
|
+
const o = l.value?.el;
|
|
27
|
+
o && (n.value = o.scrollHeight > o.clientHeight || o.scrollWidth > o.clientWidth);
|
|
32
28
|
}
|
|
33
|
-
x(
|
|
29
|
+
x(s);
|
|
34
30
|
const { cx: d } = R();
|
|
35
|
-
return (
|
|
36
|
-
|
|
31
|
+
return (o, i) => (m(), u("div", g(B(
|
|
32
|
+
a(d)(
|
|
37
33
|
"group/summary flex gap-0.5",
|
|
38
|
-
|
|
34
|
+
e.value ? "flex-col" : "flex-row items-baseline"
|
|
39
35
|
)
|
|
40
36
|
)), [
|
|
41
37
|
M(z, V({ ref: "scalar-markdown" }, c, {
|
|
42
|
-
id:
|
|
43
|
-
class: { "markdown-summary truncate": !
|
|
44
|
-
clamp:
|
|
38
|
+
id: a(t),
|
|
39
|
+
class: { "markdown-summary truncate": !e.value },
|
|
40
|
+
clamp: e.value ? void 0 : o.clamp
|
|
45
41
|
}), null, 16, ["id", "class", "clamp"]),
|
|
46
|
-
|
|
42
|
+
n.value || e.value ? (m(), u("button", {
|
|
47
43
|
key: 0,
|
|
48
|
-
class: b(["whitespace-nowrap font-medium hover:underline", { "self-end":
|
|
44
|
+
class: b(["whitespace-nowrap font-medium hover:underline", { "self-end": e.value }]),
|
|
49
45
|
type: "button",
|
|
50
|
-
"aria-controls":
|
|
51
|
-
"aria-expanded":
|
|
52
|
-
onClick:
|
|
46
|
+
"aria-controls": a(t),
|
|
47
|
+
"aria-expanded": e.value,
|
|
48
|
+
onClick: i[0] || (i[0] = ($) => e.value = !e.value)
|
|
53
49
|
}, [
|
|
54
|
-
C(
|
|
55
|
-
S(T(
|
|
50
|
+
C(o.$slots, "button", { open: e.value }, () => [
|
|
51
|
+
S(T(e.value ? " Show Less" : "More"), 1)
|
|
56
52
|
])
|
|
57
53
|
], 10, N)) : P("", !0)
|
|
58
54
|
], 16));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScalarMenuLink.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarMenu/ScalarMenuLink.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ScalarMenuLink.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarMenu/ScalarMenuLink.vue"],"names":[],"mappings":"AA4CA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAA;AAG9D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,KAAK,CAAA;AAGpC,OAAO,EAAE,KAAK,IAAI,EAA2B,MAAM,eAAe,CAAA;AAElE,KAAK,WAAW,GAAG;IACjB,EAAE,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IACvB,IAAI,CAAC,EAAE,IAAI,GAAG,mBAAmB,CAAA;IACjC,MAAM,CAAC,EAAE,OAAO,CAAA;CACjB,CAAC;AAuEF,QAAA,IAAI,QAAQ,IAAW,CAAE;AACzB,KAAK,WAAW,GAAG,EAAE,GACnB;IAAE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,QAAQ,KAAK,GAAG,CAAA;CAAE,CAAC;AAsBhD,QAAA,MAAM,eAAe,kSAMnB,CAAC;wBACkB,eAAe,CAAC,OAAO,eAAe,EAAE,WAAW,CAAC;AAAzE,wBAA0E;AAQ1E,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as i, createBlock as n, openBlock as o, unref as t, mergeProps as
|
|
1
|
+
import { defineComponent as i, createBlock as n, openBlock as o, unref as t, mergeProps as a, withCtx as l, createElementBlock as m, createElementVNode as c, normalizeClass as s, renderSlot as f } from "vue";
|
|
2
2
|
import { useBindCx as p } from "@scalar/use-hooks/useBindCx";
|
|
3
3
|
import { DropdownMenu as u } from "radix-vue/namespaced";
|
|
4
4
|
import d from "../ScalarDropdown/ScalarDropdownButton.vue.js";
|
|
@@ -16,8 +16,11 @@ const h = {
|
|
|
16
16
|
},
|
|
17
17
|
setup(k) {
|
|
18
18
|
const { cx: r } = p();
|
|
19
|
-
return (e, w) => (o(), n(t(d),
|
|
20
|
-
|
|
19
|
+
return (e, w) => (o(), n(t(d), a(t(r)("flex items-center"), {
|
|
20
|
+
is: e.is,
|
|
21
|
+
as: "a"
|
|
22
|
+
}), {
|
|
23
|
+
default: l(() => [
|
|
21
24
|
e.icon ? (o(), n(t(g), {
|
|
22
25
|
key: 0,
|
|
23
26
|
class: s([
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { ScalarIconHouse as
|
|
3
|
-
import { useBindCx as
|
|
1
|
+
import { defineComponent as a, createElementBlock as f, openBlock as c, normalizeProps as p, guardReactiveProps as m, unref as s, createVNode as t, withCtx as n, createTextVNode as l } from "vue";
|
|
2
|
+
import { ScalarIconHouse as u, ScalarIconBook as h, ScalarIconArrowUpRight as C } from "@scalar/icons";
|
|
3
|
+
import { useBindCx as k } from "@scalar/use-hooks/useBindCx";
|
|
4
4
|
import d from "./ScalarMenuProduct.vue.js";
|
|
5
|
-
const
|
|
5
|
+
const P = /* @__PURE__ */ a({
|
|
6
6
|
inheritAttrs: !1,
|
|
7
7
|
__name: "ScalarMenuProducts",
|
|
8
8
|
props: {
|
|
@@ -10,51 +10,48 @@ const w = /* @__PURE__ */ p({
|
|
|
10
10
|
hrefs: {}
|
|
11
11
|
},
|
|
12
12
|
emits: ["open"],
|
|
13
|
-
setup(
|
|
14
|
-
const { cx:
|
|
15
|
-
return (o, e) =>
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
}, 8, ["href", "icon", "selected"])
|
|
54
|
-
], 16);
|
|
55
|
-
};
|
|
13
|
+
setup(b) {
|
|
14
|
+
const { cx: i } = k();
|
|
15
|
+
return (o, e) => (c(), f("div", p(m(s(i)("flex flex-col"))), [
|
|
16
|
+
t(d, {
|
|
17
|
+
href: o.hrefs?.dashboard ?? "https://dashboard.scalar.com",
|
|
18
|
+
icon: s(u),
|
|
19
|
+
selected: o.selected === "dashboard",
|
|
20
|
+
onClick: e[0] || (e[0] = (r) => o.$emit("open", r, "dashboard"))
|
|
21
|
+
}, {
|
|
22
|
+
default: n(() => e[3] || (e[3] = [
|
|
23
|
+
l(" Dashboard ")
|
|
24
|
+
])),
|
|
25
|
+
_: 1,
|
|
26
|
+
__: [3]
|
|
27
|
+
}, 8, ["href", "icon", "selected"]),
|
|
28
|
+
t(d, {
|
|
29
|
+
href: o.hrefs?.docs ?? "https://docs.scalar.com",
|
|
30
|
+
icon: s(h),
|
|
31
|
+
selected: o.selected === "docs",
|
|
32
|
+
onClick: e[1] || (e[1] = (r) => o.$emit("open", r, "docs"))
|
|
33
|
+
}, {
|
|
34
|
+
default: n(() => e[4] || (e[4] = [
|
|
35
|
+
l(" Docs ")
|
|
36
|
+
])),
|
|
37
|
+
_: 1,
|
|
38
|
+
__: [4]
|
|
39
|
+
}, 8, ["href", "icon", "selected"]),
|
|
40
|
+
t(d, {
|
|
41
|
+
href: o.hrefs?.client ?? "https://client.scalar.com",
|
|
42
|
+
icon: s(C),
|
|
43
|
+
selected: o.selected === "client",
|
|
44
|
+
onClick: e[2] || (e[2] = (r) => o.$emit("open", r, "client"))
|
|
45
|
+
}, {
|
|
46
|
+
default: n(() => e[5] || (e[5] = [
|
|
47
|
+
l(" Client ")
|
|
48
|
+
])),
|
|
49
|
+
_: 1,
|
|
50
|
+
__: [5]
|
|
51
|
+
}, 8, ["href", "icon", "selected"])
|
|
52
|
+
], 16));
|
|
56
53
|
}
|
|
57
54
|
});
|
|
58
55
|
export {
|
|
59
|
-
|
|
56
|
+
P as default
|
|
60
57
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { defineComponent as _, computed as g, createBlock as u, openBlock as n, unref as e, withCtx as
|
|
1
|
+
import { defineComponent as _, computed as g, createBlock as u, openBlock as n, unref as e, withCtx as r, createVNode as a, mergeProps as b, createElementVNode as x, createElementBlock as S, Fragment as w, renderList as v, createTextVNode as C } from "vue";
|
|
2
2
|
import { ScalarIconUserSwitch as k, ScalarIconCaretRight as V, ScalarIconPlus as $ } from "@scalar/icons";
|
|
3
|
-
import { DropdownMenu as
|
|
3
|
+
import { DropdownMenu as o } from "radix-vue/namespaced";
|
|
4
4
|
import I from "./ScalarMenuTeamProfile.vue.js";
|
|
5
5
|
import B from "./ScalarMenuLink.vue.js";
|
|
6
6
|
import P from "../ScalarDropdown/ScalarDropdownMenu.vue.js";
|
|
@@ -16,22 +16,19 @@ const y = /* @__PURE__ */ _({
|
|
|
16
16
|
emits: ["update:team", "add"],
|
|
17
17
|
setup(f, { emit: p }) {
|
|
18
18
|
const i = f, d = p, m = g({
|
|
19
|
-
get: () =>
|
|
20
|
-
|
|
21
|
-
return (r = i.team) == null ? void 0 : r.id;
|
|
22
|
-
},
|
|
23
|
-
set: (r) => d(
|
|
19
|
+
get: () => i.team?.id,
|
|
20
|
+
set: (s) => d(
|
|
24
21
|
"update:team",
|
|
25
|
-
i.teams.find((t) => t.id ===
|
|
22
|
+
i.teams.find((t) => t.id === s)
|
|
26
23
|
)
|
|
27
24
|
});
|
|
28
|
-
return (
|
|
29
|
-
default:
|
|
25
|
+
return (s, t) => (n(), u(e(o).Sub, null, {
|
|
26
|
+
default: r(() => [
|
|
30
27
|
a(e(B), b({
|
|
31
|
-
is: e(
|
|
28
|
+
is: e(o).SubTrigger,
|
|
32
29
|
icon: e(k)
|
|
33
|
-
},
|
|
34
|
-
default:
|
|
30
|
+
}, s.$attrs), {
|
|
31
|
+
default: r(() => [
|
|
35
32
|
t[2] || (t[2] = x("div", null, "Change team", -1)),
|
|
36
33
|
a(e(V), {
|
|
37
34
|
class: "ml-auto text-c-2 -mr-0.25 size-3",
|
|
@@ -41,27 +38,27 @@ const y = /* @__PURE__ */ _({
|
|
|
41
38
|
_: 1,
|
|
42
39
|
__: [2]
|
|
43
40
|
}, 16, ["is", "icon"]),
|
|
44
|
-
a(e(
|
|
45
|
-
default:
|
|
46
|
-
a(e(
|
|
41
|
+
a(e(o).Portal, null, {
|
|
42
|
+
default: r(() => [
|
|
43
|
+
a(e(o).SubContent, {
|
|
47
44
|
as: e(P),
|
|
48
45
|
class: "max-h-radix-popper z-context-plus",
|
|
49
46
|
sideOffset: 3
|
|
50
47
|
}, {
|
|
51
|
-
default:
|
|
52
|
-
a(e(
|
|
48
|
+
default: r(() => [
|
|
49
|
+
a(e(o).RadioGroup, {
|
|
53
50
|
modelValue: m.value,
|
|
54
51
|
"onUpdate:modelValue": t[0] || (t[0] = (l) => m.value = l),
|
|
55
52
|
class: "contents"
|
|
56
53
|
}, {
|
|
57
|
-
default:
|
|
58
|
-
(n(!0), S(w, null, v(
|
|
54
|
+
default: r(() => [
|
|
55
|
+
(n(!0), S(w, null, v(s.teams, (l) => (n(), u(e(o).RadioItem, {
|
|
59
56
|
key: l.id,
|
|
60
57
|
as: e(c),
|
|
61
58
|
class: "group/item flex items-center",
|
|
62
59
|
value: l.id
|
|
63
60
|
}, {
|
|
64
|
-
default:
|
|
61
|
+
default: r(() => [
|
|
65
62
|
a(I, {
|
|
66
63
|
class: "-ml-0.75 flex-1 min-w-0",
|
|
67
64
|
label: l.label,
|
|
@@ -77,12 +74,12 @@ const y = /* @__PURE__ */ _({
|
|
|
77
74
|
]),
|
|
78
75
|
_: 1
|
|
79
76
|
}, 8, ["modelValue"]),
|
|
80
|
-
a(e(
|
|
77
|
+
a(e(o).Item, {
|
|
81
78
|
as: e(c),
|
|
82
79
|
class: "flex items-center",
|
|
83
80
|
onClick: t[1] || (t[1] = (l) => d("add"))
|
|
84
81
|
}, {
|
|
85
|
-
default:
|
|
82
|
+
default: r(() => [
|
|
86
83
|
a(e($), {
|
|
87
84
|
class: "bg-b-3 -ml-0.75 rounded p-1 size-5 text-c-3",
|
|
88
85
|
weight: "bold"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import o from "./ScalarModal.vue2.js";
|
|
2
2
|
import { useModal as s } from "./ScalarModal.vue2.js";
|
|
3
|
-
|
|
3
|
+
/* empty css */
|
|
4
4
|
import a from "../../_virtual/_plugin-vue_export-helper.js";
|
|
5
5
|
const m = /* @__PURE__ */ a(o, [["__scopeId", "data-v-589f8aa0"]]);
|
|
6
6
|
export {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as f, mergeModels as p, ref as m, useModel as b, onMounted as h, createElementBlock as g, openBlock as r, normalizeProps as v, guardReactiveProps as S, unref as
|
|
1
|
+
import { defineComponent as f, mergeModels as p, ref as m, useModel as b, onMounted as h, createElementBlock as g, openBlock as r, normalizeProps as v, guardReactiveProps as S, unref as e, createVNode as k, withDirectives as x, createBlock as s, createCommentVNode as y, createElementVNode as C, mergeProps as M, vModelText as V, withModifiers as z } from "vue";
|
|
2
2
|
import { ScalarIconMagnifyingGlass as B, ScalarIconX as w } from "@scalar/icons";
|
|
3
3
|
import { useBindCx as E } from "@scalar/use-hooks/useBindCx";
|
|
4
4
|
import I from "../ScalarLoading/ScalarLoading.vue.js";
|
|
@@ -16,26 +16,23 @@ const P = ["aria-label"], D = /* @__PURE__ */ f({
|
|
|
16
16
|
}),
|
|
17
17
|
emits: ["update:modelValue"],
|
|
18
18
|
setup(t) {
|
|
19
|
-
const
|
|
19
|
+
const o = m(null), a = b(t, "modelValue");
|
|
20
20
|
function i() {
|
|
21
|
-
|
|
21
|
+
a.value = "", o.value && o.value.focus();
|
|
22
22
|
}
|
|
23
23
|
const { classCx: c, otherAttrs: u } = E();
|
|
24
|
-
return h(() =>
|
|
25
|
-
|
|
26
|
-
return t.autofocus && ((e = l.value) == null ? void 0 : e.focus());
|
|
27
|
-
}), (e, n) => (r(), g("label", v(S(
|
|
28
|
-
a(c)(
|
|
24
|
+
return h(() => t.autofocus && o.value?.focus()), (l, n) => (r(), g("label", v(S(
|
|
25
|
+
e(c)(
|
|
29
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",
|
|
30
27
|
"bg-sidebar-b-search border-sidebar-border-search",
|
|
31
|
-
|
|
28
|
+
a.value ? "text-c-1" : "text-sidebar-c-search"
|
|
32
29
|
)
|
|
33
30
|
)), [
|
|
34
|
-
k(
|
|
31
|
+
k(e(B), { class: "text-sidebar-c-search size-4" }),
|
|
35
32
|
x(C("input", M({
|
|
36
33
|
ref_key: "inputRef",
|
|
37
|
-
ref:
|
|
38
|
-
"aria-label":
|
|
34
|
+
ref: o,
|
|
35
|
+
"aria-label": l.label ?? "Enter search query",
|
|
39
36
|
autocapitalize: "off",
|
|
40
37
|
autocomplete: "off",
|
|
41
38
|
autocorrect: "off",
|
|
@@ -43,20 +40,20 @@ const P = ["aria-label"], D = /* @__PURE__ */ f({
|
|
|
43
40
|
placeholder: "Search...",
|
|
44
41
|
spellcheck: "false",
|
|
45
42
|
type: "search"
|
|
46
|
-
},
|
|
47
|
-
"onUpdate:modelValue": n[0] || (n[0] = (d) =>
|
|
43
|
+
}, e(u), {
|
|
44
|
+
"onUpdate:modelValue": n[0] || (n[0] = (d) => a.value = d)
|
|
48
45
|
}), null, 16, P), [
|
|
49
|
-
[V,
|
|
46
|
+
[V, a.value]
|
|
50
47
|
]),
|
|
51
|
-
|
|
48
|
+
l.loading && l.loading.isLoading ? (r(), s(e(I), {
|
|
52
49
|
key: 0,
|
|
53
50
|
class: "mr-3 self-center",
|
|
54
|
-
loadingState:
|
|
51
|
+
loadingState: l.loading,
|
|
55
52
|
size: "md"
|
|
56
|
-
}, null, 8, ["loadingState"])) :
|
|
53
|
+
}, null, 8, ["loadingState"])) : a.value ? (r(), s(e(N), {
|
|
57
54
|
key: 1,
|
|
58
55
|
class: "p-0.25 size-4",
|
|
59
|
-
icon:
|
|
56
|
+
icon: e(w),
|
|
60
57
|
weight: "bold",
|
|
61
58
|
label: "Clear Search",
|
|
62
59
|
onClick: z(i, ["stop", "prevent"])
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScalarTextArea.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarTextArea/ScalarTextArea.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ScalarTextArea.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ScalarTextArea/ScalarTextArea.vue"],"names":[],"mappings":"AAsDA;;;;;;;GAOG;;iBAuBU,MAAM;;;;iBAAN,MAAM;;;;AAtBnB,wBA0FC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useBindCx as
|
|
3
|
-
import { useTextareaAutosize as
|
|
4
|
-
const
|
|
5
|
-
...
|
|
1
|
+
import { defineComponent as a, useModel as m, onMounted as d, createElementBlock as f, openBlock as c, mergeProps as l, unref as n, withDirectives as p, createElementVNode as x, vModelText as v } from "vue";
|
|
2
|
+
import { useBindCx as b } from "@scalar/use-hooks/useBindCx";
|
|
3
|
+
import { useTextareaAutosize as _ } from "@vueuse/core";
|
|
4
|
+
const g = {}, A = /* @__PURE__ */ a({
|
|
5
|
+
...g,
|
|
6
6
|
inheritAttrs: !1,
|
|
7
7
|
__name: "ScalarTextArea",
|
|
8
8
|
props: {
|
|
@@ -10,35 +10,32 @@ const k = {}, C = /* @__PURE__ */ d({
|
|
|
10
10
|
modelModifiers: {}
|
|
11
11
|
},
|
|
12
12
|
emits: ["update:modelValue"],
|
|
13
|
-
setup(
|
|
14
|
-
const t =
|
|
13
|
+
setup(u) {
|
|
14
|
+
const t = m(u, "modelValue"), { textarea: o } = _({
|
|
15
|
+
// @ts-expect-error - unexpected type mismatch
|
|
15
16
|
input: t,
|
|
16
17
|
styleProp: "minHeight"
|
|
17
|
-
}), { classCx:
|
|
18
|
-
return
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
r(m)(
|
|
18
|
+
}), { classCx: i, otherAttrs: r } = b();
|
|
19
|
+
return d(() => {
|
|
20
|
+
"autofocus" in r.value && o.value?.focus();
|
|
21
|
+
}), (h, e) => (c(), f("div", l(
|
|
22
|
+
n(i)(
|
|
23
23
|
"bg-b-1.5 custom-scroll flex min-h-0 shrink cursor-text items-center gap-0.75 rounded-md border px-3 py-2.5 outline-offset-[-1px] focus-within:bg-b-1 has-[input:focus-visible]:outline"
|
|
24
24
|
),
|
|
25
25
|
{
|
|
26
|
-
onClick: e[1] || (e[1] = (
|
|
27
|
-
var u;
|
|
28
|
-
return (u = r(o)) == null ? void 0 : u.focus();
|
|
29
|
-
})
|
|
26
|
+
onClick: e[1] || (e[1] = (s) => n(o)?.focus())
|
|
30
27
|
}
|
|
31
28
|
), [
|
|
32
|
-
|
|
29
|
+
p(x("textarea", l({
|
|
33
30
|
ref_key: "textarea",
|
|
34
31
|
ref: o,
|
|
35
|
-
"onUpdate:modelValue": e[0] || (e[0] = (
|
|
36
|
-
}, r
|
|
37
|
-
[
|
|
32
|
+
"onUpdate:modelValue": e[0] || (e[0] = (s) => t.value = s)
|
|
33
|
+
}, n(r), { class: "w-full resize-none border-none bg-transparent text-sm focus-within:outline-none" }), null, 16), [
|
|
34
|
+
[v, t.value]
|
|
38
35
|
])
|
|
39
36
|
], 16));
|
|
40
37
|
}
|
|
41
38
|
});
|
|
42
39
|
export {
|
|
43
|
-
|
|
40
|
+
A as default
|
|
44
41
|
};
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { useBindCx as
|
|
3
|
-
const
|
|
1
|
+
import { defineComponent as x, useModel as h, ref as v, onMounted as $, createElementBlock as t, openBlock as s, mergeProps as d, unref as f, createElementVNode as a, renderSlot as n, createCommentVNode as l, withDirectives as b, vModelDynamic as w, toDisplayString as _ } from "vue";
|
|
2
|
+
import { useBindCx as k } from "@scalar/use-hooks/useBindCx";
|
|
3
|
+
const y = { class: "flex flex-1 relative" }, g = {
|
|
4
4
|
key: 0,
|
|
5
5
|
class: "select-none whitespace-nowrap text-sm text-transparent"
|
|
6
|
-
},
|
|
6
|
+
}, V = {
|
|
7
7
|
key: 1,
|
|
8
8
|
class: "absolute inset-0 select-none overflow-hidden whitespace-nowrap text-sm"
|
|
9
|
-
},
|
|
9
|
+
}, C = {
|
|
10
10
|
key: 0,
|
|
11
11
|
class: "text-c-2"
|
|
12
|
-
},
|
|
12
|
+
}, M = { class: "text-transparent" }, B = {
|
|
13
13
|
key: 1,
|
|
14
14
|
class: "text-c-2"
|
|
15
|
-
},
|
|
16
|
-
...
|
|
15
|
+
}, D = {}, E = /* @__PURE__ */ x({
|
|
16
|
+
...D,
|
|
17
17
|
inheritAttrs: !1,
|
|
18
18
|
__name: "ScalarTextInput",
|
|
19
19
|
props: {
|
|
@@ -21,40 +21,36 @@ const g = { class: "flex flex-1 relative" }, V = {
|
|
|
21
21
|
modelModifiers: {}
|
|
22
22
|
},
|
|
23
23
|
emits: ["update:modelValue"],
|
|
24
|
-
setup(
|
|
25
|
-
const r =
|
|
26
|
-
return
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
c(x)(
|
|
24
|
+
setup(c) {
|
|
25
|
+
const r = h(c, "modelValue"), i = v(), { classCx: m, otherAttrs: u } = k();
|
|
26
|
+
return $(() => {
|
|
27
|
+
"autofocus" in u.value && i.value?.focus();
|
|
28
|
+
}), (e, o) => (s(), t("div", d(
|
|
29
|
+
f(m)(
|
|
31
30
|
"bg-b-1.5 flex cursor-text items-center gap-0.75 rounded-md border px-3 py-2.5 outline-offset-[-1px] focus-within:bg-b-1 has-[input:focus-visible]:outline"
|
|
32
31
|
),
|
|
33
32
|
{
|
|
34
|
-
onClick: o[1] || (o[1] = (p) =>
|
|
35
|
-
var d;
|
|
36
|
-
return (d = i.value) == null ? void 0 : d.focus();
|
|
37
|
-
})
|
|
33
|
+
onClick: o[1] || (o[1] = (p) => i.value?.focus())
|
|
38
34
|
}
|
|
39
35
|
), [
|
|
40
|
-
a("div",
|
|
41
|
-
e.$slots.prefix ? (s(), t("span",
|
|
36
|
+
a("div", y, [
|
|
37
|
+
e.$slots.prefix ? (s(), t("span", g, [
|
|
42
38
|
n(e.$slots, "prefix")
|
|
43
39
|
])) : l("", !0),
|
|
44
|
-
|
|
40
|
+
b(a("input", d({
|
|
45
41
|
ref_key: "input",
|
|
46
42
|
ref: i,
|
|
47
43
|
"onUpdate:modelValue": o[0] || (o[0] = (p) => r.value = p),
|
|
48
44
|
class: "z-1 min-w-0 flex-1 border-none bg-transparent text-sm placeholder:font-[inherit] focus-within:outline-none"
|
|
49
|
-
},
|
|
50
|
-
[
|
|
45
|
+
}, f(u)), null, 16), [
|
|
46
|
+
[w, r.value]
|
|
51
47
|
]),
|
|
52
|
-
e.$slots.prefix || e.$slots.suffix ? (s(), t("div",
|
|
53
|
-
e.$slots.prefix ? (s(), t("span",
|
|
48
|
+
e.$slots.prefix || e.$slots.suffix ? (s(), t("div", V, [
|
|
49
|
+
e.$slots.prefix ? (s(), t("span", C, [
|
|
54
50
|
n(e.$slots, "prefix")
|
|
55
51
|
])) : l("", !0),
|
|
56
|
-
a("span",
|
|
57
|
-
e.$slots.suffix ? (s(), t("span",
|
|
52
|
+
a("span", M, _(r.value || e.$attrs.placeholder), 1),
|
|
53
|
+
e.$slots.suffix ? (s(), t("span", B, [
|
|
58
54
|
n(e.$slots, "suffix")
|
|
59
55
|
])) : l("", !0)
|
|
60
56
|
])) : l("", !0)
|
|
@@ -64,5 +60,5 @@ const g = { class: "flex flex-1 relative" }, V = {
|
|
|
64
60
|
}
|
|
65
61
|
});
|
|
66
62
|
export {
|
|
67
|
-
|
|
63
|
+
E as default
|
|
68
64
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as c, ref as i, computed as
|
|
1
|
+
import { defineComponent as c, ref as i, computed as o, render as f, h as l, createElementBlock as m, openBlock as s, normalizeClass as u, renderSlot as h } from "vue";
|
|
2
2
|
import { DEFAULT_OFFSET as y, DEFAULT_DELAY as k } from "./constants.js";
|
|
3
3
|
import { useTooltip as p } from "./useTooltip.js";
|
|
4
4
|
import a from "../ScalarHotkey/ScalarHotkey.vue.js";
|
|
@@ -14,14 +14,14 @@ const T = {}, w = /* @__PURE__ */ c({
|
|
|
14
14
|
offset: { default: () => y }
|
|
15
15
|
},
|
|
16
16
|
setup(e) {
|
|
17
|
-
const
|
|
17
|
+
const n = i(null), d = o(() => {
|
|
18
18
|
if (!document) return "";
|
|
19
|
-
const t = document.createElement("div"),
|
|
19
|
+
const t = document.createElement("div"), r = "-m-0.5 border-none p-0 grid grid-flow-col *:border *:h-5 *:min-w-5 *:border-border-tooltip *:rounded *:px-1 *:flex *:items-center *:justify-center";
|
|
20
20
|
return e.content ? f(
|
|
21
21
|
l("div", { class: "flex items-center gap-2" }, [
|
|
22
22
|
e.content,
|
|
23
23
|
l(a, {
|
|
24
|
-
class:
|
|
24
|
+
class: r,
|
|
25
25
|
hotkey: e.hotkey,
|
|
26
26
|
modifier: e.modifier
|
|
27
27
|
})
|
|
@@ -29,7 +29,7 @@ const T = {}, w = /* @__PURE__ */ c({
|
|
|
29
29
|
t
|
|
30
30
|
) : f(
|
|
31
31
|
l(a, {
|
|
32
|
-
class:
|
|
32
|
+
class: r,
|
|
33
33
|
hotkey: e.hotkey,
|
|
34
34
|
modifier: e.modifier
|
|
35
35
|
}),
|
|
@@ -39,18 +39,15 @@ const T = {}, w = /* @__PURE__ */ c({
|
|
|
39
39
|
return p({
|
|
40
40
|
content: d,
|
|
41
41
|
contentTarget: "innerHTML",
|
|
42
|
-
delay:
|
|
43
|
-
placement:
|
|
44
|
-
offset:
|
|
45
|
-
targetRef:
|
|
46
|
-
() =>
|
|
47
|
-
var t, o;
|
|
48
|
-
return ((o = (t = r.value) == null ? void 0 : t.children) == null ? void 0 : o[0]) || r.value || void 0;
|
|
49
|
-
}
|
|
42
|
+
delay: o(() => e.delay),
|
|
43
|
+
placement: o(() => e.placement),
|
|
44
|
+
offset: o(() => e.offset),
|
|
45
|
+
targetRef: o(
|
|
46
|
+
() => n.value?.children?.[0] || n.value || void 0
|
|
50
47
|
)
|
|
51
|
-
}), (t,
|
|
48
|
+
}), (t, r) => (s(), m("div", {
|
|
52
49
|
ref_key: "wrapperRef",
|
|
53
|
-
ref:
|
|
50
|
+
ref: n,
|
|
54
51
|
class: u({ contents: !!t.$slots.default })
|
|
55
52
|
}, [
|
|
56
53
|
h(t.$slots, "default")
|