eservices-core 1.0.595 → 1.0.597

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.
@@ -101,16 +101,25 @@ export interface MetadataField {
101
101
  }
102
102
  export declare type MetadataResponse = Metadata & {
103
103
  _filter: string;
104
+ metadataByEntityId?: number;
104
105
  };
105
- export interface CustomCriterion {
106
- "name": string;
107
- "expression": {
108
- "equal"?: [string, string];
106
+ export interface NamedCriterion {
107
+ name: string;
108
+ "expression"?: {
109
+ "equal"?: [CustomCriterionEqualItem, CustomCriterionEqualItem];
109
110
  };
110
111
  }
112
+ export declare type MasterNamedCriterion = NamedCriterion & MasterEntityCriterion;
113
+ export interface FieldsCriterion {
114
+ fields: string[];
115
+ }
116
+ export declare type MasterFieldsCriterion = FieldsCriterion & MasterEntityCriterion;
117
+ export declare type CustomCriterionEqualItem = string | RefCriterionItem;
118
+ export declare type RefCriterionItem = {
119
+ value: string | number | null;
120
+ };
111
121
  export interface MasterEntityCriterion {
112
122
  entity: string;
113
- fields: string[];
114
123
  }
115
- export declare type CriterionItem = string | CustomCriterion | MasterEntityCriterion;
124
+ export declare type CriterionItem = string | NamedCriterion | MasterNamedCriterion | FieldsCriterion | MasterFieldsCriterion;
116
125
  export declare type CriterionGroup = (CriterionItem | CriterionItem[])[];
@@ -1,24 +1,23 @@
1
1
  declare const _default: {
2
2
  /**
3
- * @description Array of current cards.
3
+ * @description Хранилище текущих активных уведомлений. Если уведомление не активно (время жизни его вышло) - оно уд
4
+ * аляется из массива безвозвратно.
4
5
  */
5
6
  store: {
6
7
  id: number;
7
- type: "error" | "warning" | "info";
8
+ type: NotificationType;
8
9
  msg: string;
9
- children: string[];
10
10
  timeout: number;
11
+ children: string[];
11
12
  }[];
12
13
  /**
13
- * @description Adding new Notification Item.
14
- * @param type Type of current notification
15
- * @param msg {String} Text message of notification item.
14
+ * @description Метод используется для добавления новых уведомлений. Принимает два обязательных поля type и message,
15
+ * которые будут отображаться в системе уведомлений.
16
+ * @param type Тип уведомления. В данной реализации данный тип влияет на способ отображения сообщения.
17
+ * @param msg {String} Текстовая метка уведомления.
16
18
  * @param options Params for current notification item: children, timeout (Default 10) in seconds.
17
19
  */
18
- add(type: INotificationCard["type"], msg: string, { children, timeout }?: {
19
- children?: string[];
20
- timeout?: number;
21
- }): void;
20
+ add(type: NotificationType, msg: string, { children, timeout }?: Partial<INotificationAddOptions>): NotificationCard;
22
21
  /**
23
22
  * @description Function remove item by id. Return true if card was founded, otherwise false.
24
23
  * */
@@ -29,9 +28,24 @@ declare const _default: {
29
28
  removeChild(cardId: number, childId: number): void;
30
29
  };
31
30
  export default _default;
32
- export interface INotificationCard {
33
- id: number;
34
- type: 'error' | 'warning' | 'info';
31
+ declare class NotificationCard {
32
+ type: NotificationType;
35
33
  msg: string;
34
+ /**
35
+ * @description Время жизни уведомления в СЕКУНДАХ.
36
+ * */
37
+ timeout: INotificationAddOptions['timeout'];
38
+ children: INotificationAddOptions['children'];
39
+ static cardId: number;
40
+ id: number;
41
+ constructor(type: NotificationType, msg: string,
42
+ /**
43
+ * @description Время жизни уведомления в СЕКУНДАХ.
44
+ * */
45
+ timeout: INotificationAddOptions['timeout'], children: INotificationAddOptions['children']);
46
+ }
47
+ export declare type NotificationType = 'error' | 'warning' | 'info' | 'success';
48
+ interface INotificationAddOptions {
36
49
  children: string[];
50
+ timeout: number;
37
51
  }
@@ -56,6 +56,7 @@ export default function useFormMetadata(form: Form, id: number): {
56
56
  [name: string]: import("..").MetadataField;
57
57
  };
58
58
  _filter: string;
59
+ metadataByEntityId?: number;
59
60
  }>;
60
61
  update: () => Promise<void>;
61
62
  };
@@ -11,12 +11,12 @@ import { Values } from "./types";
11
11
  import historyService, { IParsedHistoryResponse } from "./services/history-service";
12
12
  import * as newImport from "./new/new-import";
13
13
  import { MetadataStore, ComputedMetadata, prettifyValueByMetadata } from "./classes/MetadataStore";
14
+ import { NotificationType } from "./classes/NotificationSystem";
14
15
  import { Metadata, MetadataField, MetadataResponse } from "./../../backend/src/types/main";
15
16
  export { Metadata, MetadataResponse, MetadataField, MasterEntity, MasterEntities };
16
- export { newImport, testTypes, MetadataStore, ComputedMetadata, prettifyValueByMetadata };
17
+ export { newImport, testTypes, MetadataStore, ComputedMetadata, prettifyValueByMetadata, NotificationType };
17
18
  import { ICustomerContext, ApplicationType } from "./classes/ApplicationManager";
18
19
  import { IActionExecuteResult, IValidationEffect, IActionResponse } from "./services/action-service";
19
- import { INotificationCard } from "./classes/NotificationSystem";
20
20
  import { IAffectedEntity } from "./hooks/use-form-action";
21
21
  import { IWizardFixedResponse } from "./services/process-wizard-service";
22
22
  import { IWizardCompletedResult, IWizardConfirmationResult, IWizardValidationErrorResult, IWizardStepConfig } from "./hooks/use-wizard";
@@ -117,7 +117,7 @@ export { utils, Request };
117
117
  /**
118
118
  * Interfaces and Types
119
119
  * */
120
- export { IListCell, ICustomerContext, IActionExecuteResult, IValidationEffect, INotificationCard, ApplicationType, IAffectedEntity, IWizardFixedResponse, IWizardCompletedResult, IWizardConfirmationResult, IWizardValidationErrorResult, IWizardStepConfig };
120
+ export { IListCell, ICustomerContext, IActionExecuteResult, IValidationEffect, ApplicationType, IAffectedEntity, IWizardFixedResponse, IWizardCompletedResult, IWizardConfirmationResult, IWizardValidationErrorResult, IWizardStepConfig };
121
121
  declare const _default: {
122
122
  widgets: {
123
123
  inputs: {
@@ -100,6 +100,6 @@ export interface IOrganizationPopup {
100
100
  id: number;
101
101
  name: string;
102
102
  }
103
- export declare type MasterEntity = [entity: string, id: number];
103
+ declare type MasterEntity = [entity: string, id: number];
104
104
  export declare type MasterEntities = MasterEntity[];
105
- export type { EntityId, ValuesInterface, Values, FormControllerInterface, FormProvideControllerInterface, TableCellInterface, ListChunker, SortConfig, ListOptions, ViewFormInterface, TableController, ValuesEntityInterface, LoginValues, TableRowController, ListRowValues };
105
+ export type { MasterEntity, EntityId, ValuesInterface, Values, FormControllerInterface, FormProvideControllerInterface, TableCellInterface, ListChunker, SortConfig, ListOptions, ViewFormInterface, TableController, ValuesEntityInterface, LoginValues, TableRowController, ListRowValues };
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * eservices-core v1.0.595
2
+ * eservices-core v1.0.597
3
3
  * (c) 2023 ESERVICES
4
4
  */
5
5
  'use strict';
@@ -1620,21 +1620,24 @@ var spinners = {
1620
1620
  var NotificationSystem = new class NotificationSystem {
1621
1621
  constructor() {
1622
1622
  /**
1623
- * @description Array of current cards.
1623
+ * @description Хранилище текущих активных уведомлений. Если уведомление не активно (время жизни его вышло) - оно уд
1624
+ * аляется из массива безвозвратно.
1624
1625
  */
1625
1626
  this.store = vue.reactive([]);
1626
1627
  }
1627
1628
  /**
1628
- * @description Adding new Notification Item.
1629
- * @param type Type of current notification
1630
- * @param msg {String} Text message of notification item.
1629
+ * @description Метод используется для добавления новых уведомлений. Принимает два обязательных поля type и message,
1630
+ * которые будут отображаться в системе уведомлений.
1631
+ * @param type Тип уведомления. В данной реализации данный тип влияет на способ отображения сообщения.
1632
+ * @param msg {String} Текстовая метка уведомления.
1631
1633
  * @param options Params for current notification item: children, timeout (Default 10) in seconds.
1632
1634
  */
1633
1635
  add(type, msg, { children, timeout = 10 } = {}) {
1634
- const card = new NotificationCard(type, msg, children || [], timeout);
1636
+ const card = new NotificationCard(type, msg, timeout, children || []);
1635
1637
  this.store.push(card);
1636
1638
  if (timeout)
1637
- setTimeout(() => this.remove(card.id), timeout * 1000);
1639
+ setTimeout(this.remove.bind(this, card.id), timeout * 1000);
1640
+ return card;
1638
1641
  }
1639
1642
  /**
1640
1643
  * @description Function remove item by id. Return true if card was founded, otherwise false.
@@ -1664,11 +1667,15 @@ var NotificationSystem = new class NotificationSystem {
1664
1667
  }
1665
1668
  };
1666
1669
  class NotificationCard {
1667
- constructor(type, msg, children, timeout) {
1670
+ constructor(type, msg,
1671
+ /**
1672
+ * @description Время жизни уведомления в СЕКУНДАХ.
1673
+ * */
1674
+ timeout, children) {
1668
1675
  this.type = type;
1669
1676
  this.msg = msg;
1670
- this.children = children;
1671
1677
  this.timeout = timeout;
1678
+ this.children = children;
1672
1679
  this.id = NotificationCard.cardId++;
1673
1680
  }
1674
1681
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eservices-core",
3
- "version": "1.0.595",
3
+ "version": "1.0.597",
4
4
  "description": "Core library",
5
5
  "author": "",
6
6
  "scripts": {