dk-plus
Version:
32 lines (31 loc) • 1.05 kB
JavaScript
import { toRaw as a } from "vue";
import { getColor as c } from "../public/get-color/index.js";
import { getStyleList as h } from "../public/get-StyleList/index.js";
import { setSize as m } from "../public/set-size/index.js";
import "../../_icon/index.js";
const y = (o) => {
const e = a(o), { classes: l } = h(e, "switch");
return {
classList: l([...["dk-switch", "disabled"]], "dk-switch"),
styleList: (() => {
const { size: s, checkedColor: r, uncheckedColor: n, width: i } = e, t = {
large: ["56px", "28px"],
medium: ["48px", "24px"],
small: ["40px", "20px"],
mini: ["36px", "18px"]
};
return {
...{
"--switch-width": i ? m(i) : "fit-content",
"--switch-min-width": s && t[s][0] || t.small[0],
"--switch-height": s && t[s][1] || t.small[1],
"--switch-checked-color": c(r || "#409EFF").getDeepen(0),
"--switch-unchecked-color": c(n || "#C0CCDA").getDeepen(0)
}
};
})()
};
};
export {
y as getSwitch
};