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