ant-design-x-vue-next
Version:
Ant Design X for Vue — community continuation aligned with @ant-design/x
58 lines (57 loc) • 1.41 kB
JavaScript
import { setValueByPath as y, isPathObject as i, getValueByPath as c, isPathValue as V } from "./utils.mjs";
function s(e, r) {
if (i(e))
return c(r, e.path);
if (V(e))
return c(r, e);
if (Array.isArray(e))
return e.map((t) => s(t, r));
if (e && typeof e == "object") {
const t = {};
for (const [o, n] of Object.entries(e))
t[o] = s(n, r);
return t;
}
return e;
}
function b(e, r) {
if (!e || typeof e != "object") return e;
const t = {};
for (const [o, n] of Object.entries(e))
o === "context" ? t[o] = n : t[o] = s(n, r);
return t;
}
function j(e, r) {
if (!e || typeof e != "object") return e;
const t = {};
for (const [o, n] of Object.entries(e))
o === "event" ? t[o] = b(n, r) : t[o] = s(n, r);
return t;
}
function l(e, r) {
const t = {};
for (const [o, n] of Object.entries(e))
o === "action" ? t[o] = j(n, r) : t[o] = s(n, r);
return t;
}
function A(e, r) {
var n;
const t = (n = e == null ? void 0 : e.event) == null ? void 0 : n.context;
if (!t || typeof t != "object" || Array.isArray(t))
return [];
const o = [];
for (const [p, f] of Object.entries(t))
if (i(f)) {
const u = r[p];
u !== void 0 && o.push({ path: f.path, value: u });
}
return o;
}
function O(e, r, t) {
return y(e, r, t);
}
export {
O as applyDataModelUpdateV09,
A as extractDataUpdatesV09,
l as resolvePropsV09
};