@aplus-frontend/ui
Version:
64 lines (63 loc) • 1.28 kB
JavaScript
import { cloneDeepWith as f, isArray as l, omit as u } from "lodash-unified";
import { isVNode as c } from "vue";
import { getTableTitle as s } from "../../utils.mjs";
function a(e, n) {
const r = [];
for (const t of n) {
const i = e.find((o) => o.key === t.key);
if (t.children?.length) {
const o = a(
i.children,
t.children
);
o.length && r.push({
...i,
fixed: t.fixed,
children: o
});
} else {
if (!t.show)
continue;
r.push({ ...i, fixed: t.fixed });
}
}
return r;
}
function g(e) {
return f(e, (n, r) => {
if (r === "label")
return n;
});
}
function p(e, n) {
const r = e.title, t = l(r) ? r[0] : r;
return c(t) ? t : s(
e,
n?.className || "",
void 0,
n?.color
);
}
function y(e) {
return c(e) ? e : l(e) ? e[0] : e;
}
function b(e) {
function n(r) {
const t = {};
return r.forEach((i, o) => {
t[i.key] = {
...u(i, ["label", "key", "children"]),
order: o,
children: i.children?.length ? n(i.children) : void 0
};
}), t;
}
return n(e);
}
export {
g as customCloneColumnStates,
a as default,
b as getColumnStateString,
p as getLabelNode,
y as getLabelRenderNode
};