@gisce/react-ooui 2.6.1-rc.2 → 2.6.1

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 de, 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 fe, 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, ue] = v(i);
1675
+ ), [Me, de] = 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: ue
1751
+ setTitle: de
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: ue = void 0,
2118
+ setFormIsSaving: de = 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 fe = (M, $, X, Z) => {
2153
- Fe == null || Fe(!1), ue == null || ue(!1), s == null || s(M, $, X, Z), Le == null || Le(M);
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);
2154
2154
  }, pe = () => {
2155
- ue == null || ue(!1), o == null || o();
2155
+ de == null || de(!1), o == null || o();
2156
2156
  }, we = (M) => {
2157
- ue == null || ue(!1), u == null || u(M);
2157
+ de == null || de(!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 && $ && (fe == null || fe(se(), De(), oe()));
2356
+ g && await g([se()]), !y && $ && (ue == null || ue(se(), De(), oe()));
2357
2357
  }, jo = async (M) => {
2358
2358
  const { callOnSubmitSucceed: $ = !0 } = M || {};
2359
- !y && $ && (fe == null || fe(se(), De(), oe()));
2359
+ !y && $ && (ue == null || ue(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), fe == null || fe(
2364
+ te.current = !1, Fe == null || Fe(!1), ue == null || ue(
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), ue == null || ue(!0);
2377
+ O(!0), de == null || de(!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), ue == null || ue(!1), we == null || we(Z), Tn.error(F("errorWhileSavingForm")), _(Z != null && Z.message ? Z.message : 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);
2382
2382
  } finally {
2383
- te.current = !1, ue == null || ue(!1), O(!1);
2383
+ te.current = !1, de == null || de(!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
- fe == null || fe(se(), De(), oe());
2519
+ ue == null || ue(se(), De(), oe());
2520
2520
  else if (X.type && X.type === "ir.actions.act_window_close")
2521
- fe == null || fe(se(), De(), oe());
2521
+ ue == null || ue(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" ? fe == null || fe(se(), De(), oe()) : await at({ forceRefresh: !0 });
2541
+ $.type && $.type === "ir.actions.act_window_close" ? ue == null || ue(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 && (fe == null || fe(se(), De(), oe()));
2571
+ !S && X && (ue == null || ue(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 = de(async () => {
3314
+ const [i, o] = v(!1), [s, a] = v(!1), { t: l } = ge(), [d, u] = v(), f = fe(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 = de(
3390
+ const n = fe(
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 = de((o) => {
3406
+ ), i = fe((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 = de(() => {
3420
+ ), y = fe(() => {
3421
3421
  p(), g();
3422
- }, [p, g]), w = de(async () => {
3422
+ }, [p, g]), w = fe(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 = de(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 = fe(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 = de(async () => {
3685
+ const [o, s] = v([]), [a, l] = v(!1), { relation: d, field: u } = n, f = fe(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 = de(
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(
3921
3921
  (ae) => {
3922
3922
  y == null || y([...ae]), ne([...ae]);
3923
3923
  },
3924
3924
  [y]
3925
- ), ve = de(() => w || Q, [w, Q]), z = de(async () => {
3925
+ ), ve = fe(() => w || Q, [w, Q]), z = fe(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 fe = Ae.map((we) => we.id), pe = p !== void 0 ? Dt({
3945
+ const ue = 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), fe.length > 0 ? g == null || g(0) : g == null || g(void 0);
3950
+ te(pe), ue.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 = de(
3966
+ ]), ie = fe(
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: fe, results: pe, attrsEvaluated: we } = await P.getHandler().searchForTree({
3970
+ const { totalItems: ue, 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 fe;
3993
+ const We = await ue;
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 = de(
4011
+ ), Se = fe(
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 = de(
4030
+ ), Ee = fe(
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 = de(
4050
+ ), ke = fe(
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 = de(
4068
+ ), Me = fe(
4069
4069
  (ae) => {
4070
4070
  O(!0), H(ae), k((ae - 1) * S);
4071
4071
  },
4072
4072
  [O, S, k, H]
4073
- ), ue = de(() => {
4073
+ ), de = fe(() => {
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 = de(
4082
+ ]), Fe = fe(
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 = de(async () => await P.getHandler().searchAllIds({
4093
+ ), Le = fe(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: ue,
4101
+ clear: de,
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 : {}) || {}, ue = de(
4157
+ } = (f ? U : {}) || {}, de = fe(
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: fe,
4172
+ getResults: ue,
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: ue,
4183
+ setSelectedRowItems: de,
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 = de(
4242
+ const Te = fe(
4243
4243
  (Ne) => {
4244
4244
  Me == null || Me(Ne);
4245
4245
  },
4246
4246
  [Me]
4247
- ), Ve = de(
4247
+ ), Ve = fe(
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 = de(
4267
+ ), tt = fe(
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 = de(async () => {
4286
+ ), Ge = fe(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 = de(() => !R || !A ? null : /* @__PURE__ */ D(ee, { children: [
4292
+ ), Qt = fe(() => !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: fe(),
4322
+ results: ue(),
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: ue,
4330
+ onRowSelectionChange: de,
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
- ue,
4341
+ de,
4342
4342
  we,
4343
4343
  Le,
4344
4344
  We,
4345
4345
  se,
4346
4346
  A,
4347
- fe,
4347
+ ue,
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 = de(async () => {
4984
+ ), [S] = Xe(P.getHandler().search), R = fe(async () => {
4985
4985
  u(!0), c(void 0);
4986
4986
  const I = Wn(o);
4987
4987
  w(I.type || "line");
@@ -5239,6 +5239,7 @@ const Jl = {
5239
5239
  label: {
5240
5240
  type: "inner",
5241
5241
  offset: "-30%",
5242
+ content: ({ percent: e }) => e < 0.07 ? "" : `${(e * 100).toFixed(0)}%`,
5242
5243
  style: {
5243
5244
  fontSize: 12,
5244
5245
  textAlign: "center"
@@ -5248,7 +5249,8 @@ const Jl = {
5248
5249
  spider: {
5249
5250
  label: {
5250
5251
  type: "spider",
5251
- labelHeight: 28
5252
+ labelHeight: 28,
5253
+ content: ({ percent: e }) => `${(e * 100).toFixed(0)}%`
5252
5254
  }
5253
5255
  }
5254
5256
  }, Xl = (e) => {
@@ -5272,31 +5274,23 @@ const Jl = {
5272
5274
  }) => {
5273
5275
  const { t: s } = ge(), a = _e(() => {
5274
5276
  if (!(e !== "pie" || t.reduce(
5275
- (p, h) => h.operator === "+" ? p + h.value : 0,
5277
+ (c, m) => m.operator === "+" ? c + m.value : 0,
5276
5278
  0
5277
5279
  ) === 0))
5278
- return t.reduce((p, h) => p + h.value, 0);
5280
+ return t.reduce((c, m) => c + m.value, 0);
5279
5281
  }, [t, e]), l = _e(() => {
5280
5282
  if (e === "pie")
5281
5283
  return Xl(t);
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(() => {
5284
+ }, [t, e]), d = _e(() => {
5291
5285
  if (l !== void 0)
5292
5286
  return {
5293
- formatter: (m, p) => d(p.id)
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
+ }
5294
5291
  };
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(
5292
+ }, [l]), u = Ql[e];
5293
+ return u ? /* @__PURE__ */ D(
5300
5294
  "div",
5301
5295
  {
5302
5296
  style: {
@@ -5314,15 +5308,14 @@ const Jl = {
5314
5308
  useGrouping: !0
5315
5309
  })}` }) }),
5316
5310
  /* @__PURE__ */ r("div", { style: { width: "100%", height: "100%", overflow: "hidden" }, children: /* @__PURE__ */ r(
5317
- c,
5311
+ u,
5318
5312
  {
5319
5313
  ...Zl({
5320
5314
  type: e,
5321
5315
  data: t,
5322
5316
  isGroup: n,
5323
5317
  isStack: i,
5324
- pieItemValueFormatter: u,
5325
- pieLabelFormatter: f
5318
+ pieItemValueFormatter: d
5326
5319
  })
5327
5320
  }
5328
5321
  ) })
@@ -5331,16 +5324,9 @@ const Jl = {
5331
5324
  ) : /* @__PURE__ */ r(ee, { children: `Unknown graph type: ${e}` });
5332
5325
  };
5333
5326
  function Zl(e) {
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;
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;
5344
5330
  }
5345
5331
  const ec = (e) => {
5346
5332
  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({
@@ -5605,7 +5591,7 @@ const dc = (e) => {
5605
5591
  }
5606
5592
  z();
5607
5593
  }, [s, a]);
5608
- const z = de(() => {
5594
+ const z = fe(() => {
5609
5595
  (a === "form" && s.some((G) => !G.values) || a === "tree" && s.some((G) => !G.treeValues)) && Se();
5610
5596
  }, [s, a]);
5611
5597
  me(() => {
@@ -5664,7 +5650,7 @@ const dc = (e) => {
5664
5650
  a === "form" ? ae(() => {
5665
5651
  l(oe);
5666
5652
  }) : l(oe);
5667
- }, ue = () => {
5653
+ }, de = () => {
5668
5654
  d > 0 && (a === "form" ? ae(() => {
5669
5655
  u(d - 1);
5670
5656
  }) : u(d - 1));
@@ -5780,7 +5766,7 @@ const dc = (e) => {
5780
5766
  });
5781
5767
  }
5782
5768
  ie(Te), j || F(!1);
5783
- }, fe = async (G) => {
5769
+ }, ue = async (G) => {
5784
5770
  const { id: oe } = G;
5785
5771
  let Re = s;
5786
5772
  const xe = s.find((Te) => Te.id === oe);
@@ -5866,7 +5852,7 @@ const dc = (e) => {
5866
5852
  treeView: o.get("tree"),
5867
5853
  results: G,
5868
5854
  loading: x,
5869
- onRowClicked: ((Te = o.get("form")) == null ? void 0 : Te.fields) !== void 0 ? fe : void 0,
5855
+ onRowClicked: ((Te = o.get("form")) == null ? void 0 : Te.fields) !== void 0 ? ue : void 0,
5870
5856
  showPagination: !1,
5871
5857
  selectedRowKeys: V,
5872
5858
  onRowSelectionChange: N,
@@ -5909,7 +5895,7 @@ const dc = (e) => {
5909
5895
  onDelete: Ie,
5910
5896
  onCreateItem: je,
5911
5897
  onToggleViewMode: Me,
5912
- onPreviousItem: ue,
5898
+ onPreviousItem: de,
5913
5899
  onNextItem: Fe,
5914
5900
  onSearchItem: Ke,
5915
5901
  selectedRowKeys: V,
@@ -6203,7 +6189,7 @@ const { useToken: yc } = Be, { TextArea: Pn } = it, wc = (e) => {
6203
6189
  limit: o,
6204
6190
  onClose: s
6205
6191
  }) => {
6206
- const a = le({}), l = le(/* @__PURE__ */ new Map()), { t: d } = ge(), u = de(
6192
+ const a = le({}), l = le(/* @__PURE__ */ new Map()), { t: d } = ge(), u = fe(
6207
6193
  async (y) => {
6208
6194
  if (y.selectedKeys === void 0 || y.selectedKeys.length === 0) {
6209
6195
  mt(d("selectAtLeastOneField"));
@@ -6229,14 +6215,14 @@ const { useToken: yc } = Be, { TextArea: Pn } = it, wc = (e) => {
6229
6215
  pn(b, x.mime);
6230
6216
  },
6231
6217
  [i, n, e, o, t, s, d]
6232
- ), f = de(async () => {
6218
+ ), f = fe(async () => {
6233
6219
  const y = await P.getHandler().getFields({
6234
6220
  model: e,
6235
6221
  context: t,
6236
6222
  fields: []
6237
6223
  });
6238
6224
  return a.current["/"] = y, Er({ fields: y });
6239
- }, [e, t, a]), c = de(
6225
+ }, [e, t, a]), c = fe(
6240
6226
  async (y) => {
6241
6227
  const b = Ln(y, a.current)[Nn(y)], x = b.relation, S = await P.getHandler().getFields({
6242
6228
  model: x,
@@ -6254,7 +6240,7 @@ const { useToken: yc } = Be, { TextArea: Pn } = it, wc = (e) => {
6254
6240
  });
6255
6241
  },
6256
6242
  [t]
6257
- ), m = de(async () => {
6243
+ ), m = fe(async () => {
6258
6244
  const y = await Tc({ model: e, context: t }), w = await Rc({
6259
6245
  predefinedExports: y,
6260
6246
  fields: a.current,
@@ -6275,7 +6261,7 @@ const { useToken: yc } = Be, { TextArea: Pn } = it, wc = (e) => {
6275
6261
  })),
6276
6262
  keysWithChilds: w
6277
6263
  };
6278
- }, [t, e, c]), p = de(
6264
+ }, [t, e, c]), p = fe(
6279
6265
  async (y) => {
6280
6266
  await P.getHandler().deleteObjects({
6281
6267
  model: "ir.exports",
@@ -6284,7 +6270,7 @@ const { useToken: yc } = Be, { TextArea: Pn } = it, wc = (e) => {
6284
6270
  });
6285
6271
  },
6286
6272
  [t]
6287
- ), h = de(
6273
+ ), h = fe(
6288
6274
  async (y) => {
6289
6275
  if (l.current.has(y))
6290
6276
  return l.current.get(y);
@@ -6296,7 +6282,7 @@ const { useToken: yc } = Be, { TextArea: Pn } = it, wc = (e) => {
6296
6282
  l.current.set(y, w);
6297
6283
  },
6298
6284
  [l, t]
6299
- ), g = de(
6285
+ ), g = fe(
6300
6286
  async (y) => {
6301
6287
  const w = await h("ir.exports"), b = await h("ir.exports.line"), x = await P.getHandler().create({
6302
6288
  model: "ir.exports",
@@ -6903,7 +6889,7 @@ function Kc(e) {
6903
6889
  onAddNewAttachment: i,
6904
6890
  onListAllAttachments: o,
6905
6891
  onViewAttachmentDetails: s
6906
- } = e, { formRef: a } = re(nt), [l, d] = v(!1), [u, f] = v([]), [c, m] = v(!1), { t: p } = ge(), h = de(async () => {
6892
+ } = e, { formRef: a } = re(nt), [l, d] = v(!1), [u, f] = v([]), [c, m] = v(!1), { t: p } = ge(), h = fe(async () => {
6907
6893
  if (!(!t || t.length === 0)) {
6908
6894
  d(!0);
6909
6895
  try {
@@ -6926,7 +6912,7 @@ function Kc(e) {
6926
6912
  }
6927
6913
  d(!1);
6928
6914
  }
6929
- }, [t, a]), g = de(
6915
+ }, [t, a]), g = fe(
6930
6916
  async (w) => {
6931
6917
  if (w.link) {
6932
6918
  window.open(w.link);
@@ -6951,7 +6937,7 @@ function Kc(e) {
6951
6937
  s(b);
6952
6938
  },
6953
6939
  [a, s]
6954
- ), y = de(
6940
+ ), y = fe(
6955
6941
  async (w) => {
6956
6942
  s(w);
6957
6943
  },
@@ -8682,7 +8668,7 @@ function hd(e, t) {
8682
8668
  function Me(W) {
8683
8669
  T(W), z == null || z(W);
8684
8670
  }
8685
- function ue(W) {
8671
+ function de(W) {
8686
8672
  b(W);
8687
8673
  const ye = { action_id: p, action_type: h };
8688
8674
  ve == null || ve({ ...W, extra: ye });
@@ -8760,19 +8746,19 @@ function hd(e, t) {
8760
8746
  }
8761
8747
  }
8762
8748
  }
8763
- let fe;
8764
- !u && W.find((pe) => pe.type === "tree") ? fe = W.find(
8749
+ let ue;
8750
+ !u && W.find((pe) => pe.type === "tree") ? ue = W.find(
8765
8751
  (we) => we.type === "tree"
8766
- ) : u ? fe = W.find((we) => u.id ? we.type === u.type && we.view_id === u.id : we.type === u.type) : fe = W.find(
8752
+ ) : u ? ue = W.find((we) => u.id ? we.type === u.type && we.view_id === u.id : we.type === u.type) : ue = W.find(
8767
8753
  (we) => we.type === "form"
8768
- ), fe || (Qe(
8754
+ ), ue || (Qe(
8769
8755
  `Error determining the first view to show for model ${i}.
8770
8756
  Please, make sure the view ids on the fields_view_get responses are the same as the ones defined in the action`
8771
- ), ke == null || ke(d)), ue(fe), S(W), I(!1);
8757
+ ), ke == null || ke(d)), de(ue), S(W), I(!1);
8772
8758
  };
8773
8759
  l({ tabKey: d, canWeClose: Le }), me(() => {
8774
8760
  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);
8775
- ue(ye || W), m ? z == null || z(A) : (Me(void 0), V(void 0)), Fe();
8761
+ de(ye || W), m ? z == null || z(A) : (Me(void 0), V(void 0)), Fe();
8776
8762
  }, [i, s, m]), me(() => {
8777
8763
  if (Se === d) {
8778
8764
  z == null || z(F);
@@ -8812,7 +8798,7 @@ Please, make sure the view ids on the fields_view_get responses are the same as
8812
8798
  } else
8813
8799
  ye = "tree", Ae = [["id", "in", W]];
8814
8800
  B(!1), Q(!1);
8815
- const fe = s.find((we) => we[1] === ye);
8801
+ const ue = s.find((we) => we[1] === ye);
8816
8802
  Ee({
8817
8803
  domain: Ae,
8818
8804
  context: o,
@@ -8820,7 +8806,7 @@ Please, make sure the view ids on the fields_view_get responses are the same as
8820
8806
  views: s,
8821
8807
  title: a,
8822
8808
  target: "current",
8823
- initialView: { id: fe == null ? void 0 : fe[0], type: ye },
8809
+ initialView: { id: ue == null ? void 0 : ue[0], type: ye },
8824
8810
  action_id: p,
8825
8811
  action_type: h,
8826
8812
  res_id: W[0]
@@ -8865,7 +8851,7 @@ Please, make sure the view ids on the fields_view_get responses are the same as
8865
8851
  results: N,
8866
8852
  setCurrentItemIndex: V,
8867
8853
  setCurrentId: Me,
8868
- setCurrentView: ue
8854
+ setCurrentView: de
8869
8855
  },
8870
8856
  `${W.type}-${W.view_id}`
8871
8857
  );
@@ -8903,7 +8889,7 @@ Please, make sure the view ids on the fields_view_get responses are the same as
8903
8889
  const W = x.find(
8904
8890
  (ye) => ye.type === "form"
8905
8891
  );
8906
- ue(W);
8892
+ de(W);
8907
8893
  }
8908
8894
  }
8909
8895
  return R ? /* @__PURE__ */ r($e, {}) : w ? /* @__PURE__ */ D(
@@ -8911,7 +8897,7 @@ Please, make sure the view ids on the fields_view_get responses are the same as
8911
8897
  {
8912
8898
  title: a,
8913
8899
  currentView: w,
8914
- setCurrentView: ue,
8900
+ setCurrentView: de,
8915
8901
  availableViews: x,
8916
8902
  formRef: ce,
8917
8903
  searchTreeRef: J,
@@ -9111,12 +9097,12 @@ function Cd(e) {
9111
9097
  attrs: Se && { colors: Se }
9112
9098
  });
9113
9099
  V(nn(Me));
9114
- const ue = Dt({
9100
+ const de = Dt({
9115
9101
  resultsToSort: ke,
9116
9102
  sorter: N,
9117
9103
  fields: { ...h.fields, ...y.fields }
9118
9104
  });
9119
- Q(!1), C(ue);
9105
+ Q(!1), C(de);
9120
9106
  const Fe = await Ee;
9121
9107
  T(Fe);
9122
9108
  }, K = async () => {
@@ -9218,7 +9204,7 @@ const xd = $n(Cd), Sd = (e) => {
9218
9204
  }, Td = (e) => {
9219
9205
  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(
9220
9206
  P.getHandler().readForView
9221
- ), p = de(async () => {
9207
+ ), p = fe(async () => {
9222
9208
  l(!0), u(void 0), s && n.push(["id", "in", s]);
9223
9209
  try {
9224
9210
  const h = await m({
@@ -9483,12 +9469,12 @@ function _d(e, t) {
9483
9469
  if (Se) {
9484
9470
  const [Ee, ke] = Se, {
9485
9471
  actionId: Me,
9486
- actionType: ue,
9472
+ actionType: de,
9487
9473
  title: Fe,
9488
9474
  model: Le
9489
9475
  } = N, ae = {
9490
9476
  action_id: Me,
9491
- action_type: ue,
9477
+ action_type: de,
9492
9478
  name: Fe,
9493
9479
  res_id: ie.id,
9494
9480
  res_model: Le,
@@ -9532,14 +9518,14 @@ function _d(e, t) {
9532
9518
  actionId: Ee,
9533
9519
  actionType: ke,
9534
9520
  title: Me,
9535
- model: ue
9521
+ model: de
9536
9522
  } = N;
9537
9523
  ve = {
9538
9524
  action_id: Ee,
9539
9525
  action_type: ke,
9540
9526
  name: Me,
9541
9527
  res_id: !1,
9542
- res_model: ue,
9528
+ res_model: de,
9543
9529
  view_id: ie,
9544
9530
  view_type: Se,
9545
9531
  overrideUnsettedLimit: !0
@@ -10236,7 +10222,7 @@ const { useToken: nu } = Be, Yu = (e) => {
10236
10222
  const _ = C;
10237
10223
  (_ == null ? void 0 : _.action_type) !== "ir.actions.wizard" && h(_);
10238
10224
  }
10239
- const A = de(async () => {
10225
+ const A = fe(async () => {
10240
10226
  if (!S)
10241
10227
  return;
10242
10228
  const C = await n(S);
@@ -10246,7 +10232,7 @@ const { useToken: nu } = Be, Yu = (e) => {
10246
10232
  var C;
10247
10233
  (C = m == null ? void 0 : m.current) == null || C.close(), x == null || x({ model: "ir.ui.view_sc" });
10248
10234
  }
10249
- const T = de(async () => {
10235
+ const T = fe(async () => {
10250
10236
  const C = await t();
10251
10237
  return C.length === 0 ? [
10252
10238
  {
@@ -10263,7 +10249,7 @@ const { useToken: nu } = Be, Yu = (e) => {
10263
10249
  }))
10264
10250
  }
10265
10251
  ];
10266
- }, [t, f]), O = de(async () => {
10252
+ }, [t, f]), O = fe(async () => {
10267
10253
  if (a && d)
10268
10254
  await o(d);
10269
10255
  else {