UNPKG

@aplus-frontend/ui

Version:

75 lines (74 loc) 1.81 kB
import { unref as s, markRaw as f } from "vue"; import { isUndefined as d } from "lodash-unified"; import { isClient as l } from "@vueuse/core"; function w(e) { return e?.parentNode ?? document.body; } function m(e) { return typeof e < "u"; } function h(e) { const t = {}; return Object.keys(e).map((n) => { t[n] = s(e[n]); }), t; } function g(e, t = [], n) { const o = Object.assign({}, e), c = Object.keys(o); for (let r = 0; r < c.length; r += 1) { const i = c[r]; (t.includes(i) || n?.(i, o[i])) && delete o[i]; } return o; } function v(e) { return /^[A-Z][A-Za-z]*$/.test(e); } function u(e) { if (Array.isArray(e)) return e.map((t) => u(t)); if (typeof e == "object" && e !== null) { const t = {}; for (const n in e) t[n] = u(e[n]); return f(t); } return e; } function b(e) { const t = { ...e }; for (const n of Object.keys(t)) d(t[n]) && delete t[n]; return t; } function k(e, ...t) { return typeof e == "function" ? e(...t) : e; } function x() { const e = "history"; return typeof window > "u" ? e : window.location.href.includes("#/") ? "hash" : e; } function C() { if (!l) return 15; const e = document.createElement("div"); e.style.width = "100px", e.style.height = "100px", e.style.overflow = "scroll", e.style.position = "absolute", e.style.top = "-9999px", document.body.appendChild(e); const t = e.offsetHeight - e.clientHeight; return document.body.removeChild(e), t; } function R() { return (window.top !== window ? window.top : window) ?? window; } export { u as convertReactiveToRaw, h as getDynamicProps, w as getPopupContainer, x as getRouteType, C as getScrollbarSize, R as getTopWindow, m as isDef, v as isPascalCase, b as omitUndefined, g as omitWhen, k as runFunction };