UNPKG

@aplus-frontend/ui

Version:

45 lines (44 loc) 1.01 kB
import { isFunction as c, isArray as u } from "lodash-unified"; import "../../utils/index.mjs"; import { isDef as p } from "../../utils/is.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; }, y = (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 i(r) { return c(r.type) ? r.type() : r; } function f(r) { const t = [], n = r.filter( (e) => e && i(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 (u(e)) { const l = f(e); t.push(...l); } else t.push(i(e)); return t; } const N = (r) => { const t = []; return t.push(...f(r)), t; }; function d(r) { return p(r) ? (u(r) ? r : [r]).join("") : Date.now(); } export { y as buildColSpan, N as genRealChildren, d as getStringName };