mdt-client 31.0.6 → 31.0.7
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 -2
- package/dist/index.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -3027
- package/package.json +1 -1
- package/types/components/baseFormControls/input/inputOptions.d.ts +0 -1
- package/types/components/form/fieldView/fieldViewOptions.d.ts +12 -0
- package/types/components/icon/iconOptions.d.ts +0 -1
- package/types/helpers/types.d.ts +0 -1
- package/types/helpers/ui/elementModificators/focusableComponent.d.ts +0 -1
- package/types/helpers/zone/IZone.d.ts +0 -1
- package/types/security/PermissionLevel.d.ts +5 -0
- package/types/services/api/ApiAccessor/apiV1Types.d.ts +159 -0
- package/types/services/api/ApiAccessorRequestAdapter/handlers/fetch/helpers/query/exts/hierarchy/hierarchyQueryHelpersTypes.d.ts +19 -0
- package/types/services/api/Query.d.ts +12 -1
- package/types/services/customModules/facades/Form/IFormControlFacade.d.ts +4 -0
- package/types/services/customModules/facades/Form/IFormFacade.d.ts +5 -0
- package/types/services/customModules/facades/IMdtFacade.d.ts +2 -1
- package/types/services/customModules/facades/record/IRecordManagerFacade.d.ts +5 -0
- package/types/services/customModules/facades/schema/IFieldFacade.d.ts +2 -0
- package/types/services/customModules/facades/schema/IObjectFacade.d.ts +1 -0
- package/types/services/customModules/facades/services/ISecurityFacade.d.ts +3 -1
- package/types/services/customModules/facades/utils/IApiFacade.d.ts +2 -0
- package/types/services/customModules/facades/utils/IUiComponentsFacade.d.ts +2 -1
- package/types/services/customModules/facades/utils/IUiFacade.d.ts +1 -1
- package/types/services/customModules/facades/utils/ImUtilsFacade.d.ts +0 -1
- package/types/services/dropdown/IDropDownMenu.d.ts +0 -1
- package/types/views/form/controls/commonControl/ICommonControl.d.ts +0 -1
- package/types/views/list/IListView.d.ts +0 -1
- package/types/views/list/schema/ListPageOptions.schema.d.ts +4 -0
package/package.json
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
/// <reference types="../../../../mithril" />
|
|
2
|
-
/// <reference types="mithril" />
|
|
3
2
|
import { CSSClassName } from "../../../helpers/types";
|
|
4
3
|
import { KeyboardActions } from "../../../helpers/ui/elementModificators/focusableComponent";
|
|
5
4
|
import { ComponentSize } from "../../../helpers/utils/stringifyControlSize";
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ViewElement } from "mdtScripts/helpers/types";
|
|
2
|
+
import { LabelViewOptions } from "../label/labelOptions";
|
|
3
|
+
export declare type FieldViewLabelMode = "normal" | "heading" | "hidden" | "inline";
|
|
4
|
+
export interface FieldLabelViewOptions extends LabelViewOptions {
|
|
5
|
+
labelMode?: FieldViewLabelMode;
|
|
6
|
+
handleLabelView?: (label: ViewElement) => ViewElement;
|
|
7
|
+
}
|
|
8
|
+
export interface FieldViewOptions extends FieldLabelViewOptions {
|
|
9
|
+
id?: string;
|
|
10
|
+
isLocked?: () => boolean;
|
|
11
|
+
control: ViewElement;
|
|
12
|
+
}
|
package/types/helpers/types.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
/// <reference types="../../../../mithril" />
|
|
2
|
-
/// <reference types="mithril" />
|
|
3
2
|
import { KeyboardKeyCode } from "../../../helpers/types";
|
|
4
3
|
import { ComponentConfigParams } from "./modificatorsTypes";
|
|
5
4
|
export declare function doesKeyPressed(keyCode: KeyboardKeyCode | KeyboardKeyCode[], e: KeyboardEvent): boolean;
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
import { HierarchicalRecord, MdtRecord, RecordId } from "mdtScripts/common/Record";
|
|
2
|
+
import { AnyObject, FieldCode, ObjectCode } from "mdtScripts/helpers/types";
|
|
3
|
+
export declare namespace ApiV1 {
|
|
4
|
+
namespace Request {
|
|
5
|
+
export type Common = Main | Main[];
|
|
6
|
+
type Main = Save | Delete | AnyObject;
|
|
7
|
+
export interface Save extends MdtRecord, WithParams {
|
|
8
|
+
}
|
|
9
|
+
export type WithParams = {
|
|
10
|
+
$params?: CommonParams;
|
|
11
|
+
};
|
|
12
|
+
export type CommonParams = AnyObject & BaseParams & DataExtParams & DmParams & SaveParams;
|
|
13
|
+
interface BaseParams {
|
|
14
|
+
formId?: RecordId;
|
|
15
|
+
}
|
|
16
|
+
interface DataExtParams {
|
|
17
|
+
ID_Language_ext?: RecordId;
|
|
18
|
+
}
|
|
19
|
+
interface DmParams {
|
|
20
|
+
FlagConfirm?: boolean;
|
|
21
|
+
Actions?: ApiV1.Response.DmAction[];
|
|
22
|
+
}
|
|
23
|
+
interface SaveParams {
|
|
24
|
+
StatusComment?: string;
|
|
25
|
+
}
|
|
26
|
+
export interface Delete extends WithParams {
|
|
27
|
+
tableName: ObjectCode;
|
|
28
|
+
IdList: RecordId[];
|
|
29
|
+
Actions?: Response.DmAction[];
|
|
30
|
+
}
|
|
31
|
+
export namespace Fetch {
|
|
32
|
+
type Params = DataExtParams & MappingParams;
|
|
33
|
+
interface DataExtParams {
|
|
34
|
+
ID_Language_ext?: RecordId;
|
|
35
|
+
dataext?: "explicit";
|
|
36
|
+
}
|
|
37
|
+
interface MappingParams {
|
|
38
|
+
flagGetMappedFKs?: boolean;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* В query.select в Api V1 может содержаться как функция аггрегации, так и приведение типа.
|
|
42
|
+
* Примеры:
|
|
43
|
+
* - `date(DateCreate) date` - приведение datetime к типу date
|
|
44
|
+
* - `avg(Amount) amount` - агрегация
|
|
45
|
+
*/
|
|
46
|
+
type AggragationOrCast = "date" | AggregationType;
|
|
47
|
+
interface ParsedQuery extends Params {
|
|
48
|
+
table?: string;
|
|
49
|
+
select?: string;
|
|
50
|
+
filter?: string;
|
|
51
|
+
orderby?: string;
|
|
52
|
+
skip?: number;
|
|
53
|
+
top?: number;
|
|
54
|
+
distinct?: true;
|
|
55
|
+
aggregate?: true;
|
|
56
|
+
withCount?: true;
|
|
57
|
+
params?: string;
|
|
58
|
+
date?: string;
|
|
59
|
+
hierarchy?: string;
|
|
60
|
+
placeIn?: string;
|
|
61
|
+
checkDependency?: string;
|
|
62
|
+
audit?: string;
|
|
63
|
+
workflow?: string;
|
|
64
|
+
tag?: string;
|
|
65
|
+
export?: string;
|
|
66
|
+
format?: string;
|
|
67
|
+
groups?: string;
|
|
68
|
+
skippedRowsCount?: number;
|
|
69
|
+
/** Нужен для сопоставления ответа в ApiService при сборке нескольких запросов в 1 */
|
|
70
|
+
key?: string;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
export {};
|
|
74
|
+
}
|
|
75
|
+
namespace Response {
|
|
76
|
+
export type Main = AnyObject | Delete | Error;
|
|
77
|
+
export interface Delete {
|
|
78
|
+
$: "cst";
|
|
79
|
+
items: DmItem[];
|
|
80
|
+
}
|
|
81
|
+
type DmItem = {
|
|
82
|
+
code?: "actions";
|
|
83
|
+
rows?: DmAction[];
|
|
84
|
+
};
|
|
85
|
+
export interface DmAction extends MdtRecord {
|
|
86
|
+
FieldCode?: FieldCode;
|
|
87
|
+
ID_Action?: string;
|
|
88
|
+
ID_Object?: number;
|
|
89
|
+
ID_ObjectField?: number;
|
|
90
|
+
ObjectCode?: string;
|
|
91
|
+
ObjectTitle?: string;
|
|
92
|
+
RecordCount?: string;
|
|
93
|
+
Warning?: string;
|
|
94
|
+
AvailActions?: boolean;
|
|
95
|
+
}
|
|
96
|
+
export interface Error {
|
|
97
|
+
Message: string;
|
|
98
|
+
Code: string;
|
|
99
|
+
Args?: any;
|
|
100
|
+
Debug?: any;
|
|
101
|
+
Error: boolean;
|
|
102
|
+
}
|
|
103
|
+
export interface Save {
|
|
104
|
+
$: "msg";
|
|
105
|
+
items: Save.StatItem[];
|
|
106
|
+
debug?: {
|
|
107
|
+
objectRuleLogs?: string[];
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
export namespace Save {
|
|
111
|
+
interface StatItem {
|
|
112
|
+
stats: Stats;
|
|
113
|
+
ids?: RecordId[];
|
|
114
|
+
extIds?: StatExtItem[];
|
|
115
|
+
}
|
|
116
|
+
interface Stats {
|
|
117
|
+
inserted: number;
|
|
118
|
+
updated: number;
|
|
119
|
+
deleted: number;
|
|
120
|
+
}
|
|
121
|
+
interface StatExtItem {
|
|
122
|
+
ID: RecordId;
|
|
123
|
+
Table: string;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
/** Fetch */
|
|
127
|
+
export type Fetch = Fetch.Common<HierarchicalRecord> | Fetch.Common;
|
|
128
|
+
export namespace Fetch {
|
|
129
|
+
interface Common<RowsType = MdtRecord> {
|
|
130
|
+
Rows?: RowsType[];
|
|
131
|
+
Items?: any[];
|
|
132
|
+
Count?: number;
|
|
133
|
+
[k: string]: any;
|
|
134
|
+
}
|
|
135
|
+
interface Record extends MdtRecord {
|
|
136
|
+
$tag?: {
|
|
137
|
+
ticket: string;
|
|
138
|
+
list: RecordId[];
|
|
139
|
+
};
|
|
140
|
+
$audit: {
|
|
141
|
+
ticket: string;
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
export namespace File {
|
|
146
|
+
interface Upload {
|
|
147
|
+
ID: RecordId;
|
|
148
|
+
ShortUid: string;
|
|
149
|
+
UID: string;
|
|
150
|
+
Name: string;
|
|
151
|
+
Size?: number;
|
|
152
|
+
StorageProvider?: StorageProvider;
|
|
153
|
+
}
|
|
154
|
+
type StorageProvider = "db";
|
|
155
|
+
}
|
|
156
|
+
export {};
|
|
157
|
+
}
|
|
158
|
+
type AggregationType = "sum" | "avg" | "count" | "distinct" | "max" | "min";
|
|
159
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
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;
|
|
5
|
+
};
|
|
6
|
+
export declare const QHIERARCHY_TYPE_CUSTOM = "hierachy-custom";
|
|
7
|
+
declare type QueryHierarchyCustom = {
|
|
8
|
+
type: typeof QHIERARCHY_TYPE_CUSTOM;
|
|
9
|
+
data: QueryHierarchyCustomData;
|
|
10
|
+
};
|
|
11
|
+
export declare type QueryHierarchyCustomData = {
|
|
12
|
+
idField: string;
|
|
13
|
+
parentIdField: string;
|
|
14
|
+
};
|
|
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 {};
|
|
@@ -2,12 +2,16 @@ import { Grouping } from "../../common/list/group/groupTypes";
|
|
|
2
2
|
import { HierarchyQuery } from "../../common/list/hierarchy/hierarchyTypes";
|
|
3
3
|
import { Table } from "../../common/Table";
|
|
4
4
|
import { BaseQuery } from "./BaseQuery";
|
|
5
|
+
import { ApiV1 } from "./ApiAccessor/apiV1Types";
|
|
6
|
+
import { HierarchyQueryMeta } from "./ApiAccessorRequestAdapter/handlers/fetch/helpers/query/exts/hierarchy/hierarchyQueryHelpersTypes";
|
|
5
7
|
export interface Query extends BaseQuery {
|
|
6
8
|
options?: QueryOptions;
|
|
7
9
|
withCount?: boolean;
|
|
8
10
|
distinct?: boolean;
|
|
9
11
|
key?: string;
|
|
10
|
-
params?:
|
|
12
|
+
params?: QueryParams & {
|
|
13
|
+
[name: string]: any;
|
|
14
|
+
};
|
|
11
15
|
dependency?: {
|
|
12
16
|
table: string;
|
|
13
17
|
field: string;
|
|
@@ -28,7 +32,13 @@ export interface Query extends BaseQuery {
|
|
|
28
32
|
workflow?: TicketQuery;
|
|
29
33
|
tag?: TicketQuery;
|
|
30
34
|
skippedRowsCount?: number;
|
|
35
|
+
/**
|
|
36
|
+
* Дополнительная информация по запросу, содержит логические данные.
|
|
37
|
+
* Используется при конвертации запроса под API v1/v2, чтобы не парсить сгенерированные строки, напр. placeIn
|
|
38
|
+
*/
|
|
39
|
+
meta?: HierarchyQueryMeta;
|
|
31
40
|
}
|
|
41
|
+
declare type QueryParams = ApiV1.Request.Fetch.Params;
|
|
32
42
|
export declare type TicketQuery = string | "ticket";
|
|
33
43
|
export interface QueryOptions {
|
|
34
44
|
root?: boolean;
|
|
@@ -39,3 +49,4 @@ export interface QueryOptions {
|
|
|
39
49
|
[ext: string]: any;
|
|
40
50
|
};
|
|
41
51
|
}
|
|
52
|
+
export {};
|
|
@@ -70,4 +70,8 @@ export interface IFormControlFacade extends ParentCtrl {
|
|
|
70
70
|
onUpdated<V = string>(callback: (field: IFieldFacade, value: V) => void): void;
|
|
71
71
|
/** Закрыть форму */
|
|
72
72
|
close(): void;
|
|
73
|
+
/** Сообщить подписчикам формы о внесении изменений в данные
|
|
74
|
+
* Например, при вызове функции обновиться связанный список
|
|
75
|
+
*/
|
|
76
|
+
notifyDataUpdated(): void;
|
|
73
77
|
}
|
|
@@ -44,6 +44,11 @@ export interface IFormOptions {
|
|
|
44
44
|
defaultValues?: Partial<MdtRecord>;
|
|
45
45
|
/** Описание лэйаута формы */
|
|
46
46
|
layout?: CustomFormLayout;
|
|
47
|
+
viewSettings?: FormViewSettings;
|
|
48
|
+
}
|
|
49
|
+
export interface FormViewSettings {
|
|
50
|
+
hideSubTitle?: boolean;
|
|
51
|
+
hideTitle?: boolean;
|
|
47
52
|
}
|
|
48
53
|
export interface IFormServiceFacade {
|
|
49
54
|
/** Создать форму, привязанную объекту */
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
/// <reference types="../../../../mithril" />
|
|
2
|
-
/// <reference types="mithril" />
|
|
3
2
|
import { FilterConstructor } from "../../../services/IFilter";
|
|
4
3
|
import { IFieldControlFacadeContstructor } from "./Form/IFieldControlFacade";
|
|
5
4
|
import { IFieldControlManagerFacade } from "./Form/IFieldControlManagerFacade";
|
|
@@ -19,6 +18,7 @@ import { IUiFacade } from "./utils/IUiFacade";
|
|
|
19
18
|
import { IUtilsFacade } from "./utils/IUtilsFacade";
|
|
20
19
|
import { IPageFacade } from "./IPageFacade";
|
|
21
20
|
import { CommandManagerFacade } from "./services/CommandManagerFacade";
|
|
21
|
+
import { IRecordManagerFacade } from "./record/IRecordManagerFacade";
|
|
22
22
|
export declare type ModulePackageInfo = {
|
|
23
23
|
version: string;
|
|
24
24
|
name?: string;
|
|
@@ -54,6 +54,7 @@ export interface IMDTFacade {
|
|
|
54
54
|
/** Компонент фильтра */
|
|
55
55
|
Filter: FilterConstructor;
|
|
56
56
|
Schema: ISchemaFacade;
|
|
57
|
+
RecordManager: IRecordManagerFacade;
|
|
57
58
|
ModuleRegistry: IModuleRegistryFacade;
|
|
58
59
|
/** Управление способами авторизации */
|
|
59
60
|
Auth: IAuthFacade;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { User } from "../../../../security/User";
|
|
2
|
-
import { PermissionLevel } from "../../../../security/PermissionLevel";
|
|
2
|
+
import type { PermissionLevel, PrincipalTypes } from "../../../../security/PermissionLevel";
|
|
3
3
|
import { IObjectFacade } from "../schema/IObjectFacade";
|
|
4
4
|
export interface ISecurityFacade {
|
|
5
5
|
/** Проверка на наличие роли у пользователя */
|
|
@@ -8,4 +8,6 @@ export interface ISecurityFacade {
|
|
|
8
8
|
getUser(): User;
|
|
9
9
|
/** Имеет ли текущий пользователь разрешение на объект */
|
|
10
10
|
hasPermission(object: IObjectFacade, permissionLevel: PermissionLevel): any;
|
|
11
|
+
PermissionLevel: typeof PermissionLevel;
|
|
12
|
+
PrincipalTypes: typeof PrincipalTypes;
|
|
11
13
|
}
|
|
@@ -14,6 +14,8 @@ export interface IApiFacade {
|
|
|
14
14
|
fetchFromFunction<R extends FetchResult = FetchResult>(objectCode: string, query?: BaseQuery, params?: any[]): Promise<R>;
|
|
15
15
|
/** Отправить запрос на получение одной записи из функции */
|
|
16
16
|
fetchRecordFromFunction<R = any>(objectCode: string, query?: BaseQuery, params?: any[]): Promise<R>;
|
|
17
|
+
/** Отправить запрос к хранимой процедуре */
|
|
18
|
+
executeStoredProcedure<Result = any>(objectCode: string, params: any): PromiseLike<Result>;
|
|
17
19
|
/** Сохранить новые данные */
|
|
18
20
|
save<S = MdtQueryResult>(objectCode: string, record: MdtRecord): Promise<S>;
|
|
19
21
|
/** Удалить данные */
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
/// <reference types="../../../../mithril" />
|
|
2
|
-
/// <reference types="mithril" />
|
|
3
2
|
import { ProcessPrincipalsListItem } from "../../../../components/processPrincipalsList/ProcessPrincipalsListItem";
|
|
4
3
|
import { Markdown, MithrilAttributes, Valued, ViewControl, ViewElement } from "../../../../helpers/types";
|
|
5
4
|
import { Icon, IconElOptions, IconOptions } from "../../../../components/icon/iconOptions";
|
|
@@ -12,6 +11,7 @@ import { ToggleablePanelsEditorFacadeOptions } from "../../../../views/form/cont
|
|
|
12
11
|
import { InputOptions } from "../../../../components/baseFormControls/input/inputOptions";
|
|
13
12
|
import { CodeEditorFacade, CodeEditorFacadeOptions } from "../components/CodeEditorFacade";
|
|
14
13
|
import { FileInputFacadeOptions } from "../../../../views/form/controls/fileupload/FileInputFacade.types";
|
|
14
|
+
import { FieldViewOptions } from "../../../../components/form/fieldView/fieldViewOptions";
|
|
15
15
|
export interface IUiComponentsFacade {
|
|
16
16
|
button(button: ButtonFacade, translate?: boolean): ViewElement;
|
|
17
17
|
topNavButton(options: TopNavButton): _mithril.MithrilVirtualElement;
|
|
@@ -21,6 +21,7 @@ export interface IUiComponentsFacade {
|
|
|
21
21
|
commonControl(options: CommonControlOptions): _mithril.MithrilVirtualElement;
|
|
22
22
|
unstyledInput(options: InputOptions): _mithril.MithrilVirtualElement;
|
|
23
23
|
input(options: InputOptions): _mithril.MithrilVirtualElement;
|
|
24
|
+
field(options: FieldViewOptions): _mithril.MithrilVirtualElement;
|
|
24
25
|
dropdownItem(options: DropdownItemViewOptions): _mithril.MithrilVirtualElement;
|
|
25
26
|
dropdownInputItem(options: DropdownInputItemOptions): _mithril.MithrilVirtualElement;
|
|
26
27
|
toggleablePanelsCtrl(options: ToggleablePanelsEditorFacadeOptions): ViewControl;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
/// <reference types="../../../../mithril" />
|
|
2
|
-
/// <reference types="mithril" />
|
|
3
2
|
import { MithrilControl } from "../../../../helpers/types";
|
|
4
3
|
import { DropdownOptions } from "../../../dropdown/IDropDownMenu";
|
|
5
4
|
import { ButtonFacade } from "../Form/IFormFacade";
|
|
@@ -68,6 +67,7 @@ export interface IModalOptions {
|
|
|
68
67
|
* @default true
|
|
69
68
|
*/
|
|
70
69
|
closable?: boolean;
|
|
70
|
+
onClose?: (closeResult?: any) => void;
|
|
71
71
|
}
|
|
72
72
|
export interface IPanelOptions {
|
|
73
73
|
/** Отображать боковую панель в расширенном на весь экран виде */
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
/// <reference types="../../../../mithril" />
|
|
2
|
-
/// <reference types="mithril" />
|
|
3
2
|
import { MithrilControl } from "../../../../helpers/types";
|
|
4
3
|
export declare type ConfigFunction = (element: HTMLElement, isInitialized: boolean, context?: any) => void;
|
|
5
4
|
export interface ImUtilsFacade {
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
/// <reference types="../../../../mithril" />
|
|
2
|
-
/// <reference types="mithril" />
|
|
3
2
|
import { Valued } from "mdtScripts/helpers/types";
|
|
4
3
|
import { Field } from "../../common/Field";
|
|
5
4
|
import { IListControlFacade } from "../../services/customModules/facades/List/IListControlFacade";
|