mdt-client 1.3.0 → 23.0.1
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/dist/index.d.ts +1 -2
- package/dist/index.js +2 -12
- package/dist/index.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -2715
- package/package.json +3 -5
- package/readme.md +15 -15
- package/types/common/Datasource.d.ts +1 -1
- package/types/common/Field.d.ts +3 -5
- package/types/common/Record.d.ts +1 -9
- package/types/common/Table.d.ts +6 -12
- package/types/security/PermissionLevel.d.ts +1 -2
- package/types/services/IFilter.d.ts +9 -20
- package/types/services/customModules/facades/Form/IFieldControlManagerFacade.d.ts +1 -1
- package/types/services/customModules/facades/Form/IFormControlFacade.d.ts +2 -25
- package/types/services/customModules/facades/Form/IFormFacade.d.ts +4 -14
- package/types/services/customModules/facades/IAuthFacade.d.ts +1 -2
- package/types/services/customModules/facades/IMdtFacade.d.ts +3 -11
- package/types/services/customModules/facades/List/IListCellFacade.d.ts +1 -6
- package/types/services/customModules/facades/List/IListControlFacade.d.ts +1 -8
- package/types/services/customModules/facades/List/IListRowFacade.d.ts +12 -2
- package/types/services/customModules/facades/List/IListServiceFacade.d.ts +0 -7
- package/types/services/customModules/facades/internalModules/modulesFacadeTypes.d.ts +10 -0
- package/types/services/customModules/facades/internalModules/statusFacade.d.ts +14 -0
- package/types/services/customModules/facades/record/IRecordFacade.d.ts +16 -0
- package/types/services/customModules/facades/schema/IObjectFacade.d.ts +0 -2
- package/types/services/customModules/facades/utils/IUiComponentsFacade.d.ts +1 -40
- package/types/services/customModules/facades/utils/IUiFacade.d.ts +9 -12
- package/types/services/customModules/facades/utils/IUtilsFacade.d.ts +0 -1
- package/types/services/customModules/facades/utils/ImUtilsFacade.d.ts +0 -4
- package/types/views/controls/Control.d.ts +2 -1
- package/types/views/form/controls/monacoEditor/jsonSchemas/Button.schema.d.ts +3 -4
- package/types/views/form/schema/FormPageOptions.schema.d.ts +17 -0
- package/types/views/list/schema/ListPageOptions.schema.d.ts +7 -34
- package/types/components/baseFormControls/input/inputView.d.ts +0 -28
- package/types/components/dropdown/menu/item/dropdownInputItemOptions.d.ts +0 -5
- package/types/components/dropdown/menu/item/dropdownItemWrapOptions.d.ts +0 -19
- package/types/components/dropdown/menuActionItem/dropdownMenuItemOptions.d.ts +0 -28
- package/types/components/icon/iconOptions.d.ts +0 -22
- package/types/components/processPrincipalsList/ProcessPrincipalsListItem.d.ts +0 -5
- package/types/data/active/ActivationListAdapterTypes.d.ts +0 -6
- package/types/helpers/formattedText.d.ts +0 -9
- package/types/helpers/types.d.ts +0 -61
- package/types/helpers/ui/elementModificators/focusableComponent.d.ts +0 -12
- package/types/helpers/ui/elementModificators/modificatorsTypes.d.ts +0 -4
- package/types/helpers/ui/keyboardUtils/keyboardUtils.d.ts +0 -16
- package/types/helpers/utils/classNames.d.ts +0 -2
- package/types/helpers/utils/object.d.ts +0 -1
- package/types/helpers/utils/stringifyControlSize.d.ts +0 -3
- package/types/helpers/zone/IZone.d.ts +0 -8
- package/types/services/HotkeyManager.d.ts +0 -4
- package/types/services/commands/Command.d.ts +0 -22
- package/types/services/commands/CommandGroup.d.ts +0 -15
- package/types/services/commands/CommandManager.d.ts +0 -77
- package/types/services/customModules/facades/IPageFacade.d.ts +0 -7
- package/types/services/customModules/facades/List/IListComponentFacade.d.ts +0 -10
- package/types/services/customModules/facades/components/ModalFacade.d.ts +0 -4
- package/types/services/customModules/facades/services/CommandManagerFacade.d.ts +0 -11
- package/types/services/dropdown/IDropDownMenu.d.ts +0 -29
- package/types/views/form/controls/commonControl/ICommonControl.d.ts +0 -24
- package/types/views/form/formTypes.d.ts +0 -4
- package/types/views/list/IListView.d.ts +0 -62
- package/types/views/page/PageZoneTypes.d.ts +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mdt-client",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "23.0.1",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -11,9 +11,7 @@
|
|
|
11
11
|
"scripts": {
|
|
12
12
|
"build": "tsc",
|
|
13
13
|
"types-update": "tsc --project tsconfig.facade-types.json",
|
|
14
|
-
"
|
|
15
|
-
"pub-patch": "npm version patch && npm publish",
|
|
16
|
-
"pub-minor": "npm version minor && npm publish"
|
|
14
|
+
"pub": "npm version patch && npm publish"
|
|
17
15
|
},
|
|
18
16
|
"repository": {
|
|
19
17
|
"type": "git",
|
|
@@ -25,6 +23,6 @@
|
|
|
25
23
|
"typescript": "^4.2.3"
|
|
26
24
|
},
|
|
27
25
|
"dependencies": {
|
|
28
|
-
"@types/mithril": "
|
|
26
|
+
"@types/mithril": "0.0.27"
|
|
29
27
|
}
|
|
30
28
|
}
|
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
|
+
```
|
|
@@ -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):
|
|
6
|
+
save?(data: any, params?: any, options?: ApiRequestOptions): any;
|
|
7
7
|
delete?(ids: any[], table: Table): any;
|
|
8
8
|
table?: Table;
|
|
9
9
|
}
|
package/types/common/Field.d.ts
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
import { FieldCode, FieldKind, Valued } from "mdtScripts/helpers/types";
|
|
2
|
-
import { IFilter } from "mdtServices/IFilter";
|
|
3
1
|
import { Record } from "./Record";
|
|
4
2
|
import { Table } from "./Table";
|
|
5
3
|
export interface Field extends Record {
|
|
6
4
|
id?: any;
|
|
7
|
-
code?:
|
|
5
|
+
code?: string;
|
|
8
6
|
title?: string;
|
|
9
7
|
type?: string;
|
|
10
8
|
codeLowered?: string;
|
|
@@ -19,7 +17,7 @@ export interface Field extends Record {
|
|
|
19
17
|
hidden?: boolean;
|
|
20
18
|
id_RefObject?: number;
|
|
21
19
|
id_RefObjectField?: number;
|
|
22
|
-
kind?:
|
|
20
|
+
kind?: string;
|
|
23
21
|
role?: string;
|
|
24
22
|
length?: number;
|
|
25
23
|
hasDefault?: boolean;
|
|
@@ -30,7 +28,7 @@ export interface Field extends Record {
|
|
|
30
28
|
refTable?: Table;
|
|
31
29
|
readonly?: boolean;
|
|
32
30
|
multiple?: boolean;
|
|
33
|
-
refFilter?:
|
|
31
|
+
refFilter?: any;
|
|
34
32
|
validate?: Function;
|
|
35
33
|
min?: number;
|
|
36
34
|
max?: number;
|
package/types/common/Record.d.ts
CHANGED
|
@@ -1,19 +1,11 @@
|
|
|
1
1
|
import { Table } from "./Table";
|
|
2
2
|
export declare type RecordId = number | string;
|
|
3
|
-
declare type PrimitiveTypes = string | number | boolean;
|
|
4
|
-
export declare type RecordValue = PrimitiveTypes | Record | Array<RecordValue> | null | undefined;
|
|
5
|
-
/**
|
|
6
|
-
* @deprecated use MdtRecord
|
|
7
|
-
*/
|
|
8
3
|
export interface Record {
|
|
9
4
|
$id?: RecordId;
|
|
10
5
|
$table?: Table;
|
|
11
|
-
$diff?:
|
|
6
|
+
$diff?: any;
|
|
12
7
|
$new?: boolean;
|
|
13
8
|
$dirty?: boolean;
|
|
14
9
|
$destroy?: boolean;
|
|
15
10
|
$params?: any;
|
|
16
|
-
[field: string]: any;
|
|
17
11
|
}
|
|
18
|
-
export declare type MdtRecord = Record;
|
|
19
|
-
export {};
|
package/types/common/Table.d.ts
CHANGED
|
@@ -1,25 +1,20 @@
|
|
|
1
|
-
import { Icon } from "mdtScripts/components/icon/iconOptions";
|
|
2
|
-
import { ModuleId, ObjectCode, ObjectId, ObjectTitle } from "mdtScripts/helpers/types";
|
|
3
1
|
import { PermissionLevel } from "../security/PermissionLevel";
|
|
4
2
|
import { Datasource } from "./Datasource";
|
|
5
3
|
import { Field } from "./Field";
|
|
6
4
|
import { Record } from "./Record";
|
|
7
5
|
export interface Table extends Record {
|
|
8
|
-
$id?:
|
|
9
|
-
id?:
|
|
6
|
+
$id?: number;
|
|
7
|
+
id?: number;
|
|
10
8
|
object_id?: number;
|
|
11
|
-
title?:
|
|
9
|
+
title?: string;
|
|
12
10
|
titlePlural?: string;
|
|
13
|
-
|
|
14
|
-
code?: ObjectCode;
|
|
11
|
+
code?: string;
|
|
15
12
|
abstract?: boolean;
|
|
16
13
|
defaultFieldCode?: any;
|
|
17
14
|
defaultField?: Field;
|
|
18
15
|
fields?: Field[];
|
|
19
16
|
primaryField?: Field;
|
|
20
|
-
map?:
|
|
21
|
-
[k: string]: Field;
|
|
22
|
-
};
|
|
17
|
+
map?: any;
|
|
23
18
|
mapLowered?: any;
|
|
24
19
|
$datasource?: Datasource;
|
|
25
20
|
id_ObjectType?: string;
|
|
@@ -27,8 +22,7 @@ export interface Table extends Record {
|
|
|
27
22
|
accessLevel?: PermissionLevel;
|
|
28
23
|
children?: Array<string>;
|
|
29
24
|
readonly?: boolean;
|
|
30
|
-
icon?:
|
|
31
|
-
id_ver_Module?: ModuleId;
|
|
25
|
+
icon?: string;
|
|
32
26
|
audit_Enabled?: boolean;
|
|
33
27
|
inline_AddInRow?: boolean;
|
|
34
28
|
inline_Enabled?: boolean;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { IFilterGroup } from "mdtServices/IFilter";
|
|
2
1
|
import { MdtField } from "../common/MdtField";
|
|
3
2
|
import { MdtObject } from "../common/MdtObject";
|
|
4
3
|
import { Record } from "../common/Record";
|
|
@@ -21,7 +20,7 @@ export interface PrincipalPermission extends Record {
|
|
|
21
20
|
ID_Field$?: MdtField;
|
|
22
21
|
LevelGrant?: PermissionLevel;
|
|
23
22
|
LevelDeny?: PermissionLevel;
|
|
24
|
-
Filter?:
|
|
23
|
+
Filter?: string;
|
|
25
24
|
}
|
|
26
25
|
export interface Permission extends Record {
|
|
27
26
|
id?: number;
|
|
@@ -4,37 +4,25 @@
|
|
|
4
4
|
* @default { "op": "eq", "p1": "", "p2": "" }
|
|
5
5
|
*/
|
|
6
6
|
export declare type IFilter = IFilterItem | IFilterGroup | IFilterIn;
|
|
7
|
-
export declare type FilterKeys = keyof IFilter | keyof IFilterItem | keyof IFilterGroup;
|
|
8
|
-
export declare type FilterUserIdOp = "userId";
|
|
9
|
-
export declare type FilterOp = "eq" | "ne" | "gt" | "ge" | "lt" | "le" | "startsWith" | "endsWith" | "contains" | "fulltext" | "equalTemplate" | "queryIn" | "notStartsWith" | "notContains" | "notEndsWith" | "null" | "notNull" | FilterUserIdOp | FilterInOperation;
|
|
10
|
-
export declare type FilterGroupOp = "and" | "or";
|
|
11
|
-
export declare type AnyFilterOp = FilterOp | FilterGroupOp;
|
|
12
|
-
export interface QueryInValue {
|
|
13
|
-
table?: string;
|
|
14
|
-
field?: string;
|
|
15
|
-
args?: string;
|
|
16
|
-
filter?: IFilter;
|
|
17
|
-
}
|
|
18
7
|
/** Группировка фильтров */
|
|
19
8
|
export interface IFilterGroup {
|
|
20
|
-
op:
|
|
9
|
+
op: "and" | "or";
|
|
21
10
|
groups: IFilter[];
|
|
22
11
|
not?: boolean;
|
|
23
12
|
}
|
|
24
13
|
/** Фильтр */
|
|
25
14
|
export interface IFilterItem {
|
|
26
|
-
op:
|
|
15
|
+
op: "eq" | "ne" | "gt" | "ge" | "lt" | "le" | "startsWith" | "endsWith" | "contains" | "fulltext" | "equalTemplate";
|
|
27
16
|
/** Поле, по которому происходит фильтрация */
|
|
28
17
|
p1: string;
|
|
29
18
|
/** Значение фильтра */
|
|
30
|
-
p2: string | number | Date
|
|
19
|
+
p2: string | number | Date;
|
|
31
20
|
not?: boolean;
|
|
32
21
|
cast?: "date";
|
|
33
22
|
}
|
|
34
|
-
export declare type FilterInOperation = "in";
|
|
35
23
|
/** Фильтр */
|
|
36
24
|
export interface IFilterIn extends Omit<IFilterItem, "op" | "p2"> {
|
|
37
|
-
op:
|
|
25
|
+
op: "in";
|
|
38
26
|
p2: {
|
|
39
27
|
table: string;
|
|
40
28
|
field: string;
|
|
@@ -64,7 +52,6 @@ export interface FilterConstructor {
|
|
|
64
52
|
queryIn(field: any, table: any, subField: any, filter: any, args?: any): IFilterIn;
|
|
65
53
|
cast(filter: any, cast: any): IFilter;
|
|
66
54
|
equalTemplate(p1: any, p2: any): any;
|
|
67
|
-
empty: any;
|
|
68
55
|
}
|
|
69
56
|
export declare class Filter {
|
|
70
57
|
static empty: IFilter;
|
|
@@ -86,7 +73,9 @@ export declare class Filter {
|
|
|
86
73
|
static in(p1: any, ar: any): IFilterIn;
|
|
87
74
|
static queryIn(field: any, table: any, subField: any, filter: any, args?: any): IFilterIn;
|
|
88
75
|
static cast(filter: any, cast: any): IFilter;
|
|
89
|
-
static equalTemplate(p1: any, p2: any):
|
|
90
|
-
|
|
91
|
-
|
|
76
|
+
static equalTemplate(p1: any, p2: any): {
|
|
77
|
+
op: string;
|
|
78
|
+
p1: any;
|
|
79
|
+
p2: any;
|
|
80
|
+
};
|
|
92
81
|
}
|
|
@@ -2,7 +2,7 @@ import { IFieldControlFacade } from "./IFieldControlFacade";
|
|
|
2
2
|
export interface MountContext<V> {
|
|
3
3
|
/** Родительский DOM-элемент контрола */
|
|
4
4
|
el: HTMLElement;
|
|
5
|
-
/** Поле, к которому привязан
|
|
5
|
+
/** Поле, к которому привязан контрол */
|
|
6
6
|
field: IFieldControlFacade<V>;
|
|
7
7
|
/** Опции контрола */
|
|
8
8
|
options: any;
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
import { FormZones } from "mdtScripts/views/form/formTypes";
|
|
2
|
-
import { IFieldFacade } from "../schema/IFieldFacade";
|
|
3
1
|
import { IObjectFacade } from "../schema/IObjectFacade";
|
|
4
|
-
import { RecordId } from "../utils/IApiFacade";
|
|
5
2
|
import { ParentCtrl } from "../utils/IUiFacade";
|
|
6
3
|
import { ButtonFacade } from "./IFormFacade";
|
|
7
4
|
export declare type IFormFieldOptionsConfig = {
|
|
@@ -21,46 +18,26 @@ export interface IFormControlFacade extends ParentCtrl {
|
|
|
21
18
|
getContext(key: string): any;
|
|
22
19
|
/** Установить контекстный параметр формы */
|
|
23
20
|
setContext(key: string, value: any): void;
|
|
24
|
-
/** Получить ID записи */
|
|
25
|
-
getRecordId(): RecordId;
|
|
26
21
|
/** Проверка, что запись в форме новая */
|
|
27
22
|
isNewRecord(): boolean;
|
|
28
23
|
/** Получить или установить значение для поля формы */
|
|
29
24
|
value(field: string, val?: any, val$?: any, fireEvent?: boolean, setDirty?: boolean, updateData?: {}): any;
|
|
30
25
|
/** Получение значения по пути */
|
|
31
26
|
valueByPath(path: string): any;
|
|
32
|
-
/** Добавить зависимость для запроса записи*/
|
|
33
|
-
addRecordInitDependence(dependence: () => Promise<unknown>): void;
|
|
34
27
|
/** Подписаться на событие инициализации записи формы */
|
|
35
28
|
onBound(callback: () => void): void;
|
|
36
29
|
/** Подписаться на событие сохранения записи */
|
|
37
30
|
onSave<T = {
|
|
38
31
|
[field: string]: any;
|
|
39
32
|
}>(callback: (record: T) => void): void;
|
|
40
|
-
/** Подписаться на событие закрытия формы */
|
|
41
|
-
onClose(callback: () => void): void;
|
|
42
33
|
/** Подписаться на событие создания макета формы */
|
|
43
34
|
onLayoutCreated(callback: () => void): void;
|
|
44
35
|
/** Установить команду на форму */
|
|
45
|
-
addCommand(command: ButtonFacade
|
|
36
|
+
addCommand(command: ButtonFacade): void;
|
|
46
37
|
/** Установить настройки для полей формы */
|
|
47
38
|
setFieldOptions(options: IFormFieldOptionsConfig): void;
|
|
48
39
|
/** Установить настройки для компонента формы */
|
|
49
40
|
setControlOptions(findControl: (col: any) => boolean, controlOptions: any): any;
|
|
50
|
-
/** Установить флаг доступности редактирования формы */
|
|
51
|
-
setReadonly(readonly: boolean): void;
|
|
52
41
|
/** Изменить свойства существующей кнопки */
|
|
53
|
-
updateCommand(findCondition: (
|
|
54
|
-
/** Повторно инициализировать форму */
|
|
55
|
-
reinit(): void;
|
|
56
|
-
/** Сохранить форму */
|
|
57
|
-
save(): void;
|
|
58
|
-
/** Открыть конструктор формы */
|
|
59
|
-
openDesigner(): void;
|
|
60
|
-
/** Получить зоны */
|
|
61
|
-
getZones(): FormZones;
|
|
62
|
-
/** Подписаться на событие обновление значения поля формы */
|
|
63
|
-
onUpdated<V = string>(callback: (field: IFieldFacade, value: V) => void): void;
|
|
64
|
-
/** Закрыть форму */
|
|
65
|
-
close(): void;
|
|
42
|
+
updateCommand(findCondition: () => boolean, command: Partial<ButtonFacade>): void;
|
|
66
43
|
}
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import { MdtRecord } from "mdtScripts/common/Record";
|
|
2
|
-
import { FormattedText } from "mdtScripts/helpers/formattedText";
|
|
3
|
-
import { Valued } from "mdtScripts/helpers/types";
|
|
4
1
|
import { Field } from "../../../../common/Field";
|
|
5
2
|
import { IButton } from "../../../../views/form/controls/monacoEditor/jsonSchemas/Button.schema";
|
|
6
3
|
import { RecordId } from "../utils/IApiFacade";
|
|
7
4
|
import { IFormControlFacade } from "./IFormControlFacade";
|
|
8
5
|
export declare type ActionButton = IButton & {
|
|
9
|
-
/**
|
|
10
|
-
description?:
|
|
6
|
+
/** Вспылвающая подсказка */
|
|
7
|
+
description?: string | {
|
|
8
|
+
(): string;
|
|
9
|
+
};
|
|
11
10
|
/** Подписка на событие нажатия на кнопку */
|
|
12
11
|
execute?: () => void;
|
|
13
12
|
/** Активность кнопки */
|
|
@@ -40,8 +39,6 @@ export interface IFormOptions {
|
|
|
40
39
|
primaryButton?: ButtonFacade;
|
|
41
40
|
/** Подписаться на событие сохранения записи формы */
|
|
42
41
|
onSave(record: Record<string, any>): any;
|
|
43
|
-
/** Запись по умолчанию */
|
|
44
|
-
defaultValues?: Partial<MdtRecord>;
|
|
45
42
|
}
|
|
46
43
|
export interface IFormServiceFacade {
|
|
47
44
|
/** Создать форму, привязанную объекту */
|
|
@@ -56,15 +53,8 @@ export interface IFormServiceFacade {
|
|
|
56
53
|
onCreated(callback: (form: IFormControlFacade) => void): void;
|
|
57
54
|
/** Добавить настройки для полей формы */
|
|
58
55
|
addFieldOptions(tableCode: string, options: IFormInitOptions): void;
|
|
59
|
-
/** Зарегистрировать расширение формы
|
|
60
|
-
* @param {string} alias - Имя свойства, которое можно использовать для установки опций экстендера
|
|
61
|
-
*/
|
|
62
|
-
registerExtender<T>(extender: IFormExtenderFacade<T>, alias: string): void;
|
|
63
56
|
}
|
|
64
57
|
export interface ICustomField extends Field {
|
|
65
58
|
/** Опции контрола поля */
|
|
66
59
|
options?: any;
|
|
67
60
|
}
|
|
68
|
-
export interface IFormExtenderFacade<T> {
|
|
69
|
-
new (form: IFormControlFacade, options: any): T;
|
|
70
|
-
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { MithrilControl } from "
|
|
2
|
-
import { IType } from "./utils/IUiFacade";
|
|
1
|
+
import { IType, MithrilControl } from "./utils/IUiFacade";
|
|
3
2
|
export interface IAuthFacade {
|
|
4
3
|
disableFormsProvider(): void;
|
|
5
4
|
disableProvider(control: IType<MithrilControl>): void;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="../../../../mithril" />
|
|
2
1
|
/// <reference types="mithril" />
|
|
3
2
|
import { FilterConstructor } from "../../../services/IFilter";
|
|
4
3
|
import { IFieldControlFacadeContstructor } from "./Form/IFieldControlFacade";
|
|
@@ -17,11 +16,7 @@ import { ImUtilsFacade } from "./utils/ImUtilsFacade";
|
|
|
17
16
|
import { IUiComponentsFacade } from "./utils/IUiComponentsFacade";
|
|
18
17
|
import { IUiFacade } from "./utils/IUiFacade";
|
|
19
18
|
import { IUtilsFacade } from "./utils/IUtilsFacade";
|
|
20
|
-
import {
|
|
21
|
-
import { CommandManagerFacade } from "./services/CommandManagerFacade";
|
|
22
|
-
export declare type ModulePackageInfo = {
|
|
23
|
-
version: string;
|
|
24
|
-
};
|
|
19
|
+
import { InternalModulesFacade } from "./internalModules/modulesFacadeTypes";
|
|
25
20
|
export interface IMDTFacade {
|
|
26
21
|
/** Mithril библиотека */
|
|
27
22
|
m: _mithril.MithrilStatic;
|
|
@@ -56,10 +51,7 @@ export interface IMDTFacade {
|
|
|
56
51
|
ModuleRegistry: IModuleRegistryFacade;
|
|
57
52
|
/** Управление способами авторизации */
|
|
58
53
|
Auth: IAuthFacade;
|
|
59
|
-
|
|
60
|
-
Page: IPageFacade;
|
|
61
|
-
/** Управление командами */
|
|
62
|
-
CommandManager: CommandManagerFacade;
|
|
54
|
+
modules: InternalModulesFacade;
|
|
63
55
|
/** Зарегистрировать модуль */
|
|
64
|
-
registerModule(callback: () => void
|
|
56
|
+
registerModule(callback: () => void): void;
|
|
65
57
|
}
|
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { ILayoutColumnBase } from "../../../../views/list/IListView";
|
|
3
|
-
import { IListComponentFacade } from "./IListComponentFacade";
|
|
1
|
+
import { IListComponentFacade } from "./IListRowFacade";
|
|
4
2
|
export interface IListCellFacade extends IListComponentFacade {
|
|
5
|
-
col: ILayoutColumnBase;
|
|
6
|
-
value(): any;
|
|
7
|
-
setContent(content: ViewElement[]): void;
|
|
8
3
|
}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="../../../../mithril" />
|
|
2
1
|
/// <reference types="mithril" />
|
|
3
2
|
import { FilterSetterOptions, IFilter } from "../../../../services/IFilter";
|
|
4
3
|
import { ButtonFacade } from "../Form/IFormFacade";
|
|
@@ -34,11 +33,5 @@ export interface IListControlFacade extends ParentCtrl {
|
|
|
34
33
|
/** Установить расширения списка */
|
|
35
34
|
setExtOptions(extOptions: any): void;
|
|
36
35
|
/** Изменить свойства существующей кнопки */
|
|
37
|
-
updateCommand(findCondition: (
|
|
38
|
-
/** Открыть форму добавления записи */
|
|
39
|
-
openNewRecordForm(): void;
|
|
40
|
-
/** Удалить выделенные строки */
|
|
41
|
-
removeSelectedRows(): void;
|
|
42
|
-
/** Открыть конструктор списка */
|
|
43
|
-
openDesigner(): void;
|
|
36
|
+
updateCommand(findCondition: () => boolean, command: Partial<ButtonFacade>): void;
|
|
44
37
|
}
|
|
@@ -1,2 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export
|
|
1
|
+
import { IListControlFacade } from "./IListControlFacade";
|
|
2
|
+
export interface IListComponentFacade {
|
|
3
|
+
record: any;
|
|
4
|
+
list: IListControlFacade;
|
|
5
|
+
addClass(className: string): void;
|
|
6
|
+
hasClass(className: string): boolean;
|
|
7
|
+
removeClass(className: string): void;
|
|
8
|
+
addStyle(prop: string, value: string): void;
|
|
9
|
+
config(config: Function, before?: boolean): void;
|
|
10
|
+
}
|
|
11
|
+
export interface IListRowFacade extends IListComponentFacade {
|
|
12
|
+
}
|
|
@@ -16,11 +16,4 @@ export interface IListServiceFacade {
|
|
|
16
16
|
configureList(tableCode: string, options: IListInitOptions): void;
|
|
17
17
|
/** Создать список */
|
|
18
18
|
create(tableCode: string, options?: any, extOptions?: any): IListControlFacade;
|
|
19
|
-
/** Зарегистрировать расширение списка
|
|
20
|
-
* @param {string} alias - Имя свойства, которое можно использовать для установки опций экстендера в extConfig или extOptions списка
|
|
21
|
-
*/
|
|
22
|
-
registerExtender<T>(extender: IListExtenderFacade<T>, alias: string): void;
|
|
23
|
-
}
|
|
24
|
-
export interface IListExtenderFacade<T> {
|
|
25
|
-
new (list: IListControlFacade, options: any): T;
|
|
26
19
|
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { StatusModuleFacade } from "./statusFacade";
|
|
2
|
+
export interface InternalModulesFacade {
|
|
3
|
+
/**
|
|
4
|
+
* Возвращает фасад модуля. Если фасада нет или модуль не подключен, то метод выбрасывает ошибку.
|
|
5
|
+
* @throws {Error} - Выбрасывает ошибку, если имя не найдено
|
|
6
|
+
* @param moduleName - имя модуля
|
|
7
|
+
*/
|
|
8
|
+
get<T extends keyof InternalModulesTypes>(moduleName: T): InternalModulesTypes[T];
|
|
9
|
+
}
|
|
10
|
+
export declare type InternalModulesTypes = StatusModuleFacade;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { RecordFacade } from "../record/IRecordFacade";
|
|
2
|
+
export interface StatusModuleFacade {
|
|
3
|
+
"mdt.status": {
|
|
4
|
+
statusChangeHandler: (status: StatusCode, handler: ChangeStatusHandler) => void;
|
|
5
|
+
};
|
|
6
|
+
}
|
|
7
|
+
export declare type ChangeStatusHandler = ({ record, object }: StatusChangeHandlerContext) => void | Promise<void>;
|
|
8
|
+
export declare type StatusCode = string;
|
|
9
|
+
export interface StatusChangeHandlerContext {
|
|
10
|
+
record: RecordFacade;
|
|
11
|
+
object: ObjectCode;
|
|
12
|
+
}
|
|
13
|
+
declare type ObjectCode = string;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export declare type RecordFacade = RecordValueFacade & RecordChangesFacade;
|
|
2
|
+
export interface RecordValueFacade {
|
|
3
|
+
/** Получить значение записи по пути. */
|
|
4
|
+
getValue: (path: FieldPath) => any;
|
|
5
|
+
}
|
|
6
|
+
export interface RecordChangesFacade {
|
|
7
|
+
changes: RecordChanges;
|
|
8
|
+
}
|
|
9
|
+
export declare type RecordChanges = {
|
|
10
|
+
record: Record<FieldCode, any>;
|
|
11
|
+
table: ObjectCode;
|
|
12
|
+
};
|
|
13
|
+
declare type FieldCode = string;
|
|
14
|
+
declare type FieldPath = string;
|
|
15
|
+
declare type ObjectCode = string;
|
|
16
|
+
export {};
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { ObjectId } from "mdtScripts/helpers/types";
|
|
2
1
|
import { IFieldFacade } from "./IFieldFacade";
|
|
3
2
|
export interface IObjectFacade {
|
|
4
3
|
getCode(): string;
|
|
@@ -7,5 +6,4 @@ export interface IObjectFacade {
|
|
|
7
6
|
getPrimaryField(): IFieldFacade;
|
|
8
7
|
isReadonly(): boolean;
|
|
9
8
|
getField(code: string, check?: boolean): IFieldFacade;
|
|
10
|
-
getId(): ObjectId;
|
|
11
9
|
}
|
|
@@ -1,44 +1,5 @@
|
|
|
1
|
-
/// <reference types="../../../../mithril" />
|
|
2
1
|
/// <reference types="mithril" />
|
|
3
|
-
import { ProcessPrincipalsListItem } from "../../../../components/processPrincipalsList/ProcessPrincipalsListItem";
|
|
4
|
-
import { Markdown, MithrilAttributes, Valued, ViewElement } from "../../../../helpers/types";
|
|
5
|
-
import { Icon, IconElOptions, IconOptions } from "../../../../components/icon/iconOptions";
|
|
6
|
-
import { InputOptions } from "../../../../components/baseFormControls/input/inputView";
|
|
7
|
-
import { CommonControlOptions } from "../../../../views/form/controls/commonControl/ICommonControl";
|
|
8
2
|
import { ButtonFacade } from "../Form/IFormFacade";
|
|
9
|
-
import { DropdownInputItemOptions } from "../../../../components/dropdown/menu/item/dropdownInputItemOptions";
|
|
10
|
-
import { DropdownItemViewOptions } from "../../../../components/dropdown/menu/item/dropdownItemWrapOptions";
|
|
11
3
|
export interface IUiComponentsFacade {
|
|
12
|
-
button(button: ButtonFacade, translate?: boolean):
|
|
13
|
-
topNavButton(options: TopNavButton): _mithril.MithrilVirtualElement;
|
|
14
|
-
icon(code: string, options?: IconOptions): _mithril.MithrilVirtualElement;
|
|
15
|
-
iconHTML(icon: Icon, options?: IconElOptions): HTMLElement;
|
|
16
|
-
processFormBlock(options: IProcessFormBlockOptions): _mithril.MithrilVirtualElement;
|
|
17
|
-
commonControl(options: CommonControlOptions): _mithril.MithrilVirtualElement;
|
|
18
|
-
unstyledInput(options: InputOptions): _mithril.MithrilVirtualElement;
|
|
19
|
-
input(options: InputOptions): _mithril.MithrilVirtualElement;
|
|
20
|
-
dropdownItem(options: DropdownItemViewOptions): _mithril.MithrilVirtualElement;
|
|
21
|
-
dropdownInputItem(options: DropdownInputItemOptions): _mithril.MithrilVirtualElement;
|
|
22
|
-
}
|
|
23
|
-
export interface IProcessFormBlockOptions {
|
|
24
|
-
title: string;
|
|
25
|
-
subtitle: string;
|
|
26
|
-
titleTooltip: string;
|
|
27
|
-
subtitleTooltip: string;
|
|
28
|
-
icon?: Icon;
|
|
29
|
-
description?: Markdown;
|
|
30
|
-
principals?: ProcessPrincipalsListItem[];
|
|
31
|
-
principalsTooltip?: string;
|
|
32
|
-
principalsTextError?: string;
|
|
33
|
-
principalsOnclick?: (item: ProcessPrincipalsListItem) => void;
|
|
34
|
-
historyAction?: ButtonFacade;
|
|
35
|
-
actions?: ButtonFacade[];
|
|
36
|
-
}
|
|
37
|
-
export interface TopNavButton {
|
|
38
|
-
title: string;
|
|
39
|
-
icon?: Icon;
|
|
40
|
-
attrs?: MithrilAttributes;
|
|
41
|
-
showCaret?: boolean;
|
|
42
|
-
focused?: Valued<boolean>;
|
|
43
|
-
execute?: () => void;
|
|
4
|
+
button(button: ButtonFacade, translate?: boolean): _mithril.MithrilVirtualElement;
|
|
44
5
|
}
|
|
@@ -1,14 +1,16 @@
|
|
|
1
|
-
/// <reference types="../../../../mithril" />
|
|
2
1
|
/// <reference types="mithril" />
|
|
3
|
-
import { MithrilControl } from "../../../../helpers/types";
|
|
4
|
-
import { DropdownOptions } from "../../../dropdown/IDropDownMenu";
|
|
5
2
|
import { ButtonFacade } from "../Form/IFormFacade";
|
|
6
|
-
import { DropdownTargetContext, IDropdownMenu } from "mdtServices/dropdown/IDropDownMenu";
|
|
7
|
-
import { IModalFacade } from "../components/ModalFacade";
|
|
8
3
|
export declare type onModalResizeCallback = (data: IModalSizingState) => void;
|
|
4
|
+
export declare type MithrilControl = ViewControl | ContentControl;
|
|
9
5
|
export interface IType<T> {
|
|
10
6
|
new (...args: any[]): T;
|
|
11
7
|
}
|
|
8
|
+
interface ViewControl {
|
|
9
|
+
$view(): _mithril.MithrilVirtualElement | string;
|
|
10
|
+
}
|
|
11
|
+
interface ContentControl {
|
|
12
|
+
content: any;
|
|
13
|
+
}
|
|
12
14
|
export interface ParentCtrl {
|
|
13
15
|
getViewControl(): MithrilControl;
|
|
14
16
|
}
|
|
@@ -28,13 +30,9 @@ export interface IUiFacade {
|
|
|
28
30
|
/** Вызвать окно уведомления */
|
|
29
31
|
showNotification(msg: CustomNotification, duration?: number): any;
|
|
30
32
|
/** Вызвать модальное окно */
|
|
31
|
-
showModal(ctrl: MithrilControl | ParentCtrl, options?: IModalOptions):
|
|
33
|
+
showModal(ctrl: MithrilControl | ParentCtrl, options?: IModalOptions): any;
|
|
32
34
|
/** Вызвать боковую панель */
|
|
33
35
|
showSidebar(ctrl: MithrilControl | ParentCtrl, options?: IPanelOptions): any;
|
|
34
|
-
/** Создать выпадающее меню */
|
|
35
|
-
createDropdown<I>(options: DropdownOptions<I>, el: Element, ctx: DropdownTargetContext<I>): IDropdownMenu<I>;
|
|
36
|
-
/** Создать компонент с пользовательской версткой */
|
|
37
|
-
createControl(view: () => _mithril.MithrilVirtualElement): MithrilControl;
|
|
38
36
|
}
|
|
39
37
|
export declare type ModalTypes = "info" | "success" | "warning" | "danger" | "primary" | "fatal";
|
|
40
38
|
export interface IModalOptions {
|
|
@@ -56,8 +54,6 @@ export interface IModalOptions {
|
|
|
56
54
|
initialSizingState?: IModalSizingState;
|
|
57
55
|
/** Тип модального окна */
|
|
58
56
|
type?: ModalTypes;
|
|
59
|
-
/** Дополнительные кнопки на окне */
|
|
60
|
-
buttons?: ButtonFacade[];
|
|
61
57
|
}
|
|
62
58
|
export interface IPanelOptions {
|
|
63
59
|
/** Отображать боковую панель в расширенном на весь экран виде */
|
|
@@ -71,3 +67,4 @@ export interface IModalSizingState {
|
|
|
71
67
|
/** Высота */
|
|
72
68
|
height: number;
|
|
73
69
|
}
|
|
70
|
+
export {};
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
/// <reference types="../../../../mithril" />
|
|
2
1
|
/// <reference types="mithril" />
|
|
3
|
-
import { MithrilControl } from "mdtScripts/helpers/types";
|
|
4
2
|
export declare type ConfigFunction = (element: HTMLElement, isInitialized: boolean, context?: any) => void;
|
|
5
3
|
export interface ImUtilsFacade {
|
|
6
4
|
/** Проверка, есть ли класс у элемента */
|
|
@@ -21,6 +19,4 @@ export interface ImUtilsFacade {
|
|
|
21
19
|
attr(obj: {
|
|
22
20
|
$attrs: any;
|
|
23
21
|
}, attr?: string, value?: string, op?: boolean): void;
|
|
24
|
-
/** Проверить наличие view у компонента */
|
|
25
|
-
hasView(ctrl: MithrilControl): boolean;
|
|
26
22
|
}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { FormattedText } from "mdtScripts/helpers/formattedText";
|
|
2
1
|
import { ControlSize } from "mdtScripts/views/controls/Control";
|
|
3
2
|
export declare type ButtonTypes = "default" | "primary" | "success" | "info" | "warning" | "danger" | "link" | "group-title" | "extended" | "fatal";
|
|
4
3
|
export interface IButton {
|
|
@@ -61,9 +60,9 @@ export interface IButton {
|
|
|
61
60
|
}
|
|
62
61
|
export interface Button extends IButton {
|
|
63
62
|
/**
|
|
64
|
-
*
|
|
63
|
+
* Вспылвающая подсказка
|
|
65
64
|
*/
|
|
66
|
-
tooltip?:
|
|
67
|
-
():
|
|
65
|
+
tooltip?: string | {
|
|
66
|
+
(): string;
|
|
68
67
|
};
|
|
69
68
|
}
|