@aplus-frontend/ui
Version:
73 lines (72 loc) • 1.81 kB
JavaScript
import { unref as s, markRaw as f } from "vue";
import { isDef as A } from "./is.mjs";
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) {
const t = {};
return Object.keys(e).map((n) => {
t[n] = s(e[n]);
}), t;
}
function h(e, t = [], n) {
const o = Object.assign({}, e), c = Object.keys(o);
for (let i = 0; i < c.length; i += 1) {
const r = c[i];
(t.includes(r) || n?.(r, o[r])) && delete o[r];
}
return o;
}
function g(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 v(e) {
const t = { ...e };
for (const n of Object.keys(t))
d(t[n]) && delete t[n];
return t;
}
function x(e, ...t) {
return typeof e == "function" ? e(...t) : e;
}
function b() {
const e = "history";
return typeof window > "u" ? e : window.location.href.includes("#/") ? "hash" : e;
}
function k() {
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 C() {
return (window.top !== window ? window.top : window) ?? window;
}
export {
u as convertReactiveToRaw,
m as getDynamicProps,
w as getPopupContainer,
b as getRouteType,
k as getScrollbarSize,
C as getTopWindow,
A as isDef,
g as isPascalCase,
v as omitUndefined,
h as omitWhen,
x as runFunction
};