UNPKG

@scalar/api-client

Version:

the open source API testing client

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