@gisce/react-ooui 2.65.0-alpha.2 → 2.65.0-alpha.4

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 Cl = Object.defineProperty;
2
2
  var xl = (e, t, n) => t in e ? Cl(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
3
3
  var Xo = (e, t, n) => (xl(e, typeof t != "symbol" ? t + "" : t, n), n);
4
4
  import { jsx as i, jsxs as P, Fragment as ee } from "react/jsx-runtime";
5
- import At, { useContext as ne, useState as I, useEffect as ae, useRef as W, memo as Ze, useCallback as D, useMemo as q, forwardRef as _t, useImperativeHandle as Dt, Fragment as Sn, createContext as Tl, createElement as Il } from "react";
5
+ import At, { useContext as ne, useState as I, useEffect as ae, useRef as Y, memo as Ze, useCallback as D, useMemo as q, forwardRef as _t, useImperativeHandle as Dt, Fragment as Sn, createContext as Tl, createElement as Il } from "react";
6
6
  import { Tooltip as Et, theme as ze, Typography as zt, Form as Rt, Row as Ye, Col as Oe, Modal as Tt, Button as We, Dropdown as Al, Menu as Zo, Spin as Qe, Divider as hr, Space as rt, Input as ft, Select as rn, Checkbox as Pn, Alert as yt, Timeline as is, message as Dn, Popover as Fl, App as _l, Progress as Ol, Avatar as ss, Tag as yo, DatePicker as vo, ColorPicker as as, TimePicker as Rl, InputNumber as gr, Layout as ls, Badge as jn, Pagination as Dl, Empty as cs, Statistic as El, Card as bo, Tabs as ds, Radio as ei, Switch as Pl, Steps as ti, Carousel as Vl } from "antd";
7
7
  import { Label as Cn, Field as Zr, Tree as us, Reference as kl, Selection as wo, Many2one as fs, Boolean as $l, parseContext as Yt, graphProcessor as ms, graphFieldUtils as Ml, parseContextFields as Ll, parseDomainFields as Nl, Integer as eo, SearchFieldTypes as Wt, SearchFilter as ps, parseGraph as hs, Container as jl, Form as gs, transformDomainForChildWidget as So, Button as Bl } from "@gisce/ooui";
8
8
  import * as ni from "@ant-design/icons";
@@ -636,7 +636,7 @@ const Es = (e) => {
636
636
  content: t
637
637
  });
638
638
  }, Ps = (e) => {
639
- const { visible: t, onCloseModal: n, model: r, id: o, field: a, onSubmitSucceed: s } = e, { modalWidth: l } = Ar(), { t: c } = me(), [u, m] = I([]), [d, f] = I(!1), [h, p] = I(!1), [g, y] = I({}), v = W();
639
+ const { visible: t, onCloseModal: n, model: r, id: o, field: a, onSubmitSucceed: s } = e, { modalWidth: l } = Ar(), { t: c } = me(), [u, m] = I([]), [d, f] = I(!1), [h, p] = I(!1), [g, y] = I({}), v = Y();
640
640
  ae(() => {
641
641
  t ? b() : y({});
642
642
  }, [t]);
@@ -1030,7 +1030,7 @@ const Ro = (e) => {
1030
1030
  const { ooui: t } = e, { required: n, id: r } = t;
1031
1031
  return St(r) ? /* @__PURE__ */ i(Ro, { value: r }) : /* @__PURE__ */ i(Pe, { required: n, ...e, children: /* @__PURE__ */ i(Fd, { ooui: t }) });
1032
1032
  }, Fd = (e) => {
1033
- const { ooui: t, value: n, onChange: r } = e, { readOnly: o } = t, a = W(null), { t: s } = me(), l = (d) => {
1033
+ const { ooui: t, value: n, onChange: r } = e, { readOnly: o } = t, a = Y(null), { t: s } = me(), l = (d) => {
1034
1034
  r == null || r(d);
1035
1035
  };
1036
1036
  async function c() {
@@ -1598,7 +1598,7 @@ const on = ({
1598
1598
  summary: (L = R.values) == null ? void 0 : L[v],
1599
1599
  onClick: () => {
1600
1600
  h(
1601
- C.find((Y) => R.id === Y.id)
1601
+ C.find((W) => R.id === W.id)
1602
1602
  ), d(!0);
1603
1603
  }
1604
1604
  }
@@ -1723,7 +1723,7 @@ const on = ({
1723
1723
  allRecordsSelected: "Hi ha {totalRecords} registres seleccionats.",
1724
1724
  openInSameWindow: "Obrir en la pestanya actual",
1725
1725
  openInNewTab: "Obrir en una nova pestanya",
1726
- confirmDuplicate: "Estàs segur de volguer duplicar els registre/s seleccionats?",
1726
+ confirmDuplicate: "Estàs segur de volguer duplicar els registre seleccionat?",
1727
1727
  confirmSelectAllRegisters: "Estàs segur de volguer seleccionar tots els {totalRecords} registres?",
1728
1728
  filter: "Filtrar",
1729
1729
  applyFilters: "Aplicar filtres",
@@ -1834,7 +1834,7 @@ const on = ({
1834
1834
  allRecordsSelected: "There are {totalRecords} records selected.",
1835
1835
  openInSameWindow: "Open in the current tab",
1836
1836
  openInNewTab: "Open in a new tab",
1837
- confirmDuplicate: "Are you sure you want to duplicate the selected item/s?",
1837
+ confirmDuplicate: "Are you sure you want to duplicate the selected item?",
1838
1838
  confirmSelectAllRegisters: "Are you sure you want to select all {totalRecords} registers?",
1839
1839
  filter: "Filter",
1840
1840
  applyFilters: "Apply filters",
@@ -1945,7 +1945,7 @@ const on = ({
1945
1945
  allRecordsSelected: "Hay {totalRecords} registros seleccionados.",
1946
1946
  openInSameWindow: "Abrir en la pestaña actual",
1947
1947
  openInNewTab: "Abrir en una nueva pestaña",
1948
- confirmDuplicate: "Estás seguro de querer duplicar el registro/s seleccionado/s?",
1948
+ confirmDuplicate: "Estás seguro de querer duplicar el registro seleccionado?",
1949
1949
  confirmSelectAllRegisters: "Estás seguro de querer seleccionar todos los {totalRecords} registros?",
1950
1950
  filter: "Filtrar",
1951
1951
  applyFilters: "Aplicar filtros",
@@ -2153,7 +2153,7 @@ const nu = (e) => {
2153
2153
  }
2154
2154
  );
2155
2155
  }, Xe = (e) => {
2156
- const t = W(/* @__PURE__ */ new Map());
2156
+ const t = Y(/* @__PURE__ */ new Map());
2157
2157
  ae(() => () => {
2158
2158
  n();
2159
2159
  }, []);
@@ -2365,7 +2365,7 @@ const { getValueForOperator: pi } = ms, iu = (e) => {
2365
2365
  $.getHandler().parseCondition
2366
2366
  );
2367
2367
  ae(() => {
2368
- Y();
2368
+ W();
2369
2369
  }, [t, o]);
2370
2370
  async function N({
2371
2371
  domain: k,
@@ -2418,7 +2418,7 @@ const { getValueForOperator: pi } = ms, iu = (e) => {
2418
2418
  context: r
2419
2419
  });
2420
2420
  }
2421
- async function Y() {
2421
+ async function W() {
2422
2422
  p(!0), O(void 0);
2423
2423
  let k, K;
2424
2424
  try {
@@ -3290,9 +3290,9 @@ const An = At.createContext(null), bi = async (e) => {
3290
3290
  for (let n = 0; n < e.length; n++)
3291
3291
  await ((t = e == null ? void 0 : e[n]) == null ? void 0 : t.call(e));
3292
3292
  }, Vu = (e, t) => {
3293
- const { children: n, globalValues: r = {} } = e, o = W(), a = W(), [s, l] = I(!1), c = ne(
3293
+ const { children: n, globalValues: r = {} } = e, o = Y(), a = Y(), [s, l] = I(!1), c = ne(
3294
3294
  Ot
3295
- ), { openAction: u } = c || {}, m = W([]), { t: d } = me();
3295
+ ), { openAction: u } = c || {}, m = Y([]), { t: d } = me();
3296
3296
  Dt(t, () => ({
3297
3297
  openActionModal: S,
3298
3298
  processAction: b
@@ -3314,7 +3314,7 @@ const An = At.createContext(null), bi = async (e) => {
3314
3314
  wt(`${N} action not supported`);
3315
3315
  return;
3316
3316
  }
3317
- const { ids: B } = V || {}, Y = B || [], k = typeof R == "string" ? Yt({
3317
+ const { ids: B } = V || {}, W = B || [], k = typeof R == "string" ? Yt({
3318
3318
  context: R,
3319
3319
  fields: _,
3320
3320
  values: O
@@ -3324,7 +3324,7 @@ const An = At.createContext(null), bi = async (e) => {
3324
3324
  model: E,
3325
3325
  name: L,
3326
3326
  datas: V,
3327
- ids: Y,
3327
+ ids: W,
3328
3328
  context: { ...x, ...k }
3329
3329
  });
3330
3330
  l(!0), a.current = !0, o.current = setInterval(() => {
@@ -3405,7 +3405,7 @@ const An = At.createContext(null), bi = async (e) => {
3405
3405
  fields: T,
3406
3406
  context: V
3407
3407
  })), x.target === "new") {
3408
- const Y = await $.getHandler().getView({
3408
+ const W = await $.getHandler().getView({
3409
3409
  model: x.res_model,
3410
3410
  type: "form",
3411
3411
  id: ((B = x == null ? void 0 : x.view_id) == null ? void 0 : B[0]) || void 0,
@@ -3414,11 +3414,11 @@ const An = At.createContext(null), bi = async (e) => {
3414
3414
  return S({
3415
3415
  domain: L,
3416
3416
  model: x.res_model,
3417
- formView: Y,
3417
+ formView: W,
3418
3418
  context: V
3419
3419
  }), {};
3420
3420
  } else {
3421
- const { initialView: Y, views: k } = await ku({
3421
+ const { initialView: W, views: k } = await ku({
3422
3422
  model: x.res_model,
3423
3423
  context: V,
3424
3424
  view_mode: x.view_mode,
@@ -3431,7 +3431,7 @@ const An = At.createContext(null), bi = async (e) => {
3431
3431
  model: x.res_model,
3432
3432
  views: k,
3433
3433
  title: x.name,
3434
- initialView: Y,
3434
+ initialView: W,
3435
3435
  action_id: x.id,
3436
3436
  action_type: x.type,
3437
3437
  actionRawData: {
@@ -3667,7 +3667,7 @@ const Mu = "action", Lu = ["active_id", "active_ids", "id"], Nu = ["target", "co
3667
3667
  Object.entries(e).filter(([t]) => Lu.includes(t))
3668
3668
  );
3669
3669
  function Rr({ res_id: e, searchParams: t }) {
3670
- const n = W(null), { currentView: r } = Xn(), o = {
3670
+ const n = Y(null), { currentView: r } = Xn(), o = {
3671
3671
  id: r.view_id,
3672
3672
  type: r.type
3673
3673
  }, { token: a } = ze.useToken(), { t: s } = me(), [l, c] = I(!1), { currentTab: u } = Vo(), m = D(
@@ -3776,10 +3776,10 @@ function Hu({
3776
3776
  treeType: x
3777
3777
  } = ne(Ct), R = Gn(
3778
3778
  sn.FEATURE_ADVANCED_EXPORT
3779
- ), { t: E } = me(), [V, L] = I(!1), N = W(!0), B = D(() => {
3779
+ ), { t: E } = me(), [V, L] = I(!1), N = Y(!0), B = D(() => {
3780
3780
  var X;
3781
3781
  (X = f == null ? void 0 : f.current) == null || X.refreshResults();
3782
- }, [f]), { actionButtonProps: Y, printButtonProps: k } = ra({
3782
+ }, [f]), { actionButtonProps: W, printButtonProps: k } = ra({
3783
3783
  toolbar: n,
3784
3784
  disabled: S,
3785
3785
  parentContext: e,
@@ -3968,7 +3968,7 @@ function Hu({
3968
3968
  {
3969
3969
  icon: /* @__PURE__ */ i(Tn, {}),
3970
3970
  tooltip: E("showLogs"),
3971
- disabled: !(s && (s == null ? void 0 : s.length) > 0) || S,
3971
+ disabled: !(s && (s == null ? void 0 : s.length) === 1) || S,
3972
3972
  onClick: () => Po(d, s[0].id, E)
3973
3973
  }
3974
3974
  ),
@@ -3995,7 +3995,7 @@ function Hu({
3995
3995
  )
3996
3996
  ] }),
3997
3997
  /* @__PURE__ */ i(st, {}),
3998
- /* @__PURE__ */ i(Nt, { icon: /* @__PURE__ */ i(Sr, {}), ...Y }),
3998
+ /* @__PURE__ */ i(Nt, { icon: /* @__PURE__ */ i(Sr, {}), ...W }),
3999
3999
  /* @__PURE__ */ i(Nt, { icon: /* @__PURE__ */ i(Cr, {}), ...k }),
4000
4000
  R && /* @__PURE__ */ P(ee, { children: [
4001
4001
  /* @__PURE__ */ i(st, {}),
@@ -4205,7 +4205,7 @@ const { useToken: Wu } = ze, { Title: Yu, Text: nr } = zt, Dr = ({
4205
4205
  context: r,
4206
4206
  enabled: o = !0
4207
4207
  }) => {
4208
- const [a, s] = I(!0), [l, c] = I(), [u, m] = I(), d = W(!1), [f, h] = Xe(
4208
+ const [a, s] = I(!0), [l, c] = I(), [u, m] = I(), d = Y(!1), [f, h] = Xe(
4209
4209
  $.getHandler().getView
4210
4210
  );
4211
4211
  Mt(() => (o && p(), () => {
@@ -4631,7 +4631,7 @@ const of = (e) => /* @__PURE__ */ i(Pe, { ...e, children: /* @__PURE__ */ i(ca,
4631
4631
  }) => {
4632
4632
  const { token: o } = ze.useToken(), [a, s] = I(
4633
4633
  e ? e.split(";").map((y) => y.trim()).filter((y) => y) : []
4634
- ), [l, c] = I(""), u = W(null), m = ne(Ge), { elementHasLostFocus: d } = m || {}, f = D(
4634
+ ), [l, c] = I(""), u = Y(null), m = ne(Ge), { elementHasLostFocus: d } = m || {}, f = D(
4635
4635
  (y) => {
4636
4636
  t && t(y.join(";"));
4637
4637
  },
@@ -4967,7 +4967,7 @@ const of = (e) => /* @__PURE__ */ i(Pe, { ...e, children: /* @__PURE__ */ i(ca,
4967
4967
  key: e,
4968
4968
  treeViewFetching: t = !1
4969
4969
  }) => {
4970
- const [n, r] = I(!0), o = W(void 0), a = W(!1), {
4970
+ const [n, r] = I(!0), o = Y(void 0), a = Y(!1), {
4971
4971
  getColumnState: s,
4972
4972
  updateColumnState: l
4973
4973
  } = _f(e), c = D(async () => {
@@ -5164,7 +5164,7 @@ const of = (e) => /* @__PURE__ */ i(Pe, { ...e, children: /* @__PURE__ */ i(ca,
5164
5164
  numberOfSelectsToHide: n = 2,
5165
5165
  ...r
5166
5166
  }) => {
5167
- const o = W(), a = W(0);
5167
+ const o = Y(), a = Y(0);
5168
5168
  return /* @__PURE__ */ i(
5169
5169
  Rl,
5170
5170
  {
@@ -5431,7 +5431,7 @@ const { useToken: Qf } = ze, { Title: Xf } = zt, { Header: Zf, Content: em, Foot
5431
5431
  title: r,
5432
5432
  footer: o
5433
5433
  }) => {
5434
- const [a, s] = I(e), l = W(null), { token: c } = Qf(), u = D(
5434
+ const [a, s] = I(e), l = Y(null), { token: c } = Qf(), u = D(
5435
5435
  (h) => {
5436
5436
  h.preventDefault(), h.stopPropagation(), t();
5437
5437
  },
@@ -6351,7 +6351,7 @@ const Ko = /* @__PURE__ */ Ds(Zp), eh = _t(
6351
6351
  }
6352
6352
  ), ja = (e) => {
6353
6353
  var A;
6354
- const { onSubmit: t, isOpen: n, onClose: r, searchFields: o, fields: a, searchValues: s } = e, l = W(), { t: c } = me(), [u, m] = I(), d = W(null), [f, h] = I();
6354
+ const { onSubmit: t, isOpen: n, onClose: r, searchFields: o, fields: a, searchValues: s } = e, l = Y(), { t: c } = me(), [u, m] = I(), d = Y(null), [f, h] = I();
6355
6355
  ae(() => {
6356
6356
  n && (h(void 0), setTimeout(() => {
6357
6357
  const S = document.querySelector(
@@ -6528,7 +6528,7 @@ function kr(e) {
6528
6528
  searchError: d,
6529
6529
  searchValues: f,
6530
6530
  showLimitOptions: h = !0
6531
- } = e, [p, g] = I(), [y, v] = I(), [b, A] = I(!1), S = W(), { token: C } = oh(), [F] = Rt.useForm();
6531
+ } = e, [p, g] = I(), [y, v] = I(), [b, A] = I(!1), S = Y(), { token: C } = oh(), [F] = Rt.useForm();
6532
6532
  ae(() => {
6533
6533
  F.setFieldsValue(f);
6534
6534
  }, [f]);
@@ -6716,7 +6716,7 @@ const Ha = () => {
6716
6716
  autorefreshableFields: o,
6717
6717
  fieldDefs: a,
6718
6718
  isActive: s
6719
- } = e, l = W(null), [c, u] = I(!0), [m, d] = Xe(
6719
+ } = e, l = Y(null), [c, u] = I(!0), [m, d] = Xe(
6720
6720
  $.getHandler().readObjects
6721
6721
  ), f = Ha();
6722
6722
  ae(() => {
@@ -6779,7 +6779,7 @@ function lh(e, t) {
6779
6779
  onChangeSelectedRowKeys: m,
6780
6780
  nameSearch: d,
6781
6781
  filterType: f = "side"
6782
- } = e, h = W({}), p = W(), g = W(null), y = W([]), v = W(!1), b = ko(), [A, S] = I(!0), [C, F] = I(), { t: w } = me(), T = W(null), _ = fa({
6782
+ } = e, h = Y({}), p = Y(), g = Y(null), y = Y([]), v = Y(!1), b = ko(), [A, S] = I(!0), [C, F] = I(), { t: w } = me(), T = Y(null), _ = fa({
6783
6783
  elementRef: T,
6784
6784
  offset: sh
6785
6785
  }), { treeView: O, formView: x, loading: R } = $o({
@@ -6793,7 +6793,7 @@ function lh(e, t) {
6793
6793
  setSearchVisible: L,
6794
6794
  setSelectedRowItems: N,
6795
6795
  setTreeFirstVisibleRow: B,
6796
- treeFirstVisibleRow: Y,
6796
+ treeFirstVisibleRow: W,
6797
6797
  selectedRowItems: k,
6798
6798
  setSearchParams: K,
6799
6799
  searchValues: Z,
@@ -6808,7 +6808,7 @@ function lh(e, t) {
6808
6808
  isActive: X,
6809
6809
  order: j,
6810
6810
  setOrder: le
6811
- } = Ba({ useLocalState: !c }), ce = d || we, de = W(ce);
6811
+ } = Ba({ useLocalState: !c }), ce = d || we, de = Y(ce);
6812
6812
  ae(() => {
6813
6813
  Ve();
6814
6814
  }, []), ae(() => {
@@ -7037,7 +7037,7 @@ function lh(e, t) {
7037
7037
  N,
7038
7038
  w,
7039
7039
  C
7040
- ]), nt = D(() => Y, [Y]), it = q(() => Be ? /* @__PURE__ */ i(Bo, { aggregates: Se, isLoading: ve }) : null, [Se, ve, Be]), It = D((he) => /* @__PURE__ */ i(jn, { color: he, style: { marginLeft: 7 } }), []), te = D(
7040
+ ]), nt = D(() => W, [W]), it = q(() => Be ? /* @__PURE__ */ i(Bo, { aggregates: Se, isLoading: ve }) : null, [Se, ve, Be]), It = D((he) => /* @__PURE__ */ i(jn, { color: he, style: { marginLeft: 7 } }), []), te = D(
7041
7041
  (he) => {
7042
7042
  var qe;
7043
7043
  return (qe = p.current) == null ? void 0 : qe[he.id];
@@ -7093,7 +7093,7 @@ function lh(e, t) {
7093
7093
  C,
7094
7094
  ye,
7095
7095
  re
7096
- ]), Te = W(Q), $e = W(V), Le = W(), pt = W();
7096
+ ]), Te = Y(Q), $e = Y(V), Le = Y(), pt = Y();
7097
7097
  Gt(() => {
7098
7098
  const he = !Ko(
7099
7099
  Q,
@@ -7305,9 +7305,9 @@ const Wa = _t(lh), Qi = (e, t = "14px -apple-system") => {
7305
7305
  context: C,
7306
7306
  readonly: F,
7307
7307
  onSelectAllRecords: w
7308
- } = e, T = W(null), [_, O] = I([]), x = W(!1), [R, E] = I(), { t: V } = me(), L = W(r), N = ne(
7308
+ } = e, T = Y(null), [_, O] = I([]), x = Y(!1), [R, E] = I(), { t: V } = me(), L = Y(r), N = ne(
7309
7309
  Ct
7310
- ), { title: B = void 0, setTitle: Y = void 0 } = (S ? N : {}) || {}, k = q(() => {
7310
+ ), { title: B = void 0, setTitle: W = void 0 } = (S ? N : {}) || {}, k = q(() => {
7311
7311
  if (R)
7312
7312
  return Or(
7313
7313
  R,
@@ -7325,7 +7325,7 @@ const Wa = _t(lh), Qi = (e, t = "14px -apple-system") => {
7325
7325
  }
7326
7326
  })), ae(() => {
7327
7327
  const z = jt(a);
7328
- E(z), z.string && B !== z.string && (Y == null || Y(z.string));
7328
+ E(z), z.string && B !== z.string && (W == null || W(z.string));
7329
7329
  }, [a, B]), ae(() => {
7330
7330
  if (!R)
7331
7331
  return;
@@ -7455,7 +7455,7 @@ const Ga = (e) => {
7455
7455
  searchParams: F = [],
7456
7456
  setSearchValues: w,
7457
7457
  clearSelection: T
7458
- } = e, [_, O] = I(!1), [x, R] = I(!1), [E, V] = I(), [L, N] = I(1), [B, Y] = I(0), [k, K] = I(), [Z, Q] = I([]), [J, we] = I(void 0), [oe, H] = I(void 0), M = W(S || $t), z = W([]), ie = D(
7458
+ } = e, [_, O] = I(!1), [x, R] = I(!1), [E, V] = I(), [L, N] = I(1), [B, W] = I(0), [k, K] = I(), [Z, Q] = I([]), [J, we] = I(void 0), [oe, H] = I(void 0), M = Y(S || $t), z = Y([]), ie = D(
7459
7459
  (re) => {
7460
7460
  y == null || y([...re]), Q([...re]);
7461
7461
  },
@@ -7588,7 +7588,7 @@ const Ga = (e) => {
7588
7588
  ), ye = D(
7589
7589
  (re) => {
7590
7590
  const { params: Ae, searchValues: xe, limit: Ve, offset: je } = re;
7591
- _ || (n == null || n(void 0), r == null || r([]), w == null || w(xe), o == null || o(Ae), a == null || a(!1), R(!0), V(void 0), N(1), Ve && (M.current = Ve, C == null || C(Ve)), je && Y(je), ce({
7591
+ _ || (n == null || n(void 0), r == null || r([]), w == null || w(xe), o == null || o(Ae), a == null || a(!1), R(!0), V(void 0), N(1), Ve && (M.current = Ve, C == null || C(Ve)), je && W(je), ce({
7592
7592
  params: Ae,
7593
7593
  newOffset: je
7594
7594
  }));
@@ -7605,11 +7605,11 @@ const Ga = (e) => {
7605
7605
  ]
7606
7606
  ), _e = D(
7607
7607
  (re) => {
7608
- O(!0), N(re), Y((re - 1) * S);
7608
+ O(!0), N(re), W((re - 1) * S);
7609
7609
  },
7610
- [O, S, Y, N]
7610
+ [O, S, W, N]
7611
7611
  ), Ue = D(() => {
7612
- _ || (n == null || n(void 0), o == null || o([]), w == null || w({}), V(void 0), Y(0), N(1), C == null || C(S || $t));
7612
+ _ || (n == null || n(void 0), o == null || o([]), w == null || w({}), V(void 0), W(0), N(1), C == null || C(S || $t));
7613
7613
  }, [
7614
7614
  _,
7615
7615
  n,
@@ -7668,12 +7668,12 @@ function fh(e, t) {
7668
7668
  rootTree: m = !1,
7669
7669
  parentContext: d = {},
7670
7670
  onChangeSelectedRowKeys: f
7671
- } = e, [h, p] = I(!1), [g, y] = I(!1), v = W(!1), b = W(null), [A, S] = I(), [C, F] = I(), [w, T] = I(), [_, O] = I(), [x, R] = I(200), E = W(), { height: V } = Ar(), L = ne(
7671
+ } = e, [h, p] = I(!1), [g, y] = I(!1), v = Y(!1), b = Y(null), [A, S] = I(), [C, F] = I(), [w, T] = I(), [_, O] = I(), [x, R] = I(200), E = Y(), { height: V } = Ar(), L = ne(
7672
7672
  An
7673
7673
  ), { processAction: N } = L || {}, B = ne(
7674
7674
  Ct
7675
7675
  ), {
7676
- setResults: Y = void 0,
7676
+ setResults: W = void 0,
7677
7677
  setCurrentItemIndex: k = void 0,
7678
7678
  currentId: K = void 0,
7679
7679
  results: Z = void 0,
@@ -7732,7 +7732,7 @@ function fh(e, t) {
7732
7732
  sorter: z,
7733
7733
  setSorter: ie,
7734
7734
  setCurrentItemIndex: k,
7735
- setResultsActionView: Y,
7735
+ setResultsActionView: W,
7736
7736
  resultsActionView: Z,
7737
7737
  domain: c,
7738
7738
  currentId: K,
@@ -7944,10 +7944,10 @@ const Ka = _t(fh), mh = 80, ph = (e) => {
7944
7944
  currentPage: L,
7945
7945
  setCurrentPage: N,
7946
7946
  order: B,
7947
- setOrder: Y,
7947
+ setOrder: W,
7948
7948
  limit: k,
7949
7949
  setLimit: K
7950
- } = Ba({ useLocalState: !a }), [Z, Q] = I(!0), [J, we] = I(), [oe, H] = I([]), M = s || _, z = W(M), ie = W(w), X = W(h), j = W(), le = W({}), ce = W(), de = W([]), ye = q(() => ma({ treeViewId: r == null ? void 0 : r.view_id, model: o }), [r == null ? void 0 : r.view_id, o]), {
7950
+ } = Ba({ useLocalState: !a }), [Z, Q] = I(!0), [J, we] = I(), [oe, H] = I([]), M = s || _, z = Y(M), ie = Y(w), X = Y(h), j = Y(), le = Y({}), ce = Y(), de = Y([]), ye = q(() => ma({ treeViewId: r == null ? void 0 : r.view_id, model: o }), [r == null ? void 0 : r.view_id, o]), {
7951
7951
  fetchColumnState: _e,
7952
7952
  loading: Ue,
7953
7953
  getColumnState: Ke,
@@ -8159,10 +8159,10 @@ const Ka = _t(fh), mh = 80, ph = (e) => {
8159
8159
  xt === "unchecked" ? ((Ce = l.current) == null || Ce.selectAll(), g(oe.map((et) => ({ id: et.id })))) : (g([]), (He = l.current) == null || He.unselectAll());
8160
8160
  }, [l, g, oe, xt]), Fe = D(
8161
8161
  (Ce) => {
8162
- Y(Ce), y(0), A(void 0), N(1);
8162
+ W(Ce), y(0), A(void 0), N(1);
8163
8163
  },
8164
8164
  [
8165
- Y,
8165
+ W,
8166
8166
  N,
8167
8167
  A,
8168
8168
  y
@@ -8208,7 +8208,7 @@ const Ka = _t(fh), mh = 80, ph = (e) => {
8208
8208
  currentPage: L,
8209
8209
  limit: k,
8210
8210
  order: B,
8211
- setOrder: Y,
8211
+ setOrder: W,
8212
8212
  setTreeFirstVisibleColumn: A,
8213
8213
  onGetFirstVisibleColumn: Be,
8214
8214
  onSortChange: Fe
@@ -8368,7 +8368,7 @@ function vh(e, t) {
8368
8368
  parentContext: u = {},
8369
8369
  nameSearch: m,
8370
8370
  filterType: d = "side"
8371
- } = e, f = W(null), h = W(null), p = W(a);
8371
+ } = e, f = Y(null), h = Y(null), p = Y(a);
8372
8372
  ae(() => {
8373
8373
  p.current = a;
8374
8374
  }, [a]);
@@ -8397,7 +8397,7 @@ function vh(e, t) {
8397
8397
  setTreeFirstVisibleRow: L,
8398
8398
  onRowHasBeenSelected: N,
8399
8399
  onSearchFilterClear: B,
8400
- onSearchFilterSubmit: Y,
8400
+ onSearchFilterSubmit: W,
8401
8401
  onSideSearchFilterClose: k,
8402
8402
  onSideSearchFilterSubmit: K,
8403
8403
  totalRowsLoading: Z,
@@ -8471,7 +8471,7 @@ function vh(e, t) {
8471
8471
  searchVisible: _,
8472
8472
  searchValues: O,
8473
8473
  onSearchFilterClear: B,
8474
- onSearchFilterSubmit: Y,
8474
+ onSearchFilterSubmit: W,
8475
8475
  onSideSearchFilterClose: k,
8476
8476
  onSideSearchFilterSubmit: K
8477
8477
  }
@@ -8535,7 +8535,7 @@ const bh = _t(vh), pr = "legacy", wh = (e) => {
8535
8535
  setCurrentView: d,
8536
8536
  availableViews: f,
8537
8537
  searchTreeNameSearch: h
8538
- } = e, p = W(t), g = q(() => {
8538
+ } = e, p = Y(t), g = q(() => {
8539
8539
  if (!(s != null && s.arch) || s.isExpandable)
8540
8540
  return "legacy";
8541
8541
  const C = Hs(s.arch, "infinite");
@@ -8651,7 +8651,7 @@ const bh = _t(vh), pr = "legacy", wh = (e) => {
8651
8651
  initialSearchParams: x,
8652
8652
  initialCurrentPage: R,
8653
8653
  initialOrder: E
8654
- } = e, [V, L] = I(!1), [N, B] = I(!1), [Y, k] = I(!1), [K, Z] = I(!0), [Q, J] = I(!0), [we, oe] = I([]), [H, M] = I(!1), [z, ie] = I(
8654
+ } = e, [V, L] = I(!1), [N, B] = I(!1), [W, k] = I(!1), [K, Z] = I(!0), [Q, J] = I(!0), [we, oe] = I([]), [H, M] = I(!1), [z, ie] = I(
8655
8655
  x || []
8656
8656
  ), [X, j] = I(!1), [le, ce] = I(!0), [de, ye] = I(), [_e, Ue] = I(
8657
8657
  Ou(
@@ -8709,7 +8709,7 @@ const bh = _t(vh), pr = "legacy", wh = (e) => {
8709
8709
  results: f,
8710
8710
  setResults: d,
8711
8711
  currentModel: g,
8712
- removingItem: Y,
8712
+ removingItem: W,
8713
8713
  setRemovingItem: k,
8714
8714
  formIsLoading: K,
8715
8715
  setFormIsLoading: Z,
@@ -9503,7 +9503,7 @@ const bh = _t(vh), pr = "legacy", wh = (e) => {
9503
9503
  fieldDefs: a,
9504
9504
  onAutorefreshableFieldsChange: s,
9505
9505
  isActive: l
9506
- } = e, c = W(null), [u, m] = I(!0), [d, f] = Xe(
9506
+ } = e, c = Y(null), [u, m] = I(!0), [d, f] = Xe(
9507
9507
  $.getHandler().readObjects
9508
9508
  ), h = Ha();
9509
9509
  ae(() => {
@@ -9576,7 +9576,7 @@ function Jh(e, t) {
9576
9576
  forcedValues: F = {},
9577
9577
  parentWidth: w,
9578
9578
  onMustRefreshParent: T
9579
- } = e, { t: _ } = me(), [O, x] = I(!1), [R, E] = I(), [V, L] = I(), [N] = Rt.useForm(), [B, Y] = I(), [k, K] = I(), Z = ne(Qa), [Q, J] = I(), [we, oe] = I(!1), H = W(), M = W({}), z = W({}), ie = W(!1), X = W(!1), j = W(!1), ce = (w !== void 0 ? w : Q) < zh, de = ne(Ge), { activeId: ye, getPlainValues: _e } = de || {}, Ue = W(!1), Ke = ne(
9579
+ } = e, { t: _ } = me(), [O, x] = I(!1), [R, E] = I(), [V, L] = I(), [N] = Rt.useForm(), [B, W] = I(), [k, K] = I(), Z = ne(Qa), [Q, J] = I(), [we, oe] = I(!1), H = Y(), M = Y({}), z = Y({}), ie = Y(!1), X = Y(!1), j = Y(!1), ce = (w !== void 0 ? w : Q) < zh, de = ne(Ge), { activeId: ye, getPlainValues: _e } = de || {}, Ue = Y(!1), Ke = ne(
9580
9580
  Ct
9581
9581
  ), {
9582
9582
  setFormIsSaving: Ie = void 0,
@@ -9707,7 +9707,7 @@ function Jh(e, t) {
9707
9707
  try {
9708
9708
  p ? U = { arch: p.arch, fields: p.fields } : U = await qe();
9709
9709
  const { fields: G, arch: fe } = U;
9710
- K(G), Y(fe), await ot({
9710
+ K(G), W(fe), await ot({
9711
9711
  fields: G,
9712
9712
  arch: fe
9713
9713
  });
@@ -10419,20 +10419,20 @@ const _n = _t(Jh), On = (e) => {
10419
10419
  context: l,
10420
10420
  id: c,
10421
10421
  domain: u
10422
- } = r, m = o && !s ? { backgroundColor: Xa.colorPrimaryBg } : void 0, [d, f] = I(!1), [h, p] = I(!1), [g, y] = I(!1), [v, b] = I(), A = W(!1), [S, C] = I(""), F = W(), w = ne(Ge), { domain: T, getValues: _, getFields: O, getContext: x, elementHasLostFocus: R } = w || {}, E = W([]), [V, L] = I([]), N = t && t[0] || void 0, B = t && t[1] || "";
10422
+ } = r, m = o && !s ? { backgroundColor: Xa.colorPrimaryBg } : void 0, [d, f] = I(!1), [h, p] = I(!1), [g, y] = I(!1), [v, b] = I(), A = Y(!1), [S, C] = I(""), F = Y(), w = ne(Ge), { domain: T, getValues: _, getFields: O, getContext: x, elementHasLostFocus: R } = w || {}, E = Y([]), [V, L] = I([]), N = t && t[0] || void 0, B = t && t[1] || "";
10423
10423
  ae(() => {
10424
10424
  !Array.isArray(t) && t && Q(t);
10425
10425
  }, [t]), ae(() => {
10426
10426
  N && B.length === 0 ? Q(N) : N && B.length > 0 ? C(B) : !N && !B && C(F.current || "");
10427
10427
  }, [t]);
10428
- const Y = (H) => {
10428
+ const W = (H) => {
10429
10429
  n == null || n(H), R == null || R();
10430
10430
  }, k = (H) => {
10431
- F.current = H.target.value, Y([void 0, ""]);
10431
+ F.current = H.target.value, W([void 0, ""]);
10432
10432
  }, K = async () => {
10433
10433
  if (!g && S !== B) {
10434
10434
  if (await new Promise((H) => setTimeout(H, 100)), A.current) {
10435
- Y([void 0, ""]);
10435
+ W([void 0, ""]);
10436
10436
  return;
10437
10437
  }
10438
10438
  y(!0);
@@ -10445,7 +10445,7 @@ const _n = _t(Jh), On = (e) => {
10445
10445
  payload: F.current,
10446
10446
  context: { ...x == null ? void 0 : x(), ...l }
10447
10447
  });
10448
- H.length === 1 ? (F.current = void 0, Y(H[0])) : Z(F.current);
10448
+ H.length === 1 ? (F.current = void 0, W(H[0])) : Z(F.current);
10449
10449
  }
10450
10450
  } catch (H) {
10451
10451
  qt(H);
@@ -10474,7 +10474,7 @@ const _n = _t(Jh), On = (e) => {
10474
10474
  model: a,
10475
10475
  context: { ...x == null ? void 0 : x(), ...l }
10476
10476
  });
10477
- Y([H, M[0][1]]);
10477
+ W([H, M[0][1]]);
10478
10478
  } catch (M) {
10479
10479
  qt(M);
10480
10480
  } finally {
@@ -10498,7 +10498,7 @@ const _n = _t(Jh), On = (e) => {
10498
10498
  )), L(E.current);
10499
10499
  }
10500
10500
  async function we(H) {
10501
- H.keyCode === 13 ? (H.preventDefault(), H.stopPropagation(), await K()) : H.code === "Backspace" && N !== void 0 && (H.preventDefault(), H.stopPropagation(), Y([void 0, ""]));
10501
+ H.keyCode === 13 ? (H.preventDefault(), H.stopPropagation(), await K()) : H.code === "Backspace" && N !== void 0 && (H.preventDefault(), H.stopPropagation(), W([void 0, ""]));
10502
10502
  }
10503
10503
  return /* @__PURE__ */ P(Ye, { gutter: 8, wrap: !1, children: [
10504
10504
  /* @__PURE__ */ i(Oe, { flex: "auto", style: { paddingRight: 0 }, children: /* @__PURE__ */ i(
@@ -10780,8 +10780,8 @@ const _n = _t(Jh), On = (e) => {
10780
10780
  }, rg = ({
10781
10781
  currentId: e,
10782
10782
  currentModel: t,
10783
- formRef: n,
10784
- onItemDuplicated: r
10783
+ onItemDuplicated: n,
10784
+ context: r
10785
10785
  }) => {
10786
10786
  const [o, a] = I(!1), s = D(async () => {
10787
10787
  try {
@@ -10791,9 +10791,9 @@ const _n = _t(Jh), On = (e) => {
10791
10791
  const l = await $.getHandler().duplicate({
10792
10792
  id: e,
10793
10793
  model: t,
10794
- context: n.current.getContext()
10794
+ context: r
10795
10795
  });
10796
- l && await (r == null ? void 0 : r(l));
10796
+ l && await (n == null ? void 0 : n(l));
10797
10797
  } catch (l) {
10798
10798
  qt(JSON.stringify(l));
10799
10799
  } finally {
@@ -10806,7 +10806,7 @@ const _n = _t(Jh), On = (e) => {
10806
10806
  };
10807
10807
  }, { useToken: og } = ze;
10808
10808
  function ig(e) {
10809
- var L, N, B;
10809
+ var L, N, B, W;
10810
10810
  const {
10811
10811
  title: t,
10812
10812
  readOnly: n,
@@ -10830,12 +10830,12 @@ function ig(e) {
10830
10830
  onRefreshParentValues: S,
10831
10831
  currentId: C
10832
10832
  } = e, { token: F } = og(), { t: w } = me(), { duplicatingItem: T, duplicate: _ } = rg({
10833
- currentId: C,
10833
+ currentId: s === "form" ? C : parseInt(p[0]),
10834
10834
  currentModel: o,
10835
- formRef: A,
10836
10835
  onItemDuplicated: () => {
10837
10836
  S == null || S();
10838
- }
10837
+ },
10838
+ context: s === "tree" ? b : (L = A == null ? void 0 : A.current) == null ? void 0 : L.getContext()
10839
10839
  }), { actionButtonProps: O, printButtonProps: x, relateButtonProps: R } = rl({
10840
10840
  toolbar: v,
10841
10841
  mustDisableButtons: n,
@@ -10848,7 +10848,7 @@ function ig(e) {
10848
10848
  toolbar: v,
10849
10849
  disabled: n,
10850
10850
  parentContext: b,
10851
- selectedRowItems: p.map((Y) => ({ id: Y })),
10851
+ selectedRowItems: p.map((k) => ({ id: k })),
10852
10852
  onRefreshParentValues: S
10853
10853
  });
10854
10854
  return /* @__PURE__ */ P("div", { className: "flex mb-2 pt-3", children: [
@@ -10894,7 +10894,7 @@ function ig(e) {
10894
10894
  {
10895
10895
  icon: /* @__PURE__ */ i(Tn, {}),
10896
10896
  tooltip: w("showLogs"),
10897
- disabled: !(s === "form" && C !== void 0 && C > 0 || s === "tree" && p.length >= 1 && (p == null ? void 0 : p[0]) !== void 0 && parseInt(p[0]) > 0),
10897
+ disabled: !(s === "form" && C !== void 0 && C > 0 || s === "tree" && p.length === 1 && (p == null ? void 0 : p[0]) !== void 0 && parseInt(p[0]) > 0),
10898
10898
  onClick: () => Po(
10899
10899
  o,
10900
10900
  s === "form" ? C : parseInt(p[0]),
@@ -10903,14 +10903,14 @@ function ig(e) {
10903
10903
  }
10904
10904
  )
10905
10905
  ] }),
10906
- s === "form" && /* @__PURE__ */ P(ee, { children: [
10906
+ (s === "form" || s === "tree") && /* @__PURE__ */ P(ee, { children: [
10907
10907
  /* @__PURE__ */ i(kt, {}),
10908
10908
  /* @__PURE__ */ i(
10909
10909
  dt,
10910
10910
  {
10911
10911
  icon: /* @__PURE__ */ i(Hn, {}),
10912
10912
  tooltip: w("duplicate"),
10913
- disabled: n || T || C === void 0 || C < 0,
10913
+ disabled: n || T || s === "tree" && p.length !== 1 || s === "form" && (C === void 0 || C < 0),
10914
10914
  loading: T,
10915
10915
  onClick: () => Bt({
10916
10916
  confirmMessage: w("confirmDuplicate"),
@@ -10941,7 +10941,7 @@ function ig(e) {
10941
10941
  )
10942
10942
  ] }),
10943
10943
  v && /* @__PURE__ */ P(ee, { children: [
10944
- ((L = v.action) == null ? void 0 : L.length) > 0 && /* @__PURE__ */ P(ee, { children: [
10944
+ ((N = v.action) == null ? void 0 : N.length) > 0 && /* @__PURE__ */ P(ee, { children: [
10945
10945
  /* @__PURE__ */ i(kt, {}),
10946
10946
  /* @__PURE__ */ i(
10947
10947
  Nt,
@@ -10951,7 +10951,7 @@ function ig(e) {
10951
10951
  }
10952
10952
  )
10953
10953
  ] }),
10954
- ((N = v.print) == null ? void 0 : N.length) > 0 && /* @__PURE__ */ P(ee, { children: [
10954
+ ((B = v.print) == null ? void 0 : B.length) > 0 && /* @__PURE__ */ P(ee, { children: [
10955
10955
  /* @__PURE__ */ i(kt, {}),
10956
10956
  /* @__PURE__ */ i(
10957
10957
  Nt,
@@ -10961,7 +10961,7 @@ function ig(e) {
10961
10961
  }
10962
10962
  )
10963
10963
  ] }),
10964
- s === "form" && ((B = v.relate) == null ? void 0 : B.length) > 0 && /* @__PURE__ */ P(ee, { children: [
10964
+ s === "form" && ((W = v.relate) == null ? void 0 : W.length) > 0 && /* @__PURE__ */ P(ee, { children: [
10965
10965
  /* @__PURE__ */ i(kt, {}),
10966
10966
  /* @__PURE__ */ i(
10967
10967
  Nt,
@@ -11089,14 +11089,14 @@ const lg = (e) => {
11089
11089
  getContext: p,
11090
11090
  domain: g,
11091
11091
  fetchValues: y
11092
- } = m || {}, { t: v } = me(), [b, A] = I(!1), [S, C] = I(!1), [F, w] = I(), [T, _] = I(!1), [O, x] = I(!1), [R, E] = I(), [V, L] = I([]), [N, B] = I(!1), Y = W([]), [k, K] = I(), Z = W(), [Q, J] = I(void 0), we = W(), {
11092
+ } = m || {}, { t: v } = me(), [b, A] = I(!1), [S, C] = I(!1), [F, w] = I(), [T, _] = I(!1), [O, x] = I(!1), [R, E] = I(), [V, L] = I([]), [N, B] = I(!1), W = Y([]), [k, K] = I(), Z = Y(), [Q, J] = I(void 0), we = Y(), {
11093
11093
  readOnly: oe,
11094
11094
  relation: H,
11095
11095
  context: M,
11096
11096
  domain: z
11097
11097
  } = r, ie = r.type === "many2many", { id: X } = r, j = a.filter(
11098
11098
  (te) => (te.values || te.treeValues) && te.operation !== "pendingRemove"
11099
- ), le = W();
11099
+ ), le = Y();
11100
11100
  ae(() => {
11101
11101
  if (le.current !== s) {
11102
11102
  le.current = s, ce();
@@ -11143,7 +11143,7 @@ const lg = (e) => {
11143
11143
  }
11144
11144
  };
11145
11145
  async function Ue() {
11146
- z && (Y.current = await $.getHandler().evalDomain({
11146
+ z && (W.current = await $.getHandler().evalDomain({
11147
11147
  domain: z,
11148
11148
  values: on({
11149
11149
  fields: f(),
@@ -11151,7 +11151,7 @@ const lg = (e) => {
11151
11151
  }),
11152
11152
  fields: f(),
11153
11153
  context: p()
11154
- })), g && g.length > 0 && (Y.current = Y.current.concat(
11154
+ })), g && g.length > 0 && (W.current = W.current.concat(
11155
11155
  So({
11156
11156
  domain: g,
11157
11157
  widgetFieldName: X
@@ -11452,7 +11452,7 @@ const lg = (e) => {
11452
11452
  /* @__PURE__ */ i(
11453
11453
  zo,
11454
11454
  {
11455
- domain: Y.current,
11455
+ domain: W.current,
11456
11456
  model: H,
11457
11457
  context: { ...p == null ? void 0 : p(), ...M },
11458
11458
  visible: O,
@@ -11469,7 +11469,7 @@ const lg = (e) => {
11469
11469
  fieldName: e,
11470
11470
  widgetDomain: t
11471
11471
  }) => {
11472
- const n = W([]), {
11472
+ const n = Y([]), {
11473
11473
  getFields: r,
11474
11474
  getValues: o,
11475
11475
  getContext: a,
@@ -11502,7 +11502,7 @@ const lg = (e) => {
11502
11502
  allRowsIds: r,
11503
11503
  gridRef: o
11504
11504
  }) => {
11505
- const [a, s] = I([]), l = W(0), c = D(() => {
11505
+ const [a, s] = I([]), l = Y(0), c = D(() => {
11506
11506
  var p, g;
11507
11507
  let h = !1;
11508
11508
  a.length === 0 ? h = !0 : h = !1, h ? (s(r), (p = o.current) == null || p.setSelectedRows(r)) : (s([]), (g = o.current) == null || g.setSelectedRows([]));
@@ -11888,7 +11888,7 @@ const hg = ({
11888
11888
  selectedRowKeys: g = [],
11889
11889
  showPointerCursorInRows: y = !0
11890
11890
  }) => {
11891
- const v = W(), b = c || v, A = W({}), S = W(), C = W(), F = W(e), { t: w } = me();
11891
+ const v = Y(), b = c || v, A = Y({}), S = Y(), C = Y(), F = Y(e), { t: w } = me();
11892
11892
  Mt(() => {
11893
11893
  var L, N;
11894
11894
  if (F.current = e, C.current === void 0) {
@@ -11910,21 +11910,21 @@ const hg = ({
11910
11910
  endRow: N,
11911
11911
  state: B
11912
11912
  }) => {
11913
- const Y = sr({
11913
+ const W = sr({
11914
11914
  state: B
11915
11915
  }), { results: k, colors: K, status: Z } = await s({
11916
11916
  allItems: F.current,
11917
11917
  startRow: L,
11918
11918
  endRow: N,
11919
- sortFields: Y
11919
+ sortFields: W
11920
11920
  });
11921
11921
  return A.current = { ...A.current, ...K }, !S.current && Z && (S.current = {}), Z && (S.current = { ...S.current, ...Z }), k;
11922
11922
  },
11923
11923
  [s]
11924
11924
  ), x = D((L) => {
11925
- var N, B, Y, k;
11925
+ var N, B, W, k;
11926
11926
  if (A.current[(B = (N = L.node) == null ? void 0 : N.data) == null ? void 0 : B.id])
11927
- return { color: A.current[(k = (Y = L.node) == null ? void 0 : Y.data) == null ? void 0 : k.id] };
11927
+ return { color: A.current[(k = (W = L.node) == null ? void 0 : W.data) == null ? void 0 : k.id] };
11928
11928
  }, []), { loading: R, getColumnState: E, updateColumnState: V } = No({
11929
11929
  key: yg({
11930
11930
  ...h,
@@ -11977,7 +11977,7 @@ const hg = ({
11977
11977
  });
11978
11978
  }, Sg = ["form", "tree", "graph"], Cg = (e) => {
11979
11979
  var xe, Ve, je;
11980
- const t = W(null), { value: n, onChange: r, ooui: o, views: a } = e, { items: s = [] } = n || {}, l = fg({ one2manyItems: s }), { currentView: c, setCurrentView: u, itemIndex: m, setItemIndex: d } = ne(
11980
+ const t = Y(null), { value: n, onChange: r, ooui: o, views: a } = e, { items: s = [] } = n || {}, l = fg({ one2manyItems: s }), { currentView: c, setCurrentView: u, itemIndex: m, setItemIndex: d } = ne(
11981
11981
  Rn
11982
11982
  ), {
11983
11983
  readOnly: f,
@@ -11989,7 +11989,7 @@ const hg = ({
11989
11989
  activeId: b,
11990
11990
  getContext: A,
11991
11991
  fetchValues: S
11992
- } = v || {}, C = W(), F = a.size > 1, w = ((xe = a.get("form")) == null ? void 0 : xe.fields) !== void 0, T = q(() => ({ ...A == null ? void 0 : A(), ...p }), [A, p]), _ = cg({
11992
+ } = v || {}, C = Y(), F = a.size > 1, w = ((xe = a.get("form")) == null ? void 0 : xe.fields) !== void 0, T = q(() => ({ ...A == null ? void 0 : A(), ...p }), [A, p]), _ = cg({
11993
11993
  widgetDomain: g,
11994
11994
  fieldName: y
11995
11995
  }), {
@@ -12011,7 +12011,7 @@ const hg = ({
12011
12011
  model: h,
12012
12012
  items: l,
12013
12013
  selectedRowKeys: R
12014
- }), Y = q(() => {
12014
+ }), W = q(() => {
12015
12015
  const { title: pe } = a.get(c) || {};
12016
12016
  return pe || o.label;
12017
12017
  }, [c, o.label, a]), k = o.type === "many2many", K = D(
@@ -12111,7 +12111,7 @@ const hg = ({
12111
12111
  ll,
12112
12112
  {
12113
12113
  mode: c,
12114
- title: Y,
12114
+ title: W,
12115
12115
  currentId: (Ve = l[m]) == null ? void 0 : Ve.id,
12116
12116
  model: h,
12117
12117
  readOnly: f || !1,
@@ -12302,7 +12302,7 @@ const hg = ({
12302
12302
  const { ooui: t } = e, { required: n } = t;
12303
12303
  return /* @__PURE__ */ i(Pe, { required: n, type: "number", ...e, children: /* @__PURE__ */ i(_g, { ooui: t }) });
12304
12304
  }, _g = (e) => {
12305
- const { ooui: t, value: n, onChange: r } = e, { id: o, readOnly: a, required: s } = t, { token: l } = Ag(), c = s && !a ? { backgroundColor: l.colorPrimaryBg } : void 0, u = W(), [m, d] = I(), f = ne(Ge), { elementHasLostFocus: h } = f || {};
12305
+ const { ooui: t, value: n, onChange: r } = e, { id: o, readOnly: a, required: s } = t, { token: l } = Ag(), c = s && !a ? { backgroundColor: l.colorPrimaryBg } : void 0, u = Y(), [m, d] = I(), f = ne(Ge), { elementHasLostFocus: h } = f || {};
12306
12306
  ae(() => {
12307
12307
  d(aa(n));
12308
12308
  }, [n]);
@@ -12549,7 +12549,7 @@ const { useToken: Eg } = ze, { TextArea: mo } = ft, Pg = (e) => {
12549
12549
  limit: o,
12550
12550
  onClose: a
12551
12551
  }) => {
12552
- const s = W({}), l = W(/* @__PURE__ */ new Map()), { t: c } = me(), u = D(
12552
+ const s = Y({}), l = Y(/* @__PURE__ */ new Map()), { t: c } = me(), u = D(
12553
12553
  async (y) => {
12554
12554
  if (y.selectedKeys === void 0 || y.selectedKeys.length === 0) {
12555
12555
  Zt(c("selectAtLeastOneField"));
@@ -12888,7 +12888,7 @@ const { useToken: Eg } = ze, { TextArea: mo } = ft, Pg = (e) => {
12888
12888
  const { ooui: t } = e, { required: n } = t;
12889
12889
  return /* @__PURE__ */ i(Pe, { required: n, ...e, children: /* @__PURE__ */ i(Zg, { ooui: t }) });
12890
12890
  }, Zg = (e) => {
12891
- const { ooui: t, value: n, onChange: r } = e, { readOnly: o, required: a, filenameField: s } = t, { token: l } = Qg(), c = a && !o ? { backgroundColor: l.colorPrimaryBg } : void 0, u = W(null), { setFieldValue: m, getFieldValue: d } = ne(Ge) || {}, { t: f } = me(), h = n ? Id(n) : "", p = (A) => {
12891
+ const { ooui: t, value: n, onChange: r } = e, { readOnly: o, required: a, filenameField: s } = t, { token: l } = Qg(), c = a && !o ? { backgroundColor: l.colorPrimaryBg } : void 0, u = Y(null), { setFieldValue: m, getFieldValue: d } = ne(Ge) || {}, { t: f } = me(), h = n ? Id(n) : "", p = (A) => {
12892
12892
  r == null || r(A);
12893
12893
  };
12894
12894
  async function g() {
@@ -12971,7 +12971,7 @@ const { useToken: Eg } = ze, { TextArea: mo } = ft, Pg = (e) => {
12971
12971
  onOpenAttachmentLink: a,
12972
12972
  onOpenAttachmentDetail: s,
12973
12973
  onListAllAttachments: l
12974
- } = e, { t: c } = me(), u = W(null), m = /* @__PURE__ */ P(We, { children: [
12974
+ } = e, { t: c } = me(), u = Y(null), m = /* @__PURE__ */ P(We, { children: [
12975
12975
  /* @__PURE__ */ i(ri, {}),
12976
12976
  `(${t})`,
12977
12977
  /* @__PURE__ */ i(yr, { style: { fontSize: 12 } })
@@ -13273,7 +13273,7 @@ function ry({ toolbar: e }) {
13273
13273
  [u, n]
13274
13274
  ), B = D(() => {
13275
13275
  N(() => T.current.fetchValues());
13276
- }, [N, T]), { actionButtonProps: Y, printButtonProps: k, relateButtonProps: K } = rl({
13276
+ }, [N, T]), { actionButtonProps: W, printButtonProps: k, relateButtonProps: K } = rl({
13277
13277
  toolbar: e,
13278
13278
  mustDisableButtons: L,
13279
13279
  formRef: T,
@@ -13473,7 +13473,7 @@ function ry({ toolbar: e }) {
13473
13473
  }
13474
13474
  ),
13475
13475
  /* @__PURE__ */ i(st, {}),
13476
- /* @__PURE__ */ i(Nt, { icon: /* @__PURE__ */ i(Sr, {}), ...Y }),
13476
+ /* @__PURE__ */ i(Nt, { icon: /* @__PURE__ */ i(Sr, {}), ...W }),
13477
13477
  /* @__PURE__ */ i(Nt, { icon: /* @__PURE__ */ i(Cr, {}), ...k }),
13478
13478
  /* @__PURE__ */ i(Nt, { icon: /* @__PURE__ */ i(xr, {}), ...K }),
13479
13479
  /* @__PURE__ */ i(
@@ -13605,7 +13605,7 @@ const ts = (e, t) => ({
13605
13605
  }
13606
13606
  ) });
13607
13607
  }, ly = (e) => {
13608
- const { visible: t, onIdSubmitted: n, onCancel: r, isSearching: o } = e, { t: a } = me(), s = W(null), l = W(!1);
13608
+ const { visible: t, onIdSubmitted: n, onCancel: r, isSearching: o } = e, { t: a } = me(), s = Y(null), l = Y(!1);
13609
13609
  function c(u) {
13610
13610
  const m = u.id.split(",").map((d) => parseInt(d.trim()));
13611
13611
  n(m, l.current), l.current = !1;
@@ -13756,7 +13756,7 @@ const dy = (e) => {
13756
13756
  formView: s,
13757
13757
  treeView: l,
13758
13758
  graphView: c
13759
- } = e, u = W(), m = ne(
13759
+ } = e, u = Y(), m = ne(
13760
13760
  Ct
13761
13761
  ), {
13762
13762
  setResults: d = void 0,
@@ -13785,7 +13785,7 @@ const dy = (e) => {
13785
13785
  }, [O]), ae(() => {
13786
13786
  t.view_id !== E.view_id && L(!0);
13787
13787
  }, [E]);
13788
- const { clear: N, searchFilterLoading: B, searchError: Y, offset: k, tableRefreshing: K } = Ga({
13788
+ const { clear: N, searchFilterLoading: B, searchError: W, offset: k, tableRefreshing: K } = Ga({
13789
13789
  model: r,
13790
13790
  setSearchTreeNameSearch: F,
13791
13791
  setSelectedRowItems: g,
@@ -13844,7 +13844,7 @@ const dy = (e) => {
13844
13844
  onSubmit: (Q) => {
13845
13845
  L(!1), y == null || y(Q.params), b == null || b(!1);
13846
13846
  },
13847
- searchError: Y,
13847
+ searchError: W,
13848
13848
  searchVisible: v,
13849
13849
  searchValues: x,
13850
13850
  showLimitOptions: !1
@@ -13967,7 +13967,7 @@ function my() {
13967
13967
  ] });
13968
13968
  }
13969
13969
  const py = (e) => {
13970
- const { dashboardData: t, visible: n } = e, r = W(), o = ne(
13970
+ const { dashboardData: t, visible: n } = e, r = Y(), o = ne(
13971
13971
  Ot
13972
13972
  ), { openShortcut: a } = o || {};
13973
13973
  return !t || !n ? null : /* @__PURE__ */ P(
@@ -14062,7 +14062,7 @@ function vy(e, t) {
14062
14062
  order: A
14063
14063
  } = e, [S, C] = I(), [F, w] = I([]), [T, _] = I(!0), O = f || void 0, [x, R] = I(
14064
14064
  O
14065
- ), [E, V] = I([]), [L, N] = I(), [B, Y] = I([]), [k, K] = I(), [Z, Q] = I(0), [J, we] = I(!1), [oe, H] = I(!1), [M, z] = I(), { t: ie } = me(), X = W(), j = W(), le = ne(
14065
+ ), [E, V] = I([]), [L, N] = I(), [B, W] = I([]), [k, K] = I(), [Z, Q] = I(0), [J, we] = I(!1), [oe, H] = I(!1), [M, z] = I(), { t: ie } = me(), X = Y(), j = Y(), le = ne(
14066
14066
  Ot
14067
14067
  ), {
14068
14068
  setCurrentView: ce,
@@ -14288,7 +14288,7 @@ Please, make sure the view ids on the fields_view_get responses are the same as
14288
14288
  setCurrentItemIndex: N,
14289
14289
  currentItemIndex: L,
14290
14290
  results: B,
14291
- setResults: Y,
14291
+ setResults: W,
14292
14292
  currentModel: r,
14293
14293
  sorter: k,
14294
14294
  setSorter: K,
@@ -14317,7 +14317,7 @@ Please, make sure the view ids on the fields_view_get responses are the same as
14317
14317
  domain: n,
14318
14318
  formDefaultValues: m,
14319
14319
  results: B,
14320
- setResults: Y,
14320
+ setResults: W,
14321
14321
  setCurrentItemIndex: N,
14322
14322
  formForcedValues: d,
14323
14323
  limit: y,
@@ -14469,7 +14469,7 @@ function Cy(e) {
14469
14469
  domain: a = [],
14470
14470
  visible: s = !0,
14471
14471
  parentContext: l = {}
14472
- } = e, [c, u] = I(!1), [m, d] = I(!1), [f, h] = I(), [p, g] = I(), [y, v] = I(), [b, A] = I(1), [S, C] = I(0), F = W($t), w = W([]), [T, _] = I(0), [O, x] = I([]), [R, E] = I(void 0), [V, L] = I(), [N, B] = I(), [Y, k] = I(), [K, Z] = I(!1), Q = W([]), J = (j) => {
14472
+ } = e, [c, u] = I(!1), [m, d] = I(!1), [f, h] = I(), [p, g] = I(), [y, v] = I(), [b, A] = I(1), [S, C] = I(0), F = Y($t), w = Y([]), [T, _] = I(0), [O, x] = I([]), [R, E] = I(void 0), [V, L] = I(), [N, B] = I(), [W, k] = I(), [K, Z] = I(!1), Q = Y([]), J = (j) => {
14473
14473
  Z(!0), A(j), C((j - 1) * F.current);
14474
14474
  }, we = async () => {
14475
14475
  const j = Q.current.length > 0 ? Q.current : a, le = Kt(w.current, j), { colors: ce } = jt(p), { totalItems: de, results: ye, attrsEvaluated: _e } = await $.getHandler().searchForTree({
@@ -14570,7 +14570,7 @@ function Cy(e) {
14570
14570
  }
14571
14571
  )
14572
14572
  ] });
14573
- return Y ? /* @__PURE__ */ i(yt, { className: "mt-10", message: Y, type: "error", banner: !0 }) : c ? /* @__PURE__ */ i(Qe, { style: { padding: "2rem" } }) : X();
14573
+ return W ? /* @__PURE__ */ i(yt, { className: "mt-10", message: W, type: "error", banner: !0 }) : c ? /* @__PURE__ */ i(Qe, { style: { padding: "2rem" } }) : X();
14574
14574
  }
14575
14575
  const xy = Ze(Cy), Ty = (e) => {
14576
14576
  const { model: t } = e, [n, r] = I();
@@ -14592,7 +14592,7 @@ function Iy(e, t) {
14592
14592
  setIsLoading: f,
14593
14593
  openAction: h,
14594
14594
  moveItemsEnabled: p
14595
- } = ne(Jo), g = W(), y = W(), [v] = Xe($.getHandler().getView), [b] = Xe(
14595
+ } = ne(Jo), g = Y(), y = Y(), [v] = Xe($.getHandler().getView), [b] = Xe(
14596
14596
  $.getHandler().readObjects
14597
14597
  ), [A] = Xe($.getHandler().update), S = Gn(
14598
14598
  sn.FEATURE_READFORVIEW
@@ -14664,11 +14664,11 @@ function Iy(e, t) {
14664
14664
  for (const L of R) {
14665
14665
  const { values: N } = L;
14666
14666
  if (N.action_id && N.action_id.length > 0) {
14667
- const B = parseInt(N.action_id[0], 10), Y = Gs({
14667
+ const B = parseInt(N.action_id[0], 10), W = Gs({
14668
14668
  actionId: B,
14669
14669
  rootContext: r
14670
14670
  }).then((k) => ({ ...L, actionData: k }));
14671
- E.push(Y);
14671
+ E.push(W);
14672
14672
  }
14673
14673
  }
14674
14674
  return await Promise.all(E);
@@ -14677,31 +14677,31 @@ function Iy(e, t) {
14677
14677
  if (!p)
14678
14678
  return;
14679
14679
  const E = R.filter((B) => {
14680
- const Y = s.find(
14680
+ const W = s.find(
14681
14681
  (K) => K.id === B.id
14682
14682
  );
14683
- if (!Y)
14683
+ if (!W)
14684
14684
  return !1;
14685
- if (!Y.position)
14685
+ if (!W.position)
14686
14686
  return !0;
14687
14687
  const k = {
14688
- ...JSON.parse(Y.position.replace(/'/g, '"')),
14689
- id: Y.id
14688
+ ...JSON.parse(W.position.replace(/'/g, '"')),
14689
+ id: W.id
14690
14690
  };
14691
14691
  return JSON.stringify(B) !== JSON.stringify(k);
14692
14692
  });
14693
14693
  if (E.length === 0)
14694
14694
  return;
14695
- const L = s.filter((B) => E.map((Y) => Y.id).includes(B.id)).map((B) => {
14696
- const Y = {
14695
+ const L = s.filter((B) => E.map((W) => W.id).includes(B.id)).map((B) => {
14696
+ const W = {
14697
14697
  ...E.find((k) => k.id === B.id)
14698
14698
  };
14699
- return delete Y.id, { ...B }, {
14699
+ return delete W.id, { ...B }, {
14700
14700
  ...B,
14701
14701
  operation: "pendingUpdate",
14702
14702
  values: {
14703
14703
  ...B.values,
14704
- position: JSON.stringify(Y).replace(/"/g, "'")
14704
+ position: JSON.stringify(W).replace(/"/g, "'")
14705
14705
  }
14706
14706
  };
14707
14707
  }), N = {
@@ -14721,7 +14721,7 @@ function Iy(e, t) {
14721
14721
  }
14722
14722
  return c ? /* @__PURE__ */ i(Pt, {}) : m ? /* @__PURE__ */ i(yt, { className: "mt-10 mb-20", message: m, type: "error", banner: !0 }) : /* @__PURE__ */ i(Sy, { onPositionItemsChanged: O, children: s.map((R, E) => {
14723
14723
  const { actionData: V, values: L } = R, { position: N, id: B } = L, {
14724
- actionId: Y,
14724
+ actionId: W,
14725
14725
  actionType: k,
14726
14726
  key: K,
14727
14727
  title: Z,
@@ -14797,7 +14797,7 @@ function Iy(e, t) {
14797
14797
  X = /* @__PURE__ */ i(
14798
14798
  pl,
14799
14799
  {
14800
- action_id: Y,
14800
+ action_id: W,
14801
14801
  action_type: k,
14802
14802
  tabKey: K,
14803
14803
  title: Z,
@@ -14976,7 +14976,9 @@ const Ay = _t(Iy), Fy = (e) => {
14976
14976
  const { ooui: t } = e, { required: n } = t;
14977
14977
  return /* @__PURE__ */ i(Pe, { required: n, type: "any", ...e, children: /* @__PURE__ */ i($y, { ...e }) });
14978
14978
  }, $y = (e) => {
14979
- const { ooui: t, value: n } = e, { selectionValues: r, errorField: o, lastStep: a } = t, s = ne(Ge), l = Array.from(r.entries()), c = l.map((d) => d[0]).indexOf(n);
14979
+ const { ooui: t, value: n } = e, { selectionValues: r, errorField: o, lastStep: a } = t, s = ne(Ge);
14980
+ let l = [], c;
14981
+ t.fieldType === "json" ? (l = n.map((d) => [d.title, d.title]), c = n.findIndex((d) => d.active)) : (l = Array.from(r.entries()), c = l.map((d) => d[0]).indexOf(n));
14980
14982
  let u = "process", m = "";
14981
14983
  return o && (m = s.getFieldValue(o), m && (u = "error")), a && c + 1 == l.length && (u = "finish"), /* @__PURE__ */ i(ti, { current: c, status: u, children: l.map((d, f) => /* @__PURE__ */ i(
14982
14984
  ti.Step,
@@ -15222,7 +15224,7 @@ function iv(e, t) {
15222
15224
  content: /* @__PURE__ */ i(ov, {}),
15223
15225
  action: null
15224
15226
  }
15225
- ]), m = W(/* @__PURE__ */ new Map()), d = W();
15227
+ ]), m = Y(/* @__PURE__ */ new Map()), d = Y();
15226
15228
  Dt(t, () => ({
15227
15229
  retrieveAndOpenAction: y,
15228
15230
  openShortcut: A,
@@ -15333,10 +15335,10 @@ function iv(e, t) {
15333
15335
  const [E, V] = F.split(","), L = parseInt(V), N = R.context, B = Yt({
15334
15336
  context: N,
15335
15337
  values: s
15336
- }), Y = R.domain, k = await (async () => {
15338
+ }), W = R.domain, k = await (async () => {
15337
15339
  try {
15338
- return Y ? await $.getHandler().evalDomain({
15339
- domain: Y,
15340
+ return W ? await $.getHandler().evalDomain({
15341
+ domain: W,
15340
15342
  values: s,
15341
15343
  context: { ...l, ...B }
15342
15344
  }) : [];
@@ -15394,7 +15396,7 @@ function iv(e, t) {
15394
15396
  limit: oe,
15395
15397
  actionRawData: {
15396
15398
  context: N,
15397
- domain: Y
15399
+ domain: W
15398
15400
  }
15399
15401
  });
15400
15402
  }
@@ -15431,7 +15433,7 @@ function iv(e, t) {
15431
15433
  target: L,
15432
15434
  string: N,
15433
15435
  limit: B
15434
- } = F, [Y, k] = V[0], K = { id: Y, type: k }, Z = R, Q = Yt({
15436
+ } = F, [W, k] = V[0], K = { id: W, type: k }, Z = R, Q = Yt({
15435
15437
  context: Z,
15436
15438
  values: { ...T, ...s }
15437
15439
  }), J = E, we = E ? await $.getHandler().evalDomain({
@@ -15479,9 +15481,9 @@ function iv(e, t) {
15479
15481
  values: { ...s, ...R },
15480
15482
  fields: {}
15481
15483
  });
15482
- let Y = [];
15484
+ let W = [];
15483
15485
  const k = E && E.length > 0 ? E : L.domain;
15484
- (E == null ? void 0 : E.length) > 0 ? Y = E : L.domain && (Y = await $.getHandler().evalDomain({
15486
+ (E == null ? void 0 : E.length) > 0 ? W = E : L.domain && (W = await $.getHandler().evalDomain({
15485
15487
  domain: L.domain,
15486
15488
  values: { ...s, ...R },
15487
15489
  context: { ...l, ...B }
@@ -15518,7 +15520,7 @@ function iv(e, t) {
15518
15520
  [z, ie] = M.find((j) => j[0] === void 0 ? !1 : j[0] === O);
15519
15521
  const X = { id: z, type: ie };
15520
15522
  C({
15521
- domain: Y,
15523
+ domain: W,
15522
15524
  context: { ...l, ...B },
15523
15525
  model: K,
15524
15526
  views: M,
@@ -15568,7 +15570,7 @@ function iv(e, t) {
15568
15570
  action_type: L,
15569
15571
  res_id: N,
15570
15572
  values: B,
15571
- forced_values: Y,
15573
+ forced_values: W,
15572
15574
  treeExpandable: k = !1,
15573
15575
  limit: K,
15574
15576
  searchParams: Z,
@@ -15613,7 +15615,7 @@ function iv(e, t) {
15613
15615
  initialView: oe,
15614
15616
  res_id: N,
15615
15617
  formDefaultValues: B,
15616
- formForcedValues: Y,
15618
+ formForcedValues: W,
15617
15619
  treeExpandable: k,
15618
15620
  limit: K,
15619
15621
  initialSearchParams: Z,
@@ -15763,7 +15765,7 @@ const { useToken: dv } = ze, fb = (e) => {
15763
15765
  onAddFavourite: r,
15764
15766
  onRemoveFavourite: o,
15765
15767
  onDropdownClosed: a
15766
- } = e, [s, l] = I(!1), [c, u] = I(), { t: m } = me(), { token: d } = dv(), f = W(null), h = ne(
15768
+ } = e, [s, l] = I(!1), [c, u] = I(), { t: m } = me(), { token: d } = dv(), f = Y(null), h = ne(
15767
15769
  Ot
15768
15770
  ), {
15769
15771
  openShortcut: p,