@morghulis/core 1.0.34 → 1.0.36

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -7246,7 +7246,7 @@ function he(e, t) {
7246
7246
  a("search", p).then((v) => {
7247
7247
  const y = new nt(v), E = n.value.convertor;
7248
7248
  y.results.forEach((V) => {
7249
- E && E(V), y.type === "tree" && (V.children = []);
7249
+ y.type === "tree" && (V.children = []), E && E(V);
7250
7250
  }), _(y);
7251
7251
  });
7252
7252
  }),
@@ -7312,26 +7312,28 @@ function Cm(e) {
7312
7312
  }
7313
7313
  return { post: o, request_loading: n };
7314
7314
  }
7315
- function Nt(e) {
7316
- const t = ie(e) ? e : x(e), n = x({}), o = O(() => t.value.root), l = O(() => n.value[o.value]?.children || []);
7317
- return J(t, () => {
7318
- const { results: s } = t.value;
7319
- n.value = {};
7320
- const a = {};
7321
- if (!s.length) return;
7322
- s.forEach((i) => {
7323
- const u = i.id;
7324
- a[u] = Qe(i);
7315
+ function Nt(e, t) {
7316
+ const n = ie(e) ? e : x(e), o = x({}), l = O(() => n.value.root), s = O(() => o.value[l.value]?.children || []);
7317
+ return J(n, () => {
7318
+ const { results: a } = n.value;
7319
+ o.value = {};
7320
+ const r = {};
7321
+ if (!a.length) return;
7322
+ a.forEach((u) => {
7323
+ const c = u.id;
7324
+ r[c] = Qe(u);
7325
7325
  });
7326
- const r = t.value.root;
7327
- a[r] = a[r] || { id: r, children: [], pid: null }, Object.values(a).forEach((i) => {
7328
- const u = i.pid;
7329
- if (u != null) {
7330
- const c = a[u];
7331
- c && c.children.push(i);
7326
+ const i = n.value.root;
7327
+ r[i] = r[i] || { id: i, children: [], pid: null }, Object.values(r).forEach((u) => {
7328
+ const c = u.pid;
7329
+ if (c != null) {
7330
+ const d = r[c];
7331
+ d && d.children.push(u);
7332
7332
  }
7333
- }), Object.values(a).forEach((i) => i.children.sort(mr("sort", -1))), n.value = a;
7334
- }, { deep: !0, immediate: !0 }), { mapping: n, root: o, length, options: l };
7333
+ }), Object.values(r).forEach((u) => {
7334
+ t && t(u), u.children.sort(mr("sort", -1));
7335
+ }), o.value = r;
7336
+ }, { deep: !0, immediate: !0 }), { mapping: o, root: l, length, options: s };
7335
7337
  }
7336
7338
  function pr(e) {
7337
7339
  const t = ie(e) ? e : x(e), n = x({}), o = x([]), l = O(() => o.value.length), s = O(() => t.value.total);
@@ -11117,8 +11119,8 @@ const n_ = /* @__PURE__ */ R({
11117
11119
  get: () => n.modelValue,
11118
11120
  set: (c) => o("update:modelValue", c || null)
11119
11121
  }), s = (c) => {
11120
- c.children.length === 0 && !c.isLeaf && !a.strict && (c.disabled = !0);
11121
- }, { param: a, model: r, loading: i } = sn(n.field, n.row, "tree", s), { options: u } = Nt(r);
11122
+ !c.children?.length && !c.isLeaf && !a.strict && (c.disabled = !0);
11123
+ }, { param: a, model: r, loading: i } = sn(n.field, n.row, "tree"), { options: u } = Nt(r, s);
11122
11124
  return (c, d) => {
11123
11125
  const _ = w("el-cascader");
11124
11126
  return b(), k(_, {
@@ -11324,7 +11326,7 @@ const n_ = /* @__PURE__ */ R({
11324
11326
  set: (d) => o("update:modelValue", d || null)
11325
11327
  }), s = (d) => {
11326
11328
  !d.children?.length && !d.isLeaf && !a.strict && (d.disabled = !0);
11327
- }, { param: a, model: r, loading: i } = sn(n.field, n.row, "tree", s), { options: u } = Nt(r), c = O(() => ({
11329
+ }, { param: a, model: r, loading: i } = sn(n.field, n.row, "tree"), { options: u } = Nt(r, s), c = O(() => ({
11328
11330
  label: a.props.label,
11329
11331
  value: a.props.value,
11330
11332
  emitPath: !1
@@ -13897,8 +13899,12 @@ function Y_(e) {
13897
13899
  const y = i.value.$fields;
13898
13900
  return d.value.filter((E) => E.valid && !E.payload).map(({ cells: E }) => {
13899
13901
  const V = Object.entries(E).map(([D, C]) => {
13900
- const { format: { multiple: A } } = y[D], P = A ? C.value.split(";") : C.value;
13901
- return [D, P];
13902
+ const { format: { multiple: A } } = y[D];
13903
+ if (A) {
13904
+ const P = C.value ? C.value.split(";") : [];
13905
+ return [D, P];
13906
+ } else
13907
+ return [D, C.value];
13902
13908
  });
13903
13909
  return Object.fromEntries(V);
13904
13910
  });