mdt-client 31.0.7 → 31.0.8

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.
Files changed (32) hide show
  1. package/dist/index.d.ts +1 -0
  2. package/dist/tsconfig.tsbuildinfo +3082 -1
  3. package/package.json +1 -1
  4. package/types/common/Datasource.d.ts +1 -1
  5. package/types/common/list/hierarchy/hierarchyTypes.d.ts +9 -0
  6. package/types/components/baseFormControls/input/inputOptions.d.ts +1 -0
  7. package/types/components/form/label/labelOptions.d.ts +9 -5
  8. package/types/components/icon/iconOptions.d.ts +1 -0
  9. package/types/components/resizablePanels/panelTitle/panelTitleOptions.d.ts +1 -0
  10. package/types/helpers/types.d.ts +1 -0
  11. package/types/helpers/ui/elementModificators/focusableComponent.d.ts +1 -0
  12. package/types/helpers/zone/IZone.d.ts +1 -0
  13. package/types/security/User.d.ts +9 -8
  14. package/types/services/api/ApiAccessorRequestAdapter/handlers/fetch/helpers/query/exts/hierarchy/hierarchyQueryHelpersTypes.d.ts +17 -16
  15. package/types/services/api/ApiAccessorRequestAdapter/handlers/fetch/helpers/query/exts/placeIn/placeInQueryTypes.d.ts +9 -0
  16. package/types/services/api/Query.d.ts +2 -1
  17. package/types/services/customModules/facades/Form/IFormControlFacade.d.ts +1 -1
  18. package/types/services/customModules/facades/Form/IFormFacade.d.ts +2 -2
  19. package/types/services/customModules/facades/IMdtFacade.d.ts +1 -0
  20. package/types/services/customModules/facades/List/IListControlFacade.d.ts +1 -1
  21. package/types/services/customModules/facades/List/IListServiceFacade.d.ts +2 -2
  22. package/types/services/customModules/facades/schema/IFieldFacade.d.ts +1 -1
  23. package/types/services/customModules/facades/schema/IObjectFacade.d.ts +6 -6
  24. package/types/services/customModules/facades/utils/IUiComponentsFacade.d.ts +1 -0
  25. package/types/services/customModules/facades/utils/IUiFacade.d.ts +3 -0
  26. package/types/services/customModules/facades/utils/ImUtilsFacade.d.ts +1 -0
  27. package/types/services/dropdown/IDropDownMenu.d.ts +1 -0
  28. package/types/views/form/controls/commonControl/ICommonControl.d.ts +1 -0
  29. package/types/views/form/controls/monacoEditor/jsonSchemas/Button.schema.d.ts +1 -1
  30. package/types/views/form/controls/toggleablePanels/editor/toggleablePanelsEditorFacadeOptions.d.ts +2 -1
  31. package/types/views/list/IListView.d.ts +1 -0
  32. package/types/views/list/schema/ListPageOptions.schema.d.ts +1 -5
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mdt-client",
3
- "version": "31.0.7",
3
+ "version": "31.0.8",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -2,7 +2,7 @@ import { Table } from "./Table";
2
2
  import { Query } from "../services/api/Query";
3
3
  import { ApiRequestOptions } from "../services/api/ApiRequestOptions";
4
4
  export interface Datasource {
5
- fetch(query: Query, table: Table, options?: ApiRequestOptions, batch?: boolean): any;
5
+ fetch(query: Query, table: Table, options?: ApiRequestOptions, batch?: boolean, meta?: any): any;
6
6
  save?(data: any, params?: any, options?: ApiRequestOptions): PromiseLike<any>;
7
7
  delete?(ids: any[], table: Table): any;
8
8
  table?: Table;
@@ -17,6 +17,10 @@ export interface HierarchyQuery {
17
17
  /** Фильтр для дочерних и родительских записей, не попадающих под критерии основной фильтрации списка */
18
18
  filter?: IFilter;
19
19
  table?: Table;
20
+ /**
21
+ * @default false
22
+ */
23
+ legacy?: boolean;
20
24
  }
21
25
  export interface HierarchyListExtenderPublicOptions extends Exclude<HierarchyQuery, "table"> {
22
26
  /**
@@ -36,4 +40,9 @@ export interface HierarchyListExtenderPublicOptions extends Exclude<HierarchyQue
36
40
  * Уровень до которого будут раскрыты узлы
37
41
  */
38
42
  expandedLevel?: number;
43
+ /**
44
+ *
45
+ * @default false
46
+ */
47
+ legacy?: boolean;
39
48
  }
@@ -1,4 +1,5 @@
1
1
  /// <reference types="../../../../mithril" />
2
+ /// <reference types="mithril" />
2
3
  import { CSSClassName } from "../../../helpers/types";
3
4
  import { KeyboardActions } from "../../../helpers/ui/elementModificators/focusableComponent";
4
5
  import { ComponentSize } from "../../../helpers/utils/stringifyControlSize";
@@ -1,15 +1,19 @@
1
1
  import { IconButtonOptions } from "mdtScripts/components/iconButton/iconButtonOptions";
2
- import { CSSClassName } from "mdtScripts/helpers/types";
2
+ import { FormattedText } from "mdtScripts/helpers/formattedText";
3
+ import { CSSClassName, Valued } from "mdtScripts/helpers/types";
3
4
  export interface LabelIconButton {
4
5
  name: string;
5
6
  options: IconButtonOptions;
6
7
  }
7
- export interface LabelOptions {
8
- title: string;
8
+ export interface LabelIconButtonOptions {
9
9
  description?: string;
10
- required?: boolean;
11
10
  error?: string;
12
- iconButtons?: LabelIconButton[];
11
+ iconButtons?: Valued<LabelIconButton | undefined>[];
12
+ }
13
+ export interface LabelOptions extends LabelIconButtonOptions {
14
+ title: string;
15
+ required?: boolean;
16
+ tooltip?: Valued<FormattedText>;
13
17
  }
14
18
  export interface LabelViewOptions extends LabelOptions {
15
19
  for?: string;
@@ -1,4 +1,5 @@
1
1
  /// <reference types="../../../../mithril" />
2
+ /// <reference types="mithril" />
2
3
  import { CSSClassName } from "../../helpers/types";
3
4
  import { FormattedText } from "../../helpers/formattedText";
4
5
  export declare type Icon = string;
@@ -6,6 +6,7 @@ export interface PanelTitleOptions {
6
6
  text: Valued<PanelTitleTextContent>;
7
7
  tooltip?: Valued<FormattedText>;
8
8
  endZone?: PanelTitleEndZone;
9
+ error?: Valued<string | undefined>;
9
10
  icons?: Valued<LabelIconButton | undefined>[];
10
11
  className?: Valued<CSSClassName>;
11
12
  wrapperClassName?: string;
@@ -1,4 +1,5 @@
1
1
  /// <reference types="../../../../mithril" />
2
+ /// <reference types="mithril" />
2
3
  import { UiType } from "./IUi";
3
4
  export interface AnyObject {
4
5
  [key: string]: any;
@@ -1,4 +1,5 @@
1
1
  /// <reference types="../../../../mithril" />
2
+ /// <reference types="mithril" />
2
3
  import { KeyboardKeyCode } from "../../../helpers/types";
3
4
  import { ComponentConfigParams } from "./modificatorsTypes";
4
5
  export declare function doesKeyPressed(keyCode: KeyboardKeyCode | KeyboardKeyCode[], e: KeyboardEvent): boolean;
@@ -1,4 +1,5 @@
1
1
  /// <reference types="../../../../mithril" />
2
+ /// <reference types="mithril" />
2
3
  import { MithrilControl } from "../types";
3
4
  export interface IZone {
4
5
  remove(content: MithrilControl): void;
@@ -4,14 +4,7 @@ export interface User {
4
4
  id: any;
5
5
  permissions: {
6
6
  object: {
7
- [objectId: number]: {
8
- level: PermissionLevel;
9
- fields?: {
10
- [fieldId: number]: {
11
- level: PermissionLevel;
12
- };
13
- };
14
- };
7
+ [objectId: number]: ObjectPermission;
15
8
  };
16
9
  listview: PermissionLevel;
17
10
  namedfilters: PermissionLevel;
@@ -27,3 +20,11 @@ export interface User {
27
20
  languageCode: string;
28
21
  isImpersonated: boolean;
29
22
  }
23
+ export interface EntityPermission {
24
+ level: PermissionLevel;
25
+ }
26
+ export interface ObjectPermission extends EntityPermission {
27
+ fields?: {
28
+ [fieldId: number]: EntityPermission;
29
+ };
30
+ }
@@ -1,19 +1,20 @@
1
- export declare type HierarchyQueryMeta = QueryHierarchyLoadMore | QueryHierarchyCustom | QueryHierarchyCustomChild;
2
- export declare const QHIERARCHY_TYPE_LOAD_MORE = "hierarchy-load-more";
3
- declare type QueryHierarchyLoadMore = {
4
- type: typeof QHIERARCHY_TYPE_LOAD_MORE;
1
+ import { RecordId } from "mdtScripts/common/Record";
2
+ import { IFilter } from "mdtServices/IFilter";
3
+ export declare type HierarchyQueryMeta = {
4
+ hierarchy?: QueryHierarchyBaseData;
5
+ hierarchyLoadMore?: QueryHierarchyLoadMoreData;
5
6
  };
6
- export declare const QHIERARCHY_TYPE_CUSTOM = "hierachy-custom";
7
- declare type QueryHierarchyCustom = {
8
- type: typeof QHIERARCHY_TYPE_CUSTOM;
9
- data: QueryHierarchyCustomData;
7
+ export declare type QueryHierarchyLoadMoreData = {
8
+ parentId: RecordId;
9
+ filter?: IFilter;
10
10
  };
11
- export declare type QueryHierarchyCustomData = {
12
- idField: string;
13
- parentIdField: string;
11
+ export declare type QueryHierarchyBaseData = {
12
+ top?: number;
13
+ } & WithExpandedIds;
14
+ export declare type ExpandedIds = {
15
+ id: RecordId;
16
+ take: number;
17
+ }[];
18
+ export declare type WithExpandedIds = {
19
+ expandedIds?: ExpandedIds;
14
20
  };
15
- export declare const QHIERARCHY_TYPE_CUSTOM_CHILD = "hierachy-custom-child";
16
- declare type QueryHierarchyCustomChild = {
17
- type: typeof QHIERARCHY_TYPE_CUSTOM_CHILD;
18
- };
19
- export {};
@@ -0,0 +1,9 @@
1
+ import { Query } from "mdtServices/api/Query";
2
+ export declare type PlaceInQueryMeta = {
3
+ placeIn?: PlaceInQueryData[];
4
+ };
5
+ export interface PlaceInQueryData {
6
+ query: Query;
7
+ name: string;
8
+ fk: string;
9
+ }
@@ -3,6 +3,7 @@ import { HierarchyQuery } from "../../common/list/hierarchy/hierarchyTypes";
3
3
  import { Table } from "../../common/Table";
4
4
  import { BaseQuery } from "./BaseQuery";
5
5
  import { ApiV1 } from "./ApiAccessor/apiV1Types";
6
+ import { PlaceInQueryMeta } from "./ApiAccessorRequestAdapter/handlers/fetch/helpers/query/exts/placeIn/placeInQueryTypes";
6
7
  import { HierarchyQueryMeta } from "./ApiAccessorRequestAdapter/handlers/fetch/helpers/query/exts/hierarchy/hierarchyQueryHelpersTypes";
7
8
  export interface Query extends BaseQuery {
8
9
  options?: QueryOptions;
@@ -36,7 +37,7 @@ export interface Query extends BaseQuery {
36
37
  * Дополнительная информация по запросу, содержит логические данные.
37
38
  * Используется при конвертации запроса под API v1/v2, чтобы не парсить сгенерированные строки, напр. placeIn
38
39
  */
39
- meta?: HierarchyQueryMeta;
40
+ meta?: PlaceInQueryMeta & HierarchyQueryMeta;
40
41
  }
41
42
  declare type QueryParams = ApiV1.Request.Fetch.Params;
42
43
  export declare type TicketQuery = string | "ticket";
@@ -23,7 +23,7 @@ export interface IFormControlFacade extends ParentCtrl {
23
23
  /** Получить объект, к которому приязана форма */
24
24
  getObject(): IObjectFacade;
25
25
  /** Получить код формы */
26
- getCode(): string;
26
+ getCode(): string | undefined;
27
27
  /** Получить контекстный параметр формы */
28
28
  getContext(key: string): any;
29
29
  /** Установить контекстный параметр формы */
@@ -1,6 +1,6 @@
1
1
  import { MdtRecord, RecordId } from "../../../../common/Record";
2
2
  import { FormattedText } from "../../../../helpers/formattedText";
3
- import { AnyObject, MithrilControl, Valued } from "mdtScripts/helpers/types";
3
+ import { AnyObject, MithrilControl, Valued, ViewControl } from "mdtScripts/helpers/types";
4
4
  import { Field } from "../../../../common/Field";
5
5
  import { IButton } from "../../../../views/form/controls/monacoEditor/jsonSchemas/Button.schema";
6
6
  import { IObjectFacade } from "../schema/IObjectFacade";
@@ -75,7 +75,7 @@ export interface ICustomField extends Field {
75
75
  options?: any;
76
76
  }
77
77
  declare type CustomFormLayout = any;
78
- export interface IFormExtenderFacade<T> {
78
+ export interface IFormExtenderFacade<T> extends Partial<ViewControl> {
79
79
  new (form: IFormControlFacade, options: any): T;
80
80
  }
81
81
  export interface FormControlOptions<Options = AnyObject> {
@@ -1,4 +1,5 @@
1
1
  /// <reference types="../../../../mithril" />
2
+ /// <reference types="mithril" />
2
3
  import { FilterConstructor } from "../../../services/IFilter";
3
4
  import { IFieldControlFacadeContstructor } from "./Form/IFieldControlFacade";
4
5
  import { IFieldControlManagerFacade } from "./Form/IFieldControlManagerFacade";
@@ -13,7 +13,7 @@ export interface IListControlFacade extends ParentCtrl {
13
13
  /** Получить оригинальный контрол списка */
14
14
  getListCtrl(): any;
15
15
  /** Получить уникальный код списка */
16
- getCode(): string;
16
+ getCode(): string | undefined;
17
17
  /** Получить объект списка */
18
18
  getObject(): IObjectFacade;
19
19
  /** Получить выделенные строки списка */
@@ -1,5 +1,5 @@
1
1
  import { Field } from "../../../../../scripts/common/Field";
2
- import { ObjectCode } from "../../../../../scripts/helpers/types";
2
+ import { ObjectCode, ViewControl } from "../../../../../scripts/helpers/types";
3
3
  import { MdtRecord } from "../utils/IApiFacade";
4
4
  import { IListControlFacade } from "./IListControlFacade";
5
5
  export interface IListInitOptions {
@@ -25,7 +25,7 @@ export interface IListServiceFacade {
25
25
  registerExtender<T>(extender: IListExtenderFacade<T>, alias: string): void;
26
26
  createCustom(options: CustomListOptions): IListControlFacade;
27
27
  }
28
- export interface IListExtenderFacade<T> {
28
+ export interface IListExtenderFacade<T> extends Partial<ViewControl> {
29
29
  new (list: IListControlFacade, options: any): T;
30
30
  }
31
31
  export interface CustomListOptions<R = MdtRecord> {
@@ -1,6 +1,6 @@
1
1
  export interface IFieldFacade {
2
2
  getCode(): string;
3
- getTitle(): string;
3
+ getTitle(): string | undefined;
4
4
  isPrimary(): boolean;
5
5
  getType(): string;
6
6
  isNullable(): boolean;
@@ -1,12 +1,12 @@
1
1
  import { ObjectId } from "../../../../helpers/types";
2
2
  import { IFieldFacade } from "./IFieldFacade";
3
3
  export interface IObjectFacade {
4
- getCode(): string;
5
- getTitle(): string;
6
- getIcon(): string;
7
- getPrimaryField(): IFieldFacade;
4
+ getCode(): string | undefined;
5
+ getTitle(): string | undefined;
6
+ getIcon(): string | undefined;
7
+ getPrimaryField(): IFieldFacade | undefined;
8
8
  isReadonly(): boolean;
9
- getField(code: string, check?: boolean): IFieldFacade;
10
- getId(): ObjectId;
9
+ getField(code: string, check?: boolean): IFieldFacade | undefined;
10
+ getId(): ObjectId | undefined;
11
11
  getFields(): IFieldFacade[];
12
12
  }
@@ -1,4 +1,5 @@
1
1
  /// <reference types="../../../../mithril" />
2
+ /// <reference types="mithril" />
2
3
  import { ProcessPrincipalsListItem } from "../../../../components/processPrincipalsList/ProcessPrincipalsListItem";
3
4
  import { Markdown, MithrilAttributes, Valued, ViewControl, ViewElement } from "../../../../helpers/types";
4
5
  import { Icon, IconElOptions, IconOptions } from "../../../../components/icon/iconOptions";
@@ -1,4 +1,5 @@
1
1
  /// <reference types="../../../../mithril" />
2
+ /// <reference types="mithril" />
2
3
  import { MithrilControl } from "../../../../helpers/types";
3
4
  import { DropdownOptions } from "../../../dropdown/IDropDownMenu";
4
5
  import { ButtonFacade } from "../Form/IFormFacade";
@@ -68,6 +69,8 @@ export interface IModalOptions {
68
69
  */
69
70
  closable?: boolean;
70
71
  onClose?: (closeResult?: any) => void;
72
+ /** Содержит ли модальное окно какое-либо действие */
73
+ isAction?: boolean;
71
74
  }
72
75
  export interface IPanelOptions {
73
76
  /** Отображать боковую панель в расширенном на весь экран виде */
@@ -1,4 +1,5 @@
1
1
  /// <reference types="../../../../mithril" />
2
+ /// <reference types="mithril" />
2
3
  import { MithrilControl } from "../../../../helpers/types";
3
4
  export declare type ConfigFunction = (element: HTMLElement, isInitialized: boolean, context?: any) => void;
4
5
  export interface ImUtilsFacade {
@@ -1,4 +1,5 @@
1
1
  /// <reference types="../../../../mithril" />
2
+ /// <reference types="mithril" />
2
3
  import { MithrilContext, MithrilControl } from "../../helpers/types";
3
4
  export declare class IDropdownMenu<I> {
4
5
  constructor(items: I[], uid: string, options?: DropdownOptions<I>);
@@ -1,4 +1,5 @@
1
1
  /// <reference types="../../../../mithril" />
2
+ /// <reference types="mithril" />
2
3
  import { CSSClassName, Valued, ViewElement } from "../../../../helpers/types";
3
4
  export interface Action {
4
5
  /** Иконка для отображения. */
@@ -1,7 +1,7 @@
1
1
  import { FormattedText } from "../../../../../helpers/formattedText";
2
2
  import { UiType } from "../../../../../helpers/IUi";
3
3
  import { ControlSize } from "../../../../../views/controls/Control";
4
- export declare type ButtonTypes = UiType | "default" | "link" | "group-title" | "extended";
4
+ export declare type ButtonTypes = UiType | "default" | "link" | "group-title" | "extended" | "no-type";
5
5
  export interface IButton {
6
6
  /**
7
7
  * Тип кнопки
@@ -2,7 +2,7 @@ import { PanelTitleTextContent } from "../../../../../components/resizablePanels
2
2
  import { ResizablePanelFocusOptions } from "../../../../../components/resizablePanels/resizablePanel/resizablePanelOptions";
3
3
  import { PanelSizeFactor } from "../../../../../components/resizablePanels/resizablePanelsOptions";
4
4
  import { PanelsGrid, ToggleableRotatablePanelsOptions } from "../../../../../components/toggleablePanels/toggleablePanelsOptions";
5
- import { ViewElement } from "../../../../../helpers/types";
5
+ import { Valued, ViewElement } from "../../../../../helpers/types";
6
6
  import { ButtonFacade } from "../../../../../services/customModules/facades/Form/IFormFacade";
7
7
  export interface ToggleablePanelsEditorFacadeOptions extends ToggleableRotatablePanelsOptions {
8
8
  toolbarButtons?: ButtonFacade[];
@@ -12,6 +12,7 @@ export interface ToggleablePanelsEditorFacadeOptions extends ToggleableRotatable
12
12
  }
13
13
  interface ToggleablePanelsEditorPanelFacadeOptions {
14
14
  title: PanelTitleTextContent;
15
+ error?: Valued<string>;
15
16
  isShown?: boolean;
16
17
  size?: PanelSizeFactor;
17
18
  content: () => ViewElement;
@@ -1,4 +1,5 @@
1
1
  /// <reference types="../../../../mithril" />
2
+ /// <reference types="mithril" />
2
3
  import { Valued } from "mdtScripts/helpers/types";
3
4
  import { Field } from "../../common/Field";
4
5
  import { IListControlFacade } from "../../services/customModules/facades/List/IListControlFacade";
@@ -41,11 +41,7 @@ export interface ListPageOptions {
41
41
  fkLinksFormOptions?: {
42
42
  [k: string]: FormPageOptions;
43
43
  };
44
- /** Запретить редактирование записей */
45
- /**
46
- * @title Запретить редактирование o2m полей в списке
47
- * @TJS-type boolean
48
- */
44
+ /** Запретить редактирование списка */
49
45
  readonly?: any;
50
46
  /** Запрашивать дополнительную информацию по путям, не отображающимся в списке */
51
47
  addSelect?: string[];