mdt-client 31.3.43 → 31.3.45
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/package.json +1 -1
- package/types/common/FieldSettings.schema.d.ts +15 -0
- package/types/common/form/tabs/TabsFormExtenderOptions.d.ts +2 -0
- package/types/components/dropdown/menu/item/dropdownItemWrapOptions.d.ts +1 -1
- package/types/helpers/formatOptions.d.ts +8 -0
- package/types/helpers/pipeline/Pipeline.d.ts +1 -1
- package/types/helpers/utils/duration/durationFormatTypes.d.ts +21 -0
- package/types/helpers/utils/object.d.ts +6 -0
- package/types/services/api/ApiAccessor/job/jobApiTypes.d.ts +83 -0
- package/types/services/customModules/facades/ILegacyFacade.d.ts +1 -0
- package/types/services/customModules/facades/List/IListCellFacade.d.ts +1 -0
- package/types/services/customModules/facades/List/IListControlFacade.d.ts +2 -0
- package/types/services/customModules/facades/internalModules/importModuleFacade.d.ts +11 -13
- package/types/services/customModules/facades/internalModules/jobFacade.d.ts +24 -0
- package/types/services/customModules/facades/internalModules/modulesFacadeTypes.d.ts +6 -1
- package/types/services/customModules/facades/internalModules/statusFacade.d.ts +1 -3
- package/types/services/customModules/facades/schema/ISchemaFacade.d.ts +1 -1
- package/types/services/customModules/facades/services/INavigationFacade.d.ts +2 -1
- package/types/ui-kit/UiKitFacade.d.ts +2 -0
package/package.json
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import IMask from "imask";
|
|
2
|
+
import { DurationFormatOptions, DurationUnit } from "mdtHelpers/utils/duration/durationFormatTypes";
|
|
2
3
|
export interface FieldSettings {
|
|
3
4
|
/**
|
|
4
5
|
* Маска отображает значение в заданном формате в списке и на форме. Например, число можно отобразить как "1 234,56" или "1234.56".
|
|
@@ -14,4 +15,18 @@ export interface FieldSettings {
|
|
|
14
15
|
*/
|
|
15
16
|
visibleItemsLimit?: number;
|
|
16
17
|
};
|
|
18
|
+
/**
|
|
19
|
+
* Настройки для полей типа duration
|
|
20
|
+
*/
|
|
21
|
+
durationOptions?: {
|
|
22
|
+
/**
|
|
23
|
+
* Единица хранимого значения.
|
|
24
|
+
* @default "milliseconds"
|
|
25
|
+
*/
|
|
26
|
+
unit?: DurationUnit;
|
|
27
|
+
/**
|
|
28
|
+
* Настройки формата отображения длительности.
|
|
29
|
+
*/
|
|
30
|
+
formatOptions?: DurationFormatOptions;
|
|
31
|
+
};
|
|
17
32
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Valued, ViewElement } from "mdtScripts/helpers/types";
|
|
1
2
|
export interface TabsFormExtenderPublicOptions {
|
|
2
3
|
tabs: FormTab[];
|
|
3
4
|
}
|
|
@@ -9,4 +10,5 @@ export interface FormTab {
|
|
|
9
10
|
order?: number;
|
|
10
11
|
visible?: () => boolean;
|
|
11
12
|
onShow?: (init: boolean) => void;
|
|
13
|
+
rightZone?: Valued<ViewElement>;
|
|
12
14
|
}
|
|
@@ -3,11 +3,11 @@ import { DropdownMenuItemBaseOptions, DropdownMenuItemOptions, DropdownMenuItemW
|
|
|
3
3
|
export interface DropdownItemBaseOptions {
|
|
4
4
|
className?: string;
|
|
5
5
|
idx?: number;
|
|
6
|
+
role?: string;
|
|
6
7
|
}
|
|
7
8
|
export interface DropdownItemOptions<T extends DropdownMenuItemBaseOptions = DropdownMenuItemBaseOptions> extends DropdownItemBaseOptions {
|
|
8
9
|
focused?: boolean;
|
|
9
10
|
actionItemOptions: T;
|
|
10
|
-
role?: string;
|
|
11
11
|
}
|
|
12
12
|
export type DropdownBaseItemOptions = DropdownItemOptions<DropdownMenuItemOptions>;
|
|
13
13
|
export type DropdownItemWithMoreOptions = DropdownItemOptions<DropdownMenuItemWithChildrenOptions>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { MaskOptions } from "mdtScripts/components/baseFormControls/maskedInput/MaskFormatter.types";
|
|
2
2
|
import { PeriodBoundaryIcon } from "mdtScripts/data/periods/helpers/types";
|
|
3
|
+
import { DurationFormatOptions, DurationUnit } from "mdtHelpers/utils/duration/durationFormatTypes";
|
|
3
4
|
export interface FormatOptions {
|
|
4
5
|
type?: string;
|
|
5
6
|
title?: string;
|
|
@@ -13,4 +14,11 @@ export interface FormatOptions {
|
|
|
13
14
|
*/
|
|
14
15
|
maskOptions?: MaskOptions;
|
|
15
16
|
dateRangeIcon?: PeriodBoundaryIcon;
|
|
17
|
+
/**
|
|
18
|
+
* Настройки форматирования длительности (для типа duration)
|
|
19
|
+
*/
|
|
20
|
+
durationOptions?: {
|
|
21
|
+
unit?: DurationUnit;
|
|
22
|
+
formatOptions?: DurationFormatOptions;
|
|
23
|
+
};
|
|
16
24
|
}
|
|
@@ -9,7 +9,7 @@ export declare class Pipeline<D = any> {
|
|
|
9
9
|
execute(args: D, onComplete: (args: D) => void, onError?: (e: AnyError) => void): void;
|
|
10
10
|
executePromise(args: D): Promise<D>;
|
|
11
11
|
}
|
|
12
|
-
type MiddlewareSync<D> = (args: D) => D | undefined;
|
|
12
|
+
export type MiddlewareSync<D> = (args: D) => D | undefined;
|
|
13
13
|
export declare class PipelineSync<D = any> {
|
|
14
14
|
private middlewaresStorage;
|
|
15
15
|
constructor(middlewares?: MiddlewareSync<D>[]);
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Единица хранимого значения длительности.
|
|
3
|
+
* Определяет, в каких единицах хранится числовое значение поля.
|
|
4
|
+
*/
|
|
5
|
+
export type DurationUnit = "milliseconds" | "seconds" | "minutes" | "hours";
|
|
6
|
+
/**
|
|
7
|
+
* Сериализуемые настройки формата длительности (подмножество Intl.DurationFormatOptions).
|
|
8
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DurationFormat/DurationFormat
|
|
9
|
+
*/
|
|
10
|
+
export type DurationFormatOptions = {
|
|
11
|
+
/** Локаль форматирования (BCP 47, default: текущая локаль). Допустимы как "ru", так и "ru-RU" */
|
|
12
|
+
locale?: string;
|
|
13
|
+
/**
|
|
14
|
+
* Стиль отображения:
|
|
15
|
+
* - "long" (1 час 30 минут 5 секунд)
|
|
16
|
+
* - "short" (1 ч. 30 мин. 5 сек.)
|
|
17
|
+
* - "narrow" (1ч 30м 5с)
|
|
18
|
+
* - "digital" (1:30:05)
|
|
19
|
+
*/
|
|
20
|
+
style?: "long" | "short" | "narrow" | "digital";
|
|
21
|
+
};
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Removes keys with `undefined` values from an object before passing it to Mithril as vnode attrs.
|
|
3
|
+
* Mithril (v1) renders `undefined` and `null` values as literal strings in the DOM (e.g. `id="undefined"`),
|
|
4
|
+
* because it sets attributes unconditionally without checking for nullish values.
|
|
5
|
+
*/
|
|
6
|
+
export declare function omitNullish<T extends Record<string, unknown>>(obj: T): Partial<T>;
|
|
1
7
|
export declare function hasOwnProperty(object: Record<never, unknown>, name: string): boolean;
|
|
2
8
|
export declare function shallowCopy<T>(obj: T): T;
|
|
3
9
|
export declare function copyWithIgnore<T, K extends keyof T = null>(obj: T, ignore: K[]): Omit<T, K>;
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { RecordId } from "mdtScripts/common/Record";
|
|
2
|
+
import { AnyObject, ObjectId, URLString } from "mdtScripts/helpers/types";
|
|
3
|
+
export declare namespace ApiV1 {
|
|
4
|
+
namespace Request {
|
|
5
|
+
interface JobTask {
|
|
6
|
+
ObjectId?: number;
|
|
7
|
+
RecordId?: number;
|
|
8
|
+
RecordIds?: number[];
|
|
9
|
+
Args?: AnyObject;
|
|
10
|
+
/**
|
|
11
|
+
* Тип файла для экспорта результата выполнения задачи (например, "pdf", "docx", "txt").
|
|
12
|
+
* Определяет формат ответа сервера: если свойство указано, результат содержит URL для скачивания файла
|
|
13
|
+
*/
|
|
14
|
+
File?: string;
|
|
15
|
+
}
|
|
16
|
+
namespace Job {
|
|
17
|
+
interface ExecProc {
|
|
18
|
+
process: RecordId;
|
|
19
|
+
}
|
|
20
|
+
interface ExecTask {
|
|
21
|
+
taskCode: string;
|
|
22
|
+
}
|
|
23
|
+
interface StopTask {
|
|
24
|
+
taskCode: string;
|
|
25
|
+
}
|
|
26
|
+
interface IsRunning {
|
|
27
|
+
taskCode: string;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
namespace Response {
|
|
32
|
+
namespace Job {
|
|
33
|
+
export type ExecTask = FileExecutionResult | StoredProcExecutionResult | TextExecutionResult | EmptyExecutionResult;
|
|
34
|
+
interface FileExecutionResult {
|
|
35
|
+
Type: "File";
|
|
36
|
+
Url: URLString;
|
|
37
|
+
}
|
|
38
|
+
interface StoredProcExecutionResult {
|
|
39
|
+
Type: "StoredProc";
|
|
40
|
+
ID_ProcedureObject: ObjectId;
|
|
41
|
+
}
|
|
42
|
+
interface TextExecutionResult {
|
|
43
|
+
Type: "Text" | "Error";
|
|
44
|
+
Text: string;
|
|
45
|
+
Header: string;
|
|
46
|
+
}
|
|
47
|
+
interface EmptyExecutionResult {
|
|
48
|
+
Type: "Empty";
|
|
49
|
+
}
|
|
50
|
+
export {};
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
export declare namespace ApiV2 {
|
|
55
|
+
namespace Request {
|
|
56
|
+
type ExecProc = ApiV1.Request.Job.ExecProc;
|
|
57
|
+
type ExecTask = ApiV1.Request.Job.ExecTask;
|
|
58
|
+
type StopTask = ApiV1.Request.Job.StopTask;
|
|
59
|
+
type IsRunning = ApiV1.Request.Job.IsRunning;
|
|
60
|
+
}
|
|
61
|
+
namespace Response {
|
|
62
|
+
namespace Job {
|
|
63
|
+
export type ExecTask = FileExecutionResult | StoredProcExecutionResult | TextExecutionResult | EmptyExecutionResult;
|
|
64
|
+
interface FileExecutionResult {
|
|
65
|
+
type: "File";
|
|
66
|
+
url: URLString;
|
|
67
|
+
}
|
|
68
|
+
interface StoredProcExecutionResult {
|
|
69
|
+
type: "StoredProc";
|
|
70
|
+
id_ProcedureObject: ObjectId;
|
|
71
|
+
}
|
|
72
|
+
interface TextExecutionResult {
|
|
73
|
+
type: "Text";
|
|
74
|
+
text: string;
|
|
75
|
+
header: string;
|
|
76
|
+
}
|
|
77
|
+
interface EmptyExecutionResult {
|
|
78
|
+
type: "Empty";
|
|
79
|
+
}
|
|
80
|
+
export {};
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
@@ -4,5 +4,6 @@ import { IListComponentFacade } from "./IListComponentFacade";
|
|
|
4
4
|
export interface IListCellFacade extends IListComponentFacade {
|
|
5
5
|
col: ILayoutColumnBase & LayoutColumnValued;
|
|
6
6
|
value(): any;
|
|
7
|
+
/** Заменить содержимое ячейки */
|
|
7
8
|
setContent(content: ViewElement[]): void;
|
|
8
9
|
}
|
|
@@ -51,6 +51,8 @@ export interface IListControlFacade extends ParentCtrl {
|
|
|
51
51
|
/** Изменить значение отображаемое в колонке */
|
|
52
52
|
setColumnValueHandler(codeOrPath: FieldCode | FieldPath, handler: (value: any, ctx: IColumnValueHandlerCtx) => ViewElement): any;
|
|
53
53
|
addColumn<Control>(column: ColumnOptions<Control>): void;
|
|
54
|
+
/** Установить контрол для колонок, удовлетворяющих предикату */
|
|
55
|
+
setColumnControl(fn: (col: ILayoutColumnBase) => boolean, control: any): void;
|
|
54
56
|
/**
|
|
55
57
|
* Вызывается при отображении элемента списка
|
|
56
58
|
*/
|
|
@@ -1,19 +1,17 @@
|
|
|
1
1
|
import { ViewControl } from "mdtScripts/helpers/types";
|
|
2
2
|
import { ImportFormData, ImportUploadCtrlOptions, ImportPreviewCtrlOptions, MappingCtrlOptions, ImportDefaultValuesOptions } from "./importFormCtrl.types";
|
|
3
3
|
export interface ImportModuleFacade {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
[key: string]: any;
|
|
16
|
-
};
|
|
4
|
+
ImportForm: ImportFormFacade;
|
|
5
|
+
ImportUploadCtrl: ImportUploadCtrlFacade;
|
|
6
|
+
ImportPreviewCtrl: ImportPreviewCtrlFacade;
|
|
7
|
+
ImportMappingCtrl: ImportMappingCtrlFacade;
|
|
8
|
+
ImportDefaultValues: ImportDefaultValuesFacade;
|
|
9
|
+
ImportService: ImportServiceFacade;
|
|
10
|
+
utils: {
|
|
11
|
+
prepareFieldCodes: (record: {
|
|
12
|
+
[key: string]: any;
|
|
13
|
+
}) => {
|
|
14
|
+
[key: string]: any;
|
|
17
15
|
};
|
|
18
16
|
};
|
|
19
17
|
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/// <reference types="../../../../mithril" />
|
|
2
|
+
import { Field } from "ics-ui-kit/dist/vendors/react-hook-form";
|
|
3
|
+
import { ApiV1, ApiV2 } from "mdtServices/api/ApiAccessor/job/jobApiTypes";
|
|
4
|
+
export interface JobModuleFacade {
|
|
5
|
+
/** Выполняет запрос на выполнение службы */
|
|
6
|
+
request: (taskCode: string, context?: JobContextFacade) => PromiseLike<JobExecutionResult>;
|
|
7
|
+
/**
|
|
8
|
+
* Выполняет запрос на выполнение службы и выполняет стандартную обработку результата в зависимости от типа
|
|
9
|
+
* - "Empty": отображение информационного сообщения
|
|
10
|
+
* - "File": скачивание файла
|
|
11
|
+
* - "StoredProc": выполнение хранимой процедуры
|
|
12
|
+
* - "Text": отображение текстового результата в модальном окне
|
|
13
|
+
* */
|
|
14
|
+
exec: (taskCode: string, context?: JobContextFacade) => PromiseLike<MPromise<JobExecutionResult>>;
|
|
15
|
+
}
|
|
16
|
+
type JobContextFacade = ApiV1.Request.JobTask & {
|
|
17
|
+
formContext?: ParentFormContextFacade;
|
|
18
|
+
};
|
|
19
|
+
type JobExecutionResult = ApiV2.Response.Job.ExecTask;
|
|
20
|
+
interface ParentFormContextFacade<FormType = any, FieldType = Field> {
|
|
21
|
+
parentForm?: FormType;
|
|
22
|
+
parentField?: FieldType;
|
|
23
|
+
}
|
|
24
|
+
export {};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { ImportModuleFacade } from "./importModuleFacade";
|
|
2
|
+
import { JobModuleFacade } from "./jobFacade";
|
|
2
3
|
import { StatusModuleFacade } from "./statusFacade";
|
|
3
4
|
export interface InternalModulesFacade {
|
|
4
5
|
/**
|
|
@@ -8,4 +9,8 @@ export interface InternalModulesFacade {
|
|
|
8
9
|
*/
|
|
9
10
|
get<T extends keyof InternalModulesTypes>(moduleName: T): InternalModulesTypes[T];
|
|
10
11
|
}
|
|
11
|
-
export type InternalModulesTypes =
|
|
12
|
+
export type InternalModulesTypes = {
|
|
13
|
+
"mdt.import": ImportModuleFacade;
|
|
14
|
+
"mdt.status": StatusModuleFacade;
|
|
15
|
+
"mdt.job": JobModuleFacade;
|
|
16
|
+
};
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import { ObjectCode } from "../../../../helpers/types";
|
|
2
2
|
import { RecordFacade } from "../record/IRecordFacade";
|
|
3
3
|
export interface StatusModuleFacade {
|
|
4
|
-
|
|
5
|
-
statusChangeHandler: (status: StatusCode, handler: ChangeStatusHandler) => void;
|
|
6
|
-
};
|
|
4
|
+
statusChangeHandler: (status: StatusCode, handler: ChangeStatusHandler) => void;
|
|
7
5
|
}
|
|
8
6
|
export type ChangeStatusHandler = ({ record, object }: StatusChangeHandlerContext) => void | Promise<void>;
|
|
9
7
|
export type StatusCode = string;
|
|
@@ -3,7 +3,7 @@ import { IObjectFacade } from "./IObjectFacade";
|
|
|
3
3
|
import { BaseBuilderTypes } from "./fieldBuilder/fieldBuilder/IFieldBuilder";
|
|
4
4
|
import { IFieldFkBuilder } from "./fieldBuilder/fieldFkBuilder/IFieldFkBuilder";
|
|
5
5
|
declare const allFieldPhysicalTypes: readonly ["bigint", "binary", "bit", "char", "date", "datetime", "datetime2", "datetimeoffset", "decimal", "float", "geography", "geometry", "hierarchyid", "image", "int", "money", "nchar", "ntext", "numeric", "nvarchar", "real", "smalldatetime", "smallint", "smallmoney", "sql_variant", "sysname", "text", "time", "timestamp", "tinyint", "uniqueidentifier", "varbinary", "varchar", "xml"];
|
|
6
|
-
export declare const allFieldLogicalTypes: readonly ["number", "money", "long", "string", "date", "time", "datetime", "boolean", "image", "icon", "secret", "identifier", "url", "xml", "markdown", "query", "etl", "json"];
|
|
6
|
+
export declare const allFieldLogicalTypes: readonly ["number", "money", "long", "string", "date", "time", "datetime", "boolean", "image", "icon", "secret", "identifier", "url", "xml", "markdown", "query", "etl", "json", "duration"];
|
|
7
7
|
export type FieldPhysicalType = typeof allFieldPhysicalTypes[number];
|
|
8
8
|
export type FieldLogicalType = typeof allFieldLogicalTypes[number];
|
|
9
9
|
export type FieldType = FieldPhysicalType | FieldLogicalType;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { UiType } from "mdtScripts/helpers/IUi";
|
|
1
2
|
import { AnyObject, URLString, Valued } from "mdtScripts/helpers/types";
|
|
2
3
|
export interface CustomPageCtrl {
|
|
3
4
|
new (node: ICustomNodeNavigationFacade): any;
|
|
@@ -81,7 +82,7 @@ interface CustomNavNodeValue {
|
|
|
81
82
|
/** Значение узла навигации. Отображается рядом с заголовком */
|
|
82
83
|
value?: string;
|
|
83
84
|
/** Стиль значения узла */
|
|
84
|
-
style?:
|
|
85
|
+
style?: UiType;
|
|
85
86
|
/** Иконка значения узла */
|
|
86
87
|
icon?: string;
|
|
87
88
|
/** Текст появляющийся при наведении на счетчик. Поддерживается markdown */
|
|
@@ -37,6 +37,7 @@ import * as tabs from "ics-ui-kit/dist/components/tabs";
|
|
|
37
37
|
import * as tag from "ics-ui-kit/dist/components/tag";
|
|
38
38
|
import * as textarea from "ics-ui-kit/dist/components/textarea";
|
|
39
39
|
import * as toast from "ics-ui-kit/dist/components/toast";
|
|
40
|
+
import * as toggle from "ics-ui-kit/dist/components/toggle";
|
|
40
41
|
import * as toggleGroup from "ics-ui-kit/dist/components/toggle-group";
|
|
41
42
|
import * as toolbar from "ics-ui-kit/dist/components/toolbar";
|
|
42
43
|
import * as tooltip from "ics-ui-kit/dist/components/tooltip";
|
|
@@ -93,6 +94,7 @@ export declare class UiKitFacade {
|
|
|
93
94
|
readonly tag: typeof tag;
|
|
94
95
|
readonly textarea: typeof textarea;
|
|
95
96
|
readonly toast: typeof toast;
|
|
97
|
+
readonly toggle: typeof toggle;
|
|
96
98
|
readonly "toggle-group": typeof toggleGroup;
|
|
97
99
|
readonly tooltip: typeof tooltip;
|
|
98
100
|
readonly toolbar: typeof toolbar;
|