@gisce/react-ooui 2.74.0 → 2.74.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.
@@ -2764,12 +2764,20 @@ const Iu = {
2764
2764
  }
2765
2765
  }
2766
2766
  }, Fu = (e) => {
2767
- const t = e.reduce((i, l) => i + l.value, 0), r = e.map((i) => i.value / t * 100).map((i) => Math.round(i)), a = 100 - r.reduce((i, l) => i + l, 0);
2768
- for (let i = 0; i < Math.abs(a); i++)
2769
- a > 0 ? r[i % r.length]++ : r[i % r.length]--;
2770
- return e.map((i, l) => ({
2771
- x: i.x,
2772
- percent: r[l]
2767
+ const t = e.reduce((c, d) => c + d.value, 0), r = e.map((c) => c.value / t * 100).map(
2768
+ (c) => Math.round(c * 100) / 100
2769
+ ), o = r.reduce((c, d) => c + d, 0);
2770
+ if (Math.abs(o - 100) < 1e-3)
2771
+ return e.map((c, d) => ({
2772
+ x: c.x,
2773
+ percent: r[d]
2774
+ }));
2775
+ const i = (100 - o) / r.length, l = r.map(
2776
+ (c) => Math.round((c + i) * 100) / 100
2777
+ );
2778
+ return e.map((c, d) => ({
2779
+ x: c.x,
2780
+ percent: l[d]
2773
2781
  }));
2774
2782
  }, { Text: Ts } = nn, la = 400, Au = nt(Vc), _u = nt(Nc), Ru = nt(Mc), Ou = {
2775
2783
  line: Au,
@@ -2798,7 +2806,7 @@ const Iu = {
2798
2806
  if (!d)
2799
2807
  return;
2800
2808
  const g = d.find((_) => _.x === y);
2801
- return `${`${((g == null ? void 0 : g.percent) || 0).toFixed(0)}%`}`;
2809
+ return `${`${(g == null ? void 0 : g.percent) || 0}`}%`;
2802
2810
  },
2803
2811
  [d]
2804
2812
  ), u = Q(() => {
@@ -3822,7 +3830,7 @@ function Zu({
3822
3830
  }), X = Q(
3823
3831
  () => C !== void 0 && C.trim().length > 0,
3824
3832
  [C]
3825
- ), we = Q(() => en(r || [], g || []), [r, g]), B = O(async () => {
3833
+ ), Se = Q(() => en(r || [], g || []), [r, g]), B = O(async () => {
3826
3834
  var Y;
3827
3835
  try {
3828
3836
  u == null || u(!0);
@@ -4067,7 +4075,7 @@ function Zu({
4067
4075
  visible: $,
4068
4076
  onClose: () => L(!1),
4069
4077
  model: p,
4070
- domain: we,
4078
+ domain: Se,
4071
4079
  limit: A,
4072
4080
  totalRegisters: k || 0,
4073
4081
  selectedRegistersToExport: l,
@@ -7074,10 +7082,10 @@ const Gr = ({
7074
7082
  return;
7075
7083
  const D = v.current.filter((j) => {
7076
7084
  const ne = L.find(
7077
- (we) => (we == null ? void 0 : we.id) === (j == null ? void 0 : j.id)
7085
+ (Se) => (Se == null ? void 0 : Se.id) === (j == null ? void 0 : j.id)
7078
7086
  );
7079
7087
  return ne ? u.current.some(
7080
- (we) => j[we] !== ne[we]
7088
+ (Se) => j[Se] !== ne[Se]
7081
7089
  ) : !1;
7082
7090
  }).filter(Boolean);
7083
7091
  D.length > 0 && (D.forEach((j) => g.current.delete(j.id)), P(D), (G = n == null ? void 0 : n.current) == null || G.updateRows(D));
@@ -7227,7 +7235,7 @@ function xh(e, t) {
7227
7235
  searchValues: j,
7228
7236
  searchParams: ne,
7229
7237
  setSearchValues: X,
7230
- searchTreeNameSearch: we,
7238
+ searchTreeNameSearch: Se,
7231
7239
  setSearchTreeNameSearch: B,
7232
7240
  setResults: U,
7233
7241
  results: me,
@@ -7236,7 +7244,7 @@ function xh(e, t) {
7236
7244
  isActive: Z,
7237
7245
  order: re,
7238
7246
  setOrder: Y
7239
- } = el({ useLocalState: !c }), K = u || we, be = z(K), ke = z(!1), Ye = Jt(
7247
+ } = el({ useLocalState: !c }), K = u || Se, be = z(K), ke = z(!1), Ye = Jt(
7240
7248
  $t.FEATURE_MANY2ONE_SORT
7241
7249
  );
7242
7250
  le(() => {
@@ -7245,11 +7253,11 @@ function xh(e, t) {
7245
7253
  var ue;
7246
7254
  (K !== void 0 && be.current === void 0 || typeof K == "string" && typeof be.current == "string" && K !== be.current || K === void 0 && be.current !== void 0) && (ke.current = !!K, G == null || G([]), X == null || X({}), (ue = m.current) == null || ue.unselectAll()), be.current = K;
7247
7255
  }, [K]);
7248
- const Ce = Q(() => {
7256
+ const xe = Q(() => {
7249
7257
  if (S)
7250
7258
  return Kt(S);
7251
7259
  }, [S]), {
7252
- colorsForResults: xe,
7260
+ colorsForResults: Te,
7253
7261
  statusForResults: fe,
7254
7262
  updateAttributes: De,
7255
7263
  clearAttributes: Ie
@@ -7258,16 +7266,16 @@ function xh(e, t) {
7258
7266
  }), { clear: He } = nl({
7259
7267
  model: n,
7260
7268
  tableRef: m,
7261
- autorefreshableFields: Ce == null ? void 0 : Ce.autorefreshableFields,
7269
+ autorefreshableFields: xe == null ? void 0 : xe.autorefreshableFields,
7262
7270
  treeView: S,
7263
7271
  context: d,
7264
7272
  isActive: Z,
7265
- treeOoui: Ce,
7273
+ treeOoui: xe,
7266
7274
  updateAttributes: De,
7267
7275
  results: me
7268
7276
  }), {
7269
7277
  isFieldLoading: Be,
7270
- refresh: Te,
7278
+ refresh: we,
7271
7279
  addRecordsToCheckFunctionFields: ce,
7272
7280
  onHasFunctionFieldsToParseConditions: je
7273
7281
  } = rl({
@@ -7276,20 +7284,20 @@ function xh(e, t) {
7276
7284
  tableRef: m,
7277
7285
  context: d,
7278
7286
  isActive: Z,
7279
- treeOoui: Ce,
7287
+ treeOoui: xe,
7280
7288
  updateAttributes: De,
7281
7289
  results: me
7282
7290
  }), Oe = Fn(() => {
7283
- if (Ce)
7291
+ if (xe)
7284
7292
  return Lr(
7285
- Ce,
7293
+ xe,
7286
7294
  {
7287
7295
  ...Ur
7288
7296
  },
7289
7297
  d,
7290
7298
  Ye
7291
7299
  );
7292
- }, [Ce, d, Ye]), Ne = Q(() => {
7300
+ }, [xe, d, Ye]), Ne = Q(() => {
7293
7301
  if (Oe)
7294
7302
  return Oe.map((ue) => ({
7295
7303
  ...ue,
@@ -7352,7 +7360,7 @@ function xh(e, t) {
7352
7360
  endRow: _e,
7353
7361
  state: rt
7354
7362
  }) => {
7355
- if (!Ce)
7363
+ if (!xe)
7356
7364
  return [];
7357
7365
  let lt;
7358
7366
  if (!g.current && re) {
@@ -7372,7 +7380,7 @@ function xh(e, t) {
7372
7380
  }
7373
7381
  g.current = !0;
7374
7382
  const Nt = K ? i : Ge, cr = (S == null ? void 0 : S.fields_in_conditions) !== void 0, Kr = Gr({
7375
- treeOoui: Ce,
7383
+ treeOoui: xe,
7376
7384
  hasFunctionFieldsToParseConditions: cr && je()
7377
7385
  }), { results: q, attrsEvaluated: J } = await M.getHandler().searchForTree({
7378
7386
  params: Nt,
@@ -7403,8 +7411,8 @@ function xh(e, t) {
7403
7411
  }
7404
7412
  if (Ut.current = lt, K ? (x(q.length), oe(q.length), T(!0), _(!1)) : T(!1), q.length === 0)
7405
7413
  return y.current = [], x(0), oe(0), [];
7406
- const pe = mn(Ce, q);
7407
- return De(J, Ce), y.current = [...pe], pe;
7414
+ const pe = mn(xe, q);
7415
+ return De(J, xe), y.current = [...pe], pe;
7408
7416
  },
7409
7417
  [
7410
7418
  me,
@@ -7419,7 +7427,7 @@ function xh(e, t) {
7419
7427
  Y,
7420
7428
  ee,
7421
7429
  oe,
7422
- Ce,
7430
+ xe,
7423
7431
  S,
7424
7432
  ce,
7425
7433
  je,
@@ -7458,10 +7466,10 @@ function xh(e, t) {
7458
7466
  [te, oe, E, v]
7459
7467
  ), Ve = O((ue) => {
7460
7468
  var _e, rt, lt, Nt;
7461
- if (xe.current[(rt = (_e = ue.node) == null ? void 0 : _e.data) == null ? void 0 : rt.id])
7462
- return { color: xe.current[(Nt = (lt = ue.node) == null ? void 0 : lt.data) == null ? void 0 : Nt.id] };
7469
+ if (Te.current[(rt = (_e = ue.node) == null ? void 0 : _e.data) == null ? void 0 : rt.id])
7470
+ return { color: Te.current[(Nt = (lt = ue.node) == null ? void 0 : lt.data) == null ? void 0 : Nt.id] };
7463
7471
  }, []), ye = Q(() => (W == null ? void 0 : W.map((ue) => ue.id)) || [], [W]), [Ke, ot, Tt] = Ko({
7464
- ooui: Ce,
7472
+ ooui: xe,
7465
7473
  model: n,
7466
7474
  showEmptyValues: !0,
7467
7475
  domain: (ye == null ? void 0 : ye.length) > 0 ? (
@@ -7520,7 +7528,7 @@ function xh(e, t) {
7520
7528
  }),
7521
7529
  [b]
7522
7530
  ), kt = Q(() => {
7523
- if (!Oe || !Ce)
7531
+ if (!Oe || !xe)
7524
7532
  return null;
7525
7533
  const ue = ke.current ? gt : void 0;
7526
7534
  return /* @__PURE__ */ s(
@@ -7542,7 +7550,7 @@ function xh(e, t) {
7542
7550
  onSelectionCheckboxClicked: Ue,
7543
7551
  totalRows: C || 99999,
7544
7552
  footer: Pt,
7545
- hasStatusColumn: Ce.status !== null,
7553
+ hasStatusColumn: xe.status !== null,
7546
7554
  statusComponent: Ot,
7547
7555
  onRowStatus: sn,
7548
7556
  strings: hn,
@@ -7570,7 +7578,7 @@ function xh(e, t) {
7570
7578
  Ot,
7571
7579
  hn,
7572
7580
  C,
7573
- Ce,
7581
+ xe,
7574
7582
  Ze,
7575
7583
  h
7576
7584
  ]), gn = z(ne), jt = z(H), Qt = z(), Ut = z();
@@ -7583,13 +7591,13 @@ function xh(e, t) {
7583
7591
  }, [ne, H]);
7584
7592
  const Wt = O(async () => {
7585
7593
  var ue;
7586
- he([]), Ie(), He(), Qt.current = void 0, T(!1), await at(), (ue = m == null ? void 0 : m.current) == null || ue.refresh(), Te();
7594
+ he([]), Ie(), He(), Qt.current = void 0, T(!1), await at(), (ue = m == null ? void 0 : m.current) == null || ue.refresh(), we();
7587
7595
  }, [
7588
7596
  he,
7589
7597
  Ie,
7590
7598
  He,
7591
7599
  at,
7592
- Te
7600
+ we
7593
7601
  ]);
7594
7602
  Dt(t, () => ({
7595
7603
  refreshResults: Wt,
@@ -7660,7 +7668,7 @@ function xh(e, t) {
7660
7668
  S == null ? void 0 : S.search_fields,
7661
7669
  j
7662
7670
  ]
7663
- ), Se = O(
7671
+ ), Ce = O(
7664
7672
  () => V == null ? void 0 : V(!1),
7665
7673
  [V]
7666
7674
  ), Me = O(
@@ -7689,7 +7697,7 @@ function xh(e, t) {
7689
7697
  Za,
7690
7698
  {
7691
7699
  ...Un,
7692
- onClose: Se,
7700
+ onClose: Ce,
7693
7701
  onSubmit: Me
7694
7702
  }
7695
7703
  ),
@@ -7867,7 +7875,7 @@ const sl = _t(xh), si = (e, t = "14px -apple-system") => {
7867
7875
  ne,
7868
7876
  o,
7869
7877
  a.isExpandable
7870
- ]), we = Q(() => {
7878
+ ]), Se = Q(() => {
7871
7879
  if (!F)
7872
7880
  return null;
7873
7881
  const ee = F.columns.filter((re) => re.sum !== void 0).map((re) => ({ label: re.sum, field: re.id }));
@@ -7915,7 +7923,7 @@ const sl = _t(xh), si = (e, t = "14px -apple-system") => {
7915
7923
  } : void 0
7916
7924
  }
7917
7925
  ),
7918
- we
7926
+ Se
7919
7927
  ] });
7920
7928
  }
7921
7929
  ), lr = nt(il);
@@ -7947,7 +7955,7 @@ const al = (e) => {
7947
7955
  searchParams: R = [],
7948
7956
  setSearchValues: T,
7949
7957
  clearSelection: b
7950
- } = e, [A, k] = I(!1), [S, F] = I(!1), [P, E] = I(), [H, V] = I(1), [$, L] = I(0), [D, W] = I(), [G, j] = I([]), [ne, X] = I(void 0), [we, B] = I(void 0), U = z(C || gt), me = z([]), ee = O(
7958
+ } = e, [A, k] = I(!1), [S, F] = I(!1), [P, E] = I(), [H, V] = I(1), [$, L] = I(0), [D, W] = I(), [G, j] = I([]), [ne, X] = I(void 0), [Se, B] = I(void 0), U = z(C || gt), me = z([]), ee = O(
7951
7959
  (fe) => {
7952
7960
  g == null || g([...fe]), j([...fe]);
7953
7961
  },
@@ -7963,15 +7971,15 @@ const al = (e) => {
7963
7971
  if (W(fe.length), f == null || f(fe.length), fe.length > 0) {
7964
7972
  const De = fe.map((Ne) => Ne == null ? void 0 : Ne[0]), { colors: Ie, status: He } = Kt(u), Be = {};
7965
7973
  Ie && (Be.colors = Ie), He && (Be.status = He);
7966
- const Te = await M.getHandler().readEvalUiObjects({
7974
+ const we = await M.getHandler().readEvalUiObjects({
7967
7975
  model: t,
7968
7976
  ids: De,
7969
7977
  arch: u == null ? void 0 : u.arch,
7970
7978
  fields: u.field_parent ? { ...u.fields, [u.field_parent]: {} } : u.fields,
7971
7979
  context: d,
7972
7980
  attrs: Be
7973
- }), ce = Te[0];
7974
- me.current = [...ce], X(_n(Te[1])), B(hr(Te[1]));
7981
+ }), ce = we[0];
7982
+ me.current = [...ce], X(_n(we[1])), B(hr(we[1]));
7975
7983
  const je = ce.map((Ne) => Ne.id), Oe = h !== void 0 ? xn({
7976
7984
  resultsToSort: ce,
7977
7985
  sorter: h,
@@ -7995,8 +8003,8 @@ const al = (e) => {
7995
8003
  f
7996
8004
  ]), re = O(
7997
8005
  async (fe) => {
7998
- const { params: De, newOffset: Ie } = fe || {}, He = en(De || R, w), { colors: Be, status: Te } = Kt(u), ce = {};
7999
- Be && (ce.colors = Be), Te && (ce.status = Te);
8006
+ const { params: De, newOffset: Ie } = fe || {}, He = en(De || R, w), { colors: Be, status: we } = Kt(u), ce = {};
8007
+ Be && (ce.colors = Be), we && (ce.status = we);
8000
8008
  const { totalItems: je, results: Oe, attrsEvaluated: Ne } = await M.getHandler().searchForTree({
8001
8009
  params: He,
8002
8010
  limit: U.current,
@@ -8109,7 +8117,7 @@ const al = (e) => {
8109
8117
  T,
8110
8118
  x,
8111
8119
  C
8112
- ]), Ce = O(
8120
+ ]), xe = O(
8113
8121
  async (fe) => {
8114
8122
  const De = fe[(u == null ? void 0 : u.field_parent) || "child_id"], Ie = await M.getHandler().readObjects({
8115
8123
  model: t,
@@ -8120,7 +8128,7 @@ const al = (e) => {
8120
8128
  return ee([...oe(), ...Ie]), mn(Kt(u), Ie);
8121
8129
  },
8122
8130
  [u, t, d, oe, ee]
8123
- ), xe = O(async () => await M.getHandler().searchAllIds({
8131
+ ), Te = O(async () => await M.getHandler().searchAllIds({
8124
8132
  params: en(R, w),
8125
8133
  model: t,
8126
8134
  context: d,
@@ -8139,11 +8147,11 @@ const al = (e) => {
8139
8147
  getResults: oe,
8140
8148
  requestPageChange: ke,
8141
8149
  changeSort: K,
8142
- fetchChildrenForRecord: Ce,
8150
+ fetchChildrenForRecord: xe,
8143
8151
  colorsForResults: ne,
8144
- statusForResults: we,
8152
+ statusForResults: Se,
8145
8153
  totalItems: D,
8146
- getAllIds: xe
8154
+ getAllIds: Te
8147
8155
  };
8148
8156
  };
8149
8157
  function Ah(e, t) {
@@ -8172,7 +8180,7 @@ function Ah(e, t) {
8172
8180
  selectedRowItems: j = void 0,
8173
8181
  setSelectedRowItems: ne = void 0,
8174
8182
  searchParams: X = [],
8175
- setSearchParams: we = void 0,
8183
+ setSearchParams: Se = void 0,
8176
8184
  searchVisible: B = !0,
8177
8185
  setSearchVisible: U = void 0,
8178
8186
  sorter: me = void 0,
@@ -8190,14 +8198,14 @@ function Ah(e, t) {
8190
8198
  },
8191
8199
  [p, ne]
8192
8200
  ), {
8193
- submit: Ce,
8194
- clear: xe,
8201
+ submit: xe,
8202
+ clear: Te,
8195
8203
  fetchResults: fe,
8196
8204
  tableRefreshing: De,
8197
8205
  searchFilterLoading: Ie,
8198
8206
  searchError: He,
8199
8207
  page: Be,
8200
- limit: Te,
8208
+ limit: we,
8201
8209
  offset: ce,
8202
8210
  getResults: je,
8203
8211
  requestPageChange: Oe,
@@ -8211,7 +8219,7 @@ function Ah(e, t) {
8211
8219
  model: _,
8212
8220
  setSearchTreeNameSearch: Z,
8213
8221
  setSelectedRowItems: Ye,
8214
- setSearchParams: we,
8222
+ setSearchParams: Se,
8215
8223
  setSearchValues: K,
8216
8224
  searchParams: X,
8217
8225
  setSearchVisible: U,
@@ -8327,11 +8335,11 @@ function Ah(e, t) {
8327
8335
  T.search_fields,
8328
8336
  x.search_fields
8329
8337
  ]),
8330
- onClear: xe,
8338
+ onClear: Te,
8331
8339
  limit: be,
8332
8340
  offset: ce,
8333
8341
  isSearching: Ie,
8334
- onSubmit: Ce,
8342
+ onSubmit: xe,
8335
8343
  onLimitChange: te,
8336
8344
  setSearchFilterHeight: F,
8337
8345
  searchError: He,
@@ -8345,7 +8353,7 @@ function Ah(e, t) {
8345
8353
  ref: w,
8346
8354
  context: u,
8347
8355
  total: Ze,
8348
- limit: Te,
8356
+ limit: we,
8349
8357
  page: Be,
8350
8358
  treeView: x,
8351
8359
  results: je(),
@@ -8369,13 +8377,13 @@ function Ah(e, t) {
8369
8377
  Ve,
8370
8378
  Ye,
8371
8379
  Ne,
8372
- xe,
8380
+ Te,
8373
8381
  Ae,
8374
8382
  ve,
8375
8383
  T,
8376
8384
  je,
8377
8385
  be,
8378
- Te,
8386
+ we,
8379
8387
  ce,
8380
8388
  Re,
8381
8389
  te,
@@ -8391,7 +8399,7 @@ function Ah(e, t) {
8391
8399
  ye,
8392
8400
  me,
8393
8401
  de,
8394
- Ce,
8402
+ xe,
8395
8403
  De,
8396
8404
  Ze,
8397
8405
  l,
@@ -8440,7 +8448,7 @@ const ll = _t(Ah), _h = gt, Rh = (e) => {
8440
8448
  setOrder: W,
8441
8449
  limit: G,
8442
8450
  setLimit: j
8443
- } = el({ useLocalState: !a }), { treeMaxLimit: ne } = on(), X = Math.min(G, ne), [we, B] = I(!0), [U, me] = I(), [ee, oe] = I([]), [Z, re] = I(!1), Y = i || k, K = z(Y), be = z(b), ke = z(m), Ye = z(), Ce = z([]), xe = z(!1), fe = Q(() => Ta({ treeViewId: r == null ? void 0 : r.view_id, model: o }), [r == null ? void 0 : r.view_id, o]), {
8451
+ } = el({ useLocalState: !a }), { treeMaxLimit: ne } = on(), X = Math.min(G, ne), [Se, B] = I(!0), [U, me] = I(), [ee, oe] = I([]), [Z, re] = I(!1), Y = i || k, K = z(Y), be = z(b), ke = z(m), Ye = z(), xe = z([]), Te = z(!1), fe = Q(() => Ta({ treeViewId: r == null ? void 0 : r.view_id, model: o }), [r == null ? void 0 : r.view_id, o]), {
8444
8452
  fetchColumnState: De,
8445
8453
  loading: Ie,
8446
8454
  getColumnState: He,
@@ -8448,12 +8456,12 @@ const ll = _t(Ah), _h = gt, Rh = (e) => {
8448
8456
  } = Go({
8449
8457
  key: fe,
8450
8458
  treeViewFetching: t
8451
- }), Te = O((Se) => {
8452
- Ce.current = Ce.current.map((Me) => {
8453
- const et = Se.find((ue) => ue.id === Me.id);
8459
+ }), we = O((Ce) => {
8460
+ xe.current = xe.current.map((Me) => {
8461
+ const et = Ce.find((ue) => ue.id === Me.id);
8454
8462
  return { ...Me, ...et };
8455
8463
  }), oe((Me) => Me.map((et) => {
8456
- const ue = Se.find((_e) => _e.id === et.id);
8464
+ const ue = Ce.find((_e) => _e.id === et.id);
8457
8465
  return { ...et, ...ue };
8458
8466
  }));
8459
8467
  }, []), {
@@ -8474,7 +8482,7 @@ const ll = _t(Ah), _h = gt, Rh = (e) => {
8474
8482
  tableRef: l,
8475
8483
  context: d,
8476
8484
  isActive: V,
8477
- onResultsUpdated: Te,
8485
+ onResultsUpdated: we,
8478
8486
  treeOoui: n,
8479
8487
  updateAttributes: Oe,
8480
8488
  results: P
@@ -8497,21 +8505,21 @@ const ll = _t(Ah), _h = gt, Rh = (e) => {
8497
8505
  ), ye = Q(
8498
8506
  () => en(b || [], c),
8499
8507
  [c, b]
8500
- ), Ke = Q(() => (x == null ? void 0 : x.map((Se) => Se.id)) || [], [x]), ot = O(() => {
8508
+ ), Ke = Q(() => (x == null ? void 0 : x.map((Ce) => Ce.id)) || [], [x]), ot = O(() => {
8501
8509
  const Me = `${JSON.stringify(Y ? c : ye)}-${Y}`;
8502
8510
  return Me !== Ye.current ? (Ye.current = Me, !0) : !1;
8503
8511
  }, [c, ye, Y]), Tt = O(async () => {
8504
8512
  me(void 0), H(0), B(!0);
8505
8513
  try {
8506
- const Se = await at({
8514
+ const Ce = await at({
8507
8515
  params: Y ? c : ye,
8508
8516
  model: o,
8509
8517
  context: d,
8510
8518
  name_search: Y
8511
8519
  });
8512
- me(Se), H(Se);
8513
- } catch (Se) {
8514
- st(Se);
8520
+ me(Ce), H(Ce);
8521
+ } catch (Ce) {
8522
+ st(Ce);
8515
8523
  } finally {
8516
8524
  B(!1);
8517
8525
  }
@@ -8524,19 +8532,19 @@ const ll = _t(Ah), _h = gt, Rh = (e) => {
8524
8532
  o,
8525
8533
  d,
8526
8534
  st
8527
- ]), Ue = O(() => w, [w]), ft = O(() => _, [_]), Pt = O((Se) => {
8535
+ ]), Ue = O(() => w, [w]), ft = O(() => _, [_]), Pt = O((Ce) => {
8528
8536
  var Me, et, ue, _e;
8529
- return ce.current[(et = (Me = Se.node) == null ? void 0 : Me.data) == null ? void 0 : et.id] ? { color: ce.current[(_e = (ue = Se.node) == null ? void 0 : ue.data) == null ? void 0 : _e.id] } : {};
8537
+ return ce.current[(et = (Me = Ce.node) == null ? void 0 : Me.data) == null ? void 0 : et.id] ? { color: ce.current[(_e = (ue = Ce.node) == null ? void 0 : ue.data) == null ? void 0 : _e.id] } : {};
8530
8538
  }, []), Ot = O(
8531
- (Se) => {
8539
+ (Ce) => {
8532
8540
  var Me;
8533
- return (Me = je.current) == null ? void 0 : Me[Se.id];
8541
+ return (Me = je.current) == null ? void 0 : Me[Ce.id];
8534
8542
  },
8535
8543
  // eslint-disable-next-line react-hooks/exhaustive-deps
8536
8544
  []
8537
8545
  ), sn = O(() => {
8538
- var Se;
8539
- g([]), (Se = l.current) == null || Se.unselectAll(), S == null || S(void 0), R == null || R([]), A == null || A(void 0);
8546
+ var Ce;
8547
+ g([]), (Ce = l.current) == null || Ce.unselectAll(), S == null || S(void 0), R == null || R([]), A == null || A(void 0);
8540
8548
  }, [
8541
8549
  g,
8542
8550
  l,
@@ -8544,9 +8552,9 @@ const ll = _t(Ah), _h = gt, Rh = (e) => {
8544
8552
  R,
8545
8553
  A
8546
8554
  ]), hn = O(
8547
- ({ params: Se, searchValues: Me }) => {
8555
+ ({ params: Ce, searchValues: Me }) => {
8548
8556
  var et;
8549
- g([]), (et = l.current) == null || et.unselectAll(), S == null || S(void 0), R == null || R(Se), A == null || A(Me);
8557
+ g([]), (et = l.current) == null || et.unselectAll(), S == null || S(void 0), R == null || R(Ce), A == null || A(Me);
8550
8558
  },
8551
8559
  [
8552
8560
  g,
@@ -8559,9 +8567,9 @@ const ll = _t(Ah), _h = gt, Rh = (e) => {
8559
8567
  () => y == null ? void 0 : y(!1),
8560
8568
  [y]
8561
8569
  ), gn = O(
8562
- ({ params: Se, values: Me }) => {
8570
+ ({ params: Ce, values: Me }) => {
8563
8571
  var et;
8564
- g([]), (et = l.current) == null || et.unselectAll(), S == null || S(void 0), R == null || R(Se), A == null || A(Me), y == null || y(!1);
8572
+ g([]), (et = l.current) == null || et.unselectAll(), S == null || S(void 0), R == null || R(Ce), A == null || A(Me), y == null || y(!1);
8565
8573
  },
8566
8574
  [
8567
8575
  g,
@@ -8588,35 +8596,35 @@ const ll = _t(Ah), _h = gt, Rh = (e) => {
8588
8596
  c,
8589
8597
  D
8590
8598
  ]), le(() => {
8591
- var Se;
8599
+ var Ce;
8592
8600
  if (Y !== K.current) {
8593
8601
  if (Y !== void 0 && K.current === void 0 || typeof Y == "string" && typeof K.current == "string" && Y !== K.current) {
8594
- R == null || R([]), A == null || A({}), (Se = l.current) == null || Se.unselectAll(), K.current = Y;
8602
+ R == null || R([]), A == null || A({}), (Ce = l.current) == null || Ce.unselectAll(), K.current = Y;
8595
8603
  return;
8596
8604
  }
8597
8605
  Y === void 0 && K.current !== void 0 && B(!0), K.current = Y;
8598
8606
  }
8599
8607
  }, [Y]), Ft(() => {
8600
- const Se = !es(
8608
+ const Ce = !es(
8601
8609
  b,
8602
8610
  be.current
8603
8611
  ), Me = ke.current && !m;
8604
- Se && (Me || f === "top") && Qt(), be.current = b, ke.current = m;
8612
+ Ce && (Me || f === "top") && Qt(), be.current = b, ke.current = m;
8605
8613
  }, [b, m]);
8606
8614
  const jt = O(async () => {
8607
8615
  if (!n || t)
8608
8616
  return [];
8609
- if (xe.current)
8617
+ if (Te.current)
8610
8618
  return [];
8611
- xe.current = !0;
8619
+ Te.current = !0;
8612
8620
  try {
8613
8621
  h(!0);
8614
- let Se;
8622
+ let Ce;
8615
8623
  if (D != null && D.length) {
8616
8624
  const Nt = gr({
8617
8625
  state: D
8618
8626
  });
8619
- Se = yr(Nt);
8627
+ Ce = yr(Nt);
8620
8628
  }
8621
8629
  const Me = Y ? c : ye, et = (r == null ? void 0 : r.fields_in_conditions) !== void 0, ue = Gr({
8622
8630
  treeOoui: n,
@@ -8629,7 +8637,7 @@ const ll = _t(Ah), _h = gt, Rh = (e) => {
8629
8637
  fields: r.field_parent ? { ...r.fields, [r.field_parent]: {} } : r.fields,
8630
8638
  context: d,
8631
8639
  attrs: ue,
8632
- order: Se,
8640
+ order: Ce,
8633
8641
  name_search: Y,
8634
8642
  skipFunctionFields: et,
8635
8643
  onIdsRetrieved: (Nt) => {
@@ -8642,15 +8650,15 @@ const ll = _t(Ah), _h = gt, Rh = (e) => {
8642
8650
  name_search: Y,
8643
8651
  context: d
8644
8652
  }), F == null || F(_e), Y ? (me(_e.length), H(_e.length), re(!0), B(!1)) : re(!1), !Y && ot() && Tt(), _e.length === 0) {
8645
- Ce.current = [], me(0), H(0), oe([]), h(!1);
8653
+ xe.current = [], me(0), H(0), oe([]), h(!1);
8646
8654
  return;
8647
8655
  }
8648
8656
  const lt = mn(n, _e);
8649
- Oe(rt, n), h(!1), Ce.current = [...lt], oe([...lt]);
8650
- } catch (Se) {
8651
- throw console.error(Se), Se;
8657
+ Oe(rt, n), h(!1), xe.current = [...lt], oe([...lt]);
8658
+ } catch (Ce) {
8659
+ throw console.error(Ce), Ce;
8652
8660
  } finally {
8653
- xe.current = !1;
8661
+ Te.current = !1;
8654
8662
  }
8655
8663
  }, [
8656
8664
  n,
@@ -8686,12 +8694,12 @@ const ll = _t(Ah), _h = gt, Rh = (e) => {
8686
8694
  jt,
8687
8695
  Ae
8688
8696
  ]), Ut = O(
8689
- (Se, Me) => {
8697
+ (Ce, Me) => {
8690
8698
  if (Me === -1) {
8691
8699
  u == null || u("infinite");
8692
8700
  return;
8693
8701
  }
8694
- v(0), C(void 0), g([]), L(Se), Me && j(Me);
8702
+ v(0), C(void 0), g([]), L(Ce), Me && j(Me);
8695
8703
  },
8696
8704
  [
8697
8705
  u,
@@ -8707,14 +8715,14 @@ const ll = _t(Ah), _h = gt, Rh = (e) => {
8707
8715
  context: d,
8708
8716
  totalItems: U
8709
8717
  }), [Pe, b, c, o, d, U]), Vt = O(async () => {
8710
- const Se = await Wt();
8711
- g == null || g(Se.map((Me) => ({ id: Me })));
8718
+ const Ce = await Wt();
8719
+ g == null || g(Ce.map((Me) => ({ id: Me })));
8712
8720
  }, [Wt, g]), Yt = Q(() => Ke.length === 0 ? "unchecked" : Ke.length === X && X > 0 || Ke.length === U ? "checked" : "indeterminate", [Ke, X, U]), Bn = O(() => {
8713
- var Se, Me;
8714
- Yt === "unchecked" ? ((Se = l.current) == null || Se.selectAll(), g(ee.map((et) => ({ id: et.id })))) : (g([]), (Me = l.current) == null || Me.unselectAll());
8721
+ var Ce, Me;
8722
+ Yt === "unchecked" ? ((Ce = l.current) == null || Ce.selectAll(), g(ee.map((et) => ({ id: et.id })))) : (g([]), (Me = l.current) == null || Me.unselectAll());
8715
8723
  }, [l, g, ee, Yt]), jn = O(
8716
- (Se) => {
8717
- W(Se), v(0), C(void 0), L(1);
8724
+ (Ce) => {
8725
+ W(Ce), v(0), C(void 0), L(1);
8718
8726
  },
8719
8727
  [
8720
8728
  W,
@@ -8723,13 +8731,13 @@ const ll = _t(Ah), _h = gt, Rh = (e) => {
8723
8731
  v
8724
8732
  ]
8725
8733
  ), Un = O(
8726
- ({ id: Se, selected: Me }) => {
8734
+ ({ id: Ce, selected: Me }) => {
8727
8735
  g((et) => {
8728
8736
  if (Me) {
8729
- const ue = ee.find((_e) => _e.id === Se);
8730
- return ue && !et.some((_e) => _e.id === Se) ? [...et, ue] : et;
8737
+ const ue = ee.find((_e) => _e.id === Ce);
8738
+ return ue && !et.some((_e) => _e.id === Ce) ? [...et, ue] : et;
8731
8739
  }
8732
- return et.filter((ue) => ue.id !== Se);
8740
+ return et.filter((ue) => ue.id !== Ce);
8733
8741
  });
8734
8742
  },
8735
8743
  [ee, g]
@@ -8748,7 +8756,7 @@ const ll = _t(Ah), _h = gt, Rh = (e) => {
8748
8756
  onSearchFilterSubmit: hn,
8749
8757
  onSideSearchFilterClose: kt,
8750
8758
  onSideSearchFilterSubmit: gn,
8751
- totalRowsLoading: we,
8759
+ totalRowsLoading: Se,
8752
8760
  totalRows: U,
8753
8761
  onRowStyle: Pt,
8754
8762
  results: ee,
@@ -8983,7 +8991,7 @@ function Ph(e, t) {
8983
8991
  totalRows: j,
8984
8992
  onRowStyle: ne,
8985
8993
  results: X,
8986
- onRequestPageChange: we,
8994
+ onRequestPageChange: Se,
8987
8995
  treeIsLoading: B,
8988
8996
  selectAllRecords: U,
8989
8997
  onHeaderCheckboxClick: me,
@@ -8996,8 +9004,8 @@ function Ph(e, t) {
8996
9004
  order: be,
8997
9005
  setTreeFirstVisibleColumn: ke,
8998
9006
  onGetFirstVisibleColumn: Ye,
8999
- onSortChange: Ce,
9000
- isFieldLoading: xe,
9007
+ onSortChange: xe,
9008
+ isFieldLoading: Te,
9001
9009
  setSearchVisible: fe,
9002
9010
  nameSearchFetchCompleted: De,
9003
9011
  nameSearch: Ie
@@ -9013,7 +9021,7 @@ function Ph(e, t) {
9013
9021
  filterType: u,
9014
9022
  context: d,
9015
9023
  onChangeTreeType: p
9016
- }), He = ii(F), [Be, Te, ce] = Ko({
9024
+ }), He = ii(F), [Be, we, ce] = Ko({
9017
9025
  ooui: x,
9018
9026
  model: n,
9019
9027
  showEmptyValues: !0,
@@ -9026,7 +9034,7 @@ function Ph(e, t) {
9026
9034
  refreshResults: F,
9027
9035
  getFields: () => w == null ? void 0 : w.fields
9028
9036
  }));
9029
- const je = Q(() => ce ? /* @__PURE__ */ s(qo, { aggregates: Te, isLoading: Be }) : null, [Te, Be, ce]), Oe = O(
9037
+ const je = Q(() => ce ? /* @__PURE__ */ s(qo, { aggregates: we, isLoading: Be }) : null, [we, Be, ce]), Oe = O(
9030
9038
  (Ge) => /* @__PURE__ */ s(er, { color: Ge, style: { marginLeft: 7 } }),
9031
9039
  []
9032
9040
  ), Ne = Q(
@@ -9061,7 +9069,7 @@ function Ph(e, t) {
9061
9069
  pageSize: Ze,
9062
9070
  maxPageSize: g,
9063
9071
  currentPageSelectedCount: S.length,
9064
- onRequestPageChange: we,
9072
+ onRequestPageChange: Se,
9065
9073
  totalSelectedCount: S.length,
9066
9074
  onSelectAllGlobalRecords: U,
9067
9075
  simpleSummary: ve,
@@ -9099,9 +9107,9 @@ function Ph(e, t) {
9099
9107
  onHeaderCheckboxClick: me,
9100
9108
  refresh: He,
9101
9109
  actionViewSortState: be,
9102
- onSortChange: Ce,
9110
+ onSortChange: xe,
9103
9111
  tableRef: h,
9104
- isFieldLoading: xe,
9112
+ isFieldLoading: Te,
9105
9113
  onChangeTreeType: p
9106
9114
  }
9107
9115
  ) })
@@ -9279,14 +9287,14 @@ const kh = _t(Ph), Zn = "legacy", Vh = (e) => {
9279
9287
  initialSearchParams: S,
9280
9288
  initialCurrentPage: F,
9281
9289
  initialOrder: P
9282
- } = e, [E, H] = I(!1), [V, $] = I(!1), [L, D] = I(!1), [W, G] = I(!0), [j, ne] = I(!0), [X, we] = I([]), [B, U] = I(!1), [me, ee] = I(
9290
+ } = e, [E, H] = I(!1), [V, $] = I(!1), [L, D] = I(!1), [W, G] = I(!0), [j, ne] = I(!0), [X, Se] = I([]), [B, U] = I(!1), [me, ee] = I(
9283
9291
  S || []
9284
9292
  ), [oe, Z] = I(!1), [re, Y] = I(!0), [K, be] = I(), [ke, Ye] = I(
9285
9293
  Hu(
9286
9294
  S || [],
9287
9295
  n.fields
9288
9296
  )
9289
- ), [Ce, xe] = I(0), [fe, De] = I(void 0), [Ie, He] = I(), [Be, Te] = I(Zn), [ce, je] = I(
9297
+ ), [xe, Te] = I(0), [fe, De] = I(void 0), [Ie, He] = I(), [Be, we] = I(Zn), [ce, je] = I(
9290
9298
  P
9291
9299
  ), [Oe, Ne] = I(
9292
9300
  A !== void 0 ? A : gt
@@ -9344,7 +9352,7 @@ const kh = _t(Ph), Zn = "legacy", Vh = (e) => {
9344
9352
  treeIsLoading: j,
9345
9353
  setTreeIsLoading: ne,
9346
9354
  attachments: X,
9347
- setAttachments: we,
9355
+ setAttachments: Se,
9348
9356
  selectedRowItems: x,
9349
9357
  setSelectedRowItems: C,
9350
9358
  duplicatingItem: B,
@@ -9370,14 +9378,14 @@ const kh = _t(Ph), Zn = "legacy", Vh = (e) => {
9370
9378
  setLimit: Ne,
9371
9379
  setTitle: Ae,
9372
9380
  isActive: k,
9373
- setTreeFirstVisibleRow: xe,
9374
- treeFirstVisibleRow: Ce,
9381
+ setTreeFirstVisibleRow: Te,
9382
+ treeFirstVisibleRow: xe,
9375
9383
  treeFirstVisibleColumn: fe,
9376
9384
  setTreeFirstVisibleColumn: De,
9377
9385
  searchQuery: Ie,
9378
9386
  setSearchQuery: He,
9379
9387
  treeType: Be,
9380
- setTreeType: Te,
9388
+ setTreeType: we,
9381
9389
  order: ce,
9382
9390
  setOrder: je,
9383
9391
  currentPage: de,
@@ -10223,18 +10231,18 @@ function ug(e, t) {
10223
10231
  forcedValues: R = {},
10224
10232
  parentWidth: T,
10225
10233
  onMustRefreshParent: b
10226
- } = e, { t: A } = ge(), [k, S] = I(!1), [F, P] = I(), [E, H] = I(), [V] = Et.useForm(), [$, L] = I(), [D, W] = I(), G = ae(fl), [j, ne] = I(), [X, we] = I(!1), B = z(), U = z({}), me = z({}), ee = z(!1), oe = z(!1), Z = z(!1), Y = (T !== void 0 ? T : j) < dg, K = ae(Je), { activeId: be, getPlainValues: ke } = K || {}, Ye = z(!1), Ce = ae(
10234
+ } = e, { t: A } = ge(), [k, S] = I(!1), [F, P] = I(), [E, H] = I(), [V] = Et.useForm(), [$, L] = I(), [D, W] = I(), G = ae(fl), [j, ne] = I(), [X, Se] = I(!1), B = z(), U = z({}), me = z({}), ee = z(!1), oe = z(!1), Z = z(!1), Y = (T !== void 0 ? T : j) < dg, K = ae(Je), { activeId: be, getPlainValues: ke } = K || {}, Ye = z(!1), xe = ae(
10227
10235
  Ct
10228
10236
  ), {
10229
- setFormIsSaving: xe = void 0,
10237
+ setFormIsSaving: Te = void 0,
10230
10238
  setFormHasChanges: fe = void 0,
10231
10239
  setCurrentId: De = void 0,
10232
10240
  setFormIsLoading: Ie = void 0,
10233
10241
  setAttachments: He = void 0,
10234
10242
  title: Be = void 0,
10235
- setTitle: Te = void 0,
10243
+ setTitle: we = void 0,
10236
10244
  isActive: ce = void 0
10237
- } = (C ? Ce : {}) || {}, je = ae(
10245
+ } = (C ? xe : {}) || {}, je = ae(
10238
10246
  Vn
10239
10247
  ), { processAction: Oe, globalValues: Ne } = je || {};
10240
10248
  Dt(t, () => ({
@@ -10259,12 +10267,12 @@ function ug(e, t) {
10259
10267
  }, [r, n, h, m, _]), le(() => {
10260
10268
  X && (Yt({
10261
10269
  elementHasLostFocus: !0
10262
- }), we(!1));
10270
+ }), Se(!1));
10263
10271
  }, [X]);
10264
10272
  const ve = (q, J, pe, se) => {
10265
- fe == null || fe(!1), xe == null || xe(!1), a == null || a(q, J, pe, se), De == null || De(q), Ye.current && (b == null || b());
10273
+ fe == null || fe(!1), Te == null || Te(!1), a == null || a(q, J, pe, se), De == null || De(q), Ye.current && (b == null || b());
10266
10274
  }, Ae = (q) => {
10267
- xe == null || xe(!1), d == null || d(q);
10275
+ Te == null || Te(!1), d == null || d(q);
10268
10276
  }, de = O(() => r || B.current, [r]), Ze = r || B.current;
10269
10277
  function Ge() {
10270
10278
  return D;
@@ -10325,13 +10333,13 @@ function ug(e, t) {
10325
10333
  q[J] === void 0 && delete q[J];
10326
10334
  return q;
10327
10335
  }, [ye, Re, D]), ot = O(() => {
10328
- Ye.current && (b == null || b()), xe == null || xe(!1), o == null || o({ id: de(), values: Ke() });
10336
+ Ye.current && (b == null || b()), Te == null || Te(!1), o == null || o({ id: de(), values: Ke() });
10329
10337
  }, [
10330
10338
  de,
10331
10339
  Ke,
10332
10340
  b,
10333
10341
  o,
10334
- xe
10342
+ Te
10335
10343
  ]), Tt = (q, J) => {
10336
10344
  kt({
10337
10345
  values: {
@@ -10372,7 +10380,7 @@ function ug(e, t) {
10372
10380
  fields: pe,
10373
10381
  reset: !0,
10374
10382
  isDefaultGet: Ee
10375
- }), Vt({ fields: pe, arch: se, values: J }), Ie == null || Ie(!1), fe == null || fe(!1), Ee && we(!0);
10383
+ }), Vt({ fields: pe, arch: se, values: J }), Ie == null || Ie(!1), fe == null || fe(!1), Ee && Se(!0);
10376
10384
  }, sn = async () => new Promise(async (q) => {
10377
10385
  Ve() ? kn({
10378
10386
  t: A,
@@ -10493,13 +10501,13 @@ function ug(e, t) {
10493
10501
  return oe.current = !1, fe == null || fe(!1), ot == null || ot(), { succeed: !0, id: de() };
10494
10502
  if (await ft())
10495
10503
  return oe.current = !1, li(A), { succeed: !1, id: de() };
10496
- S(!0), xe == null || xe(!0);
10504
+ S(!0), Te == null || Te(!0);
10497
10505
  try {
10498
10506
  p === "api" ? await jt(q) : await Qt(q), u && (B.current = void 0, kt({ values: {}, fields: D, reset: !0 })), await Ot({ forceRefresh: !0 }), J = !0, Wn.success(A("savedRegisters"));
10499
10507
  } catch (se) {
10500
- oe.current = !1, S(!1), xe == null || xe(!1), Ae == null || Ae(se), Wn.error(A("errorWhileSavingForm")), P(se != null && se.message ? se.message : se);
10508
+ oe.current = !1, S(!1), Te == null || Te(!1), Ae == null || Ae(se), Wn.error(A("errorWhileSavingForm")), P(se != null && se.message ? se.message : se);
10501
10509
  } finally {
10502
- oe.current = !1, xe == null || xe(!1), S(!1);
10510
+ oe.current = !1, Te == null || Te(!1), S(!1);
10503
10511
  }
10504
10512
  return { succeed: J, id: de() };
10505
10513
  }, Wt = O(
@@ -10536,9 +10544,9 @@ function ug(e, t) {
10536
10544
  values: pe,
10537
10545
  operationInProgress: se
10538
10546
  });
10539
- H(Ee), Ee.string && Ee.string !== Be && (Te == null || Te(Ee.string)), G && Ee.string && ((ct = G.setTitle) == null || ct.call(G, Ee.string));
10547
+ H(Ee), Ee.string && Ee.string !== Be && (we == null || we(Ee.string)), G && Ee.string && ((ct = G.setTitle) == null || ct.call(G, Ee.string));
10540
10548
  },
10541
- [G, Wt, Te, Be]
10549
+ [G, Wt, we, Be]
10542
10550
  ), Yt = async ({
10543
10551
  elementHasLostFocus: q = !1
10544
10552
  }) => {
@@ -10639,7 +10647,7 @@ function ug(e, t) {
10639
10647
  }), W(Ee);
10640
10648
  }
10641
10649
  };
10642
- async function Se({
10650
+ async function Ce({
10643
10651
  action: q,
10644
10652
  context: J
10645
10653
  }) {
@@ -10761,7 +10769,7 @@ function ug(e, t) {
10761
10769
  try {
10762
10770
  !f && (Ve() || de() === void 0) && (se = !0, rt(!0), p === "2many" ? (await jt({ callOnSubmitSucceed: !1 }), Z.current = !0) : await Ut({ callOnSubmitSucceed: !1 }));
10763
10771
  const Ee = Z.current ? he() : {}, ct = { ...pe, ...Ee };
10764
- q === "object" ? await Se({ action: J, context: ct }) : q === "workflow" ? await Me({ action: J }) : q === "action" && await et({ action: J, context: ct }), se && rt(!1);
10772
+ q === "object" ? await Ce({ action: J, context: ct }) : q === "workflow" ? await Me({ action: J }) : q === "action" && await et({ action: J, context: ct }), se && rt(!1);
10765
10773
  } catch (Ee) {
10766
10774
  se && rt(!1), wt(Ee);
10767
10775
  }
@@ -11738,7 +11746,7 @@ const xg = (e) => {
11738
11746
  domain: y,
11739
11747
  fetchValues: g
11740
11748
  } = f || {}, { t: v } = ge(), [w, _] = I(!1), [C, x] = I(!1), [R, T] = I(), [b, A] = I(!1), [k, S] = I(!1), [F, P] = I(), [E, H] = I([]), [V, $] = I(!1), L = z([]), [D, W] = I(), G = z(), [j, ne] = I(void 0), X = z(), {
11741
- readOnly: we,
11749
+ readOnly: Se,
11742
11750
  relation: B,
11743
11751
  context: U,
11744
11752
  domain: me
@@ -11806,12 +11814,12 @@ const xg = (e) => {
11806
11814
  })
11807
11815
  ));
11808
11816
  }
11809
- const Ce = () => {
11817
+ const xe = () => {
11810
11818
  const te = Array.from(o.keys()), he = te[(te.indexOf(i) + 1) % te.length];
11811
11819
  i === "form" ? Ie(() => {
11812
11820
  l(he);
11813
11821
  }) : l(he);
11814
- }, xe = () => {
11822
+ }, Te = () => {
11815
11823
  c > 0 && (i === "form" ? Ie(() => {
11816
11824
  d(c - 1);
11817
11825
  }) : d(c - 1));
@@ -11867,7 +11875,7 @@ const xg = (e) => {
11867
11875
  te && u && (he = { [te]: u }), i === "form" ? Ie(() => {
11868
11876
  $(!0), P({ defaultValues: he }), A(!0);
11869
11877
  }) : ($(!0), P({ defaultValues: he }), A(!0));
11870
- }, Te = async () => {
11878
+ }, we = async () => {
11871
11879
  i === "form" ? Ie(() => {
11872
11880
  S(!0);
11873
11881
  }) : S(!0);
@@ -11994,7 +12002,7 @@ const xg = (e) => {
11994
12002
  } : Ue);
11995
12003
  K(ot), _(!0);
11996
12004
  },
11997
- readOnly: we
12005
+ readOnly: Se
11998
12006
  }
11999
12007
  );
12000
12008
  let te = [];
@@ -12022,7 +12030,7 @@ const xg = (e) => {
12022
12030
  onChangeSort: W,
12023
12031
  context: { ...m == null ? void 0 : m(), ...U },
12024
12032
  colorsForResults: j,
12025
- readonly: we,
12033
+ readonly: Se,
12026
12034
  scrollY: r == null ? void 0 : r.height
12027
12035
  }
12028
12036
  );
@@ -12052,17 +12060,17 @@ const xg = (e) => {
12052
12060
  model: B,
12053
12061
  currentId: (Ge = Z[c]) == null ? void 0 : Ge.id,
12054
12062
  title: Ae(),
12055
- readOnly: we || !1,
12063
+ readOnly: Se || !1,
12056
12064
  isMany2Many: ee,
12057
12065
  formHasChanges: w,
12058
12066
  totalItems: Z.length,
12059
12067
  currentItemIndex: c,
12060
12068
  onDelete: He,
12061
12069
  onCreateItem: Be,
12062
- onToggleViewMode: Ce,
12063
- onPreviousItem: xe,
12070
+ onToggleViewMode: xe,
12071
+ onPreviousItem: Te,
12064
12072
  onNextItem: fe,
12065
- onSearchItem: Te,
12073
+ onSearchItem: we,
12066
12074
  selectedRowKeys: E,
12067
12075
  showCreateButton: ((st = o.get("form")) == null ? void 0 : st.fields) !== void 0,
12068
12076
  showToggleButton: o.size > 1,
@@ -12100,7 +12108,7 @@ const xg = (e) => {
12100
12108
  }
12101
12109
  A(!1);
12102
12110
  },
12103
- readOnly: we,
12111
+ readOnly: Se,
12104
12112
  mustClearAfterSave: Ze,
12105
12113
  onMustRefreshParent: () => {
12106
12114
  g == null || g({ forceRefresh: !0 });
@@ -12675,7 +12683,7 @@ const Og = ({
12675
12683
  treeView: a.get("tree"),
12676
12684
  relation: h,
12677
12685
  context: b,
12678
- allRowsIds: l.filter((Te) => Te.id !== void 0).map((Te) => Te.id),
12686
+ allRowsIds: l.filter((we) => we.id !== void 0).map((we) => we.id),
12679
12687
  gridRef: t
12680
12688
  }), [, $] = Vg({
12681
12689
  ooui: k,
@@ -12683,14 +12691,14 @@ const Og = ({
12683
12691
  items: l,
12684
12692
  selectedRowKeys: F
12685
12693
  }), L = Q(() => {
12686
- const { title: Te } = a.get(c) || {};
12687
- return Te || o.label;
12694
+ const { title: we } = a.get(c) || {};
12695
+ return we || o.label;
12688
12696
  }, [c, o.label, a]), D = o.type === "many2many", W = O(
12689
- (Te) => {
12697
+ (we) => {
12690
12698
  var ce, je;
12691
12699
  r == null || r({
12692
12700
  fields: ((ce = a.get("form")) == null ? void 0 : ce.fields) || ((je = a.get("tree")) == null ? void 0 : je.fields),
12693
- items: Te
12701
+ items: we
12694
12702
  });
12695
12703
  },
12696
12704
  [r, a]
@@ -12707,7 +12715,7 @@ const Og = ({
12707
12715
  context: b,
12708
12716
  triggerChange: W
12709
12717
  }), {
12710
- showFormModal: we,
12718
+ showFormModal: Se,
12711
12719
  modalItem: B,
12712
12720
  continuousEntryMode: U,
12713
12721
  onCancelFormModal: me,
@@ -12747,24 +12755,24 @@ const Og = ({
12747
12755
  selectedRowKeys: F,
12748
12756
  setSelectedRowKeys: P
12749
12757
  }), Ye = () => {
12750
- const Te = Array.from(a.keys()), ce = Te[(Te.indexOf(c) + 1) % Te.length];
12758
+ const we = Array.from(a.keys()), ce = we[(we.indexOf(c) + 1) % we.length];
12751
12759
  c === "form" ? ne(() => {
12752
12760
  d(ce);
12753
12761
  }) : d(ce);
12754
- }, Ce = At(
12755
- (Te) => {
12762
+ }, xe = At(
12763
+ (we) => {
12756
12764
  var ce;
12757
- (ce = a.get("form")) != null && ce.fields && Z(Te);
12765
+ (ce = a.get("form")) != null && ce.fields && Z(we);
12758
12766
  },
12759
12767
  // eslint-disable-next-line react-hooks/exhaustive-deps
12760
12768
  [l]
12761
- ), xe = O(() => {
12769
+ ), Te = O(() => {
12762
12770
  f > 0 && (c === "form" ? ne(() => {
12763
12771
  u(f - 1);
12764
12772
  }) : u(f - 1));
12765
12773
  }, [c, f, u, ne]), fe = O(() => {
12766
- const Te = l.length;
12767
- f < Te - 1 && (c === "form" ? ne(() => {
12774
+ const we = l.length;
12775
+ f < we - 1 && (c === "form" ? ne(() => {
12768
12776
  u(f + 1);
12769
12777
  }) : u(f + 1));
12770
12778
  }, [
@@ -12774,8 +12782,8 @@ const Og = ({
12774
12782
  u,
12775
12783
  ne
12776
12784
  ]), De = Q(() => {
12777
- var Te;
12778
- return ((Te = a.get("form")) == null ? void 0 : Te.fields) !== void 0;
12785
+ var we;
12786
+ return ((we = a.get("form")) == null ? void 0 : we.fields) !== void 0;
12779
12787
  }, [a]);
12780
12788
  return /* @__PURE__ */ N(ie, { children: [
12781
12789
  /* @__PURE__ */ s(
@@ -12793,7 +12801,7 @@ const Og = ({
12793
12801
  onDelete: ke,
12794
12802
  onCreateItem: oe,
12795
12803
  onToggleViewMode: Ye,
12796
- onPreviousItem: xe,
12804
+ onPreviousItem: Te,
12797
12805
  onNextItem: fe,
12798
12806
  onSearchItem: be,
12799
12807
  selectedRowKeys: F,
@@ -12803,7 +12811,8 @@ const Og = ({
12803
12811
  context: { ..._ == null ? void 0 : _(), ...b },
12804
12812
  formRef: x,
12805
12813
  onRefreshParentValues: () => {
12806
- C == null || C({ forceRefresh: !0 });
12814
+ var we;
12815
+ C == null || C({ forceRefresh: !0 }), (we = t.current) == null || we.refresh();
12807
12816
  }
12808
12817
  }
12809
12818
  ),
@@ -12817,7 +12826,7 @@ const Og = ({
12817
12826
  onFetchRecords: S,
12818
12827
  ooui: k,
12819
12828
  context: b,
12820
- onRowDoubleClick: Ce,
12829
+ onRowDoubleClick: xe,
12821
12830
  showPointerCursorInRows: De,
12822
12831
  onRowSelectionChange: P,
12823
12832
  relation: h,
@@ -12854,14 +12863,15 @@ const Og = ({
12854
12863
  submitMode: "2many",
12855
12864
  values: B == null ? void 0 : B.values,
12856
12865
  defaultValues: B == null ? void 0 : B.defaultValues,
12857
- visible: we,
12866
+ visible: Se,
12858
12867
  onSubmitSucceed: ee,
12859
12868
  parentContext: b,
12860
12869
  onCancel: me,
12861
12870
  readOnly: p,
12862
12871
  mustClearAfterSave: U,
12863
12872
  onMustRefreshParent: () => {
12864
- C == null || C({ forceRefresh: !0 });
12873
+ var we;
12874
+ C == null || C({ forceRefresh: !0 }), (we = t.current) == null || we.refresh();
12865
12875
  }
12866
12876
  }
12867
12877
  ),
@@ -14126,7 +14136,7 @@ function Cy({ toolbar: e }) {
14126
14136
  ),
14127
14137
  initialViewType: "form"
14128
14138
  }));
14129
- }, [g, c, E]), we = O(async () => {
14139
+ }, [g, c, E]), Se = O(async () => {
14130
14140
  const U = await In({ onFormSave: c });
14131
14141
  U.succeed && (E == null || E({
14132
14142
  ...di(
@@ -14274,7 +14284,7 @@ function Cy({ toolbar: e }) {
14274
14284
  disabled: H,
14275
14285
  attachments: T,
14276
14286
  onAddNewAttachment: X,
14277
- onListAllAttachments: we,
14287
+ onListAllAttachments: Se,
14278
14288
  onViewAttachmentDetails: B
14279
14289
  }
14280
14290
  ),
@@ -14854,7 +14864,7 @@ function My(e, t) {
14854
14864
  order: _
14855
14865
  } = e, [C, x] = I(), [R, T] = I([]), [b, A] = I(!0), k = p || void 0, [S, F] = I(
14856
14866
  k
14857
- ), [P, E] = I([]), [H, V] = I(), [$, L] = I([]), [D, W] = I(), [G, j] = I(0), [ne, X] = I(!1), [we, B] = I(!1), [U, me] = I(), { t: ee } = ge(), oe = z(), Z = z(), re = ae(
14867
+ ), [P, E] = I([]), [H, V] = I(), [$, L] = I([]), [D, W] = I(), [G, j] = I(0), [ne, X] = I(!1), [Se, B] = I(!1), [U, me] = I(), { t: ee } = ge(), oe = z(), Z = z(), re = ae(
14858
14868
  Rt
14859
14869
  ), {
14860
14870
  setCurrentView: Y,
@@ -14862,7 +14872,7 @@ function My(e, t) {
14862
14872
  tabs: be,
14863
14873
  activeKey: ke,
14864
14874
  openAction: Ye,
14865
- onRemoveTab: Ce
14875
+ onRemoveTab: xe
14866
14876
  } = re || {};
14867
14877
  an(
14868
14878
  "ctrl+g,command+g",
@@ -14872,7 +14882,7 @@ function My(e, t) {
14872
14882
  { enableOnFormTags: !0, preventDefault: !0 },
14873
14883
  [ke, be, C, H, $]
14874
14884
  );
14875
- function xe(ce) {
14885
+ function Te(ce) {
14876
14886
  F(ce), K == null || K(ce);
14877
14887
  }
14878
14888
  const fe = O(
@@ -14977,7 +14987,7 @@ Please, make sure the view ids on the fields_view_get responses are the same as
14977
14987
  action_id: h,
14978
14988
  action_type: m
14979
14989
  })
14980
- ), Ce == null || Ce(c)), fe(Ne), T(ce), A(!1);
14990
+ ), xe == null || xe(c)), fe(Ne), T(ce), A(!1);
14981
14991
  }, [
14982
14992
  d,
14983
14993
  fe,
@@ -14988,12 +14998,12 @@ Please, make sure the view ids on the fields_view_get responses are the same as
14988
14998
  m,
14989
14999
  i,
14990
15000
  y,
14991
- Ce,
15001
+ xe,
14992
15002
  c
14993
15003
  ]);
14994
15004
  l({ tabKey: c, canWeClose: Ie }), Ft(() => {
14995
15005
  const ce = R.find((Oe) => Oe.type === "tree"), je = R.find((Oe) => d.id ? Oe.type === d.type && Oe.view_id === d.id : Oe.type === d.type);
14996
- fe(je || ce), p ? K == null || K(k) : (xe(void 0), V(void 0)), De();
15006
+ fe(je || ce), p ? K == null || K(k) : (Te(void 0), V(void 0)), De();
14997
15007
  }, [r, a, p]), Ft(() => {
14998
15008
  if (ke === c) {
14999
15009
  K == null || K(S);
@@ -15033,7 +15043,7 @@ Please, make sure the view ids on the fields_view_get responses are the same as
15033
15043
  } else
15034
15044
  Oe = "tree", Ne = [["id", "in", ce]];
15035
15045
  if (B(!1), X(!1), je && Oe === "form") {
15036
- xe(ce[0]);
15046
+ Te(ce[0]);
15037
15047
  const Ae = R.find(
15038
15048
  (de) => de.type === "form"
15039
15049
  );
@@ -15054,11 +15064,11 @@ Please, make sure the view ids on the fields_view_get responses are the same as
15054
15064
  });
15055
15065
  }
15056
15066
  }
15057
- function Te() {
15067
+ function we() {
15058
15068
  if (S === void 0 && C.type === "form")
15059
15069
  oe.current.clearAndReload();
15060
15070
  else {
15061
- xe(void 0);
15071
+ Te(void 0);
15062
15072
  const ce = R.find(
15063
15073
  (je) => je.type === "form"
15064
15074
  );
@@ -15074,9 +15084,9 @@ Please, make sure the view ids on the fields_view_get responses are the same as
15074
15084
  availableViews: R,
15075
15085
  formRef: oe,
15076
15086
  searchTreeRef: Z,
15077
- onNewClicked: Te,
15087
+ onNewClicked: we,
15078
15088
  currentId: S,
15079
- setCurrentId: xe,
15089
+ setCurrentId: Te,
15080
15090
  setCurrentItemIndex: V,
15081
15091
  currentItemIndex: H,
15082
15092
  results: $,
@@ -15116,7 +15126,7 @@ Please, make sure the view ids on the fields_view_get responses are the same as
15116
15126
  searchTreeRef: Z,
15117
15127
  searchTreeNameSearch: U,
15118
15128
  setCurrentView: fe,
15119
- setCurrentId: xe
15129
+ setCurrentId: Te
15120
15130
  }
15121
15131
  ),
15122
15132
  /* @__PURE__ */ s(
@@ -15124,7 +15134,7 @@ Please, make sure the view ids on the fields_view_get responses are the same as
15124
15134
  {
15125
15135
  visible: ne,
15126
15136
  onIdSubmitted: Be,
15127
- isSearching: we,
15137
+ isSearching: Se,
15128
15138
  onCancel: () => {
15129
15139
  X(!1);
15130
15140
  }
@@ -15280,9 +15290,9 @@ function By(e) {
15280
15290
  fields: { ...m.fields, ...g.fields }
15281
15291
  });
15282
15292
  G(!1), S(Ye);
15283
- const Ce = await K();
15284
- A(Ce);
15285
- }, we = async () => {
15293
+ const xe = await K();
15294
+ A(xe);
15295
+ }, Se = async () => {
15286
15296
  try {
15287
15297
  G(!0), await X();
15288
15298
  } catch (Z) {
@@ -15290,7 +15300,7 @@ function By(e) {
15290
15300
  }
15291
15301
  };
15292
15302
  le(() => {
15293
- f && i && we();
15303
+ f && i && Se();
15294
15304
  }, [w, C, f, i]);
15295
15305
  const B = async (Z) => {
15296
15306
  u(!1), d(!0), D(void 0);
@@ -15520,7 +15530,7 @@ function Wy(e, t) {
15520
15530
  description: j,
15521
15531
  views: ne,
15522
15532
  model: X,
15523
- context: we,
15533
+ context: Se,
15524
15534
  domain: B,
15525
15535
  initialView: U,
15526
15536
  limit: me
@@ -15541,7 +15551,7 @@ function Wy(e, t) {
15541
15551
  (be) => be[1] === "graph"
15542
15552
  )[0][0],
15543
15553
  model: X,
15544
- context: we,
15554
+ context: Se,
15545
15555
  domain: B,
15546
15556
  limit: me
15547
15557
  },
@@ -15566,13 +15576,13 @@ function Wy(e, t) {
15566
15576
  if (K) {
15567
15577
  const [be, ke] = K, {
15568
15578
  actionId: Ye,
15569
- actionType: Ce,
15570
- title: xe,
15579
+ actionType: xe,
15580
+ title: Te,
15571
15581
  model: fe
15572
15582
  } = E, De = {
15573
15583
  action_id: Ye,
15574
- action_type: Ce,
15575
- name: xe,
15584
+ action_type: xe,
15585
+ name: Te,
15576
15586
  res_id: Y.id,
15577
15587
  res_model: fe,
15578
15588
  view_id: be,
@@ -15595,7 +15605,7 @@ function Wy(e, t) {
15595
15605
  title: G,
15596
15606
  views: ne,
15597
15607
  model: X,
15598
- context: we,
15608
+ context: Se,
15599
15609
  domain: B,
15600
15610
  setCanWeClose: () => {
15601
15611
  },
@@ -15615,14 +15625,14 @@ function Wy(e, t) {
15615
15625
  actionId: be,
15616
15626
  actionType: ke,
15617
15627
  title: Ye,
15618
- model: Ce
15628
+ model: xe
15619
15629
  } = E;
15620
15630
  Z = {
15621
15631
  action_id: be,
15622
15632
  action_type: ke,
15623
15633
  name: Ye,
15624
15634
  res_id: !1,
15625
- res_model: Ce,
15635
+ res_model: xe,
15626
15636
  view_id: Y,
15627
15637
  view_type: K,
15628
15638
  overrideUnsettedLimit: !0
@@ -16138,9 +16148,9 @@ function Tv(e, t) {
16138
16148
  views: j,
16139
16149
  name: ne,
16140
16150
  target: X,
16141
- view_type: we,
16151
+ view_type: Se,
16142
16152
  limit: B
16143
- } = P, U = we === "tree", me = [];
16153
+ } = P, U = Se === "tree", me = [];
16144
16154
  for (const oe of j) {
16145
16155
  const [Z, re] = oe;
16146
16156
  if (Z)
@@ -16224,7 +16234,7 @@ function Tv(e, t) {
16224
16234
  } = T, [D, W] = H[0], G = { id: D, type: W }, j = P, ne = Zt({
16225
16235
  context: j,
16226
16236
  values: { ...A, ...i }
16227
- }), X = E, we = E ? await M.getHandler().evalDomain({
16237
+ }), X = E, Se = E ? await M.getHandler().evalDomain({
16228
16238
  domain: E,
16229
16239
  values: pn({
16230
16240
  fields: b,
@@ -16238,7 +16248,7 @@ function Tv(e, t) {
16238
16248
  target: V,
16239
16249
  views: H,
16240
16250
  context: { ...l, ...ne },
16241
- domain: we,
16251
+ domain: Se,
16242
16252
  title: $,
16243
16253
  initialView: G,
16244
16254
  action_id: k,
@@ -16281,9 +16291,9 @@ function Tv(e, t) {
16281
16291
  views: j,
16282
16292
  name: ne,
16283
16293
  target: X,
16284
- view_type: we,
16294
+ view_type: Se,
16285
16295
  limit: B
16286
- } = V, U = we === "tree", me = [];
16296
+ } = V, U = Se === "tree", me = [];
16287
16297
  for (const re of j) {
16288
16298
  const [Y, K] = re;
16289
16299
  if (Y)
@@ -16364,7 +16374,7 @@ function Tv(e, t) {
16364
16374
  searchParams: j,
16365
16375
  currentPage: ne,
16366
16376
  order: X
16367
- } = T, we = Vo();
16377
+ } = T, Se = Vo();
16368
16378
  if (P !== "current" && P !== void 0) {
16369
16379
  const B = await M.getHandler().getView({
16370
16380
  model: k,
@@ -16393,7 +16403,7 @@ function Tv(e, t) {
16393
16403
  {
16394
16404
  action_id: H,
16395
16405
  action_type: V,
16396
- tabKey: we,
16406
+ tabKey: Se,
16397
16407
  title: F,
16398
16408
  views: S,
16399
16409
  model: k,
@@ -16411,7 +16421,7 @@ function Tv(e, t) {
16411
16421
  order: X
16412
16422
  }
16413
16423
  ),
16414
- key: we,
16424
+ key: Se,
16415
16425
  action: T
16416
16426
  });
16417
16427
  }