UNPKG

ideaz-element

Version:

<p align="center"> <a href="" target="_blank" rel="noopener noreferrer"> <img src="./docs/public/logo.svg" alt="Ideaz Element" width="180" style="width: 180px;" /> </a> </p>

50 lines (49 loc) 1.61 kB
import "../../../utils/index.mjs"; import "../../../shared/index.mjs"; import { colProps as r } from "./props.mjs"; import { defineComponent as d, inject as $, computed as c } from "vue"; import { useNamespace as h } from "../../../hooks/useNamespace.mjs"; import { isNumber as l, isObject as b } from "../../../utils/is.mjs"; import { resolveDynamicComponent as g } from "../../../shared/resolveDynamicComponent.mjs"; const O = /* @__PURE__ */ d({ name: "ZCol", props: r, emits: ["input", "update:modelValue"], setup(n, { slots: a }) { const s = h("col"), { gutter: u } = $("rowContextKey", { gutter: c(() => 0) }), i = c(() => { const t = {}; return u.value && (t.paddingLeft = t.paddingRight = `${u.value / 2}px`), t; }), f = c(() => { const t = []; return ["span", "offset", "pull", "push"].forEach((e) => { const o = n[e]; l(o) && (e === "span" ? t.push(s.b(`${n[e]}`)) : o > 0 && t.push(s.b(`${e}-${n[e]}`))); }), ["xs", "sm", "md", "lg", "xl"].forEach((e) => { l(n[e]) ? t.push(s.b(`${e}-${n[e]}`)) : b(n[e]) && Object.entries(n[e]).forEach(([o, m]) => { t.push(o !== "span" ? s.b(`${e}-${o}-${m}`) : s.b(`${e}-${m}`)); }); }), u.value && t.push(s.is("guttered")), [s.b(), t]; }); return () => { var t; return g({ name: n.tag, attrs: { class: f.value, style: i.value }, content: (t = a.default) == null ? void 0 : t.call(a) }); }; } }); export { O as default }; //# sourceMappingURL=index.mjs.map