@gisce/react-ooui 1.1.11 → 1.1.13-rc.0

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.
@@ -27836,7 +27836,10 @@ const TreeActionView = (e) => {
27836
27836
  setCurrentView: f,
27837
27837
  availableViews: p,
27838
27838
  searchTreeNameSearch: h
27839
- } = e;
27839
+ } = e, {
27840
+ currentView: m,
27841
+ setPreviousView: v
27842
+ } = useContext(ActionViewContext);
27840
27843
  return t ? /* @__PURE__ */ jsxs(Fragment, {
27841
27844
  children: [/* @__PURE__ */ jsx(TitleHeader, {
27842
27845
  children: /* @__PURE__ */ jsx(TreeActionBar, {
@@ -27853,15 +27856,15 @@ const TreeActionView = (e) => {
27853
27856
  formView: a,
27854
27857
  treeView: s,
27855
27858
  domain: c,
27856
- onRowClicked: (m) => {
27859
+ onRowClicked: (x) => {
27857
27860
  const {
27858
- id: v
27859
- } = m;
27860
- d(v);
27861
- const x = u.findIndex((g) => g.id === v);
27862
- l(x);
27863
- const I = p.find((g) => g.type === "form");
27864
- f(I);
27861
+ id: I
27862
+ } = x;
27863
+ d(I);
27864
+ const g = u.findIndex((y) => y.id === I);
27865
+ v == null || v(m), l(g);
27866
+ const C = p.find((y) => y.type === "form");
27867
+ f(C);
27865
27868
  }
27866
27869
  })]
27867
27870
  }) : null;
@@ -28728,56 +28731,68 @@ function Dashboard(e, t) {
28728
28731
  };
28729
28732
  }
28730
28733
  let H = null;
28731
- (W == null ? void 0 : W.type) === "graph" ? H = /* @__PURE__ */ jsx(Graph, {
28732
- view_id: B.filter((j) => j[1] === "graph")[0][0],
28733
- model: U,
28734
- context: G,
28735
- domain: z,
28736
- limit: Z
28737
- }) : (W == null ? void 0 : W.type) === "form" ? H = /* @__PURE__ */ jsx(DashboardForm, {
28738
- model: U,
28739
- actionDomain: z
28740
- }) : (W == null ? void 0 : W.type) === "tree" ? H = /* @__PURE__ */ jsx(DashboardTree, {
28741
- model: U,
28742
- domain: z,
28743
- view_id: B.filter((j) => j[1] === "tree")[0][0],
28744
- onRowClicked: (j) => {
28745
- const K = B.find((X) => {
28746
- const [, F] = X;
28747
- return F === "form";
28748
- });
28749
- if (K) {
28750
- const [X, F] = K, {
28751
- actionId: T,
28752
- actionType: Y,
28753
- title: Q,
28754
- model: ne
28755
- } = S, J = {
28756
- action_id: T,
28757
- action_type: Y,
28758
- name: Q,
28759
- res_id: j.id,
28760
- res_model: ne,
28761
- view_id: X,
28762
- view_type: F
28763
- };
28764
- h(J);
28734
+ if ((W == null ? void 0 : W.type) === "graph")
28735
+ H = /* @__PURE__ */ jsx(Graph, {
28736
+ view_id: B.filter((j) => j[1] === "graph")[0][0],
28737
+ model: U,
28738
+ context: G,
28739
+ domain: z,
28740
+ limit: Z
28741
+ });
28742
+ else if ((W == null ? void 0 : W.type) === "form")
28743
+ H = /* @__PURE__ */ jsx(DashboardForm, {
28744
+ model: U,
28745
+ actionDomain: z
28746
+ });
28747
+ else if ((W == null ? void 0 : W.type) === "tree")
28748
+ H = /* @__PURE__ */ jsx(DashboardTree, {
28749
+ model: U,
28750
+ domain: z,
28751
+ view_id: B.filter((j) => j[1] === "tree")[0][0],
28752
+ onRowClicked: (j) => {
28753
+ const K = B.find((X) => {
28754
+ const [, F] = X;
28755
+ return F === "form";
28756
+ });
28757
+ if (K) {
28758
+ const [X, F] = K, {
28759
+ actionId: T,
28760
+ actionType: Y,
28761
+ title: Q,
28762
+ model: ne
28763
+ } = S, J = {
28764
+ action_id: T,
28765
+ action_type: Y,
28766
+ name: Q,
28767
+ res_id: j.id,
28768
+ res_model: ne,
28769
+ view_id: X,
28770
+ view_type: F
28771
+ };
28772
+ h(J);
28773
+ }
28765
28774
  }
28766
- }
28767
- }) : W !== void 0 && (H = /* @__PURE__ */ jsx(ActionView$1, {
28768
- action_id: M,
28769
- action_type: L,
28770
- tabKey: q,
28771
- title: $,
28772
- views: B,
28773
- model: U,
28774
- context: G,
28775
- domain: z,
28776
- setCanWeClose: () => {
28777
- },
28778
- initialView: W,
28779
- limit: Z
28780
- }));
28775
+ });
28776
+ else if (W !== void 0) {
28777
+ const j = W && Array.isArray(W.id) ? {
28778
+ ...W,
28779
+ id: W.id[0]
28780
+ } : W;
28781
+ H = /* @__PURE__ */ jsx(ActionView$1, {
28782
+ action_id: M,
28783
+ action_type: L,
28784
+ tabKey: q,
28785
+ title: $,
28786
+ views: B,
28787
+ model: U,
28788
+ context: G,
28789
+ domain: z,
28790
+ setCanWeClose: () => {
28791
+ },
28792
+ initialView: j,
28793
+ limit: Z
28794
+ });
28795
+ }
28781
28796
  let P;
28782
28797
  const A = B.find((j) => {
28783
28798
  const [, K] = j;
@@ -29404,7 +29419,11 @@ function RootView(e, t) {
29404
29419
  view_id: U.view_id
29405
29420
  }
29406
29421
  });
29407
- } else
29422
+ } else {
29423
+ const U = S && Array.isArray(S.id) ? {
29424
+ ...S,
29425
+ id: S.id[0]
29426
+ } : S;
29408
29427
  v({
29409
29428
  title: w,
29410
29429
  action: {
@@ -29424,7 +29443,7 @@ function RootView(e, t) {
29424
29443
  },
29425
29444
  domain: y,
29426
29445
  setCanWeClose: h,
29427
- initialView: S,
29446
+ initialView: U,
29428
29447
  res_id: D,
29429
29448
  formDefaultValues: M,
29430
29449
  formForcedValues: L,
@@ -29433,6 +29452,7 @@ function RootView(e, t) {
29433
29452
  }),
29434
29453
  key: B
29435
29454
  });
29455
+ }
29436
29456
  }
29437
29457
  return /* @__PURE__ */ jsx(LocaleContextProvider, {
29438
29458
  lang: a,