mdt-client 1.2.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.
- package/dist/index.d.ts +0 -1
- package/dist/tsconfig.tsbuildinfo +1 -2707
- package/package.json +1 -1
- package/types/common/Field.d.ts +5 -3
- package/types/common/Record.d.ts +4 -1
- package/types/common/Table.d.ts +4 -4
- package/types/common/list/group/groupTypes.d.ts +26 -0
- package/types/common/list/hierarchy/hierarchyTypes.d.ts +39 -0
- package/types/components/baseFormControls/input/{inputView.d.ts → inputOptions.d.ts} +4 -6
- package/types/components/button/baseButton/buttonOptions.d.ts +12 -0
- package/types/components/buttonGroup/buttonGroupOptions.d.ts +7 -0
- package/types/components/dropdown/menuActionItem/dropdownMenuItemOptions.d.ts +3 -3
- package/types/components/form/label/labelOptions.d.ts +18 -0
- package/types/components/icon/iconOptions.d.ts +1 -2
- package/types/components/iconButton/iconButtonOptions.d.ts +7 -0
- package/types/components/processPrincipalsList/ProcessPrincipalsListItem.d.ts +1 -1
- package/types/components/resizablePanels/panelTitle/panelTitleOptions.d.ts +15 -0
- package/types/components/resizablePanels/panelToolbar/panelToolbarOptions.d.ts +4 -0
- package/types/components/resizablePanels/resizablePanel/resizablePanelOptions.d.ts +24 -0
- package/types/components/resizablePanels/resizablePanelsOptions.d.ts +22 -0
- package/types/components/toggleablePanels/toggleablePanelsOptions.d.ts +40 -0
- package/types/data/active/ActivationListAdapterTypes.d.ts +6 -0
- package/types/helpers/IUi.d.ts +1 -0
- package/types/helpers/deleteFromArray.d.ts +1 -0
- package/types/helpers/events/EventEmitter.d.ts +7 -0
- package/types/helpers/fireEvent.d.ts +4 -0
- package/types/helpers/pipeline/Pipeline.d.ts +20 -0
- package/types/helpers/redraw.d.ts +16 -0
- package/types/helpers/types.d.ts +19 -5
- package/types/helpers/ui/elementModificators/focusableComponent.d.ts +3 -1
- package/types/helpers/ui/keyboardUtils/keyboardUtils.d.ts +12 -5
- package/types/helpers/utils/keyStorage/KeyStorage.d.ts +6 -0
- package/types/helpers/utils/stringifyControlSize.d.ts +1 -1
- package/types/helpers/zone/IZone.d.ts +0 -1
- package/types/security/PermissionLevel.d.ts +3 -1
- package/types/security/User.d.ts +30 -0
- package/types/services/IFilter.d.ts +3 -2
- package/types/services/ModuleData.d.ts +2 -1
- package/types/services/api/BaseQuery.d.ts +3 -2
- package/types/services/api/Query.d.ts +10 -36
- package/types/services/api/QuerySorting.d.ts +8 -0
- package/types/services/commands/CommandManager.d.ts +1 -1
- package/types/services/customModules/facades/Form/IFieldControlManagerFacade.d.ts +1 -1
- package/types/services/customModules/facades/Form/IFormControlFacade.d.ts +9 -2
- package/types/services/customModules/facades/Form/IFormFacade.d.ts +20 -5
- package/types/services/customModules/facades/IAuthFacade.d.ts +2 -2
- package/types/services/customModules/facades/IMdtFacade.d.ts +0 -1
- package/types/services/customModules/facades/List/IListCellFacade.d.ts +2 -2
- package/types/services/customModules/facades/List/IListControlFacade.d.ts +5 -4
- package/types/services/customModules/facades/List/IListServiceFacade.d.ts +16 -0
- package/types/services/customModules/facades/components/CodeEditorFacade.d.ts +9 -0
- package/types/services/customModules/facades/schema/IObjectFacade.d.ts +1 -1
- package/types/services/customModules/facades/services/CommandManagerFacade.d.ts +3 -1
- package/types/services/customModules/facades/services/IListButtonExtendPipelineService.d.ts +13 -0
- package/types/services/customModules/facades/services/ISecurityFacade.d.ts +6 -14
- package/types/services/customModules/facades/utils/IApiFacade.d.ts +5 -5
- package/types/services/customModules/facades/utils/IUiComponentsFacade.d.ts +11 -3
- package/types/services/customModules/facades/utils/IUiFacade.d.ts +16 -7
- package/types/services/customModules/facades/utils/IUtilsFacade.d.ts +6 -1
- package/types/services/customModules/facades/utils/ImUtilsFacade.d.ts +1 -2
- package/types/services/dropdown/IDropDownMenu.d.ts +18 -5
- package/types/views/form/controls/commonControl/ICommonControl.d.ts +2 -2
- package/types/views/form/controls/monacoEditor/MonacoCodeOptions.schema.d.ts +22 -0
- package/types/views/form/controls/monacoEditor/jsonSchemas/Button.schema.d.ts +4 -3
- package/types/views/form/controls/toggleablePanels/editor/toggleablePanelsEditorFacadeOptions.d.ts +20 -0
- package/types/views/form/formTypes.d.ts +1 -1
- package/types/views/form/schema/FormPageOptions.schema.d.ts +17 -0
- package/types/views/list/IListView.d.ts +10 -6
- package/types/views/list/schema/ListPageOptions.schema.d.ts +30 -4
- package/types/helpers/utils/classNames.d.ts +0 -2
- package/types/helpers/utils/object.d.ts +0 -1
|
@@ -1,14 +1,12 @@
|
|
|
1
|
+
import { Grouping } from "../../common/list/group/groupTypes";
|
|
2
|
+
import { HierarchyQuery } from "../../common/list/hierarchy/hierarchyTypes";
|
|
1
3
|
import { Table } from "../../common/Table";
|
|
2
4
|
import { BaseQuery } from "./BaseQuery";
|
|
3
|
-
export declare type QuerySorting = string | {
|
|
4
|
-
path: string;
|
|
5
|
-
asc?: boolean;
|
|
6
|
-
};
|
|
7
5
|
export interface Query extends BaseQuery {
|
|
8
6
|
options?: QueryOptions;
|
|
9
7
|
withCount?: boolean;
|
|
10
8
|
distinct?: boolean;
|
|
11
|
-
key?:
|
|
9
|
+
key?: string;
|
|
12
10
|
params?: any;
|
|
13
11
|
dependency?: {
|
|
14
12
|
table: string;
|
|
@@ -17,45 +15,21 @@ export interface Query extends BaseQuery {
|
|
|
17
15
|
aggregate?: boolean;
|
|
18
16
|
export?: string;
|
|
19
17
|
format?: string;
|
|
20
|
-
hierarchy?:
|
|
21
|
-
placeIn?:
|
|
18
|
+
hierarchy?: HierarchyQuery;
|
|
19
|
+
placeIn?: string;
|
|
22
20
|
date?: Date;
|
|
23
21
|
table?: Table;
|
|
24
22
|
children?: Query[];
|
|
25
23
|
parent?: Query;
|
|
26
|
-
groups?:
|
|
24
|
+
groups?: Grouping.Group;
|
|
27
25
|
disableDefaultSorting?: boolean;
|
|
28
26
|
pure?: boolean;
|
|
29
|
-
audit?:
|
|
30
|
-
workflow?:
|
|
31
|
-
tag?:
|
|
27
|
+
audit?: TicketQuery;
|
|
28
|
+
workflow?: TicketQuery;
|
|
29
|
+
tag?: TicketQuery;
|
|
32
30
|
skippedRowsCount?: number;
|
|
33
31
|
}
|
|
34
|
-
export
|
|
35
|
-
groups?: GroupItem[];
|
|
36
|
-
allParents?: boolean;
|
|
37
|
-
orphans?: boolean;
|
|
38
|
-
toggledValues?: any[];
|
|
39
|
-
}
|
|
40
|
-
export declare type GroupLabel = {
|
|
41
|
-
title?: string;
|
|
42
|
-
icon?: string;
|
|
43
|
-
color?: string;
|
|
44
|
-
textColor?: string;
|
|
45
|
-
};
|
|
46
|
-
export interface GroupItem {
|
|
47
|
-
fieldPath: string;
|
|
48
|
-
collapsed?: boolean;
|
|
49
|
-
label?: GroupLabel | false;
|
|
50
|
-
toggledValues?: any[];
|
|
51
|
-
withEmpty?: boolean;
|
|
52
|
-
sortDesc?: boolean;
|
|
53
|
-
select?: string[];
|
|
54
|
-
sorting?: {
|
|
55
|
-
path: string;
|
|
56
|
-
asc?: boolean;
|
|
57
|
-
}[];
|
|
58
|
-
}
|
|
32
|
+
export declare type TicketQuery = string | "ticket";
|
|
59
33
|
export interface QueryOptions {
|
|
60
34
|
root?: boolean;
|
|
61
35
|
reset?: boolean;
|
|
@@ -45,7 +45,7 @@ export interface CommandBase<Context = AnyObject> extends CommandProps {
|
|
|
45
45
|
execute: (context: Context) => void;
|
|
46
46
|
/** Условие активности команды */
|
|
47
47
|
enabled?: (context: Context) => boolean;
|
|
48
|
-
/** Условие видимости команды в
|
|
48
|
+
/** Условие видимости команды в быстрых командах */
|
|
49
49
|
visible?: (context: Context) => boolean;
|
|
50
50
|
}
|
|
51
51
|
export declare type HotkeyCommands = {
|
|
@@ -7,7 +7,7 @@ export interface MountContext<V> {
|
|
|
7
7
|
/** Опции контрола */
|
|
8
8
|
options: any;
|
|
9
9
|
/** Подписка на событие удаления контрола */
|
|
10
|
-
onUnmount: (onUnmountCallback?: (
|
|
10
|
+
onUnmount: (onUnmountCallback?: () => void) => void;
|
|
11
11
|
/** Mithril класс контрола */
|
|
12
12
|
control: any;
|
|
13
13
|
}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { EventEmitter } from "../../../../helpers/events/EventEmitter";
|
|
2
|
+
import { FormZones } from "../../../../views/form/formTypes";
|
|
2
3
|
import { IFieldFacade } from "../schema/IFieldFacade";
|
|
3
4
|
import { IObjectFacade } from "../schema/IObjectFacade";
|
|
4
|
-
import { RecordId } from "
|
|
5
|
+
import { RecordId } from "../../../../common/Record";
|
|
5
6
|
import { ParentCtrl } from "../utils/IUiFacade";
|
|
6
7
|
import { ButtonFacade } from "./IFormFacade";
|
|
7
8
|
export declare type IFormFieldOptionsConfig = {
|
|
@@ -10,7 +11,13 @@ export declare type IFormFieldOptionsConfig = {
|
|
|
10
11
|
export interface IFormControlFacadeContstructor {
|
|
11
12
|
new (formCtrl: any): IFormControlFacade;
|
|
12
13
|
}
|
|
14
|
+
export interface FormControlFacadeEvents {
|
|
15
|
+
saved: {
|
|
16
|
+
recordId: RecordId;
|
|
17
|
+
};
|
|
18
|
+
}
|
|
13
19
|
export interface IFormControlFacade extends ParentCtrl {
|
|
20
|
+
eventEmitter: EventEmitter<FormControlFacadeEvents>;
|
|
14
21
|
/** Получить оригинальный контрол формы */
|
|
15
22
|
getFormCtrl(): any;
|
|
16
23
|
/** Получить объект, к которому приязана форма */
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { MdtRecord } from "
|
|
2
|
-
import { FormattedText } from "
|
|
3
|
-
import { Valued } from "mdtScripts/helpers/types";
|
|
1
|
+
import { MdtRecord, RecordId } from "../../../../common/Record";
|
|
2
|
+
import { FormattedText } from "../../../../helpers/formattedText";
|
|
3
|
+
import { AnyObject, MithrilControl, Valued } from "mdtScripts/helpers/types";
|
|
4
4
|
import { Field } from "../../../../common/Field";
|
|
5
5
|
import { IButton } from "../../../../views/form/controls/monacoEditor/jsonSchemas/Button.schema";
|
|
6
|
-
import {
|
|
6
|
+
import { IObjectFacade } from "../schema/IObjectFacade";
|
|
7
7
|
import { IFormControlFacade } from "./IFormControlFacade";
|
|
8
8
|
export declare type ActionButton = IButton & {
|
|
9
9
|
/** Всплывающая подсказка */
|
|
@@ -42,6 +42,8 @@ export interface IFormOptions {
|
|
|
42
42
|
onSave(record: Record<string, any>): any;
|
|
43
43
|
/** Запись по умолчанию */
|
|
44
44
|
defaultValues?: Partial<MdtRecord>;
|
|
45
|
+
/** Описание лэйаута формы */
|
|
46
|
+
layout?: CustomFormLayout;
|
|
45
47
|
}
|
|
46
48
|
export interface IFormServiceFacade {
|
|
47
49
|
/** Создать форму, привязанную объекту */
|
|
@@ -60,11 +62,24 @@ export interface IFormServiceFacade {
|
|
|
60
62
|
* @param {string} alias - Имя свойства, которое можно использовать для установки опций экстендера
|
|
61
63
|
*/
|
|
62
64
|
registerExtender<T>(extender: IFormExtenderFacade<T>, alias: string): void;
|
|
65
|
+
/** Зарегистрировать новый контрол формы */
|
|
66
|
+
registerControl<Options>(controlOptions: FormControlOptions<Options>): void;
|
|
63
67
|
}
|
|
64
68
|
export interface ICustomField extends Field {
|
|
65
|
-
/** Опции контрола
|
|
69
|
+
/** Опции контрола поля. Используются только в том случае, если не задан лэйаут для формы */
|
|
66
70
|
options?: any;
|
|
67
71
|
}
|
|
72
|
+
declare type CustomFormLayout = any;
|
|
68
73
|
export interface IFormExtenderFacade<T> {
|
|
69
74
|
new (form: IFormControlFacade, options: any): T;
|
|
70
75
|
}
|
|
76
|
+
export interface FormControlOptions<Options = AnyObject> {
|
|
77
|
+
code: string;
|
|
78
|
+
title: string;
|
|
79
|
+
enabled?: (object: IObjectFacade) => boolean;
|
|
80
|
+
type: FormControlClass<Options>;
|
|
81
|
+
}
|
|
82
|
+
export interface FormControlClass<Options = AnyObject> {
|
|
83
|
+
new (form: IFormControlFacade, options: Options): MithrilControl;
|
|
84
|
+
}
|
|
85
|
+
export {};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { MithrilControl } from "
|
|
1
|
+
import { MithrilControl } from "../../../helpers/types";
|
|
2
2
|
import { IType } from "./utils/IUiFacade";
|
|
3
3
|
export interface IAuthFacade {
|
|
4
4
|
disableFormsProvider(): void;
|
|
5
5
|
disableProvider(control: IType<MithrilControl>): void;
|
|
6
|
-
registerControl(
|
|
6
|
+
registerControl(getControl: () => MithrilControl): void;
|
|
7
7
|
onHeadClick(onHeadClickHandler: () => void): void;
|
|
8
8
|
disableOnHeadClick(onHeadClickHandler: () => void): void;
|
|
9
9
|
}
|
|
@@ -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";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { ViewElement } from "../../../../helpers/types";
|
|
2
|
-
import { ILayoutColumnBase } from "../../../../views/list/IListView";
|
|
2
|
+
import { ILayoutColumnBase, LayoutColumnValued } from "../../../../views/list/IListView";
|
|
3
3
|
import { IListComponentFacade } from "./IListComponentFacade";
|
|
4
4
|
export interface IListCellFacade extends IListComponentFacade {
|
|
5
|
-
col: ILayoutColumnBase;
|
|
5
|
+
col: ILayoutColumnBase & LayoutColumnValued;
|
|
6
6
|
value(): any;
|
|
7
7
|
setContent(content: ViewElement[]): void;
|
|
8
8
|
}
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
/// <reference types="../../../../mithril" />
|
|
2
|
-
/// <reference types="mithril" />
|
|
3
1
|
import { FilterSetterOptions, IFilter } from "../../../../services/IFilter";
|
|
4
2
|
import { ButtonFacade } from "../Form/IFormFacade";
|
|
5
3
|
import { ParentCtrl } from "../utils/IUiFacade";
|
|
@@ -7,6 +5,7 @@ import { IListRowFacade } from "./IListRowFacade";
|
|
|
7
5
|
import { IListCellFacade } from "./IListCellFacade";
|
|
8
6
|
import { IObjectFacade } from "../schema/IObjectFacade";
|
|
9
7
|
import { ListPageOptions } from "../../../../views/list/schema/ListPageOptions.schema";
|
|
8
|
+
import { ViewElement } from "../../../../helpers/types";
|
|
10
9
|
export interface IListControlFacadeContstructor {
|
|
11
10
|
new (listCtrl: any): IListControlFacade;
|
|
12
11
|
}
|
|
@@ -24,7 +23,7 @@ export interface IListControlFacade extends ParentCtrl {
|
|
|
24
23
|
/** Установить фильтр на список */
|
|
25
24
|
setFilter(filter: IFilter | null, options?: FilterSetterOptions, key?: string): void;
|
|
26
25
|
/** Обновить данные списка */
|
|
27
|
-
refresh():
|
|
26
|
+
refresh(): PromiseLike<unknown>;
|
|
28
27
|
/** Изменить отображение строк списка */
|
|
29
28
|
addTransformerForRow(callback: (row: IListRowFacade) => void): void;
|
|
30
29
|
/** Изменить отображение ячеек списка */
|
|
@@ -40,5 +39,7 @@ export interface IListControlFacade extends ParentCtrl {
|
|
|
40
39
|
/** Удалить выделенные строки */
|
|
41
40
|
removeSelectedRows(): void;
|
|
42
41
|
/** Открыть конструктор списка */
|
|
43
|
-
openDesigner(): void
|
|
42
|
+
openDesigner(): Promise<void>;
|
|
43
|
+
/** Получить виртуальный элемент списка */
|
|
44
|
+
getViewElement(): ViewElement;
|
|
44
45
|
}
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import { Field } from "../../../../../scripts/common/Field";
|
|
2
|
+
import { ObjectCode } from "../../../../../scripts/helpers/types";
|
|
3
|
+
import { MdtRecord } from "../utils/IApiFacade";
|
|
1
4
|
import { IListControlFacade } from "./IListControlFacade";
|
|
2
5
|
export interface IListInitOptions {
|
|
3
6
|
/** Уникальный код списка */
|
|
@@ -20,7 +23,20 @@ export interface IListServiceFacade {
|
|
|
20
23
|
* @param {string} alias - Имя свойства, которое можно использовать для установки опций экстендера в extConfig или extOptions списка
|
|
21
24
|
*/
|
|
22
25
|
registerExtender<T>(extender: IListExtenderFacade<T>, alias: string): void;
|
|
26
|
+
createCustom(options: CustomListOptions): IListControlFacade;
|
|
23
27
|
}
|
|
24
28
|
export interface IListExtenderFacade<T> {
|
|
25
29
|
new (list: IListControlFacade, options: any): T;
|
|
26
30
|
}
|
|
31
|
+
export interface CustomListOptions<R = MdtRecord> {
|
|
32
|
+
/** Код объекта списка */
|
|
33
|
+
code: ObjectCode;
|
|
34
|
+
/** Поля списка */
|
|
35
|
+
fields: Field[];
|
|
36
|
+
/** Записи списка */
|
|
37
|
+
records: R[];
|
|
38
|
+
/** Опции списка */
|
|
39
|
+
listOptions?: any;
|
|
40
|
+
/** Настройки расширений списка */
|
|
41
|
+
extConfig?: any;
|
|
42
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ViewControl } from "../../../../helpers/types";
|
|
2
|
+
import { MonacoCodeOptions } from "../../../../views/form/controls/monacoEditor/MonacoCodeOptions.schema";
|
|
3
|
+
export interface CodeEditorFacadeOptions extends MonacoCodeOptions {
|
|
4
|
+
/** Адаптировать высоту редактора под высоту родительского элемента */
|
|
5
|
+
fillParentMode?: boolean;
|
|
6
|
+
}
|
|
7
|
+
export interface CodeEditorFacade extends ViewControl {
|
|
8
|
+
pasteSnippet(snippetContent: string): void;
|
|
9
|
+
}
|
|
@@ -5,5 +5,7 @@ export declare class CommandManagerFacade {
|
|
|
5
5
|
/** Добавить группу команд */
|
|
6
6
|
addGroup(group: CommandGroupProps): CommandGroup<CommandManagerContext>;
|
|
7
7
|
/** Добавить команды */
|
|
8
|
-
addCommands(commands: CommandBase<CommandManagerContext>[]): void;
|
|
8
|
+
addCommands(commands: CommandBase<CommandManagerContext>[], groupCode?: string): void;
|
|
9
|
+
/** Получить существующую команду */
|
|
10
|
+
getCommand(code: string): import("../../../commands/Command").Command<CommandManagerContext>;
|
|
9
11
|
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Pipeline, PipelineSync } from "../../../../helpers/pipeline/Pipeline";
|
|
2
|
+
import { IListControlFacade } from "../List/IListControlFacade";
|
|
3
|
+
import { MdtRecord } from "../utils/IApiFacade";
|
|
4
|
+
export declare type JobButtonCreateHandler = (list: IListControlFacade, pipelines: ListButtonExtendPipelines) => void;
|
|
5
|
+
export interface ListButtonExtendPipelines {
|
|
6
|
+
/** Определить активность кнопок службы и удаления записи */
|
|
7
|
+
buttonEnabled: PipelineSync<boolean>;
|
|
8
|
+
/** Добавить дополнительные записи перед выполнением операции над записями */
|
|
9
|
+
preExecute: Pipeline<MdtRecord[]>;
|
|
10
|
+
}
|
|
11
|
+
export interface IListButtonExtendPipelineService {
|
|
12
|
+
onJobButtonCreate(handler: JobButtonCreateHandler): void;
|
|
13
|
+
}
|
|
@@ -1,19 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
fullName: string;
|
|
5
|
-
email: string;
|
|
6
|
-
identityName: string;
|
|
7
|
-
isAdmin: boolean;
|
|
8
|
-
isAnonymous: boolean;
|
|
9
|
-
roles: string[];
|
|
10
|
-
userGroups: any[];
|
|
11
|
-
languageId: number;
|
|
12
|
-
isImpersonated: boolean;
|
|
13
|
-
}
|
|
1
|
+
import { User } from "../../../../security/User";
|
|
2
|
+
import { PermissionLevel } from "../../../../security/PermissionLevel";
|
|
3
|
+
import { IObjectFacade } from "../schema/IObjectFacade";
|
|
14
4
|
export interface ISecurityFacade {
|
|
15
5
|
/** Проверка на наличие роли у пользователя */
|
|
16
6
|
hasRole(role: string): boolean;
|
|
17
7
|
/** Получить информацию о текущем пользователе */
|
|
18
|
-
getUser():
|
|
8
|
+
getUser(): User;
|
|
9
|
+
/** Имеет ли текущий пользователь разрешение на объект */
|
|
10
|
+
hasPermission(object: IObjectFacade, permissionLevel: PermissionLevel): any;
|
|
19
11
|
}
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { BaseQuery } from "../../../../services/api/BaseQuery";
|
|
2
2
|
import { FetchResult } from "../../../../datasources/FetchResult";
|
|
3
3
|
import { ApiRequestOptions } from "../../../../services/api/ApiRequestOptions";
|
|
4
|
-
|
|
4
|
+
import { RecordId } from "../../../../common/Record";
|
|
5
5
|
export interface QueryParams {
|
|
6
6
|
[param: string]: string | number;
|
|
7
7
|
}
|
|
8
8
|
export interface IApiFacade {
|
|
9
9
|
/** Отправить запрос на получение данных по объекту */
|
|
10
|
-
fetch<R = FetchResult>(objectCode: string, query
|
|
10
|
+
fetch<R = FetchResult>(objectCode: string, query?: BaseQuery): Promise<R>;
|
|
11
11
|
/** Отправить запрос на получение одной записи из объекта */
|
|
12
|
-
fetchRecord<R = FetchResult>(objectCode: string, query
|
|
12
|
+
fetchRecord<R = FetchResult>(objectCode: string, query?: BaseQuery): Promise<R>;
|
|
13
13
|
/** Отправить запрос к функции */
|
|
14
|
-
fetchFromFunction<R extends FetchResult = FetchResult>(objectCode: string, query
|
|
14
|
+
fetchFromFunction<R extends FetchResult = FetchResult>(objectCode: string, query?: BaseQuery, params?: any[]): Promise<R>;
|
|
15
15
|
/** Отправить запрос на получение одной записи из функции */
|
|
16
|
-
fetchRecordFromFunction<R = any>(objectCode: string, query
|
|
16
|
+
fetchRecordFromFunction<R = any>(objectCode: string, query?: BaseQuery, params?: any[]): Promise<R>;
|
|
17
17
|
/** Сохранить новые данные */
|
|
18
18
|
save<S = MdtQueryResult>(objectCode: string, record: MdtRecord): Promise<S>;
|
|
19
19
|
/** Удалить данные */
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
/// <reference types="../../../../mithril" />
|
|
2
|
-
/// <reference types="mithril" />
|
|
3
2
|
import { ProcessPrincipalsListItem } from "../../../../components/processPrincipalsList/ProcessPrincipalsListItem";
|
|
4
|
-
import { Markdown, MithrilAttributes, Valued, ViewElement } from "../../../../helpers/types";
|
|
3
|
+
import { Markdown, MithrilAttributes, Valued, ViewControl, ViewElement } from "../../../../helpers/types";
|
|
5
4
|
import { Icon, IconElOptions, IconOptions } from "../../../../components/icon/iconOptions";
|
|
6
|
-
import { InputOptions } from "../../../../components/baseFormControls/input/inputView";
|
|
7
5
|
import { CommonControlOptions } from "../../../../views/form/controls/commonControl/ICommonControl";
|
|
8
6
|
import { ButtonFacade } from "../Form/IFormFacade";
|
|
9
7
|
import { DropdownInputItemOptions } from "../../../../components/dropdown/menu/item/dropdownInputItemOptions";
|
|
10
8
|
import { DropdownItemViewOptions } from "../../../../components/dropdown/menu/item/dropdownItemWrapOptions";
|
|
9
|
+
import { MonacoCodeOptions } from "../../../../views/form/controls/monacoEditor/MonacoCodeOptions.schema";
|
|
10
|
+
import { ToggleablePanelsEditorFacadeOptions } from "../../../../views/form/controls/toggleablePanels/editor/toggleablePanelsEditorFacadeOptions";
|
|
11
|
+
import { InputOptions } from "../../../../components/baseFormControls/input/inputOptions";
|
|
12
|
+
import { CodeEditorFacade, CodeEditorFacadeOptions } from "../components/CodeEditorFacade";
|
|
11
13
|
export interface IUiComponentsFacade {
|
|
12
14
|
button(button: ButtonFacade, translate?: boolean): ViewElement;
|
|
13
15
|
topNavButton(options: TopNavButton): _mithril.MithrilVirtualElement;
|
|
@@ -19,6 +21,12 @@ export interface IUiComponentsFacade {
|
|
|
19
21
|
input(options: InputOptions): _mithril.MithrilVirtualElement;
|
|
20
22
|
dropdownItem(options: DropdownItemViewOptions): _mithril.MithrilVirtualElement;
|
|
21
23
|
dropdownInputItem(options: DropdownInputItemOptions): _mithril.MithrilVirtualElement;
|
|
24
|
+
toggleablePanelsCtrl(options: ToggleablePanelsEditorFacadeOptions): ViewControl;
|
|
25
|
+
editors: {
|
|
26
|
+
codeEditor(options: CodeEditorFacadeOptions): CodeEditorFacade;
|
|
27
|
+
};
|
|
28
|
+
/** @deprecated Use `UiComponents.editors.codeEditor` instead. */
|
|
29
|
+
fullScreenCodeEditor(options: MonacoCodeOptions): _mithril.MithrilVirtualElement;
|
|
22
30
|
}
|
|
23
31
|
export interface IProcessFormBlockOptions {
|
|
24
32
|
title: string;
|
|
@@ -1,10 +1,10 @@
|
|
|
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";
|
|
6
|
-
import { DropdownTargetContext, IDropdownMenu } from "
|
|
5
|
+
import { DropdownTargetContext, IDropdownMenu } from "../../../dropdown/IDropDownMenu";
|
|
7
6
|
import { IModalFacade } from "../components/ModalFacade";
|
|
7
|
+
import { UiType } from "../../../../helpers/IUi";
|
|
8
8
|
export declare type onModalResizeCallback = (data: IModalSizingState) => void;
|
|
9
9
|
export interface IType<T> {
|
|
10
10
|
new (...args: any[]): T;
|
|
@@ -12,6 +12,8 @@ export interface IType<T> {
|
|
|
12
12
|
export interface ParentCtrl {
|
|
13
13
|
getViewControl(): MithrilControl;
|
|
14
14
|
}
|
|
15
|
+
export declare type NotificationType = "default" | "info" | "success" | "warning" | "danger";
|
|
16
|
+
export declare type UiContainerContent = MithrilControl | ParentCtrl | string;
|
|
15
17
|
export interface CustomNotification {
|
|
16
18
|
/** Заголовок сообщения */
|
|
17
19
|
title: string;
|
|
@@ -20,23 +22,23 @@ export interface CustomNotification {
|
|
|
20
22
|
/** Наименование иконки */
|
|
21
23
|
icon?: string;
|
|
22
24
|
/** Тип выводимого сообщения*/
|
|
23
|
-
type?:
|
|
25
|
+
type?: NotificationType;
|
|
24
26
|
/** Кнопки, отображаемые в сообщении*/
|
|
25
27
|
actions?: ButtonFacade[];
|
|
26
28
|
}
|
|
27
29
|
export interface IUiFacade {
|
|
28
30
|
/** Вызвать окно уведомления */
|
|
29
|
-
showNotification(msg: CustomNotification, duration?: number):
|
|
31
|
+
showNotification(msg: CustomNotification, duration?: number): void;
|
|
30
32
|
/** Вызвать модальное окно */
|
|
31
|
-
showModal(
|
|
33
|
+
showModal(content: UiContainerContent, options?: IModalOptions): IModalFacade;
|
|
32
34
|
/** Вызвать боковую панель */
|
|
33
|
-
showSidebar(
|
|
35
|
+
showSidebar(content: UiContainerContent, options?: IPanelOptions): void;
|
|
34
36
|
/** Создать выпадающее меню */
|
|
35
37
|
createDropdown<I>(options: DropdownOptions<I>, el: Element, ctx: DropdownTargetContext<I>): IDropdownMenu<I>;
|
|
36
38
|
/** Создать компонент с пользовательской версткой */
|
|
37
39
|
createControl(view: () => _mithril.MithrilVirtualElement): MithrilControl;
|
|
38
40
|
}
|
|
39
|
-
export declare type ModalTypes =
|
|
41
|
+
export declare type ModalTypes = UiType;
|
|
40
42
|
export interface IModalOptions {
|
|
41
43
|
/** CSS класс */
|
|
42
44
|
class?: string;
|
|
@@ -58,6 +60,13 @@ export interface IModalOptions {
|
|
|
58
60
|
type?: ModalTypes;
|
|
59
61
|
/** Дополнительные кнопки на окне */
|
|
60
62
|
buttons?: ButtonFacade[];
|
|
63
|
+
/** Настройки кнопки закрытия модального окна */
|
|
64
|
+
closeButton?: Partial<ButtonFacade>;
|
|
65
|
+
/**
|
|
66
|
+
* Возможность закрыть окно по кнопкам закрытия и с помощью клавиатуры
|
|
67
|
+
* @default true
|
|
68
|
+
*/
|
|
69
|
+
closable?: boolean;
|
|
61
70
|
}
|
|
62
71
|
export interface IPanelOptions {
|
|
63
72
|
/** Отображать боковую панель в расширенном на весь экран виде */
|
|
@@ -1,6 +1,11 @@
|
|
|
1
|
+
import { AnyObject } from "../../../../helpers/types";
|
|
2
|
+
import { KeyStorage } from "../../../../helpers/utils/keyStorage/KeyStorage";
|
|
1
3
|
import { FormatOptions } from "../../../../helpers/formatOptions";
|
|
4
|
+
import { IListButtonExtendPipelineService } from "../services/IListButtonExtendPipelineService";
|
|
2
5
|
export interface IUtilsFacade {
|
|
3
|
-
|
|
6
|
+
ListButtonExtendPipelineService: IListButtonExtendPipelineService;
|
|
7
|
+
getText(textCode: string, args?: AnyObject): string;
|
|
4
8
|
format(value: any, options?: FormatOptions): any;
|
|
5
9
|
guid(): string;
|
|
10
|
+
getStorageItem<T>(key: string, defaultValue?: T): KeyStorage<T>;
|
|
6
11
|
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
/// <reference types="../../../../mithril" />
|
|
2
|
-
|
|
3
|
-
import { MithrilControl } from "mdtScripts/helpers/types";
|
|
2
|
+
import { MithrilControl } from "../../../../helpers/types";
|
|
4
3
|
export declare type ConfigFunction = (element: HTMLElement, isInitialized: boolean, context?: any) => void;
|
|
5
4
|
export interface ImUtilsFacade {
|
|
6
5
|
/** Проверка, есть ли класс у элемента */
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
/// <reference types="../../../../mithril" />
|
|
2
|
-
/// <reference types="mithril" />
|
|
3
2
|
import { MithrilContext, MithrilControl } from "../../helpers/types";
|
|
4
3
|
export declare class IDropdownMenu<I> {
|
|
5
4
|
constructor(items: I[], uid: string, options?: DropdownOptions<I>);
|
|
@@ -8,20 +7,34 @@ export declare class IDropdownMenu<I> {
|
|
|
8
7
|
close(): void;
|
|
9
8
|
isShown(): boolean;
|
|
10
9
|
}
|
|
10
|
+
export declare type DropdownItemIndex = number;
|
|
11
|
+
export declare type DropdownItem<I> = Exclude<I, MithrilControl> | I;
|
|
11
12
|
export interface DropdownOptions<I> {
|
|
12
13
|
getItems: () => I[];
|
|
13
|
-
onSelect: (item:
|
|
14
|
-
itemView: (item:
|
|
14
|
+
onSelect: (item: DropdownItem<I>) => void;
|
|
15
|
+
itemView: (item: DropdownItem<I>, viewState: {
|
|
16
|
+
isCurrent: boolean;
|
|
17
|
+
}) => _mithril.MithrilVirtualElement;
|
|
15
18
|
class?: string;
|
|
16
19
|
onShow?: () => void;
|
|
17
20
|
onClose?: () => void;
|
|
21
|
+
wrapAttrs?: _mithril.MithrilAttributes;
|
|
22
|
+
isCurrent?: (item: DropdownItem<I>) => DropdownItemIndex;
|
|
18
23
|
}
|
|
19
24
|
export interface DropdownMenuViewOptions<I> {
|
|
20
25
|
items: I[];
|
|
21
|
-
itemView?: (item:
|
|
22
|
-
|
|
26
|
+
itemView?: (item: DropdownItem<I>, viewState: {
|
|
27
|
+
isCurrent: boolean;
|
|
28
|
+
}) => _mithril.MithrilVirtualElement;
|
|
29
|
+
onSelect: (item: DropdownItem<I>) => void;
|
|
23
30
|
class?: string;
|
|
31
|
+
wrapAttrs?: _mithril.MithrilAttributes;
|
|
32
|
+
isCurrent?: DropdownItemIndex;
|
|
24
33
|
}
|
|
25
34
|
export declare type DropdownTargetContext<I> = MithrilContext<{
|
|
26
35
|
$dropdown?: IDropdownMenu<I>;
|
|
27
36
|
}>;
|
|
37
|
+
export interface DropdownMenuNavigatorOptions {
|
|
38
|
+
select: (idx: DropdownItemIndex) => void;
|
|
39
|
+
getItemsAmount?: () => number;
|
|
40
|
+
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/// <reference types="../../../../mithril" />
|
|
2
|
-
|
|
3
|
-
import { Valued, ViewElement } from "../../../../helpers/types";
|
|
2
|
+
import { CSSClassName, Valued, ViewElement } from "../../../../helpers/types";
|
|
4
3
|
export interface Action {
|
|
5
4
|
icon?: Valued<string>;
|
|
6
5
|
code?: string;
|
|
7
6
|
title?: Valued<string>;
|
|
8
7
|
command?: () => void;
|
|
8
|
+
className?: CSSClassName;
|
|
9
9
|
}
|
|
10
10
|
export interface ClearAction {
|
|
11
11
|
show?: boolean;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { CSSClassName } from "../../../../helpers/types";
|
|
2
|
+
import * as monaco from "monaco-editor";
|
|
3
|
+
export declare type MonacoCodeLang = string;
|
|
4
|
+
export interface MonacoCodeOptions {
|
|
5
|
+
lang?: MonacoCodeLang;
|
|
6
|
+
guid?: string;
|
|
7
|
+
value?: () => string;
|
|
8
|
+
onChange?: (value: string) => void;
|
|
9
|
+
onChangeErrorState?: (errMessage?: string) => void;
|
|
10
|
+
jsonSchema?: string;
|
|
11
|
+
placeholder?: string;
|
|
12
|
+
className?: CSSClassName;
|
|
13
|
+
/**
|
|
14
|
+
* @TJS-type any
|
|
15
|
+
*/
|
|
16
|
+
editorOptions?: monaco.editor.IStandaloneEditorConstructionOptions;
|
|
17
|
+
showDescription?: boolean;
|
|
18
|
+
enableFullscreen?: boolean;
|
|
19
|
+
enableSuggestionOnEnter?: boolean;
|
|
20
|
+
/** Игнорировать валидационные ошибки формата данных */
|
|
21
|
+
ignoreControlValidation?: boolean;
|
|
22
|
+
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { FormattedText } from "
|
|
2
|
-
import {
|
|
3
|
-
|
|
1
|
+
import { FormattedText } from "../../../../../helpers/formattedText";
|
|
2
|
+
import { UiType } from "../../../../../helpers/IUi";
|
|
3
|
+
import { ControlSize } from "../../../../../views/controls/Control";
|
|
4
|
+
export declare type ButtonTypes = UiType | "default" | "link" | "group-title" | "extended";
|
|
4
5
|
export interface IButton {
|
|
5
6
|
/**
|
|
6
7
|
* Тип кнопки
|
package/types/views/form/controls/toggleablePanels/editor/toggleablePanelsEditorFacadeOptions.d.ts
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { PanelTitleTextContent } from "../../../../../components/resizablePanels/panelTitle/panelTitleOptions";
|
|
2
|
+
import { ResizablePanelFocusOptions } from "../../../../../components/resizablePanels/resizablePanel/resizablePanelOptions";
|
|
3
|
+
import { PanelSizeFactor } from "../../../../../components/resizablePanels/resizablePanelsOptions";
|
|
4
|
+
import { PanelsGrid, ToggleableRotatablePanelsOptions } from "../../../../../components/toggleablePanels/toggleablePanelsOptions";
|
|
5
|
+
import { ViewElement } from "../../../../../helpers/types";
|
|
6
|
+
import { ButtonFacade } from "../../../../../services/customModules/facades/Form/IFormFacade";
|
|
7
|
+
export interface ToggleablePanelsEditorFacadeOptions extends ToggleableRotatablePanelsOptions {
|
|
8
|
+
toolbarButtons?: ButtonFacade[];
|
|
9
|
+
panels: PanelsGrid<ToggleablePanelsEditorPanelFacadeOptions>;
|
|
10
|
+
runButton: ButtonFacade;
|
|
11
|
+
hightlightFocusedPanel?: boolean;
|
|
12
|
+
}
|
|
13
|
+
interface ToggleablePanelsEditorPanelFacadeOptions {
|
|
14
|
+
title: PanelTitleTextContent;
|
|
15
|
+
isShown?: boolean;
|
|
16
|
+
size?: PanelSizeFactor;
|
|
17
|
+
content: () => ViewElement;
|
|
18
|
+
focusOptions?: ResizablePanelFocusOptions;
|
|
19
|
+
}
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Button } from "../controls/monacoEditor/jsonSchemas/Button.schema";
|
|
2
|
+
export interface FormPageOptions {
|
|
3
|
+
/** Форма только для чтения */
|
|
4
|
+
readonly?: boolean | (() => boolean);
|
|
5
|
+
/** Создавать автоматически новую запись, если не существует */
|
|
6
|
+
createIfNotExists?: boolean;
|
|
7
|
+
/** Настройки кнопки */
|
|
8
|
+
primaryButton?: Button;
|
|
9
|
+
/** Скрывать заголовок */
|
|
10
|
+
hideTitle?: boolean;
|
|
11
|
+
/** Скрывать подзаголовок */
|
|
12
|
+
hideSubtitle?: boolean;
|
|
13
|
+
/** Дополнительные данные для загрузки */
|
|
14
|
+
hintSelect?: string[];
|
|
15
|
+
/** Код макета формы */
|
|
16
|
+
layoutCode?: string;
|
|
17
|
+
}
|