UNPKG

@open-data-v/base

Version:

OpenDataV 公共基础包

37 lines (36 loc) 1.27 kB
import { isFunction as s, isUndefined as t } from "lodash-es"; const i = (r) => (r ? "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx" : "xxxxxxxxxxxx4xxxyxxxxxxxxxxxxxxx").replace(/[xy]/g, function(n) { const x = Math.random() * 16 | 0; return (n == "x" ? x : x & 3 | 8).toString(16); }), u = (r, n, x = 0) => { const o = r.find((p) => p.prop === n[x]); return o && o.children && x < n.length ? u(o.children, n, x + 1) : o; }, d = (r, n) => { r.forEach((x) => { var o; if (x.children) { const p = {}; d(x.children, p), n[x.prop] = p; } else n[x.prop] = (o = x.props) == null ? void 0 : o.defaultValue; }); }, h = (r, n, x) => { n.reduce((o, p, c) => o[p] = c === n.length - 1 ? x : o[p] || {}, r); }, e = (r, n) => { r.forEach((x) => { if (x.children) return t(n[x.prop]) && (n[x.prop] = {}), e(x.children, n[x.prop]); if (!t(n[x.prop]) && (x.props || x.componentOptions)) return (x.props || x.componentOptions).defaultValue = n[x.prop]; n[x.prop] = (x.props || x.componentOptions).defaultValue; }); }, l = (r) => s(r) && !t(r.prototype); export { d as buildModeValue, u as getObjProp, l as isClass, e as updateFormItemsValue, h as updateModeValue, i as uuid }; //# sourceMappingURL=utils.esm.js.map