@gisce/react-ooui 1.1.57 → 1.1.58-rc.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"ContentRootContext.d.ts","sourceRoot":"","sources":["ContentRootContext.tsx"],"names":[],"mappings":"AACA,OAAO,KAMN,MAAM,OAAO,CAAC;AAcf,oBAAY,sBAAsB,GAAG;IACnC,aAAa,EAAE,CAAC,EACd,UAAU,EACV,MAAM,EACN,MAAM,EACN,OAAO,GACR,EAAE;QACD,UAAU,EAAE,GAAG,CAAC;QAChB,MAAM,EAAE,GAAG,CAAC;QACZ,MAAM,EAAE,GAAG,CAAC;QACZ,OAAO,CAAC,EAAE,GAAG,CAAC;QACd,qBAAqB,CAAC,EAAE,MAAM,IAAI,CAAC;KACpC,KAAK,OAAO,CAAC,GAAG,CAAC,CAAC;IACnB,YAAY,CAAC,EAAE,GAAG,CAAC;CACpB,CAAC;AAUF,eAAO,MAAM,kBAAkB,8CAC2B,CAAC;AAE3D,aAAK,wBAAwB,GAAG;IAC9B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,YAAY,CAAC,EAAE,GAAG,CAAC;CACpB,CAAC;;AA8WF,wBAA+C"}
1
+ {"version":3,"file":"ContentRootContext.d.ts","sourceRoot":"","sources":["ContentRootContext.tsx"],"names":[],"mappings":"AACA,OAAO,KAMN,MAAM,OAAO,CAAC;AAcf,oBAAY,sBAAsB,GAAG;IACnC,aAAa,EAAE,CAAC,EACd,UAAU,EACV,MAAM,EACN,MAAM,EACN,OAAO,GACR,EAAE;QACD,UAAU,EAAE,GAAG,CAAC;QAChB,MAAM,EAAE,GAAG,CAAC;QACZ,MAAM,EAAE,GAAG,CAAC;QACZ,OAAO,CAAC,EAAE,GAAG,CAAC;QACd,qBAAqB,CAAC,EAAE,MAAM,IAAI,CAAC;KACpC,KAAK,OAAO,CAAC,GAAG,CAAC,CAAC;IACnB,YAAY,CAAC,EAAE,GAAG,CAAC;CACpB,CAAC;AAUF,eAAO,MAAM,kBAAkB,8CAC2B,CAAC;AAE3D,aAAK,wBAAwB,GAAG;IAC9B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,YAAY,CAAC,EAAE,GAAG,CAAC;CACpB,CAAC;;AAkZF,wBAA+C"}
@@ -13507,34 +13507,21 @@ const transformPlainMany2Ones = ({
13507
13507
  context: $
13508
13508
  }), {};
13509
13509
  } else {
13510
- let N;
13511
- const L = A.view_mode.split(","), I = [];
13512
- for (const W of L) {
13513
- const z = await ConnectionProvider.getHandler().getView({
13514
- model: A.res_model,
13515
- type: W,
13516
- context: $
13517
- });
13518
- I.push([z.view_id, W]);
13519
- }
13520
- if (A.view_id)
13521
- N = {
13522
- id: A.view_id,
13523
- type: A.view_mode.split(",")[0]
13524
- };
13525
- else {
13526
- const W = A.view_mode.split(",")[0], [z] = I.find(([Y, H]) => H === W);
13527
- N = {
13528
- id: z,
13529
- type: W
13530
- };
13531
- }
13510
+ const {
13511
+ initialView: N,
13512
+ views: L
13513
+ } = await getViewsAndInitialView({
13514
+ model: A.res_model,
13515
+ context: $,
13516
+ view_mode: A.view_mode,
13517
+ views: A.views
13518
+ });
13532
13519
  return c == null || c({
13533
13520
  target: "current",
13534
13521
  context: $,
13535
13522
  domain: D,
13536
13523
  model: A.res_model,
13537
- views: I,
13524
+ views: L,
13538
13525
  title: A.name,
13539
13526
  initialView: N,
13540
13527
  action_id: A.id,
@@ -13634,7 +13621,64 @@ const transformPlainMany2Ones = ({
13634
13621
  })
13635
13622
  })
13636
13623
  });
13637
- }, ContentRootProvider$1 = forwardRef(ContentRootProvider), WIDTH_BREAKPOINT = 800;
13624
+ };
13625
+ async function getViewsAndInitialView({
13626
+ views: e,
13627
+ view_mode: t,
13628
+ model: r,
13629
+ context: n,
13630
+ view_id: a
13631
+ }) {
13632
+ const o = [];
13633
+ let s;
13634
+ if (e)
13635
+ for (const u of e) {
13636
+ const l = await ConnectionProvider.getHandler().getView({
13637
+ model: r,
13638
+ type: u[1],
13639
+ id: u[0],
13640
+ context: n
13641
+ });
13642
+ o.push([l.view_id, u[1]]);
13643
+ }
13644
+ else {
13645
+ const u = t.split(",");
13646
+ for (const l of u) {
13647
+ const c = await ConnectionProvider.getHandler().getView({
13648
+ model: r,
13649
+ type: l,
13650
+ context: n
13651
+ });
13652
+ o.push([c.view_id, l]);
13653
+ }
13654
+ }
13655
+ if (e && e.length > 0) {
13656
+ const {
13657
+ id: u,
13658
+ type: l
13659
+ } = e[0];
13660
+ s = {
13661
+ id: u,
13662
+ type: l
13663
+ };
13664
+ } else if (a)
13665
+ s = {
13666
+ id: a,
13667
+ type: t.split(",")[0]
13668
+ };
13669
+ else {
13670
+ const u = t.split(",")[0], [l] = e.find(([c, d]) => d === u);
13671
+ s = {
13672
+ id: l,
13673
+ type: u
13674
+ };
13675
+ }
13676
+ return {
13677
+ views: o,
13678
+ initialView: s
13679
+ };
13680
+ }
13681
+ const ContentRootProvider$1 = forwardRef(ContentRootProvider), WIDTH_BREAKPOINT = 800;
13638
13682
  function Form(e, t) {
13639
13683
  const {
13640
13684
  model: r,