eservices-core 1.0.443 → 1.0.445

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.
@@ -8,6 +8,7 @@ export interface ICustomerContext {
8
8
  interface IUserInformation {
9
9
  id: number;
10
10
  }
11
+ declare type ApplicationType = 'front' | 'back';
11
12
  declare class ApplicationManager extends EventEmitter {
12
13
  #private;
13
14
  static EVENT_CONTEXT_UPDATE: string;
@@ -21,6 +22,10 @@ declare class ApplicationManager extends EventEmitter {
21
22
  * @description Current customer id. If Application state is not ready - undefined.
22
23
  */
23
24
  contextId?: number;
25
+ set type(type: ApplicationType);
26
+ get type(): ApplicationType;
27
+ get isBack(): boolean;
28
+ get isFront(): boolean;
24
29
  /**
25
30
  * @description User information. Parent Object.
26
31
  */
@@ -19,6 +19,9 @@ export declare class List<T> extends EventEmitter {
19
19
  private array;
20
20
  constructor(params: IListParams);
21
21
  set wait(v: boolean);
22
+ /**
23
+ * @description Value is true if request is running
24
+ * */
22
25
  get wait(): boolean;
23
26
  get primaryKeys(): string[];
24
27
  /**
@@ -37,6 +40,7 @@ export declare class List<T> extends EventEmitter {
37
40
  * @description Получение значения ключа из объекта
38
41
  * */
39
42
  static getKey<T extends IDefaultListData>(data: T): number;
43
+ static hasKey(v: unknown): any;
40
44
  /**
41
45
  * @description Добавляет к массиву новые элементы.
42
46
  * */
@@ -75,7 +79,13 @@ export declare class List<T> extends EventEmitter {
75
79
  static GetFieldNames<T extends {
76
80
  name?: string | string[];
77
81
  }>(config: T[]): string[];
82
+ /**
83
+ * @description Put ROW_KEY to data. Override keu if data include key.
84
+ * */
78
85
  static mergeWithKey(data: any, key: number): any;
86
+ /**
87
+ * @description Methods using for get name from cell config.
88
+ * */
79
89
  static getCellName<T extends Pick<ListCell, 'name'>>(cell: T): string;
80
90
  /**
81
91
  * @description Получение стандартной информации из ячейки и значений. {name, value}
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * eservices-core v1.0.443
2
+ * eservices-core v1.0.445
3
3
  * (c) 2022 ESERVICES
4
4
  */
5
5
  'use strict';
@@ -2753,6 +2753,9 @@ class List$1 extends EventEmitter {
2753
2753
  __classPrivateFieldSet(this, _wait, v);
2754
2754
  this.emit(jenesiusVueForm.Form.EVENT_WAIT, __classPrivateFieldGet(this, _wait));
2755
2755
  }
2756
+ /**
2757
+ * @description Value is true if request is running
2758
+ * */
2756
2759
  get wait() {
2757
2760
  return __classPrivateFieldGet(this, _wait);
2758
2761
  }
@@ -2783,6 +2786,11 @@ class List$1 extends EventEmitter {
2783
2786
  static getKey(data) {
2784
2787
  return data[LIST_ROW_KEY];
2785
2788
  }
2789
+ static hasKey(v) {
2790
+ if (typeof v !== "object" || v === null)
2791
+ return false;
2792
+ return Object.prototype.hasOwnProperty.call(v, LIST_ROW_KEY);
2793
+ }
2786
2794
  /**
2787
2795
  * @description Добавляет к массиву новые элементы.
2788
2796
  * */
@@ -2871,9 +2879,15 @@ class List$1 extends EventEmitter {
2871
2879
  return acc;
2872
2880
  }, []);
2873
2881
  }
2882
+ /**
2883
+ * @description Put ROW_KEY to data. Override keu if data include key.
2884
+ * */
2874
2885
  static mergeWithKey(data, key) {
2875
2886
  return Object.assign(Object.assign({}, data), { [LIST_ROW_KEY]: key });
2876
2887
  }
2888
+ /**
2889
+ * @description Methods using for get name from cell config.
2890
+ * */
2877
2891
  static getCellName(cell) {
2878
2892
  if (typeof cell.name === "string")
2879
2893
  return cell.name;
@@ -3132,7 +3146,7 @@ var script$m = /*#__PURE__*/ vue.defineComponent({
3132
3146
  /**
3133
3147
  * @description Если в новых данных отсутвует RowKey
3134
3148
  * */
3135
- const isNew = vue.computed(() => !props.values && !List$1.getKey(props.values));
3149
+ const isNew = vue.computed(() => !props.values && !List$1.hasKey(props.values));
3136
3150
  return (_ctx, _cache) => {
3137
3151
  return (vue.openBlock(), vue.createElementBlock("tr", _hoisted_1$h, [
3138
3152
  vue.createElementVNode("td", { colspan: __props.rowLength }, [
@@ -4715,10 +4729,14 @@ class clientService {
4715
4729
  }
4716
4730
  }
4717
4731
 
4718
- var _ready;
4732
+ var _type, _ready;
4719
4733
  class ApplicationManager extends EventEmitter {
4720
4734
  constructor() {
4721
4735
  super(...arguments);
4736
+ /**
4737
+ * @description Office type. By Default is front
4738
+ * */
4739
+ _type.set(this, 'front');
4722
4740
  /**
4723
4741
  * @description List of organizations
4724
4742
  */
@@ -4728,6 +4746,18 @@ class ApplicationManager extends EventEmitter {
4728
4746
  */
4729
4747
  _ready.set(this, false);
4730
4748
  }
4749
+ set type(type) {
4750
+ __classPrivateFieldSet(this, _type, type);
4751
+ }
4752
+ get type() {
4753
+ return __classPrivateFieldGet(this, _type);
4754
+ }
4755
+ get isBack() {
4756
+ return this.type === 'back';
4757
+ }
4758
+ get isFront() {
4759
+ return this.type === 'front';
4760
+ }
4731
4761
  set ready(v) {
4732
4762
  __classPrivateFieldSet(this, _ready, v);
4733
4763
  this.emit(ApplicationManager.EVENT_READY_UPDATE, v);
@@ -4799,7 +4829,7 @@ class ApplicationManager extends EventEmitter {
4799
4829
  return !!this.organizations.find(org => org.id === id);
4800
4830
  }
4801
4831
  }
4802
- _ready = new WeakMap();
4832
+ _type = new WeakMap(), _ready = new WeakMap();
4803
4833
  ApplicationManager.EVENT_CONTEXT_UPDATE = 'event:context-update';
4804
4834
  ApplicationManager.EVENT_READY_UPDATE = 'event:ready-update';
4805
4835
  ApplicationManager.EVENT_DATA_UPDATE = 'event:data-update';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eservices-core",
3
- "version": "1.0.443",
3
+ "version": "1.0.445",
4
4
  "description": "Core library",
5
5
  "author": "",
6
6
  "scripts": {