mdt-client 1.3.0 → 31.0.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.
Files changed (70) hide show
  1. package/dist/index.d.ts +0 -1
  2. package/dist/tsconfig.tsbuildinfo +1 -2715
  3. package/package.json +1 -1
  4. package/readme.md +15 -15
  5. package/types/common/Field.d.ts +3 -2
  6. package/types/common/Record.d.ts +4 -1
  7. package/types/common/Table.d.ts +4 -4
  8. package/types/common/list/group/groupTypes.d.ts +26 -0
  9. package/types/common/list/hierarchy/hierarchyTypes.d.ts +39 -0
  10. package/types/components/baseFormControls/input/{inputView.d.ts → inputOptions.d.ts} +3 -6
  11. package/types/components/button/baseButton/buttonOptions.d.ts +12 -0
  12. package/types/components/buttonGroup/buttonGroupOptions.d.ts +7 -0
  13. package/types/components/dropdown/menuActionItem/dropdownMenuItemOptions.d.ts +3 -3
  14. package/types/components/form/label/labelOptions.d.ts +18 -0
  15. package/types/components/icon/iconOptions.d.ts +1 -2
  16. package/types/components/iconButton/iconButtonOptions.d.ts +7 -0
  17. package/types/components/processPrincipalsList/ProcessPrincipalsListItem.d.ts +1 -1
  18. package/types/components/resizablePanels/panelTitle/panelTitleOptions.d.ts +15 -0
  19. package/types/components/resizablePanels/panelToolbar/panelToolbarOptions.d.ts +4 -0
  20. package/types/components/resizablePanels/resizablePanel/resizablePanelOptions.d.ts +24 -0
  21. package/types/components/resizablePanels/resizablePanelsOptions.d.ts +22 -0
  22. package/types/components/toggleablePanels/toggleablePanelsOptions.d.ts +40 -0
  23. package/types/helpers/IUi.d.ts +1 -0
  24. package/types/helpers/deleteFromArray.d.ts +1 -0
  25. package/types/helpers/events/EventEmitter.d.ts +7 -0
  26. package/types/helpers/fireEvent.d.ts +4 -0
  27. package/types/helpers/pipeline/Pipeline.d.ts +20 -0
  28. package/types/helpers/redraw.d.ts +16 -0
  29. package/types/helpers/types.d.ts +17 -5
  30. package/types/helpers/ui/elementModificators/focusableComponent.d.ts +3 -1
  31. package/types/helpers/ui/keyboardUtils/keyboardUtils.d.ts +9 -2
  32. package/types/helpers/utils/keyStorage/KeyStorage.d.ts +6 -0
  33. package/types/helpers/utils/stringifyControlSize.d.ts +1 -1
  34. package/types/helpers/zone/IZone.d.ts +0 -1
  35. package/types/security/PermissionLevel.d.ts +3 -1
  36. package/types/security/User.d.ts +30 -0
  37. package/types/services/IFilter.d.ts +2 -2
  38. package/types/services/ModuleData.d.ts +2 -1
  39. package/types/services/api/BaseQuery.d.ts +3 -2
  40. package/types/services/api/Query.d.ts +10 -36
  41. package/types/services/api/QuerySorting.d.ts +8 -0
  42. package/types/services/commands/CommandManager.d.ts +1 -1
  43. package/types/services/customModules/facades/Form/IFieldControlManagerFacade.d.ts +1 -1
  44. package/types/services/customModules/facades/Form/IFormControlFacade.d.ts +9 -2
  45. package/types/services/customModules/facades/Form/IFormFacade.d.ts +20 -5
  46. package/types/services/customModules/facades/IAuthFacade.d.ts +2 -2
  47. package/types/services/customModules/facades/IMdtFacade.d.ts +0 -1
  48. package/types/services/customModules/facades/List/IListCellFacade.d.ts +2 -2
  49. package/types/services/customModules/facades/List/IListControlFacade.d.ts +5 -4
  50. package/types/services/customModules/facades/List/IListServiceFacade.d.ts +16 -0
  51. package/types/services/customModules/facades/components/CodeEditorFacade.d.ts +9 -0
  52. package/types/services/customModules/facades/schema/IObjectFacade.d.ts +1 -1
  53. package/types/services/customModules/facades/services/IListButtonExtendPipelineService.d.ts +13 -0
  54. package/types/services/customModules/facades/services/ISecurityFacade.d.ts +6 -14
  55. package/types/services/customModules/facades/utils/IApiFacade.d.ts +5 -5
  56. package/types/services/customModules/facades/utils/IUiComponentsFacade.d.ts +11 -3
  57. package/types/services/customModules/facades/utils/IUiFacade.d.ts +16 -7
  58. package/types/services/customModules/facades/utils/IUtilsFacade.d.ts +6 -1
  59. package/types/services/customModules/facades/utils/ImUtilsFacade.d.ts +1 -2
  60. package/types/services/dropdown/IDropDownMenu.d.ts +16 -5
  61. package/types/views/form/controls/commonControl/ICommonControl.d.ts +2 -2
  62. package/types/views/form/controls/monacoEditor/MonacoCodeOptions.schema.d.ts +22 -0
  63. package/types/views/form/controls/monacoEditor/jsonSchemas/Button.schema.d.ts +4 -3
  64. package/types/views/form/controls/toggleablePanels/editor/toggleablePanelsEditorFacadeOptions.d.ts +20 -0
  65. package/types/views/form/formTypes.d.ts +1 -1
  66. package/types/views/form/schema/FormPageOptions.schema.d.ts +17 -0
  67. package/types/views/list/IListView.d.ts +10 -6
  68. package/types/views/list/schema/ListPageOptions.schema.d.ts +21 -6
  69. package/types/helpers/utils/classNames.d.ts +0 -2
  70. package/types/helpers/utils/object.d.ts +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mdt-client",
3
- "version": "1.3.0",
3
+ "version": "31.0.0",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
package/readme.md CHANGED
@@ -1,15 +1,15 @@
1
- ### Установка
2
-
3
- Установка с помощью `npm`
4
-
5
- ```
6
- npm install mdt-client
7
- ```
8
-
9
- ### Использование
10
-
11
- Для использования нужно импортировать нужный компонент
12
-
13
- ```js
14
- import { Navigation } from "mdt-client";
15
- ```
1
+ ### Установка
2
+
3
+ Установка с помощью `npm`
4
+
5
+ ```
6
+ npm install mdt-client
7
+ ```
8
+
9
+ ### Использование
10
+
11
+ Для использования нужно импортировать нужный компонент
12
+
13
+ ```js
14
+ import { Navigation } from "mdt-client";
15
+ ```
@@ -1,5 +1,5 @@
1
- import { FieldCode, FieldKind, Valued } from "mdtScripts/helpers/types";
2
- import { IFilter } from "mdtServices/IFilter";
1
+ import { FieldCode, FieldKind, Valued } from "../helpers/types";
2
+ import { IFilter } from "../services/IFilter";
3
3
  import { Record } from "./Record";
4
4
  import { Table } from "./Table";
5
5
  export interface Field extends Record {
@@ -27,6 +27,7 @@ export interface Field extends Record {
27
27
  isFixedLength?: boolean;
28
28
  defaultValue?: string | number | boolean | Date;
29
29
  formatMask?: string;
30
+ computed?: boolean;
30
31
  refTable?: Table;
31
32
  readonly?: boolean;
32
33
  multiple?: boolean;
@@ -12,8 +12,11 @@ export interface Record {
12
12
  $new?: boolean;
13
13
  $dirty?: boolean;
14
14
  $destroy?: boolean;
15
- $params?: any;
16
15
  [field: string]: any;
17
16
  }
18
17
  export declare type MdtRecord = Record;
18
+ export declare type HierarchicalRecord<R = MdtRecord> = R & {
19
+ $hierarchy?: HierarchicalRecord<R>[];
20
+ $matched?: boolean;
21
+ };
19
22
  export {};
@@ -1,6 +1,6 @@
1
- import { Icon } from "mdtScripts/components/icon/iconOptions";
2
- import { ModuleId, ObjectCode, ObjectId, ObjectTitle } from "mdtScripts/helpers/types";
3
- import { PermissionLevel } from "../security/PermissionLevel";
1
+ import { Icon } from "../components/icon/iconOptions";
2
+ import { ModuleId, ObjectCode, ObjectId, ObjectTitle } from "../helpers/types";
3
+ import { PermissionLevelString } from "../security/PermissionLevel";
4
4
  import { Datasource } from "./Datasource";
5
5
  import { Field } from "./Field";
6
6
  import { Record } from "./Record";
@@ -24,7 +24,7 @@ export interface Table extends Record {
24
24
  $datasource?: Datasource;
25
25
  id_ObjectType?: string;
26
26
  tag_Enabled?: any;
27
- accessLevel?: PermissionLevel;
27
+ accessLevel?: PermissionLevelString;
28
28
  children?: Array<string>;
29
29
  readonly?: boolean;
30
30
  icon?: Icon;
@@ -0,0 +1,26 @@
1
+ import { FieldPath } from "../../../helpers/types";
2
+ import { QuerySortingObject } from "../../../services//api/QuerySorting";
3
+ export declare namespace Grouping {
4
+ interface Group {
5
+ groups?: GroupItem[];
6
+ allParents?: boolean;
7
+ orphans?: boolean;
8
+ toggledValues?: string[][];
9
+ }
10
+ interface GroupItem {
11
+ fieldPath: FieldPath;
12
+ collapsed?: boolean;
13
+ select?: FieldPath[];
14
+ sorting?: QuerySortingObject[];
15
+ label?: GroupLabel | false;
16
+ toggledValues?: any[];
17
+ withEmpty?: boolean;
18
+ sortDesc?: boolean;
19
+ }
20
+ type GroupLabel = {
21
+ title?: string;
22
+ icon?: string;
23
+ color?: string;
24
+ textColor?: string;
25
+ };
26
+ }
@@ -0,0 +1,39 @@
1
+ import { Table } from "../../../common/Table";
2
+ import { FieldCode } from "../../../helpers/types";
3
+ import { IFilter } from "../../../services/IFilter";
4
+ export declare type HierarchyMode = "" | "-" | "+" | "#";
5
+ export interface HierarchyQuery {
6
+ /** Поле с ID родительской записи */
7
+ parentField?: FieldCode;
8
+ /** Поле ID записи */
9
+ primaryField?: FieldCode;
10
+ /**
11
+ * Режим фильтрации иерархии.
12
+ * "-" - Отображать всех родителей отфильтрованной записи,
13
+ * "+" - Отображать все дочерние записи отфильтрованной записи,
14
+ * "#" - Оторбражать все родительские и дочерние записи
15
+ */
16
+ mode?: HierarchyMode;
17
+ /** Фильтр для дочерних и родительских записей, не попадающих под критерии основной фильтрации списка */
18
+ filter?: IFilter;
19
+ table?: Table;
20
+ }
21
+ export interface HierarchyListExtenderPublicOptions extends Exclude<HierarchyQuery, "table"> {
22
+ /**
23
+ * Ключи наборов фильтров, при которых фильтрация считается наложенной. Используется для отображения кнопок режима фильтрации.
24
+ * Например: "default", "extended"
25
+ */
26
+ defaultFilterKeys?: string[];
27
+ /**
28
+ * Изменение иерархии с помощью перетаскивания
29
+ */
30
+ dragDropEnabled?: boolean;
31
+ /** Расширение кнопки типа иерархии
32
+ * @ignore
33
+ */
34
+ buttonExtend?: any;
35
+ /**
36
+ * Уровень до которого будут раскрыты узлы
37
+ */
38
+ expandedLevel?: number;
39
+ }
@@ -1,10 +1,7 @@
1
1
  /// <reference types="../../../../mithril" />
2
- /// <reference types="mithril" />
3
- import "./inputView.less";
4
- import { ComponentSize } from "mdtScripts/helpers/utils/stringifyControlSize";
5
- import { KeyboardActions } from "mdtScripts/helpers/ui/elementModificators/focusableComponent";
6
- import { CSSClassName } from "mdtScripts/helpers/types";
7
- export declare function inputView({ attrs, hasError, size, ...options }: InputOptions): _mithril.MithrilVirtualElement;
2
+ import { CSSClassName } from "../../../helpers/types";
3
+ import { KeyboardActions } from "../../../helpers/ui/elementModificators/focusableComponent";
4
+ import { ComponentSize } from "../../../helpers/utils/stringifyControlSize";
8
5
  export interface InputOptions {
9
6
  id?: string;
10
7
  value?: string | number;
@@ -0,0 +1,12 @@
1
+ import { ViewElement } from "mdtScripts/helpers/types";
2
+ import { ComponentSize } from "mdtScripts/helpers/utils/stringifyControlSize";
3
+ export interface ButtonOptions {
4
+ title?: string;
5
+ command?: () => void;
6
+ className?: string;
7
+ tooltip?: string;
8
+ enabled?: boolean;
9
+ icon?: string;
10
+ endElement?: ViewElement;
11
+ size?: ComponentSize;
12
+ }
@@ -0,0 +1,7 @@
1
+ import { ButtonOptions } from "../button/baseButton/buttonOptions";
2
+ export declare type GroupButtonOptions = ButtonOptions & {
3
+ selected: boolean;
4
+ };
5
+ export interface ButtonGroupOptions {
6
+ buttons: GroupButtonOptions[];
7
+ }
@@ -1,6 +1,6 @@
1
- import { Icon } from "mdtScripts/components/icon/iconOptions";
2
- import { FormattedText } from "mdtScripts/helpers/formattedText";
3
- import { CSSClassName, ViewElement, Valued } from "mdtScripts/helpers/types";
1
+ import { Icon } from "../../../components/icon/iconOptions";
2
+ import { FormattedText } from "../../../helpers/formattedText";
3
+ import { CSSClassName, ViewElement, Valued } from "../../../helpers/types";
4
4
  export interface DropdownMenuItemBaseOptions {
5
5
  icon?: Valued<Icon>;
6
6
  title: Valued<string>;
@@ -0,0 +1,18 @@
1
+ import { IconButtonOptions } from "mdtScripts/components/iconButton/iconButtonOptions";
2
+ import { CSSClassName } from "mdtScripts/helpers/types";
3
+ export interface LabelIconButton {
4
+ name: string;
5
+ options: IconButtonOptions;
6
+ }
7
+ export interface LabelOptions {
8
+ title: string;
9
+ description?: string;
10
+ required?: boolean;
11
+ error?: string;
12
+ iconButtons?: LabelIconButton[];
13
+ }
14
+ export interface LabelViewOptions extends LabelOptions {
15
+ for?: string;
16
+ onClick?: () => void;
17
+ className?: CSSClassName;
18
+ }
@@ -1,6 +1,5 @@
1
1
  /// <reference types="../../../../mithril" />
2
- /// <reference types="mithril" />
3
- import { CSSClassName } from "mdtScripts/helpers/types";
2
+ import { CSSClassName } from "../../helpers/types";
4
3
  import { FormattedText } from "../../helpers/formattedText";
5
4
  export declare type Icon = string;
6
5
  export interface BaseIconOptions {
@@ -0,0 +1,7 @@
1
+ import { UiType } from "../../helpers/IUi";
2
+ import { CommandEvent } from "../../helpers/types";
3
+ import { IconOptions } from "../icon/iconOptions";
4
+ export interface IconButtonOptions extends IconOptions {
5
+ command?: (e: CommandEvent) => void;
6
+ type?: UiType;
7
+ }
@@ -1,4 +1,4 @@
1
- import { RecordId } from "mdtScripts/common/Record";
1
+ import { RecordId } from "../../common/Record";
2
2
  export interface ProcessPrincipalsListItem {
3
3
  id: RecordId;
4
4
  title: string;
@@ -0,0 +1,15 @@
1
+ import { LabelIconButton } from "../../../components/form/label/labelOptions";
2
+ import { FormattedText } from "../../../helpers/formattedText";
3
+ import { CSSClassName, Valued, ViewElement } from "../../../helpers/types";
4
+ export declare type PanelTitleTextContent = string;
5
+ export interface PanelTitleOptions {
6
+ text: Valued<PanelTitleTextContent>;
7
+ tooltip?: Valued<FormattedText>;
8
+ endZone?: PanelTitleEndZone;
9
+ icons?: Valued<LabelIconButton | undefined>[];
10
+ className?: Valued<CSSClassName>;
11
+ wrapperClassName?: string;
12
+ }
13
+ export interface PanelTitleEndZone {
14
+ view: () => ViewElement;
15
+ }
@@ -0,0 +1,4 @@
1
+ import { ButtonGroupOptions } from "mdtScripts/components/buttonGroup/buttonGroupOptions";
2
+ export interface PanelToolbarOptions {
3
+ buttonGroup: ButtonGroupOptions;
4
+ }
@@ -0,0 +1,24 @@
1
+ import { ViewElement } from "../../../helpers/types";
2
+ import { PanelToolbarOptions } from "../panelToolbar/panelToolbarOptions";
3
+ import { PanelTitleOptions } from "../panelTitle/panelTitleOptions";
4
+ export interface ResizablePanelOptions {
5
+ content: ResizablePanelContent;
6
+ onCreated?: (el: HTMLElement, onUnload: (handler: () => void) => void) => void;
7
+ }
8
+ export declare type OnPanelResize = () => void;
9
+ export interface ResizablePanelContent {
10
+ view: () => ViewElement;
11
+ onResize?: OnPanelResize;
12
+ title?: PanelTitleOptions;
13
+ toolbar?: PanelToolbarOptions;
14
+ topZone?: PanelTopZone;
15
+ className?: string;
16
+ focusOptions?: ResizablePanelFocusOptions;
17
+ }
18
+ export interface PanelTopZone {
19
+ view: () => ViewElement;
20
+ }
21
+ export declare type ResizablePanelOnFocus = (focusedByUser: boolean) => void;
22
+ export interface ResizablePanelFocusOptions {
23
+ onFocus?: ResizablePanelOnFocus;
24
+ }
@@ -0,0 +1,22 @@
1
+ import { MithrilVirtualElementKey } from "../../helpers/types";
2
+ import { ResizablePanelContent } from "./resizablePanel/resizablePanelOptions";
3
+ export declare type PanelsDirection = "row" | "column";
4
+ export declare type PanelSizeFactor = number;
5
+ export interface PanelWithSizeFactor {
6
+ /**
7
+ * Размер панели в долях. Все панели по-умолчанию имеют размер 1. Если, например, задать 2, то панель будет больше остальных в два раза.
8
+ * @default 1
9
+ */
10
+ size?: PanelSizeFactor;
11
+ }
12
+ export interface ResizablePanelsItemContent extends ResizablePanelContent, PanelWithSizeFactor {
13
+ }
14
+ export interface ResizablePanelsContentItem extends ResizablePanelsItemContent {
15
+ key: MithrilVirtualElementKey;
16
+ }
17
+ export interface ResizablePanelsOptions {
18
+ direction: PanelsDirection;
19
+ content: ResizablePanelsContentItem[];
20
+ resizerSize?: number;
21
+ highlightFocusedPanel?: boolean;
22
+ }
@@ -0,0 +1,40 @@
1
+ import { Valued, ViewElement } from "../../helpers/types";
2
+ import { PanelTitleOptions } from "../resizablePanels/panelTitle/panelTitleOptions";
3
+ import { PanelSizeFactor, ResizablePanelsItemContent } from "../resizablePanels/resizablePanelsOptions";
4
+ export interface ToggleablePanel {
5
+ title: PanelTitleOptions;
6
+ content: ResizablePanelsItemContent;
7
+ isShown: boolean;
8
+ toggleButtonOptions?: ToggleablePanelToggleButtonOptions;
9
+ }
10
+ interface ToggleablePanelToggleButtonOptions {
11
+ title?: Valued<string>;
12
+ }
13
+ export interface ToggleablePanelsToolbarOptions {
14
+ className?: string;
15
+ leftZone?: ToolbarZone;
16
+ rightZone?: ToolbarZone;
17
+ }
18
+ interface ToolbarZone {
19
+ view: () => ViewElement;
20
+ }
21
+ export declare type ToggleablePanelsRowDirection = "vertical" | "horizontal";
22
+ export interface ToggleableRotatablePanelsOptions {
23
+ /**
24
+ * @default "horizontal"
25
+ */
26
+ rowDirection?: ToggleablePanelsRowDirection;
27
+ }
28
+ export interface ToggleablePanelsOptions extends ToggleableRotatablePanelsOptions {
29
+ highlightFocusedPanel?: boolean;
30
+ panels: PanelsGrid<ToggleablePanel>;
31
+ toolbar?: ToggleablePanelsToolbarOptions;
32
+ resizerSize?: number;
33
+ }
34
+ export interface PanelsGrid<T> {
35
+ rows: {
36
+ cols: T[];
37
+ size?: PanelSizeFactor;
38
+ }[];
39
+ }
40
+ export {};
@@ -0,0 +1 @@
1
+ export declare type UiType = "success" | "danger" | "warning" | "info" | "primary" | "fatal";
@@ -0,0 +1 @@
1
+ export declare function deleteFromArray<T = any>(array: T[], item: T): void;
@@ -0,0 +1,7 @@
1
+ import { AnyObject } from "../types";
2
+ export declare class EventEmitter<E = Record<string, AnyObject>> {
3
+ private events;
4
+ subscribe<T extends keyof E>(code: T, listener: (args: E[T]) => void): () => void;
5
+ unsubscribe<T extends keyof E>(code: T, listener: (args: E[T]) => void): void;
6
+ emit<T extends keyof E>(code: T, args?: E[T]): void;
7
+ }
@@ -0,0 +1,4 @@
1
+ export declare const fireEvent: FireEventType;
2
+ declare type FireEventType = (...args: any[]) => any;
3
+ export declare function addDisposableEvent<T extends FireEventType = FireEventType>(event: Array<FireEventType>, callback: T): void;
4
+ export {};
@@ -0,0 +1,20 @@
1
+ import { AnyError } from "../types";
2
+ declare type Next<D> = (args?: D) => void;
3
+ declare type Middleware<D> = (args: D, next: Next<D>) => void | Promise<void>;
4
+ export declare class Pipeline<D = any> {
5
+ private middlewaresStorage;
6
+ constructor(middlewares?: Middleware<D>[]);
7
+ push(middleware: Middleware<D>): () => void;
8
+ remove(middleware: Middleware<D>): void;
9
+ execute(args: D, onComplete: (args: D) => void, onError?: (e: AnyError) => void): void;
10
+ executePromise(args: D): Promise<D>;
11
+ }
12
+ declare type MiddlewareSync<D> = (args: D) => D | undefined;
13
+ export declare class PipelineSync<D = any> {
14
+ private middlewaresStorage;
15
+ constructor(middlewares?: MiddlewareSync<D>[]);
16
+ push(middleware: MiddlewareSync<D>): () => void;
17
+ remove(middleware: MiddlewareSync<D>): void;
18
+ execute(args: D): D;
19
+ }
20
+ export {};
@@ -0,0 +1,16 @@
1
+ declare type RedrawEventHandler = () => void;
2
+ export interface RedrawFn {
3
+ (x?: any): void;
4
+ events: {
5
+ after?: RedrawEventHandler[];
6
+ before?: RedrawEventHandler[];
7
+ beforeOnce: RedrawEventHandler[];
8
+ afterOnce: RedrawEventHandler[];
9
+ };
10
+ }
11
+ export declare const uiRedraw: {
12
+ redrawing: boolean;
13
+ animating: boolean;
14
+ redraw: RedrawFn;
15
+ };
16
+ export {};
@@ -1,5 +1,5 @@
1
1
  /// <reference types="../../../../mithril" />
2
- /// <reference types="mithril" />
2
+ import { UiType } from "./IUi";
3
3
  export interface AnyObject {
4
4
  [key: string]: any;
5
5
  }
@@ -17,22 +17,29 @@ export interface NotifierOptions {
17
17
  export interface Notifier {
18
18
  notify(title: MessageText, options?: NotifierOptions): void;
19
19
  }
20
+ export interface NotifierErrorOptions extends NotifierOptions {
21
+ error?: Error;
22
+ }
23
+ export interface ErrorNotifier extends Notifier {
24
+ notify(title: MessageText, options?: NotifierErrorOptions): void;
25
+ }
20
26
  export declare type ViewElement = _mithril.MithrilVirtualElement | _mithril.MithrilVirtualElement[] | string;
21
27
  export declare type CommandEvent = Event | _mithril.MithrilEvent;
22
28
  export declare type InputChangeEvent = Event | _mithril.MithrilEvent;
23
29
  export declare type CSSClassName = string;
30
+ export declare type CSSPositionUnit = string;
24
31
  export declare type MithrilControl = ViewControl | ContentControl;
25
32
  export interface ViewControl {
26
33
  $view(): ViewElement | string;
27
34
  [key: string]: any;
28
35
  }
29
- export interface ContentControl {
30
- content: any;
36
+ export interface ContentControl<C = any> {
37
+ content: C;
31
38
  [key: string]: any;
32
39
  }
33
40
  export declare type Markdown = string;
34
41
  export declare type MessageText = Markdown | string;
35
- export declare type ColorStyle = "default" | "primary" | "success" | "info" | "warning" | "danger" | "fatal";
42
+ export declare type ColorStyle = UiType | "default";
36
43
  export declare type ButtonStyle = ColorStyle;
37
44
  export declare type ObjectCode = string;
38
45
  export declare type ObjectId = number;
@@ -47,15 +54,20 @@ export declare type Timeout = ReturnType<typeof setTimeout>;
47
54
  export declare type MithrilAttributes = _mithril.MithrilAttributes & {
48
55
  [name: string]: any;
49
56
  };
57
+ export declare type MithrilVirtualElementKey = string | number;
58
+ export declare type HTMLAnchorTarget = "_blank" | "_self" | "_parent" | "_top" | "framename";
59
+ export declare type KeyboardKeyCode = string;
50
60
  export declare type AnyError = any;
51
61
  export declare type FieldPath = string;
52
62
  export declare type FieldId = number;
53
63
  export declare type FieldCode = string;
54
64
  export declare type FieldKind = "dfk" | "o2m" | "o2o" | "hist" | "dfk-list";
55
- export declare type KeyboardKeyCode = string;
56
65
  export declare type LanguageCode = "ru" | "en";
57
66
  export declare type LanguageId = number;
58
67
  export declare type GConstructor<T = Record<string, unknown>, A extends Array<any> = any> = new (...args: A) => T;
59
68
  export declare type URLString = string;
60
69
  export declare type JSONString = string;
70
+ export declare type JavaScriptCodeContent = string;
71
+ export declare type DateString = string;
72
+ export declare type RequestMethod = "POST" | "GET" | string;
61
73
  export {};
@@ -1,12 +1,14 @@
1
1
  /// <reference types="../../../../mithril" />
2
- /// <reference types="mithril" />
2
+ import { KeyboardKeyCode } from "../../../helpers/types";
3
3
  import { ComponentConfigParams } from "./modificatorsTypes";
4
+ export declare function doesKeyPressed(keyCode: KeyboardKeyCode | KeyboardKeyCode[], e: KeyboardEvent): boolean;
4
5
  export declare function getFocusableComponentAttrs(): _mithril.MithrilAttributes;
5
6
  declare type KeyboardAction = (e: KeyboardEvent) => void;
6
7
  export interface KeyboardActions {
7
8
  primary?: KeyboardAction;
8
9
  secondary?: KeyboardAction;
9
10
  clear?: KeyboardAction;
11
+ cancel?: KeyboardAction;
10
12
  }
11
13
  export declare function setKeyboardActions(actions: KeyboardActions, configParams: ComponentConfigParams): void;
12
14
  export {};
@@ -1,4 +1,9 @@
1
- export declare type KeyCode = string;
1
+ /** KeyboardEvent.code */
2
+ export declare type KeyboardKeyCode = string;
3
+ /** KeyboardEvent.key */
4
+ export declare type KeyboardKeyValue = string;
5
+ /** KeyboardEvent.key, приведенный к числу */
6
+ export declare type KeyboardNumberKeyValue = number;
2
7
  interface EventModifierKeys {
3
8
  shift: boolean;
4
9
  meta: boolean;
@@ -12,5 +17,7 @@ interface KeydownEventKeyCheckingOptions {
12
17
  /** @default true */
13
18
  checkModifiers?: boolean;
14
19
  }
15
- export declare function checkKeydownEventKeys(e: KeyboardEvent, keyCode: KeyCode, options?: KeydownEventKeyCheckingOptions): boolean;
20
+ export declare function checkKeydownEventKeys(e: KeyboardEvent, keyCode: KeyboardKeyCode, options?: KeydownEventKeyCheckingOptions): boolean;
21
+ /** Получить код клавиши с цифрой */
22
+ export declare function getKeyCodeOfNumberKey(numberKeyValue: KeyboardNumberKeyValue): KeyboardKeyCode;
16
23
  export {};
@@ -0,0 +1,6 @@
1
+ export interface KeyStorage<T> {
2
+ get(): T;
3
+ set(value: T): void;
4
+ clear(): void;
5
+ }
6
+ export declare type KeyStorageInvalidateKey = number | string;
@@ -1,3 +1,3 @@
1
- import { ControlSize } from "mdtScripts/views/controls/Control";
1
+ import { ControlSize } from "../../views/controls/Control";
2
2
  export declare type ComponentSize = "small" | "normal" | "large";
3
3
  export declare function stringifyControlSize(size: ControlSize): ComponentSize;
@@ -1,5 +1,4 @@
1
1
  /// <reference types="../../../../mithril" />
2
- /// <reference types="mithril" />
3
2
  import { MithrilControl } from "../types";
4
3
  export interface IZone {
5
4
  remove(content: MithrilControl): void;
@@ -1,4 +1,4 @@
1
- import { IFilterGroup } from "mdtServices/IFilter";
1
+ import { IFilterGroup } from "../services/IFilter";
2
2
  import { MdtField } from "../common/MdtField";
3
3
  import { MdtObject } from "../common/MdtObject";
4
4
  import { Record } from "../common/Record";
@@ -12,6 +12,8 @@ export declare enum PermissionLevel {
12
12
  Filter = 32,
13
13
  All = 255
14
14
  }
15
+ /** Example: "Read, Write, Delete, Add" */
16
+ export declare type PermissionLevelString = string;
15
17
  export interface PrincipalPermission extends Record {
16
18
  ID_Permission?: number;
17
19
  ID_Permission$?: Permission;
@@ -0,0 +1,30 @@
1
+ import { ObjectId } from "../helpers/types";
2
+ import { PermissionLevel } from "./PermissionLevel";
3
+ export interface User {
4
+ $id: number;
5
+ id: any;
6
+ permissions: {
7
+ object: {
8
+ [objectId: ObjectId]: {
9
+ level: PermissionLevel;
10
+ fields?: {
11
+ [objectId: ObjectId]: {
12
+ level: PermissionLevel;
13
+ };
14
+ };
15
+ };
16
+ };
17
+ listview: PermissionLevel;
18
+ namedfilters: PermissionLevel;
19
+ };
20
+ login: string;
21
+ fullName: string;
22
+ email?: string;
23
+ identityName: string;
24
+ isAdmin: boolean;
25
+ isAnonymous: boolean;
26
+ roles: string[];
27
+ languageId: number;
28
+ languageCode: string;
29
+ isImpersonated: boolean;
30
+ }
@@ -61,7 +61,7 @@ export interface FilterConstructor {
61
61
  fulltext(p1: any, p2: any): IFilterItem;
62
62
  not(f: any): IFilterItem;
63
63
  in(p1: any, ar: any): IFilterIn;
64
- queryIn(field: any, table: any, subField: any, filter: any, args?: any): IFilterIn;
64
+ queryIn(field: any, table: any, subField: any, filter?: any, args?: any): IFilterIn;
65
65
  cast(filter: any, cast: any): IFilter;
66
66
  equalTemplate(p1: any, p2: any): any;
67
67
  empty: any;
@@ -84,7 +84,7 @@ export declare class Filter {
84
84
  static fulltext(p1: any, p2: any): IFilterItem;
85
85
  static not(f: any): IFilterItem;
86
86
  static in(p1: any, ar: any): IFilterIn;
87
- static queryIn(field: any, table: any, subField: any, filter: any, args?: any): IFilterIn;
87
+ static queryIn(field: any, table: any, subField: any, filter?: any, args?: any): IFilterIn;
88
88
  static cast(filter: any, cast: any): IFilter;
89
89
  static equalTemplate(p1: any, p2: any): IFilter;
90
90
  static isFilterGroup(filter: IFilter): filter is IFilterGroup;
@@ -1,7 +1,8 @@
1
+ import { ModuleCode } from "../helpers/types";
1
2
  import { RecordId } from "../common/Record";
2
3
  import { Record } from "../common/Record";
3
4
  export interface ModuleData extends Record {
4
- Code: string;
5
+ Code: ModuleCode;
5
6
  ID_Package?: RecordId;
6
7
  Icon?: string;
7
8
  Title?: string;
@@ -1,8 +1,8 @@
1
1
  import { IFilter } from "../IFilter";
2
- import { QuerySorting } from "./Query";
2
+ import { QuerySorting } from "./QuerySorting";
3
3
  export interface BaseQuery {
4
4
  /** Названия выбранных полей */
5
- select?: string[];
5
+ select?: QuerySelect;
6
6
  /** Количество записей */
7
7
  top?: number;
8
8
  /** Фильтр запроса */
@@ -13,3 +13,4 @@ export interface BaseQuery {
13
13
  sorting?: QuerySorting[];
14
14
  count?: boolean;
15
15
  }
16
+ export declare type QuerySelect = string[];