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