@gisce/react-ooui 2.6.1 → 2.6.2

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.
@@ -2,7 +2,7 @@ var ri = Object.defineProperty;
2
2
  var oi = (e, t, n) => t in e ? ri(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
3
3
  var cr = (e, t, n) => (oi(e, typeof t != "symbol" ? t + "" : t, n), n);
4
4
  import { jsxs as D, jsx as r, Fragment as ee } from "react/jsx-runtime";
5
- import rt, { useContext as re, useState as v, useEffect as me, useRef as le, createContext as ii, forwardRef as ht, useImperativeHandle as pt, useCallback as fe, Fragment as Mr, useMemo as _e, memo as $n } from "react";
5
+ import rt, { useContext as re, useState as v, useEffect as me, useRef as le, createContext as ii, forwardRef as ht, useImperativeHandle as pt, useCallback as de, Fragment as Mr, useMemo as _e, memo as $n } from "react";
6
6
  import { Tooltip as wt, theme as Be, Typography as kt, Form as lt, Row as Oe, Col as he, Modal as Je, Button as Pe, Dropdown as si, Menu as dr, Spin as $e, Divider as cn, Space as Ue, Input as it, Select as Tt, Checkbox as Bt, Alert as Ze, Timeline as In, Statistic as ai, Card as Hn, Tag as Nr, message as Tn, DatePicker as Bn, TimePicker as li, InputNumber as Lr, Progress as ci, Avatar as $r, Pagination as di, Badge as ui, Tabs as Hr, Radio as ur, Switch as fi, Steps as fr, Layout as mi } from "antd";
7
7
  import { Label as Pt, Field as Vn, Tree as Br, Reference as hi, Selection as Kn, Many2one as Kr, Boolean as pi, Container as gi, parseContext as xt, Form as Wr, Integer as An, SearchFieldTypes as yt, SearchFilter as yi, parseContextFields as wi, parseDomainFields as vi, transformDomainForChildWidget as jr, graphProcessor as Ur, parseGraph as Wn, graphFieldUtils as bi } from "@gisce/ooui";
8
8
  import * as mr from "@ant-design/icons";
@@ -1672,7 +1672,7 @@ const Nt = ({
1672
1672
  limit: T
1673
1673
  } = e, [O, C] = v(!1), [_, V] = v(!1), [N, j] = v(!1), [H, U] = v(!0), [k, Y] = v(!0), [q, Q] = v([]), [ne, B] = v(!1), [E, K] = v([]), [L, ce] = v(!1), [J, te] = v(!0), [ve, z] = v(), [ie, Se] = v({}), [Ee, ke] = v(
1674
1674
  T !== void 0 ? T : St
1675
- ), [Me, de] = v(i);
1675
+ ), [Me, ue] = v(i);
1676
1676
  me(() => {
1677
1677
  m && m.length > 0 && !p && (h == null || h(0), f == null || f(m[0].id));
1678
1678
  }, [m]), me(() => {
@@ -1748,7 +1748,7 @@ const Nt = ({
1748
1748
  setSearchValues: Se,
1749
1749
  limit: Ee,
1750
1750
  setLimit: ke,
1751
- setTitle: de
1751
+ setTitle: ue
1752
1752
  },
1753
1753
  children: t
1754
1754
  }
@@ -2115,7 +2115,7 @@ function Ea(e, t) {
2115
2115
  } = e, { t: F } = ge(), [T, O] = v(!1), [C, _] = v(), [V, N] = v(), [j] = lt.useForm(), [H, U] = v(), [k, Y] = v(), q = re(go), [Q, ne] = v(), [B, E] = v(!1), K = le(), L = le({}), ce = le({}), J = le(!1), te = le(!1), ve = le(!1), ie = (A !== void 0 ? A : Q) < Da, Se = re(He), { activeId: Ee, getPlainValues: ke } = Se || {}, Me = re(
2116
2116
  nt
2117
2117
  ), {
2118
- setFormIsSaving: de = void 0,
2118
+ setFormIsSaving: ue = void 0,
2119
2119
  setFormHasChanges: Fe = void 0,
2120
2120
  setCurrentId: Le = void 0,
2121
2121
  setFormIsLoading: ae = void 0,
@@ -2149,12 +2149,12 @@ function Ea(e, t) {
2149
2149
  elementHasLostFocus: !0
2150
2150
  }), E(!1));
2151
2151
  }, [B]);
2152
- const ue = (M, $, X, Z) => {
2153
- Fe == null || Fe(!1), de == null || de(!1), s == null || s(M, $, X, Z), Le == null || Le(M);
2152
+ const fe = (M, $, X, Z) => {
2153
+ Fe == null || Fe(!1), ue == null || ue(!1), s == null || s(M, $, X, Z), Le == null || Le(M);
2154
2154
  }, pe = () => {
2155
- de == null || de(!1), o == null || o();
2155
+ ue == null || ue(!1), o == null || o();
2156
2156
  }, we = (M) => {
2157
- de == null || de(!1), u == null || u(M);
2157
+ ue == null || ue(!1), u == null || u(M);
2158
2158
  };
2159
2159
  function se() {
2160
2160
  return i || K.current;
@@ -2353,15 +2353,15 @@ function Ea(e, t) {
2353
2353
  });
2354
2354
  K.current = Z, L.current = X;
2355
2355
  }
2356
- g && await g([se()]), !y && $ && (ue == null || ue(se(), De(), oe()));
2356
+ g && await g([se()]), !y && $ && (fe == null || fe(se(), De(), oe()));
2357
2357
  }, jo = async (M) => {
2358
2358
  const { callOnSubmitSucceed: $ = !0 } = M || {};
2359
- !y && $ && (ue == null || ue(se(), De(), oe()));
2359
+ !y && $ && (fe == null || fe(se(), De(), oe()));
2360
2360
  }, Zt = async (M) => {
2361
2361
  let $ = !1;
2362
2362
  const { callOnSubmitSucceed: X = !0 } = M || {};
2363
2363
  if (te.current = !0, _(void 0), ve.current && !tt() && se() && X) {
2364
- te.current = !1, Fe == null || Fe(!1), ue == null || ue(
2364
+ te.current = !1, Fe == null || Fe(!1), fe == null || fe(
2365
2365
  se(),
2366
2366
  De(),
2367
2367
  oe(),
@@ -2374,13 +2374,13 @@ function Ea(e, t) {
2374
2374
  return te.current = !1, Fe == null || Fe(!1), pe == null || pe(), { succeed: !0, id: se() };
2375
2375
  if (await Qt())
2376
2376
  return te.current = !1, Tr(F), { succeed: !1, id: se() };
2377
- O(!0), de == null || de(!0);
2377
+ O(!0), ue == null || ue(!0);
2378
2378
  try {
2379
2379
  m === "api" ? await ar(M) : await jo(M), c && (K.current = void 0, ut({ values: {}, fields: k, reset: !0 })), await at({ forceRefresh: !0 }), $ = !0, Tn.success(F("savedRegisters"));
2380
2380
  } catch (Z) {
2381
- te.current = !1, O(!1), de == null || de(!1), we == null || we(Z), Tn.error(F("errorWhileSavingForm")), _(Z != null && Z.message ? Z.message : Z);
2381
+ te.current = !1, O(!1), ue == null || ue(!1), we == null || we(Z), Tn.error(F("errorWhileSavingForm")), _(Z != null && Z.message ? Z.message : Z);
2382
2382
  } finally {
2383
- te.current = !1, de == null || de(!1), O(!1);
2383
+ te.current = !1, ue == null || ue(!1), O(!1);
2384
2384
  }
2385
2385
  return { succeed: $, id: se() };
2386
2386
  }, Ht = ({
@@ -2516,9 +2516,9 @@ function Ea(e, t) {
2516
2516
  }
2517
2517
  });
2518
2518
  if (typeof X == "object" && X !== null && Object.keys(X).length === 0 && y)
2519
- ue == null || ue(se(), De(), oe());
2519
+ fe == null || fe(se(), De(), oe());
2520
2520
  else if (X.type && X.type === "ir.actions.act_window_close")
2521
- ue == null || ue(se(), De(), oe());
2521
+ fe == null || fe(se(), De(), oe());
2522
2522
  else if (X.type) {
2523
2523
  let Z = {};
2524
2524
  X.context && (Z = xt({
@@ -2538,7 +2538,7 @@ function Ea(e, t) {
2538
2538
  action: M,
2539
2539
  payload: se()
2540
2540
  });
2541
- $.type && $.type === "ir.actions.act_window_close" ? ue == null || ue(se(), De(), oe()) : await at({ forceRefresh: !0 });
2541
+ $.type && $.type === "ir.actions.act_window_close" ? fe == null || fe(se(), De(), oe()) : await at({ forceRefresh: !0 });
2542
2542
  }
2543
2543
  async function Jo({
2544
2544
  action: M,
@@ -2568,7 +2568,7 @@ function Ea(e, t) {
2568
2568
  at({ forceRefresh: !0 });
2569
2569
  }
2570
2570
  })) || {};
2571
- !S && X && (ue == null || ue(se(), De(), oe()));
2571
+ !S && X && (fe == null || fe(se(), De(), oe()));
2572
2572
  }
2573
2573
  function Xo() {
2574
2574
  bn({ elementHasLostFocus: !0 });
@@ -3311,7 +3311,7 @@ const cl = (e) => /* @__PURE__ */ r(be, { ...e, children: /* @__PURE__ */ r(bo,
3311
3311
  onItemClick: t,
3312
3312
  onOpenChange: n
3313
3313
  }) => {
3314
- const [i, o] = v(!1), [s, a] = v(!1), { t: l } = ge(), [d, u] = v(), f = fe(async () => {
3314
+ const [i, o] = v(!1), [s, a] = v(!1), { t: l } = ge(), [d, u] = v(), f = de(async () => {
3315
3315
  const {
3316
3316
  actionItems: c = [],
3317
3317
  relateItems: m = [],
@@ -3387,7 +3387,7 @@ const cl = (e) => /* @__PURE__ */ r(be, { ...e, children: /* @__PURE__ */ r(bo,
3387
3387
  me(() => () => {
3388
3388
  i();
3389
3389
  }, []);
3390
- const n = fe(
3390
+ const n = de(
3391
3391
  async (o, s) => {
3392
3392
  var d;
3393
3393
  const a = s || tr();
@@ -3403,7 +3403,7 @@ const cl = (e) => /* @__PURE__ */ r(be, { ...e, children: /* @__PURE__ */ r(bo,
3403
3403
  }
3404
3404
  },
3405
3405
  [e]
3406
- ), i = fe((o) => {
3406
+ ), i = de((o) => {
3407
3407
  var s;
3408
3408
  o ? ((s = t.current.get(o)) == null || s.abort(), t.current.delete(o)) : (t.current.forEach((a) => a.abort()), t.current.clear());
3409
3409
  }, []);
@@ -3417,9 +3417,9 @@ const cl = (e) => /* @__PURE__ */ r(be, { ...e, children: /* @__PURE__ */ r(bo,
3417
3417
  P.getHandler().getView
3418
3418
  ), [h, g] = Xe(
3419
3419
  P.getHandler().readObjects
3420
- ), y = fe(() => {
3420
+ ), y = de(() => {
3421
3421
  p(), g();
3422
- }, [p, g]), w = fe(async () => {
3422
+ }, [p, g]), w = de(async () => {
3423
3423
  var I;
3424
3424
  const x = await m({
3425
3425
  model: n,
@@ -3503,7 +3503,7 @@ const cl = (e) => /* @__PURE__ */ r(be, { ...e, children: /* @__PURE__ */ r(bo,
3503
3503
  /* @__PURE__ */ r(or, { id: t.id, model: t.model })
3504
3504
  ] }) : /* @__PURE__ */ r(ee, {});
3505
3505
  }, hl = (e) => {
3506
- const { value: t, context: n, selectionValues: i } = e, [o, s] = v(), [a, l] = v(!1), [d, u] = t ? t.split(",") : [], f = parseInt(u), c = fe(async () => {
3506
+ const { value: t, context: n, selectionValues: i } = e, [o, s] = v(), [a, l] = v(!1), [d, u] = t ? t.split(",") : [], f = parseInt(u), c = de(async () => {
3507
3507
  if (!t || t && o)
3508
3508
  return;
3509
3509
  l(!0);
@@ -3682,7 +3682,7 @@ const pl = (e) => {
3682
3682
  ooui: n,
3683
3683
  context: i
3684
3684
  }) => {
3685
- const [o, s] = v([]), [a, l] = v(!1), { relation: d, field: u } = n, f = fe(async () => {
3685
+ const [o, s] = v([]), [a, l] = v(!1), { relation: d, field: u } = n, f = de(async () => {
3686
3686
  try {
3687
3687
  l(!0);
3688
3688
  const m = await P.getHandler().search({
@@ -3917,12 +3917,12 @@ const So = (e) => {
3917
3917
  searchParams: I = [],
3918
3918
  setSearchValues: A,
3919
3919
  clearSelection: F
3920
- } = e, [T, O] = v(!1), [C, _] = v(!1), [V, N] = v(), [j, H] = v(1), [U, k] = v(0), [Y, q] = v(), [Q, ne] = v([]), [B, E] = v(void 0), [K, L] = v(void 0), ce = le(S || St), J = le([]), te = fe(
3920
+ } = e, [T, O] = v(!1), [C, _] = v(!1), [V, N] = v(), [j, H] = v(1), [U, k] = v(0), [Y, q] = v(), [Q, ne] = v([]), [B, E] = v(void 0), [K, L] = v(void 0), ce = le(S || St), J = le([]), te = de(
3921
3921
  (ae) => {
3922
3922
  y == null || y([...ae]), ne([...ae]);
3923
3923
  },
3924
3924
  [y]
3925
- ), ve = fe(() => w || Q, [w, Q]), z = fe(async () => {
3925
+ ), ve = de(() => w || Q, [w, Q]), z = de(async () => {
3926
3926
  const ae = await P.getHandler().nameSearch({
3927
3927
  model: t,
3928
3928
  payload: l,
@@ -3942,12 +3942,12 @@ const So = (e) => {
3942
3942
  attrs: W
3943
3943
  }), Ae = ye[0];
3944
3944
  J.current = [...Ae], E(nn(ye[1])), L(Cr(ye[1]));
3945
- const ue = Ae.map((we) => we.id), pe = p !== void 0 ? Dt({
3945
+ const fe = Ae.map((we) => we.id), pe = p !== void 0 ? Dt({
3946
3946
  resultsToSort: Ae,
3947
3947
  sorter: p,
3948
3948
  fields: { ...c.fields, ...m.fields }
3949
3949
  }) : [...J.current];
3950
- te(pe), ue.length > 0 ? g == null || g(0) : g == null || g(void 0);
3950
+ te(pe), fe.length > 0 ? g == null || g(0) : g == null || g(void 0);
3951
3951
  } else
3952
3952
  te([]), g == null || g(void 0);
3953
3953
  O(!1), d.current = !0;
@@ -3963,11 +3963,11 @@ const So = (e) => {
3963
3963
  p,
3964
3964
  g,
3965
3965
  f
3966
- ]), ie = fe(
3966
+ ]), ie = de(
3967
3967
  async (ae) => {
3968
3968
  const { params: Ie, newOffset: je } = ae || {}, Ke = jt(Ie || I, b), { colors: W, status: ye } = At(c), Ae = {};
3969
3969
  W && (Ae.colors = W), ye && (Ae.status = ye);
3970
- const { totalItems: ue, results: pe, attrsEvaluated: we } = await P.getHandler().searchForTree({
3970
+ const { totalItems: fe, results: pe, attrsEvaluated: we } = await P.getHandler().searchForTree({
3971
3971
  params: Ke,
3972
3972
  limit: ce.current,
3973
3973
  offset: je || U,
@@ -3990,7 +3990,7 @@ const So = (e) => {
3990
3990
  } else
3991
3991
  g == null || g(void 0);
3992
3992
  O(!1);
3993
- const We = await ue;
3993
+ const We = await fe;
3994
3994
  q(We), f == null || f(We);
3995
3995
  },
3996
3996
  [
@@ -4008,7 +4008,7 @@ const So = (e) => {
4008
4008
  U,
4009
4009
  I
4010
4010
  ]
4011
- ), Se = fe(
4011
+ ), Se = de(
4012
4012
  async (ae) => {
4013
4013
  try {
4014
4014
  O(!0), a == null || a(!0), l && !d.current ? await z() : await ie(ae), F == null || F();
@@ -4027,7 +4027,7 @@ const So = (e) => {
4027
4027
  i,
4028
4028
  a
4029
4029
  ]
4030
- ), Ee = fe(
4030
+ ), Ee = de(
4031
4031
  (ae) => {
4032
4032
  if (JSON.stringify(ae) === JSON.stringify(p))
4033
4033
  return;
@@ -4047,7 +4047,7 @@ const So = (e) => {
4047
4047
  m == null ? void 0 : m.fields,
4048
4048
  te
4049
4049
  ]
4050
- ), ke = fe(
4050
+ ), ke = de(
4051
4051
  (ae) => {
4052
4052
  const { params: Ie, searchValues: je, limit: Ke, offset: W } = ae;
4053
4053
  T || (n == null || n(void 0), i == null || i([]), A == null || A(je), o == null || o(Ie), s == null || s(!1), _(!0), N(void 0), H(1), Ke && (ce.current = Ke, R == null || R(Ke)), W && k(W), Se({
@@ -4065,12 +4065,12 @@ const So = (e) => {
4065
4065
  Se,
4066
4066
  R
4067
4067
  ]
4068
- ), Me = fe(
4068
+ ), Me = de(
4069
4069
  (ae) => {
4070
4070
  O(!0), H(ae), k((ae - 1) * S);
4071
4071
  },
4072
4072
  [O, S, k, H]
4073
- ), de = fe(() => {
4073
+ ), ue = de(() => {
4074
4074
  T || (n == null || n(void 0), o == null || o([]), A == null || A({}), N(void 0), k(0), H(1), R == null || R(S || St));
4075
4075
  }, [
4076
4076
  T,
@@ -4079,7 +4079,7 @@ const So = (e) => {
4079
4079
  A,
4080
4080
  R,
4081
4081
  S
4082
- ]), Fe = fe(
4082
+ ]), Fe = de(
4083
4083
  async (ae) => {
4084
4084
  const Ie = ae[(c == null ? void 0 : c.field_parent) || "child_id"], je = await P.getHandler().readObjects({
4085
4085
  model: t,
@@ -4090,7 +4090,7 @@ const So = (e) => {
4090
4090
  return te([...ve(), ...je]), fo(At(c), je);
4091
4091
  },
4092
4092
  [c, t, u, ve, te]
4093
- ), Le = fe(async () => await P.getHandler().searchAllIds({
4093
+ ), Le = de(async () => await P.getHandler().searchAllIds({
4094
4094
  params: jt(I, b),
4095
4095
  model: t,
4096
4096
  context: u,
@@ -4098,7 +4098,7 @@ const So = (e) => {
4098
4098
  }), [t, u, Y, I, b]);
4099
4099
  return {
4100
4100
  submit: ke,
4101
- clear: de,
4101
+ clear: ue,
4102
4102
  fetchResults: Se,
4103
4103
  tableRefreshing: T,
4104
4104
  searchFilterLoading: C,
@@ -4154,7 +4154,7 @@ function Dl(e, t) {
4154
4154
  setSearchValues: Ee = void 0,
4155
4155
  limit: ke = St,
4156
4156
  setLimit: Me = void 0
4157
- } = (f ? U : {}) || {}, de = fe(
4157
+ } = (f ? U : {}) || {}, ue = de(
4158
4158
  (Ne) => {
4159
4159
  B == null || B(Ne.map((ot) => ({ id: ot }))), m == null || m(Ne);
4160
4160
  },
@@ -4169,7 +4169,7 @@ function Dl(e, t) {
4169
4169
  page: W,
4170
4170
  limit: ye,
4171
4171
  offset: Ae,
4172
- getResults: ue,
4172
+ getResults: fe,
4173
4173
  requestPageChange: pe,
4174
4174
  changeSort: we,
4175
4175
  fetchChildrenForRecord: se,
@@ -4180,7 +4180,7 @@ function Dl(e, t) {
4180
4180
  } = So({
4181
4181
  model: x,
4182
4182
  setSearchTreeNameSearch: z,
4183
- setSelectedRowItems: de,
4183
+ setSelectedRowItems: ue,
4184
4184
  setSearchParams: K,
4185
4185
  setSearchValues: Ee,
4186
4186
  searchParams: E,
@@ -4239,12 +4239,12 @@ function Dl(e, t) {
4239
4239
  me(() => {
4240
4240
  Re();
4241
4241
  }, [n]);
4242
- const Te = fe(
4242
+ const Te = de(
4243
4243
  (Ne) => {
4244
4244
  Me == null || Me(Ne);
4245
4245
  },
4246
4246
  [Me]
4247
- ), Ve = fe(
4247
+ ), Ve = de(
4248
4248
  async (Ne) => {
4249
4249
  const { id: ot } = Ne;
4250
4250
  V.current || (V.current = await P.getHandler().treeButOpen({
@@ -4264,7 +4264,7 @@ function Dl(e, t) {
4264
4264
  }));
4265
4265
  },
4266
4266
  [x, c, H, R]
4267
- ), tt = fe(
4267
+ ), tt = de(
4268
4268
  async (Ne) => {
4269
4269
  const { id: ot } = Ne;
4270
4270
  if (R != null && R.isExpandable) {
@@ -4283,13 +4283,13 @@ function Dl(e, t) {
4283
4283
  });
4284
4284
  },
4285
4285
  [x, A, s, Ve, R]
4286
- ), Ge = fe(async () => {
4286
+ ), Ge = de(async () => {
4287
4287
  const Ne = await oe();
4288
4288
  B == null || B(Ne.map((ot) => ({ id: ot }))), m == null || m(Ne);
4289
4289
  }, [oe, m, B]), bt = _e(() => R != null && R.isExpandable ? N - 160 : N - (C + 240), [N, C, R == null ? void 0 : R.isExpandable]), st = _e(
4290
4290
  () => ne == null ? void 0 : ne.map((Ne) => Ne.id),
4291
4291
  [ne]
4292
- ), Qt = fe(() => !R || !A ? null : /* @__PURE__ */ D(ee, { children: [
4292
+ ), Qt = de(() => !R || !A ? null : /* @__PURE__ */ D(ee, { children: [
4293
4293
  /* @__PURE__ */ r(
4294
4294
  wo,
4295
4295
  {
@@ -4319,7 +4319,7 @@ function Dl(e, t) {
4319
4319
  limit: ye,
4320
4320
  page: W,
4321
4321
  treeView: R,
4322
- results: ue(),
4322
+ results: fe(),
4323
4323
  onRequestPageChange: pe,
4324
4324
  loading: Ie,
4325
4325
  onRowClicked: tt,
@@ -4327,7 +4327,7 @@ function Dl(e, t) {
4327
4327
  colorsForResults: We,
4328
4328
  statusForResults: De,
4329
4329
  selectedRowKeys: st,
4330
- onRowSelectionChange: de,
4330
+ onRowSelectionChange: ue,
4331
4331
  sorter: J,
4332
4332
  onChangeSort: we,
4333
4333
  onFetchChildrenForRecord: R.isExpandable ? se : void 0,
@@ -4338,13 +4338,13 @@ function Dl(e, t) {
4338
4338
  )
4339
4339
  ] }), [
4340
4340
  bt,
4341
- de,
4341
+ ue,
4342
4342
  we,
4343
4343
  Le,
4344
4344
  We,
4345
4345
  se,
4346
4346
  A,
4347
- ue,
4347
+ fe,
4348
4348
  ke,
4349
4349
  ye,
4350
4350
  Ae,
@@ -4981,7 +4981,7 @@ const gn = () => /* @__PURE__ */ r(
4981
4981
  P.getHandler().getFields
4982
4982
  ), [x] = Xe(
4983
4983
  P.getHandler().readObjects
4984
- ), [S] = Xe(P.getHandler().search), R = fe(async () => {
4984
+ ), [S] = Xe(P.getHandler().search), R = de(async () => {
4985
4985
  u(!0), c(void 0);
4986
4986
  const I = Wn(o);
4987
4987
  w(I.type || "line");
@@ -5239,7 +5239,6 @@ const Jl = {
5239
5239
  label: {
5240
5240
  type: "inner",
5241
5241
  offset: "-30%",
5242
- content: ({ percent: e }) => e < 0.07 ? "" : `${(e * 100).toFixed(0)}%`,
5243
5242
  style: {
5244
5243
  fontSize: 12,
5245
5244
  textAlign: "center"
@@ -5249,8 +5248,7 @@ const Jl = {
5249
5248
  spider: {
5250
5249
  label: {
5251
5250
  type: "spider",
5252
- labelHeight: 28,
5253
- content: ({ percent: e }) => `${(e * 100).toFixed(0)}%`
5251
+ labelHeight: 28
5254
5252
  }
5255
5253
  }
5256
5254
  }, Xl = (e) => {
@@ -5274,23 +5272,31 @@ const Jl = {
5274
5272
  }) => {
5275
5273
  const { t: s } = ge(), a = _e(() => {
5276
5274
  if (!(e !== "pie" || t.reduce(
5277
- (c, m) => m.operator === "+" ? c + m.value : 0,
5275
+ (p, h) => h.operator === "+" ? p + h.value : 0,
5278
5276
  0
5279
5277
  ) === 0))
5280
- return t.reduce((c, m) => c + m.value, 0);
5278
+ return t.reduce((p, h) => p + h.value, 0);
5281
5279
  }, [t, e]), l = _e(() => {
5282
5280
  if (e === "pie")
5283
5281
  return Xl(t);
5284
- }, [t, e]), d = _e(() => {
5282
+ }, [t, e]), d = de(
5283
+ (m) => {
5284
+ if (!l)
5285
+ return;
5286
+ const p = l.find((y) => y.x === m);
5287
+ return `${`${((p == null ? void 0 : p.percent) || 0).toFixed(0)}%`}`;
5288
+ },
5289
+ [l]
5290
+ ), u = _e(() => {
5285
5291
  if (l !== void 0)
5286
5292
  return {
5287
- formatter: (f, c) => {
5288
- const m = l.find((g) => g.x === c.id);
5289
- return `${`${((m == null ? void 0 : m.percent) || 0).toFixed(0)}%`}`;
5290
- }
5293
+ formatter: (m, p) => d(p.id)
5291
5294
  };
5292
- }, [l]), u = Ql[e];
5293
- return u ? /* @__PURE__ */ D(
5295
+ }, [l]), f = de(
5296
+ ({ percent: m, x: p }) => m < 0.07 ? "" : d(p),
5297
+ [l]
5298
+ ), c = Ql[e];
5299
+ return c ? /* @__PURE__ */ D(
5294
5300
  "div",
5295
5301
  {
5296
5302
  style: {
@@ -5308,14 +5314,15 @@ const Jl = {
5308
5314
  useGrouping: !0
5309
5315
  })}` }) }),
5310
5316
  /* @__PURE__ */ r("div", { style: { width: "100%", height: "100%", overflow: "hidden" }, children: /* @__PURE__ */ r(
5311
- u,
5317
+ c,
5312
5318
  {
5313
5319
  ...Zl({
5314
5320
  type: e,
5315
5321
  data: t,
5316
5322
  isGroup: n,
5317
5323
  isStack: i,
5318
- pieItemValueFormatter: d
5324
+ pieItemValueFormatter: u,
5325
+ pieLabelFormatter: f
5319
5326
  })
5320
5327
  }
5321
5328
  ) })
@@ -5324,9 +5331,16 @@ const Jl = {
5324
5331
  ) : /* @__PURE__ */ r(ee, { children: `Unknown graph type: ${e}` });
5325
5332
  };
5326
5333
  function Zl(e) {
5327
- const { type: t, data: n, isGroup: i, isStack: o, pieItemValueFormatter: s } = e;
5328
- let a = { ...Ar[t] };
5329
- return a || (a = { ...Ar.default }), a.data = n, t === "pie" ? (a.colorField = "x", a.angleField = "value", a = { ...a, ...Jl.inner }, a.legend.itemValue = s) : (a.xField = "x", a.yField = "value", a.seriesField = "type", a.isGroup = i, o && (a.isStack = !0, a.groupField = "stacked")), a;
5334
+ const {
5335
+ type: t,
5336
+ data: n,
5337
+ isGroup: i,
5338
+ isStack: o,
5339
+ pieItemValueFormatter: s,
5340
+ pieLabelFormatter: a
5341
+ } = e;
5342
+ let l = { ...Ar[t] };
5343
+ return l || (l = { ...Ar.default }), l.data = n, t === "pie" ? (l.colorField = "x", l.angleField = "value", l = { ...l, ...Jl.inner }, l.legend.itemValue = s, l.label.content = a) : (l.xField = "x", l.yField = "value", l.seriesField = "type", l.isGroup = i, o && (l.isStack = !0, l.groupField = "stacked")), l;
5330
5344
  }
5331
5345
  const ec = (e) => {
5332
5346
  const { model: t, domain: n, context: i, xml: o, limit: s, manualIds: a } = e, { t: l } = ge(), { error: d, loading: u, values: f, type: c, evaluatedEntries: m, fetchData: p } = jl({
@@ -5591,7 +5605,7 @@ const dc = (e) => {
5591
5605
  }
5592
5606
  z();
5593
5607
  }, [s, a]);
5594
- const z = fe(() => {
5608
+ const z = de(() => {
5595
5609
  (a === "form" && s.some((G) => !G.values) || a === "tree" && s.some((G) => !G.treeValues)) && Se();
5596
5610
  }, [s, a]);
5597
5611
  me(() => {
@@ -5650,7 +5664,7 @@ const dc = (e) => {
5650
5664
  a === "form" ? ae(() => {
5651
5665
  l(oe);
5652
5666
  }) : l(oe);
5653
- }, de = () => {
5667
+ }, ue = () => {
5654
5668
  d > 0 && (a === "form" ? ae(() => {
5655
5669
  u(d - 1);
5656
5670
  }) : u(d - 1));
@@ -5766,7 +5780,7 @@ const dc = (e) => {
5766
5780
  });
5767
5781
  }
5768
5782
  ie(Te), j || F(!1);
5769
- }, ue = async (G) => {
5783
+ }, fe = async (G) => {
5770
5784
  const { id: oe } = G;
5771
5785
  let Re = s;
5772
5786
  const xe = s.find((Te) => Te.id === oe);
@@ -5852,7 +5866,7 @@ const dc = (e) => {
5852
5866
  treeView: o.get("tree"),
5853
5867
  results: G,
5854
5868
  loading: x,
5855
- onRowClicked: ((Te = o.get("form")) == null ? void 0 : Te.fields) !== void 0 ? ue : void 0,
5869
+ onRowClicked: ((Te = o.get("form")) == null ? void 0 : Te.fields) !== void 0 ? fe : void 0,
5856
5870
  showPagination: !1,
5857
5871
  selectedRowKeys: V,
5858
5872
  onRowSelectionChange: N,
@@ -5895,7 +5909,7 @@ const dc = (e) => {
5895
5909
  onDelete: Ie,
5896
5910
  onCreateItem: je,
5897
5911
  onToggleViewMode: Me,
5898
- onPreviousItem: de,
5912
+ onPreviousItem: ue,
5899
5913
  onNextItem: Fe,
5900
5914
  onSearchItem: Ke,
5901
5915
  selectedRowKeys: V,
@@ -6189,7 +6203,7 @@ const { useToken: yc } = Be, { TextArea: Pn } = it, wc = (e) => {
6189
6203
  limit: o,
6190
6204
  onClose: s
6191
6205
  }) => {
6192
- const a = le({}), l = le(/* @__PURE__ */ new Map()), { t: d } = ge(), u = fe(
6206
+ const a = le({}), l = le(/* @__PURE__ */ new Map()), { t: d } = ge(), u = de(
6193
6207
  async (y) => {
6194
6208
  if (y.selectedKeys === void 0 || y.selectedKeys.length === 0) {
6195
6209
  mt(d("selectAtLeastOneField"));
@@ -6215,14 +6229,14 @@ const { useToken: yc } = Be, { TextArea: Pn } = it, wc = (e) => {
6215
6229
  pn(b, x.mime);
6216
6230
  },
6217
6231
  [i, n, e, o, t, s, d]
6218
- ), f = fe(async () => {
6232
+ ), f = de(async () => {
6219
6233
  const y = await P.getHandler().getFields({
6220
6234
  model: e,
6221
6235
  context: t,
6222
6236
  fields: []
6223
6237
  });
6224
6238
  return a.current["/"] = y, Er({ fields: y });
6225
- }, [e, t, a]), c = fe(
6239
+ }, [e, t, a]), c = de(
6226
6240
  async (y) => {
6227
6241
  const b = Ln(y, a.current)[Nn(y)], x = b.relation, S = await P.getHandler().getFields({
6228
6242
  model: x,
@@ -6240,7 +6254,7 @@ const { useToken: yc } = Be, { TextArea: Pn } = it, wc = (e) => {
6240
6254
  });
6241
6255
  },
6242
6256
  [t]
6243
- ), m = fe(async () => {
6257
+ ), m = de(async () => {
6244
6258
  const y = await Tc({ model: e, context: t }), w = await Rc({
6245
6259
  predefinedExports: y,
6246
6260
  fields: a.current,
@@ -6261,7 +6275,7 @@ const { useToken: yc } = Be, { TextArea: Pn } = it, wc = (e) => {
6261
6275
  })),
6262
6276
  keysWithChilds: w
6263
6277
  };
6264
- }, [t, e, c]), p = fe(
6278
+ }, [t, e, c]), p = de(
6265
6279
  async (y) => {
6266
6280
  await P.getHandler().deleteObjects({
6267
6281
  model: "ir.exports",
@@ -6270,7 +6284,7 @@ const { useToken: yc } = Be, { TextArea: Pn } = it, wc = (e) => {
6270
6284
  });
6271
6285
  },
6272
6286
  [t]
6273
- ), h = fe(
6287
+ ), h = de(
6274
6288
  async (y) => {
6275
6289
  if (l.current.has(y))
6276
6290
  return l.current.get(y);
@@ -6282,7 +6296,7 @@ const { useToken: yc } = Be, { TextArea: Pn } = it, wc = (e) => {
6282
6296
  l.current.set(y, w);
6283
6297
  },
6284
6298
  [l, t]
6285
- ), g = fe(
6299
+ ), g = de(
6286
6300
  async (y) => {
6287
6301
  const w = await h("ir.exports"), b = await h("ir.exports.line"), x = await P.getHandler().create({
6288
6302
  model: "ir.exports",
@@ -6889,7 +6903,7 @@ function Kc(e) {
6889
6903
  onAddNewAttachment: i,
6890
6904
  onListAllAttachments: o,
6891
6905
  onViewAttachmentDetails: s
6892
- } = e, { formRef: a } = re(nt), [l, d] = v(!1), [u, f] = v([]), [c, m] = v(!1), { t: p } = ge(), h = fe(async () => {
6906
+ } = e, { formRef: a } = re(nt), [l, d] = v(!1), [u, f] = v([]), [c, m] = v(!1), { t: p } = ge(), h = de(async () => {
6893
6907
  if (!(!t || t.length === 0)) {
6894
6908
  d(!0);
6895
6909
  try {
@@ -6912,7 +6926,7 @@ function Kc(e) {
6912
6926
  }
6913
6927
  d(!1);
6914
6928
  }
6915
- }, [t, a]), g = fe(
6929
+ }, [t, a]), g = de(
6916
6930
  async (w) => {
6917
6931
  if (w.link) {
6918
6932
  window.open(w.link);
@@ -6937,7 +6951,7 @@ function Kc(e) {
6937
6951
  s(b);
6938
6952
  },
6939
6953
  [a, s]
6940
- ), y = fe(
6954
+ ), y = de(
6941
6955
  async (w) => {
6942
6956
  s(w);
6943
6957
  },
@@ -8668,7 +8682,7 @@ function hd(e, t) {
8668
8682
  function Me(W) {
8669
8683
  T(W), z == null || z(W);
8670
8684
  }
8671
- function de(W) {
8685
+ function ue(W) {
8672
8686
  b(W);
8673
8687
  const ye = { action_id: p, action_type: h };
8674
8688
  ve == null || ve({ ...W, extra: ye });
@@ -8746,19 +8760,19 @@ function hd(e, t) {
8746
8760
  }
8747
8761
  }
8748
8762
  }
8749
- let ue;
8750
- !u && W.find((pe) => pe.type === "tree") ? ue = W.find(
8763
+ let fe;
8764
+ !u && W.find((pe) => pe.type === "tree") ? fe = W.find(
8751
8765
  (we) => we.type === "tree"
8752
- ) : u ? ue = W.find((we) => u.id ? we.type === u.type && we.view_id === u.id : we.type === u.type) : ue = W.find(
8766
+ ) : u ? fe = W.find((we) => u.id ? we.type === u.type && we.view_id === u.id : we.type === u.type) : fe = W.find(
8753
8767
  (we) => we.type === "form"
8754
- ), ue || (Qe(
8768
+ ), fe || (Qe(
8755
8769
  `Error determining the first view to show for model ${i}.
8756
8770
  Please, make sure the view ids on the fields_view_get responses are the same as the ones defined in the action`
8757
- ), ke == null || ke(d)), de(ue), S(W), I(!1);
8771
+ ), ke == null || ke(d)), ue(fe), S(W), I(!1);
8758
8772
  };
8759
8773
  l({ tabKey: d, canWeClose: Le }), me(() => {
8760
8774
  const W = x.find((Ae) => Ae.type === "tree"), ye = x.find((Ae) => u.id ? Ae.type === u.type && Ae.view_id === u.id : Ae.type === u.type);
8761
- de(ye || W), m ? z == null || z(A) : (Me(void 0), V(void 0)), Fe();
8775
+ ue(ye || W), m ? z == null || z(A) : (Me(void 0), V(void 0)), Fe();
8762
8776
  }, [i, s, m]), me(() => {
8763
8777
  if (Se === d) {
8764
8778
  z == null || z(F);
@@ -8798,7 +8812,7 @@ Please, make sure the view ids on the fields_view_get responses are the same as
8798
8812
  } else
8799
8813
  ye = "tree", Ae = [["id", "in", W]];
8800
8814
  B(!1), Q(!1);
8801
- const ue = s.find((we) => we[1] === ye);
8815
+ const fe = s.find((we) => we[1] === ye);
8802
8816
  Ee({
8803
8817
  domain: Ae,
8804
8818
  context: o,
@@ -8806,7 +8820,7 @@ Please, make sure the view ids on the fields_view_get responses are the same as
8806
8820
  views: s,
8807
8821
  title: a,
8808
8822
  target: "current",
8809
- initialView: { id: ue == null ? void 0 : ue[0], type: ye },
8823
+ initialView: { id: fe == null ? void 0 : fe[0], type: ye },
8810
8824
  action_id: p,
8811
8825
  action_type: h,
8812
8826
  res_id: W[0]
@@ -8851,7 +8865,7 @@ Please, make sure the view ids on the fields_view_get responses are the same as
8851
8865
  results: N,
8852
8866
  setCurrentItemIndex: V,
8853
8867
  setCurrentId: Me,
8854
- setCurrentView: de
8868
+ setCurrentView: ue
8855
8869
  },
8856
8870
  `${W.type}-${W.view_id}`
8857
8871
  );
@@ -8889,7 +8903,7 @@ Please, make sure the view ids on the fields_view_get responses are the same as
8889
8903
  const W = x.find(
8890
8904
  (ye) => ye.type === "form"
8891
8905
  );
8892
- de(W);
8906
+ ue(W);
8893
8907
  }
8894
8908
  }
8895
8909
  return R ? /* @__PURE__ */ r($e, {}) : w ? /* @__PURE__ */ D(
@@ -8897,7 +8911,7 @@ Please, make sure the view ids on the fields_view_get responses are the same as
8897
8911
  {
8898
8912
  title: a,
8899
8913
  currentView: w,
8900
- setCurrentView: de,
8914
+ setCurrentView: ue,
8901
8915
  availableViews: x,
8902
8916
  formRef: ce,
8903
8917
  searchTreeRef: J,
@@ -9097,12 +9111,12 @@ function Cd(e) {
9097
9111
  attrs: Se && { colors: Se }
9098
9112
  });
9099
9113
  V(nn(Me));
9100
- const de = Dt({
9114
+ const ue = Dt({
9101
9115
  resultsToSort: ke,
9102
9116
  sorter: N,
9103
9117
  fields: { ...h.fields, ...y.fields }
9104
9118
  });
9105
- Q(!1), C(de);
9119
+ Q(!1), C(ue);
9106
9120
  const Fe = await Ee;
9107
9121
  T(Fe);
9108
9122
  }, K = async () => {
@@ -9204,7 +9218,7 @@ const xd = $n(Cd), Sd = (e) => {
9204
9218
  }, Td = (e) => {
9205
9219
  const { model: t, domain: n = [], context: i = {}, view_id: o, manualIds: s } = e, [a, l] = v(!1), [d, u] = v(), [f, c] = v(), [m] = Xe(
9206
9220
  P.getHandler().readForView
9207
- ), p = fe(async () => {
9221
+ ), p = de(async () => {
9208
9222
  l(!0), u(void 0), s && n.push(["id", "in", s]);
9209
9223
  try {
9210
9224
  const h = await m({
@@ -9469,12 +9483,12 @@ function _d(e, t) {
9469
9483
  if (Se) {
9470
9484
  const [Ee, ke] = Se, {
9471
9485
  actionId: Me,
9472
- actionType: de,
9486
+ actionType: ue,
9473
9487
  title: Fe,
9474
9488
  model: Le
9475
9489
  } = N, ae = {
9476
9490
  action_id: Me,
9477
- action_type: de,
9491
+ action_type: ue,
9478
9492
  name: Fe,
9479
9493
  res_id: ie.id,
9480
9494
  res_model: Le,
@@ -9518,14 +9532,14 @@ function _d(e, t) {
9518
9532
  actionId: Ee,
9519
9533
  actionType: ke,
9520
9534
  title: Me,
9521
- model: de
9535
+ model: ue
9522
9536
  } = N;
9523
9537
  ve = {
9524
9538
  action_id: Ee,
9525
9539
  action_type: ke,
9526
9540
  name: Me,
9527
9541
  res_id: !1,
9528
- res_model: de,
9542
+ res_model: ue,
9529
9543
  view_id: ie,
9530
9544
  view_type: Se,
9531
9545
  overrideUnsettedLimit: !0
@@ -10222,7 +10236,7 @@ const { useToken: nu } = Be, Yu = (e) => {
10222
10236
  const _ = C;
10223
10237
  (_ == null ? void 0 : _.action_type) !== "ir.actions.wizard" && h(_);
10224
10238
  }
10225
- const A = fe(async () => {
10239
+ const A = de(async () => {
10226
10240
  if (!S)
10227
10241
  return;
10228
10242
  const C = await n(S);
@@ -10232,7 +10246,7 @@ const { useToken: nu } = Be, Yu = (e) => {
10232
10246
  var C;
10233
10247
  (C = m == null ? void 0 : m.current) == null || C.close(), x == null || x({ model: "ir.ui.view_sc" });
10234
10248
  }
10235
- const T = fe(async () => {
10249
+ const T = de(async () => {
10236
10250
  const C = await t();
10237
10251
  return C.length === 0 ? [
10238
10252
  {
@@ -10249,7 +10263,7 @@ const { useToken: nu } = Be, Yu = (e) => {
10249
10263
  }))
10250
10264
  }
10251
10265
  ];
10252
- }, [t, f]), O = fe(async () => {
10266
+ }, [t, f]), O = de(async () => {
10253
10267
  if (a && d)
10254
10268
  await o(d);
10255
10269
  else {