eservices-core 1.0.480 → 1.0.481

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,5 +1,6 @@
1
1
  import EventEmitter from "jenesius-event-emitter";
2
2
  import { IListCell } from "./new/List";
3
+ import { Router } from "vue-router";
3
4
  export interface ICustomerContext {
4
5
  id: number;
5
6
  name: string;
@@ -24,6 +25,11 @@ declare class ApplicationManager extends EventEmitter {
24
25
  */
25
26
  contextId?: number;
26
27
  get contextType(): 'person' | 'organization' | undefined;
28
+ set router(v: Router);
29
+ /**
30
+ * @description VueRouter of Application
31
+ * */
32
+ get router(): Router;
27
33
  set type(type: ApplicationType);
28
34
  get type(): ApplicationType;
29
35
  get isBack(): boolean;
@@ -8,5 +8,23 @@ export default function useFormAction(form: Form, options?: IActionOptions): {
8
8
  };
9
9
  interface IActionOptions {
10
10
  ModalValidationResult?: any;
11
+ handleAffectedEntities?: (entities: IActionResult['affectedEntities']) => void;
12
+ }
13
+ interface IActionResult {
14
+ code: number;
15
+ success: boolean;
16
+ message: string;
17
+ validationEffect: {
18
+ results: IActionValidationEffect[];
19
+ };
20
+ affectedEntities: {
21
+ created: boolean;
22
+ deleted: boolean;
23
+ name: string;
24
+ primaryKey: Record<string, any>;
25
+ updated: boolean;
26
+ }[];
27
+ }
28
+ interface IActionValidationEffect {
11
29
  }
12
30
  export {};
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * eservices-core v1.0.480
2
+ * eservices-core v1.0.481
3
3
  * (c) 2023 ESERVICES
4
4
  */
5
5
  'use strict';
@@ -4864,10 +4864,11 @@ class clientService {
4864
4864
  }
4865
4865
  }
4866
4866
 
4867
- var _type, _ready;
4867
+ var _router, _type, _ready;
4868
4868
  class ApplicationManager extends EventEmitter {
4869
4869
  constructor() {
4870
4870
  super(...arguments);
4871
+ _router.set(this, void 0);
4871
4872
  /**
4872
4873
  * @description Office type. By Default is front
4873
4874
  * */
@@ -4889,6 +4890,17 @@ class ApplicationManager extends EventEmitter {
4889
4890
  return 'person';
4890
4891
  return 'organization';
4891
4892
  }
4893
+ set router(v) {
4894
+ __classPrivateFieldSet(this, _router, v);
4895
+ }
4896
+ /**
4897
+ * @description VueRouter of Application
4898
+ * */
4899
+ get router() {
4900
+ if (!__classPrivateFieldGet(this, _router))
4901
+ throw new Error('Router was not founded. Please set router: Manager.router = router: VueRouter');
4902
+ return __classPrivateFieldGet(this, _router);
4903
+ }
4892
4904
  set type(type) {
4893
4905
  __classPrivateFieldSet(this, _type, type);
4894
4906
  }
@@ -4982,7 +4994,7 @@ class ApplicationManager extends EventEmitter {
4982
4994
  localStorage.setItem(this.getListKeyById(id), JSON.stringify(info));
4983
4995
  }
4984
4996
  }
4985
- _type = new WeakMap(), _ready = new WeakMap();
4997
+ _router = new WeakMap(), _type = new WeakMap(), _ready = new WeakMap();
4986
4998
  ApplicationManager.EVENT_CONTEXT_UPDATE = 'event:context-update';
4987
4999
  ApplicationManager.EVENT_READY_UPDATE = 'event:ready-update';
4988
5000
  ApplicationManager.EVENT_DATA_UPDATE = 'event:data-update';
@@ -5307,6 +5319,12 @@ function useFormAction(form, options) {
5307
5319
  }
5308
5320
  throw new Error();
5309
5321
  }
5322
+ return result;
5323
+ })
5324
+ .then(data => {
5325
+ if (options === null || options === void 0 ? void 0 : options.handleAffectedEntities) {
5326
+ options.handleAffectedEntities(data.affectedEntities);
5327
+ }
5310
5328
  })
5311
5329
  .then(() => form.read());
5312
5330
  return fn();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eservices-core",
3
- "version": "1.0.480",
3
+ "version": "1.0.481",
4
4
  "description": "Core library",
5
5
  "author": "",
6
6
  "scripts": {