@scalar/api-client
Version:
the open source API testing client
41 lines (40 loc) • 1.36 kB
JavaScript
import { defineComponent as u, computed as r, createElementBlock as i, openBlock as f, normalizeClass as o, createElementVNode as p, createVNode as d, createTextVNode as g, unref as n } from "vue";
import { ScalarIcon as x, ScalarToggle as V } from "@scalar/components";
const b = {}, N = /* @__PURE__ */ u({
...b,
__name: "WatchModeToggle",
props: {
modelValue: { type: Boolean },
disabled: { type: Boolean, default: !1 }
},
emits: ["update:modelValue"],
setup(e, { emit: m }) {
const s = m, l = r({
get: () => e.modelValue,
set: (a) => s("update:modelValue", a)
});
return (a, t) => (f(), i("label", {
class: o(["text-c-2 flex items-center gap-2 rounded p-3 py-1.5 text-sm select-none", e.disabled ? "cursor-default" : "cursor-pointer"]),
for: "watch-toggle"
}, [
p("span", {
class: o(["text-c-1 flex items-center gap-1 text-xs font-medium", { "text-c-3": !e.modelValue }])
}, [
d(n(x), {
icon: "Watch",
size: "sm"
}),
t[1] || (t[1] = g(" Watch Mode ", -1))
], 2),
d(n(V), {
id: "watch-toggle",
modelValue: l.value,
"onUpdate:modelValue": t[0] || (t[0] = (c) => l.value = c),
disabled: e.disabled
}, null, 8, ["modelValue", "disabled"])
], 2));
}
});
export {
N as default
};