UNPKG

dk-plus

Version:
33 lines (32 loc) 1.29 kB
import { toRaw as m, computed as c } from "vue"; import { DK_INPUT_NUMBER_POSITION as l } from "../../_tokens/component/index3.js"; import { getStyleList as x } from "../public/get-StyleList/index.js"; import "../../_icon/index.js"; const h = (s) => { const t = { ...m(s) }, { classes: e } = x(t, "input-number"); let i = ["disabled"]; !!t.position && l.includes(t.position) ? (t.position = `${t.position} dk-input-number_position`, i = [...i, "position"]) : typeof t.position == "string" && (t.position = "right dk-input-number_position", i = [...i, "position"]); const r = e([...i], "dk-input-number"), u = c(() => { const { size: n, disabled: p } = t, o = { large: ["240px", "45px", "16px", "4px"], medium: ["180px", "36px", "12px", "3px"], small: ["150px", "30px", "10px", "-1px"], mini: ["120px", "26px", "6px", "-3px"] }; return { "--input-number-width": o[n][0], "--input-number-height": o[n][1], "--input-number-background-color": p ? "#f5f7fa" : "#fff", "--input-number-border-color--hover": p ? "#ccc" : "#409eff", "--input-number-input-margin-right": o[n][2], "--input-number-position-button": o[n][3] }; }); return { classList: r, styleList: u }; }; export { h as getInputNumber };