mdt-client 1.1.1 → 1.2.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.
@@ -167,8 +167,8 @@
167
167
  "affectsGlobalScope": false
168
168
  },
169
169
  "../types/services/custommodules/facades/schema/iobjectfacade.d.ts": {
170
- "version": "f8aff2bf967a91877f7566e97616985fd07302810651344ab1ef6fa0b2b6c5e8",
171
- "signature": "f8aff2bf967a91877f7566e97616985fd07302810651344ab1ef6fa0b2b6c5e8",
170
+ "version": "c40cf520be550baf41529608052053c5a46c1861493ae41287925ac22197b07a",
171
+ "signature": "c40cf520be550baf41529608052053c5a46c1861493ae41287925ac22197b07a",
172
172
  "affectsGlobalScope": false
173
173
  },
174
174
  "../types/common/record.d.ts": {
@@ -187,8 +187,8 @@
187
187
  "affectsGlobalScope": false
188
188
  },
189
189
  "../types/security/permissionlevel.d.ts": {
190
- "version": "574f34c9276469e9e5fcf68db96579d237d9d4c3bd5d7331fb252f9db6c4c611",
191
- "signature": "574f34c9276469e9e5fcf68db96579d237d9d4c3bd5d7331fb252f9db6c4c611",
190
+ "version": "c643d3e4e5e8d2fe1c6e77cb220a316a25efec34e54485f7f36f89e8159f59d4",
191
+ "signature": "c643d3e4e5e8d2fe1c6e77cb220a316a25efec34e54485f7f36f89e8159f59d4",
192
192
  "affectsGlobalScope": false
193
193
  },
194
194
  "../types/services/api/apirequestoptions.d.ts": {
@@ -197,8 +197,8 @@
197
197
  "affectsGlobalScope": false
198
198
  },
199
199
  "../types/common/datasource.d.ts": {
200
- "version": "a821ade398b2bdbf39d856836a2ea74a0296d90530c790477d1c6d678f7c2829",
201
- "signature": "a821ade398b2bdbf39d856836a2ea74a0296d90530c790477d1c6d678f7c2829",
200
+ "version": "d490aad752b04ae04afa0eef8b57ec38a3f96e65447cd181a265a3955cf5c38f",
201
+ "signature": "d490aad752b04ae04afa0eef8b57ec38a3f96e65447cd181a265a3955cf5c38f",
202
202
  "affectsGlobalScope": false
203
203
  },
204
204
  "../types/common/field.d.ts": {
@@ -232,8 +232,8 @@
232
232
  "affectsGlobalScope": false
233
233
  },
234
234
  "../types/helpers/types.d.ts": {
235
- "version": "c46d4de913b2a362ea0747114383fb84fb92a5edd92f0b8a7e13d94eba907dab",
236
- "signature": "c46d4de913b2a362ea0747114383fb84fb92a5edd92f0b8a7e13d94eba907dab",
235
+ "version": "ee963e3d4a7b91136fa2bd22590d1274454ef5cb762a2add817f66576d6baab6",
236
+ "signature": "ee963e3d4a7b91136fa2bd22590d1274454ef5cb762a2add817f66576d6baab6",
237
237
  "affectsGlobalScope": false
238
238
  },
239
239
  "../types/services/dropdown/idropdownmenu.d.ts": {
@@ -247,18 +247,23 @@
247
247
  "affectsGlobalScope": false
248
248
  },
249
249
  "../types/services/custommodules/facades/form/iformfacade.d.ts": {
250
- "version": "ed1908a8a3426f98ff5f44837e3ab0d20bd3c4c2dc647d64a5a80c5fc49b8da1",
251
- "signature": "ed1908a8a3426f98ff5f44837e3ab0d20bd3c4c2dc647d64a5a80c5fc49b8da1",
250
+ "version": "10cd03f9d01221f720a70cb7a39f95153487e0b3b2b68a4024ff5c1dc8497078",
251
+ "signature": "10cd03f9d01221f720a70cb7a39f95153487e0b3b2b68a4024ff5c1dc8497078",
252
+ "affectsGlobalScope": false
253
+ },
254
+ "../types/services/custommodules/facades/components/modalfacade.d.ts": {
255
+ "version": "6293e21351507e54803c16cb963f6018ca70e699d2ec17cc04661f5097dae8ce",
256
+ "signature": "6293e21351507e54803c16cb963f6018ca70e699d2ec17cc04661f5097dae8ce",
252
257
  "affectsGlobalScope": false
253
258
  },
254
259
  "../types/services/custommodules/facades/utils/iuifacade.d.ts": {
255
- "version": "ffaf5f2e29a6e66326290dc104d291cfafb7f5950387557209af23f944a14299",
256
- "signature": "ffaf5f2e29a6e66326290dc104d291cfafb7f5950387557209af23f944a14299",
260
+ "version": "12c20194460258ca35b37353b13d50c7fb51ce93cce7dd349f2622c34235039b",
261
+ "signature": "12c20194460258ca35b37353b13d50c7fb51ce93cce7dd349f2622c34235039b",
257
262
  "affectsGlobalScope": false
258
263
  },
259
264
  "../types/services/custommodules/facades/form/iformcontrolfacade.d.ts": {
260
- "version": "193011eafd921fc4336c7ea2480a49aa28b57ca60f954ddbea538b54d74417fa",
261
- "signature": "193011eafd921fc4336c7ea2480a49aa28b57ca60f954ddbea538b54d74417fa",
265
+ "version": "5bdddec33847a6c1c9eea871434fa9e268873bd4b272b2cd67b112030c7de920",
266
+ "signature": "5bdddec33847a6c1c9eea871434fa9e268873bd4b272b2cd67b112030c7de920",
262
267
  "affectsGlobalScope": false
263
268
  },
264
269
  "../types/services/custommodules/facades/iauthfacade.d.ts": {
@@ -307,8 +312,8 @@
307
312
  "affectsGlobalScope": false
308
313
  },
309
314
  "../types/services/custommodules/facades/list/ilistcontrolfacade.d.ts": {
310
- "version": "ed70842e6766ba8ec7c95d890bf310ec7f876f48e1141fc484884144c58c3a67",
311
- "signature": "ed70842e6766ba8ec7c95d890bf310ec7f876f48e1141fc484884144c58c3a67",
315
+ "version": "36274e927bcd6e5c9f952283383c2bd39b4e2226a29c8e596fef3816a9f39c33",
316
+ "signature": "36274e927bcd6e5c9f952283383c2bd39b4e2226a29c8e596fef3816a9f39c33",
312
317
  "affectsGlobalScope": false
313
318
  },
314
319
  "../types/services/custommodules/facades/list/ilistservicefacade.d.ts": {
@@ -342,8 +347,8 @@
342
347
  "affectsGlobalScope": false
343
348
  },
344
349
  "../types/components/icon/iconoptions.d.ts": {
345
- "version": "5e64201f66ed8cbd7fccb41473905879007771a6065bcdad9178eb9ce771279a",
346
- "signature": "5e64201f66ed8cbd7fccb41473905879007771a6065bcdad9178eb9ce771279a",
350
+ "version": "8c41caaee9c812adca6887437ef2d8161beee6ec6ad1a74841573ea43d6b58b3",
351
+ "signature": "8c41caaee9c812adca6887437ef2d8161beee6ec6ad1a74841573ea43d6b58b3",
347
352
  "affectsGlobalScope": false
348
353
  },
349
354
  "../types/components/baseformcontrols/input/inputview.d.ts": {
@@ -372,8 +377,8 @@
372
377
  "affectsGlobalScope": false
373
378
  },
374
379
  "../types/services/custommodules/facades/utils/iuicomponentsfacade.d.ts": {
375
- "version": "a38615be53bca60fde998088f0e6095eed9fd6e72f1c35d8b1df5ac00a858272",
376
- "signature": "a38615be53bca60fde998088f0e6095eed9fd6e72f1c35d8b1df5ac00a858272",
380
+ "version": "91da2be160188257843261e1d7b5b45740fdefbbf40fb7612b11f6c61a3c9936",
381
+ "signature": "91da2be160188257843261e1d7b5b45740fdefbbf40fb7612b11f6c61a3c9936",
377
382
  "affectsGlobalScope": false
378
383
  },
379
384
  "../types/helpers/formatoptions.d.ts": {
@@ -1408,6 +1413,7 @@
1408
1413
  "../types/services/custommodules/facades/utils/iuifacade.d.ts": [
1409
1414
  "../node_modules/@types/mithril/index.d.ts",
1410
1415
  "../types/helpers/types.d.ts",
1416
+ "../types/services/custommodules/facades/components/modalfacade.d.ts",
1411
1417
  "../types/services/custommodules/facades/form/iformfacade.d.ts",
1412
1418
  "../types/services/dropdown/idropdownmenu.d.ts"
1413
1419
  ],
@@ -2033,6 +2039,7 @@
2033
2039
  "../types/services/custommodules/facades/utils/iuifacade.d.ts": [
2034
2040
  "../node_modules/@types/mithril/index.d.ts",
2035
2041
  "../types/helpers/types.d.ts",
2042
+ "../types/services/custommodules/facades/components/modalfacade.d.ts",
2036
2043
  "../types/services/custommodules/facades/form/iformfacade.d.ts",
2037
2044
  "../types/services/dropdown/idropdownmenu.d.ts"
2038
2045
  ],
@@ -2514,6 +2521,7 @@
2514
2521
  "../types/services/commands/command.d.ts",
2515
2522
  "../types/services/commands/commandgroup.d.ts",
2516
2523
  "../types/services/commands/commandmanager.d.ts",
2524
+ "../types/services/custommodules/facades/components/modalfacade.d.ts",
2517
2525
  "../types/services/custommodules/facades/form/ifieldcontrolfacade.d.ts",
2518
2526
  "../types/services/custommodules/facades/form/ifieldcontrolmanagerfacade.d.ts",
2519
2527
  "../types/services/custommodules/facades/form/iformcontrolfacade.d.ts",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mdt-client",
3
- "version": "1.1.1",
3
+ "version": "1.2.0",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -3,7 +3,7 @@ import { Query } from "../services/api/Query";
3
3
  import { ApiRequestOptions } from "../services/api/ApiRequestOptions";
4
4
  export interface Datasource {
5
5
  fetch(query: Query, table: Table, options?: ApiRequestOptions, batch?: boolean): any;
6
- save?(data: any, params?: any, options?: ApiRequestOptions): any;
6
+ save?(data: any, params?: any, options?: ApiRequestOptions): PromiseLike<any>;
7
7
  delete?(ids: any[], table: Table): any;
8
8
  table?: Table;
9
9
  }
@@ -1,9 +1,13 @@
1
1
  /// <reference types="../../../../mithril" />
2
2
  /// <reference types="mithril" />
3
+ import { CSSClassName } from "mdtScripts/helpers/types";
3
4
  import { FormattedText } from "../../helpers/formattedText";
4
5
  export declare type Icon = string;
5
- export interface IconOptions {
6
+ export interface BaseIconOptions {
6
7
  size?: "2xs" | "xs" | "sm" | "lg" | "xl" | "2xl" | "1x" | "2x" | "3x" | "4x" | "5x" | "6x" | "7x" | "8x" | "9x" | "10x";
8
+ className?: CSSClassName;
9
+ }
10
+ export interface IconOptions extends BaseIconOptions {
7
11
  fixedWidth?: boolean;
8
12
  rotate?: "90" | "180" | "270";
9
13
  flip?: "horizontal" | "vertical" | "both";
@@ -12,7 +16,7 @@ export interface IconOptions {
12
16
  attrs?: _mithril.MithrilAttributes;
13
17
  title?: string;
14
18
  tooltip?: FormattedText;
15
- className?: string;
16
19
  onmousedown?: () => void;
17
20
  onclick?: (e?: MouseEvent) => void;
18
21
  }
22
+ export declare type IconElOptions = BaseIconOptions;
@@ -11,11 +11,11 @@ declare type CSSSizeUnit = string;
11
11
  export declare type NotifierType = "log" | "error" | "warn" | "info" | "success";
12
12
  export interface NotifierOptions {
13
13
  type?: NotifierType;
14
- msg?: string;
14
+ msg?: MessageText;
15
15
  icon?: string;
16
16
  }
17
17
  export interface Notifier {
18
- notify(title: string, options?: NotifierOptions): void;
18
+ notify(title: MessageText, options?: NotifierOptions): void;
19
19
  }
20
20
  export declare type ViewElement = _mithril.MithrilVirtualElement | _mithril.MithrilVirtualElement[] | string;
21
21
  export declare type CommandEvent = Event | _mithril.MithrilEvent;
@@ -30,6 +30,7 @@ export interface ContentControl {
30
30
  [key: string]: any;
31
31
  }
32
32
  export declare type Markdown = string;
33
+ export declare type MessageText = Markdown | string;
33
34
  export declare type ColorStyle = "default" | "primary" | "success" | "info" | "warning" | "danger" | "fatal";
34
35
  export declare type ButtonStyle = ColorStyle;
35
36
  export declare type ObjectCode = string;
@@ -47,7 +48,6 @@ export declare type MithrilAttributes = _mithril.MithrilAttributes & {
47
48
  };
48
49
  export declare type AnyError = any;
49
50
  export declare type FieldPath = string;
50
- export declare type FieldLogicTypeCode = string;
51
51
  export declare type FieldId = number;
52
52
  export declare type FieldCode = string;
53
53
  export declare type KeyboardKeyCode = string;
@@ -1,3 +1,4 @@
1
+ import { IFilterGroup } from "mdtServices/IFilter";
1
2
  import { MdtField } from "../common/MdtField";
2
3
  import { MdtObject } from "../common/MdtObject";
3
4
  import { Record } from "../common/Record";
@@ -20,7 +21,7 @@ export interface PrincipalPermission extends Record {
20
21
  ID_Field$?: MdtField;
21
22
  LevelGrant?: PermissionLevel;
22
23
  LevelDeny?: PermissionLevel;
23
- Filter?: string;
24
+ Filter?: IFilterGroup;
24
25
  }
25
26
  export interface Permission extends Record {
26
27
  id?: number;
@@ -50,7 +50,7 @@ export interface IFormControlFacade extends ParentCtrl {
50
50
  /** Установить флаг доступности редактирования формы */
51
51
  setReadonly(readonly: boolean): void;
52
52
  /** Изменить свойства существующей кнопки */
53
- updateCommand(findCondition: () => boolean, command: Partial<ButtonFacade>): void;
53
+ updateCommand(findCondition: (button: ButtonFacade) => boolean, command: Partial<ButtonFacade>): void;
54
54
  /** Повторно инициализировать форму */
55
55
  reinit(): void;
56
56
  /** Сохранить форму */
@@ -61,4 +61,6 @@ export interface IFormControlFacade extends ParentCtrl {
61
61
  getZones(): FormZones;
62
62
  /** Подписаться на событие обновление значения поля формы */
63
63
  onUpdated<V = string>(callback: (field: IFieldFacade, value: V) => void): void;
64
+ /** Закрыть форму */
65
+ close(): void;
64
66
  }
@@ -1,13 +1,13 @@
1
1
  import { MdtRecord } from "mdtScripts/common/Record";
2
+ import { FormattedText } from "mdtScripts/helpers/formattedText";
3
+ import { Valued } from "mdtScripts/helpers/types";
2
4
  import { Field } from "../../../../common/Field";
3
5
  import { IButton } from "../../../../views/form/controls/monacoEditor/jsonSchemas/Button.schema";
4
6
  import { RecordId } from "../utils/IApiFacade";
5
7
  import { IFormControlFacade } from "./IFormControlFacade";
6
8
  export declare type ActionButton = IButton & {
7
9
  /** Всплывающая подсказка */
8
- description?: string | {
9
- (): string;
10
- };
10
+ description?: Valued<FormattedText>;
11
11
  /** Подписка на событие нажатия на кнопку */
12
12
  execute?: () => void;
13
13
  /** Активность кнопки */
@@ -56,6 +56,10 @@ export interface IFormServiceFacade {
56
56
  onCreated(callback: (form: IFormControlFacade) => void): void;
57
57
  /** Добавить настройки для полей формы */
58
58
  addFieldOptions(tableCode: string, options: IFormInitOptions): void;
59
+ /** Зарегистрировать расширение формы
60
+ * @param {string} alias - Имя свойства, которое можно использовать для установки опций экстендера
61
+ */
62
+ registerExtender<T>(extender: IFormExtenderFacade<T>, alias: string): void;
59
63
  }
60
64
  export interface ICustomField extends Field {
61
65
  /** Опции контрола поля */
@@ -34,7 +34,7 @@ export interface IListControlFacade extends ParentCtrl {
34
34
  /** Установить расширения списка */
35
35
  setExtOptions(extOptions: any): void;
36
36
  /** Изменить свойства существующей кнопки */
37
- updateCommand(findCondition: () => boolean, command: Partial<ButtonFacade>): void;
37
+ updateCommand(findCondition: (button: ButtonFacade) => boolean, command: Partial<ButtonFacade>): void;
38
38
  /** Открыть форму добавления записи */
39
39
  openNewRecordForm(): void;
40
40
  /** Удалить выделенные строки */
@@ -0,0 +1,4 @@
1
+ export interface IModalFacade {
2
+ /** Закрыть модальное окно */
3
+ close(): void;
4
+ }
@@ -1,3 +1,4 @@
1
+ import { ObjectId } from "mdtScripts/helpers/types";
1
2
  import { IFieldFacade } from "./IFieldFacade";
2
3
  export interface IObjectFacade {
3
4
  getCode(): string;
@@ -6,4 +7,5 @@ export interface IObjectFacade {
6
7
  getPrimaryField(): IFieldFacade;
7
8
  isReadonly(): boolean;
8
9
  getField(code: string, check?: boolean): IFieldFacade;
10
+ getId(): ObjectId;
9
11
  }
@@ -2,7 +2,7 @@
2
2
  /// <reference types="mithril" />
3
3
  import { ProcessPrincipalsListItem } from "../../../../components/processPrincipalsList/ProcessPrincipalsListItem";
4
4
  import { Markdown, MithrilAttributes, Valued, ViewElement } from "../../../../helpers/types";
5
- import { Icon, IconOptions } from "../../../../components/icon/iconOptions";
5
+ import { Icon, IconElOptions, IconOptions } from "../../../../components/icon/iconOptions";
6
6
  import { InputOptions } from "../../../../components/baseFormControls/input/inputView";
7
7
  import { CommonControlOptions } from "../../../../views/form/controls/commonControl/ICommonControl";
8
8
  import { ButtonFacade } from "../Form/IFormFacade";
@@ -12,6 +12,7 @@ export interface IUiComponentsFacade {
12
12
  button(button: ButtonFacade, translate?: boolean): ViewElement;
13
13
  topNavButton(options: TopNavButton): _mithril.MithrilVirtualElement;
14
14
  icon(code: string, options?: IconOptions): _mithril.MithrilVirtualElement;
15
+ iconHTML(icon: Icon, options?: IconElOptions): HTMLElement;
15
16
  processFormBlock(options: IProcessFormBlockOptions): _mithril.MithrilVirtualElement;
16
17
  commonControl(options: CommonControlOptions): _mithril.MithrilVirtualElement;
17
18
  unstyledInput(options: InputOptions): _mithril.MithrilVirtualElement;
@@ -4,6 +4,7 @@ import { MithrilControl } from "../../../../helpers/types";
4
4
  import { DropdownOptions } from "../../../dropdown/IDropDownMenu";
5
5
  import { ButtonFacade } from "../Form/IFormFacade";
6
6
  import { DropdownTargetContext, IDropdownMenu } from "mdtServices/dropdown/IDropDownMenu";
7
+ import { IModalFacade } from "../components/ModalFacade";
7
8
  export declare type onModalResizeCallback = (data: IModalSizingState) => void;
8
9
  export interface IType<T> {
9
10
  new (...args: any[]): T;
@@ -27,7 +28,7 @@ export interface IUiFacade {
27
28
  /** Вызвать окно уведомления */
28
29
  showNotification(msg: CustomNotification, duration?: number): any;
29
30
  /** Вызвать модальное окно */
30
- showModal(ctrl: MithrilControl | ParentCtrl, options?: IModalOptions): any;
31
+ showModal(ctrl: MithrilControl | ParentCtrl, options?: IModalOptions): IModalFacade;
31
32
  /** Вызвать боковую панель */
32
33
  showSidebar(ctrl: MithrilControl | ParentCtrl, options?: IPanelOptions): any;
33
34
  /** Создать выпадающее меню */
@@ -55,6 +56,8 @@ export interface IModalOptions {
55
56
  initialSizingState?: IModalSizingState;
56
57
  /** Тип модального окна */
57
58
  type?: ModalTypes;
59
+ /** Дополнительные кнопки на окне */
60
+ buttons?: ButtonFacade[];
58
61
  }
59
62
  export interface IPanelOptions {
60
63
  /** Отображать боковую панель в расширенном на весь экран виде */