@gisce/react-ooui 1.1.35-rc.1 → 1.1.36-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.
@@ -1 +1 @@
1
- {"version":3,"file":"FormActionBar.d.ts","sourceRoot":"","sources":["FormActionBar.tsx"],"names":[],"mappings":";AA0CA,iBAAS,aAAa,CAAC,EAAE,OAAO,EAAE,EAAE;IAAE,OAAO,EAAE,GAAG,CAAA;CAAE,sBAsbnD;AAyBD,eAAe,aAAa,CAAC"}
1
+ {"version":3,"file":"FormActionBar.d.ts","sourceRoot":"","sources":["FormActionBar.tsx"],"names":[],"mappings":";AA0CA,iBAAS,aAAa,CAAC,EAAE,OAAO,EAAE,EAAE;IAAE,OAAO,EAAE,GAAG,CAAA;CAAE,sBAgbnD;AAmBD,eAAe,aAAa,CAAC"}
@@ -23383,9 +23383,8 @@ function FormActionBar({
23383
23383
  tooltip: S("actions"),
23384
23384
  items: e == null ? void 0 : e.action,
23385
23385
  onItemClick: async (k) => {
23386
- !k || !(await saveNewDocumentIfNeeded({
23387
- onFormSave: a,
23388
- currentId: u
23386
+ !k || !(await saveDocument({
23387
+ onFormSave: a
23389
23388
  })).succeed || B(k);
23390
23389
  }
23391
23390
  }), /* @__PURE__ */ jsx(DropdownButton, {
@@ -23396,9 +23395,8 @@ function FormActionBar({
23396
23395
  onItemClick: async (k) => {
23397
23396
  if (!k)
23398
23397
  return;
23399
- const $ = await saveNewDocumentIfNeeded({
23400
- onFormSave: a,
23401
- currentId: u
23398
+ const $ = await saveDocument({
23399
+ onFormSave: a
23402
23400
  });
23403
23401
  !$.succeed || B({
23404
23402
  ...k,
@@ -23414,9 +23412,8 @@ function FormActionBar({
23414
23412
  tooltip: S("related"),
23415
23413
  items: e == null ? void 0 : e.relate,
23416
23414
  onItemClick: async (k) => {
23417
- !k || !(await saveNewDocumentIfNeeded({
23418
- onFormSave: a,
23419
- currentId: u
23415
+ !k || !(await saveDocument({
23416
+ onFormSave: a
23420
23417
  })).succeed || D({
23421
23418
  relateData: k,
23422
23419
  values: _.current.getValues(),
@@ -23429,9 +23426,8 @@ function FormActionBar({
23429
23426
  disabled: U,
23430
23427
  attachments: x,
23431
23428
  onAddNewAttachment: async () => {
23432
- const k = await saveNewDocumentIfNeeded({
23433
- onFormSave: a,
23434
- currentId: u
23429
+ const k = await saveDocument({
23430
+ onFormSave: a
23435
23431
  });
23436
23432
  if (!k.succeed)
23437
23433
  return;
@@ -23449,9 +23445,8 @@ function FormActionBar({
23449
23445
  });
23450
23446
  },
23451
23447
  onListAllAttachments: async () => {
23452
- const k = await saveNewDocumentIfNeeded({
23453
- onFormSave: a,
23454
- currentId: u
23448
+ const k = await saveDocument({
23449
+ onFormSave: a
23455
23450
  });
23456
23451
  if (!k.succeed)
23457
23452
  return;
@@ -23463,9 +23458,8 @@ function FormActionBar({
23463
23458
  });
23464
23459
  },
23465
23460
  onViewAttachmentDetails: async (k) => {
23466
- !(await saveNewDocumentIfNeeded({
23467
- onFormSave: a,
23468
- currentId: u
23461
+ !(await saveDocument({
23462
+ onFormSave: a
23469
23463
  })).succeed || j({
23470
23464
  model: "ir.attachment",
23471
23465
  res_id: k.id,
@@ -23480,19 +23474,13 @@ function separator$2() {
23480
23474
  className: "inline-block w-2"
23481
23475
  });
23482
23476
  }
23483
- async function saveNewDocumentIfNeeded({
23484
- onFormSave: e,
23485
- currentId: t
23477
+ async function saveDocument({
23478
+ onFormSave: e
23486
23479
  }) {
23487
- if (t !== void 0)
23488
- return {
23489
- succeed: !0,
23490
- currentId: t
23491
- };
23492
- const r = await (e == null ? void 0 : e());
23493
- return r != null && r.succeed ? {
23480
+ const t = await (e == null ? void 0 : e());
23481
+ return t != null && t.succeed ? {
23494
23482
  succeed: !0,
23495
- currentId: r.id
23483
+ currentId: t.id
23496
23484
  } : {
23497
23485
  succeed: !1,
23498
23486
  currentId: void 0