UNPKG

@aplus-frontend/ui

Version:

44 lines (43 loc) 982 B
import { isFunction as u, isArray as i } from "lodash-unified"; import { isDef as c } from "../../utils/index.mjs"; const s = (r) => r <= 1 ? 1 : r, o = (r, t = 1) => { const n = Math.floor(24 / r), e = n * t; return e > 24 ? n : e; }, h = (r, t = 1) => ({ xs: o(s(r - 3), t), sm: o(s(r - 2), t), md: o(s(r - 1), t), lg: o(s(r - 1), t), xl: o(r, t), xxl: o(r, t) }); function p(r) { return u(r.type) ? r.type() : r; } function f(r) { const t = [], n = r.filter( (e) => e && p(e) && e.type !== Symbol.for("v-cmt") ); for (const e of n) if (e.type === Symbol.for("v-fgt")) { const l = f(e.children); t.push(...l); } else if (i(e)) { const l = f(e); t.push(...l); } else t.push(e); return t; } const y = (r) => { const t = []; return t.push(...f(r)), t; }; function N(r) { return c(r) ? (i(r) ? r : [r]).join("") : Date.now(); } export { h as buildColSpan, y as genRealChildren, N as getStringName };