mdt-client 31.3.8 → 31.3.10

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mdt-client",
3
- "version": "31.3.8",
3
+ "version": "31.3.10",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -55,4 +55,7 @@ export interface ApiObjectField {
55
55
  type: string;
56
56
  required: boolean;
57
57
  refTableCode: ObjectCode;
58
+ /** title и description можно задать кодом в C# */
59
+ title?: string;
60
+ description?: string;
58
61
  }
@@ -0,0 +1,17 @@
1
+ import { MessageMetaData } from "mdtServices/api/ApiAccessorRequestAdapter/message/apiV2MessageTypes";
2
+ import { ApiRequestOptions } from "mdtServices/api/ApiRequestOptions";
3
+ declare type ServerMessageHandlerArg = {
4
+ param: string;
5
+ value: any;
6
+ paramObjId?: number;
7
+ messageAction: MessageMetaData;
8
+ requestContext: ServerMessageRequestContext<any>;
9
+ };
10
+ export interface ServerMessageRequestContext<T = unknown> {
11
+ url?: string;
12
+ requestData?: any;
13
+ responseData: T;
14
+ options?: ApiRequestOptions;
15
+ }
16
+ export declare type ServerMessageHandler = (arg: ServerMessageHandlerArg) => boolean | void;
17
+ export {};
@@ -4,7 +4,6 @@ import { CSSClassName } from "../../helpers/types";
4
4
  import { FormattedText } from "../../helpers/formattedText";
5
5
  export declare type Icon = string;
6
6
  export interface BaseIconOptions {
7
- size?: "2xs" | "xs" | "sm" | "lg" | "xl" | "2xl" | "1x" | "2x" | "3x" | "4x" | "5x" | "6x" | "7x" | "8x" | "9x" | "10x";
8
7
  className?: CSSClassName;
9
8
  }
10
9
  export interface IconOptions extends BaseIconOptions {
@@ -4,4 +4,8 @@ export declare class EventEmitter<E = Record<string, AnyObject>> {
4
4
  subscribe<T extends keyof E>(code: T, listener: (args: E[T]) => void): () => void;
5
5
  unsubscribe<T extends keyof E>(code: T, listener: (args: E[T]) => void): void;
6
6
  emit<T extends keyof E>(code: T, args?: E[T]): void;
7
+ getSubscribeController(): {
8
+ subscribe: <T extends keyof E>(code: T, listener: (args: E[T]) => void) => () => void;
9
+ unsubscribe: <T_1 extends keyof E>(code: T_1, listener: (args: E[T_1]) => void) => void;
10
+ };
7
11
  }
@@ -1,9 +1,8 @@
1
- declare type FormattedTextType = "text" | "markdown";
1
+ import { ViewElement } from "./types";
2
+ export declare type FormattedTextType = "text" | "markdown" | "view";
2
3
  export declare type FormattedText = string | {
3
- text: string;
4
+ content: string | ViewElement[];
4
5
  type: FormattedTextType;
5
6
  };
6
- export declare function getTextContent(text: FormattedText): string;
7
+ export declare function getTextContent(text: FormattedText): string | ViewElement[];
7
8
  export declare function getFormattedTextType(text: FormattedText): FormattedTextType;
8
- export declare function getTranslatedFormattedText(text: FormattedText, translateFn: (text: string) => string): FormattedText;
9
- export {};
@@ -31,7 +31,8 @@ export interface IFilterItem {
31
31
  not?: boolean;
32
32
  cast?: "date";
33
33
  }
34
- export declare type FilterInOperation = "in";
34
+ declare const filterInOp = "in";
35
+ export declare type FilterInOperation = typeof filterInOp;
35
36
  /** Фильтр */
36
37
  export interface IFilterIn extends Omit<IFilterItem, "op" | "p2"> {
37
38
  op: FilterInOperation;
@@ -42,6 +43,10 @@ export interface IFilterIn extends Omit<IFilterItem, "op" | "p2"> {
42
43
  args?: any;
43
44
  } | (string | Date)[];
44
45
  }
46
+ export interface IFilterQueryIn extends Omit<IFilterIn, "op" | "p2"> {
47
+ op: FilterInOperation | "queryIn";
48
+ p2: QueryInValue;
49
+ }
45
50
  export interface FilterSetterOptions {
46
51
  fireEvents?: boolean;
47
52
  }
@@ -303,7 +308,11 @@ export declare class Filter {
303
308
  static queryIn(field: any, table: any, subField: any, filter?: any, args?: any): IFilterIn;
304
309
  static cast(filter: any, cast: any): IFilter;
305
310
  static equalTemplate(p1: any, p2: any): IFilter;
311
+ static isFilter(filter: unknown): filter is IFilter;
306
312
  static isFilterGroup(filter: IFilter): filter is IFilterGroup;
307
313
  static isFilterItem(filter: IFilter): filter is IFilterItem;
314
+ static isFilterIn(filter: IFilter): filter is IFilterIn;
315
+ static isFilterQueryIn(filter: IFilter): filter is IFilterQueryIn;
308
316
  static getP2(filter: IFilter): string | number | QueryInValue | Date;
309
317
  }
318
+ export {};
@@ -1,3 +1,4 @@
1
+ import { ServerMessageHandler } from "mdtScripts/common/serverMessage/ServerMessageTypes";
1
2
  export interface ApiRequest {
2
3
  abort?: () => void;
3
4
  }
@@ -25,6 +26,12 @@ export interface ApiRequestOptions {
25
26
  config?(xhr: XMLHttpRequest, options?: ApiRequestOptions): XMLHttpRequest;
26
27
  dataType?: string;
27
28
  extractXhr?(xhr: XMLHttpRequest): string;
29
+ /**
30
+ * Кастомный обработчик сообщений сервера.
31
+ * Используется для кастомного проставления параметров в запрос.
32
+ * Возвращает true, если параметры проставления и стандартное проставление не требуется.
33
+ */
34
+ handleServerMessageParams?: ServerMessageHandler;
28
35
  }
29
36
  export interface ApiRequestPromiseOptions extends ApiRequestOptions {
30
37
  /**
@@ -51,34 +51,11 @@ export interface ILegacyFacade {
51
51
  FkPanels: any;
52
52
  FramePage: any;
53
53
  PageZones: any;
54
- modules: {
55
- pbi: {
56
- PbiFrameCtrl: any;
57
- };
58
- etl: {
59
- FormValueManager: any;
60
- EtlPanel: any;
61
- };
62
- mapping: {
63
- MappingListExtender: any;
64
- MappingManager: any;
65
- MappingManagerInstance: any;
66
- };
67
- admin: {
68
- DesignerHelper: any;
69
- };
70
- binding: {
71
- UnbindingForm: any;
72
- };
73
- status: {
74
- StatusButton: any;
75
- StatusManager: any;
76
- statusSchema: any;
77
- };
78
- };
54
+ modules: ModulesLegacyFacade;
79
55
  pageConfig: any;
80
56
  view: any;
81
57
  NavigationControlManager: any;
58
+ NavigationControlManagerInstance: any;
82
59
  messages: any;
83
60
  registerForm: any;
84
61
  components: any;
@@ -124,3 +101,35 @@ export interface ILegacyFacade {
124
101
  TextFieldCtrl: any;
125
102
  QuickFilterPipelines: any;
126
103
  }
104
+ export interface ModulesLegacyFacade {
105
+ pbi?: {
106
+ PbiFrameCtrl: any;
107
+ };
108
+ etl?: {
109
+ FormValueManager: any;
110
+ EtlPanel: any;
111
+ };
112
+ mapping?: {
113
+ MappingListExtender: any;
114
+ MappingManager: any;
115
+ MappingManagerInstance: any;
116
+ };
117
+ admin?: {
118
+ DesignerHelper: any;
119
+ };
120
+ binding?: {
121
+ UnbindingForm: any;
122
+ };
123
+ status?: {
124
+ StatusButton: any;
125
+ StatusManager: any;
126
+ statusSchema: any;
127
+ };
128
+ help?: {
129
+ HelpManagerInstance: any;
130
+ };
131
+ job?: {
132
+ JobHelper: any;
133
+ };
134
+ ExportApiAccessor?: any;
135
+ }
@@ -2,6 +2,7 @@ import { MdtRecord } from "mdtScripts/common/Record";
2
2
  import { PredefinedValues } from "mdtServices/customModules/facades/internalModules/importModuleFacade";
3
3
  import { Field } from "mdtScripts/common/Field";
4
4
  import { Table } from "mdtScripts/common/Table";
5
+ import { FieldPath } from "mdtScripts/helpers/types";
5
6
  interface ImportMapping {
6
7
  columns: {
7
8
  [fieldPath: string]: string;
@@ -56,6 +57,11 @@ export interface ImportDefaultData {
56
57
  table?: Table;
57
58
  /** id записи */
58
59
  entryId?: number;
60
+ defaultValues?: DefaultValuesData[];
61
+ }
62
+ export interface DefaultValuesData {
63
+ field: FieldPath;
64
+ value: any;
59
65
  }
60
66
  /** Опции для значений по умолчанию */
61
67
  export interface ImportDefaultValuesOptions {
@@ -3,11 +3,29 @@ import { URLString, Valued } from "mdtScripts/helpers/types";
3
3
  export interface INavigationFacade {
4
4
  /** Добавить узел навигации */
5
5
  addNode: (node: CustomNavNode) => void;
6
+ /**
7
+ * Обновить узлы навигации по условию.
8
+ */
9
+ updateNodes: (predicate: (item: NavigationNodeFacade) => boolean, data: {
10
+ visible?: () => boolean;
11
+ }) => void;
6
12
  /**
7
13
  * Зарегистрировать новый контрол для узла навигации.
8
14
  * Использование: Чтобы отобразить контрол на странице, нужно в узле навигации указать название контрола в поле "Идентификатор подключаемого элемента" (Control)
9
15
  */
10
16
  registerPageCtrl: (ctrl: Function, name: string) => void;
17
+ /**
18
+ * Очистить кеш отображения верхней и боковой навигации.
19
+ * Используется в случае, если условия отображения узлов навигации изменились.
20
+ */
21
+ clearViewCache: () => void;
22
+ /**
23
+ * Подписаться на событие перехода по узлу навигации
24
+ */
25
+ onNavigated: (listener: (args: {
26
+ node: NavigationNodeFacade;
27
+ path: string;
28
+ }) => void) => void;
11
29
  }
12
30
  export interface CustomNavNode {
13
31
  /** Код узла */
@@ -39,6 +57,16 @@ export interface CustomNavNode {
39
57
  /** Настройки контрола */
40
58
  controlTemplate?: Record<string, any>;
41
59
  }
60
+ export interface NavigationNodeFacade {
61
+ code?: string;
62
+ title?: string;
63
+ id_Object?: number;
64
+ control?: Function;
65
+ id_Control?: number;
66
+ id_ControlTemplate?: number;
67
+ controlTemplate?: string;
68
+ parent?: NavigationNodeFacade;
69
+ }
42
70
  interface CustomNavNodeValue {
43
71
  /** Иконка статуса узла */
44
72
  iconExt?: string;
@@ -29,7 +29,7 @@ export interface ListPageOptions {
29
29
  maxHeight?: number | string;
30
30
  /** Фильтр по-умолчанию на таблицу */
31
31
  filter?: IFilter | (() => IFilter | undefined);
32
- /** Скрыть индикатор загрузки */
32
+ /** Скрыть скелетон загрузки */
33
33
  hideLoading?: boolean;
34
34
  /** Скрыть полосу загрузки */
35
35
  hideProgressBar?: boolean;