mdt-client 31.3.20 → 31.3.22
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/components/form/header/types.d.ts +14 -0
- package/types/data/periods/helpers/types.d.ts +4 -0
- package/types/helpers/formatOptions.d.ts +2 -0
- package/types/services/api/ApiAccessor/apiV2Types.d.ts +9 -3
- package/types/services/api/ApiAccessor/binding/bindingApiTypes.d.ts +37 -0
- package/types/services/customModules/facades/Form/IFormLayout.d.ts +12 -0
- package/types/services/customModules/facades/ILegacyFacade.d.ts +4 -0
- package/types/services/customModules/facades/List/IListControlFacade.d.ts +1 -1
- package/types/services/customModules/facades/formDashboard/IFormDashboard.d.ts +5 -0
- package/types/services/customModules/facades/schema/IFieldFacade.d.ts +1 -0
- package/types/services/customModules/facades/utils/IApiFacade.d.ts +4 -5
- package/types/services/customModules/facades/utils/IUiComponentsFacade.d.ts +12 -1
- package/types/views/page/charts/ChartControlOptions.schema.d.ts +59 -11
- package/types/views/page/charts/facade/IChartControlFacade.d.ts +25 -0
- package/types/views/page/charts/facade/I/320/241hartControlFacade.d.ts +1 -0
- package/types/views/page/charts/reportDashboard/config/chartConfig.d.ts +31 -0
- package/types/views/page/charts/reportDashboard/config/filterConfig.d.ts +52 -0
- package/types/views/page/charts/reportDashboard/config/listConfig.d.ts +9 -0
- package/types/views/page/charts/reportDashboard/config/reportDashboardConfig.d.ts +45 -0
- package/types/views/page/charts/reportDashboard/controls/dynamicChart/dynamicChartControlPublicOptions.d.ts +3 -0
- package/types/views/page/charts/reportDashboard/index.d.ts +5 -0
- package/types/views/page/charts/reportDashboard/utils/formJsonVarParser.d.ts +13 -0
package/package.json
CHANGED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ViewElement } from "mdtScripts/helpers/types";
|
|
2
|
+
export declare type HeaderSize = "h1" | "h2" | "h3" | "h4" | "h5" | "h6";
|
|
3
|
+
export interface HeaderViewOptions {
|
|
4
|
+
title: string;
|
|
5
|
+
description?: string;
|
|
6
|
+
icon?: string;
|
|
7
|
+
subtitle?: string;
|
|
8
|
+
size?: HeaderSize;
|
|
9
|
+
class?: string;
|
|
10
|
+
zones?: {
|
|
11
|
+
end?: ViewElement[];
|
|
12
|
+
};
|
|
13
|
+
onclick?: () => void;
|
|
14
|
+
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { MaskOptions } from "mdtScripts/components/baseFormControls/maskedInput/MaskFormatter.types";
|
|
2
|
+
import { PeriodBoundaryIcon } from "mdtScripts/data/periods/helpers/types";
|
|
2
3
|
export interface FormatOptions {
|
|
3
4
|
type?: string;
|
|
4
5
|
title?: string;
|
|
@@ -11,4 +12,5 @@ export interface FormatOptions {
|
|
|
11
12
|
* Настройки маски
|
|
12
13
|
*/
|
|
13
14
|
maskOptions?: MaskOptions;
|
|
15
|
+
dateRangeIcon?: PeriodBoundaryIcon;
|
|
14
16
|
}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
+
import { BindingExtData, BindingRowTypes } from "./binding/bindingApiTypes";
|
|
2
|
+
import { MessageUiType, UiType } from "mdtScripts/helpers/IUi";
|
|
3
|
+
import { PermissionLevelString } from "mdtScripts/security/PermissionLevel";
|
|
1
4
|
import { HierarchicalRecord, MdtRecord, RecordId } from "../../../../scripts/common/Record";
|
|
2
5
|
import { AnyObject, ColorStyle, FieldPath, LanguageId, Markdown, ModuleId, ObjectCode, ObjectId, ObjectTitle } from "../../../../scripts/helpers/types";
|
|
3
6
|
import { FETCH_COUNT_ALIAS } from "../ApiAccessorRequestAdapter/handlers/fetch/helpers/count/count";
|
|
7
|
+
import { WithExpandedIds } from "../ApiAccessorRequestAdapter/handlers/fetch/helpers/query/exts/hierarchy/hierarchyQueryHelpersTypes";
|
|
4
8
|
import { DataExtraInformation } from "../ApiAccessorRequestAdapter/handlers/messageTypes";
|
|
5
9
|
import { ApiV1 } from "./apiV1Types";
|
|
6
|
-
import { WithExpandedIds } from "../ApiAccessorRequestAdapter/handlers/fetch/helpers/query/exts/hierarchy/hierarchyQueryHelpersTypes";
|
|
7
|
-
import { PermissionLevelString } from "../../../../scripts/security/PermissionLevel";
|
|
8
|
-
import { MessageUiType, UiType } from "../../../../scripts/helpers/IUi";
|
|
9
10
|
export declare namespace ApiV2 {
|
|
10
11
|
namespace Request {
|
|
11
12
|
type Common = (Save | AnyObject) & WithMessageAction;
|
|
@@ -116,6 +117,7 @@ export declare namespace ApiV2 {
|
|
|
116
117
|
workflow?: Exts.Workflow;
|
|
117
118
|
workflowStage?: Exts.WorkflowStage;
|
|
118
119
|
mapping?: Exts.Mapping;
|
|
120
|
+
binding?: Exts.Binding;
|
|
119
121
|
[k: string]: AnyObject | undefined;
|
|
120
122
|
}
|
|
121
123
|
namespace Exts {
|
|
@@ -194,6 +196,7 @@ export declare namespace ApiV2 {
|
|
|
194
196
|
interface Mapping {
|
|
195
197
|
flagGetMappedFKs: boolean;
|
|
196
198
|
}
|
|
199
|
+
type Binding = BindingExtData;
|
|
197
200
|
}
|
|
198
201
|
}
|
|
199
202
|
}
|
|
@@ -271,6 +274,9 @@ export declare namespace ApiV2 {
|
|
|
271
274
|
hasChildren: boolean;
|
|
272
275
|
children?: Row[];
|
|
273
276
|
};
|
|
277
|
+
binding?: {
|
|
278
|
+
status: BindingRowTypes;
|
|
279
|
+
};
|
|
274
280
|
/**
|
|
275
281
|
* Ограничения на действия (CRUD) над записью и её полями, накладываемые функцией безопасности.
|
|
276
282
|
* [Документация](https://ics-it.gram.ax/mdt/security/objectSecurity/sqlFn?l=ru)
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { MdtRecord, RecordId } from "../../../../common/Record";
|
|
2
|
+
export interface BindingFormData {
|
|
3
|
+
ID_ObjectTarget: number;
|
|
4
|
+
ID_ObjectSource: number;
|
|
5
|
+
ID_TargetRecord: number;
|
|
6
|
+
ID_SourceRecords: RecordId[];
|
|
7
|
+
ID_DimensionRecords: MdtRecord[];
|
|
8
|
+
FlagTotalPeriod: boolean;
|
|
9
|
+
DateBegin?: Date;
|
|
10
|
+
DateEndFix?: Date;
|
|
11
|
+
}
|
|
12
|
+
export interface BindingRequestData {
|
|
13
|
+
TargetObjectId: RecordId;
|
|
14
|
+
SourceObjectId: RecordId;
|
|
15
|
+
TargetRecordId: RecordId;
|
|
16
|
+
SourceRecordIds: RecordId[];
|
|
17
|
+
FlagTotalPeriod: boolean;
|
|
18
|
+
DimensionRecordIds?: RecordId[];
|
|
19
|
+
DateBegin?: Date | unknown;
|
|
20
|
+
DateEnd?: Date | unknown;
|
|
21
|
+
}
|
|
22
|
+
export interface UnbindingRequestData {
|
|
23
|
+
ObjectId: RecordId;
|
|
24
|
+
Items: UnbindingDataItemTypes[];
|
|
25
|
+
}
|
|
26
|
+
export interface UnbindingDataItemTypes {
|
|
27
|
+
BindingId: RecordId;
|
|
28
|
+
DateEnd?: Date | unknown;
|
|
29
|
+
}
|
|
30
|
+
export declare type BindingRowTypes = "Bound" | "NotBound" | "BoundOutside";
|
|
31
|
+
export interface BindingExtData {
|
|
32
|
+
BindingObjectId?: RecordId;
|
|
33
|
+
Date?: Date | unknown;
|
|
34
|
+
Filter?: {
|
|
35
|
+
Status?: BindingRowTypes;
|
|
36
|
+
};
|
|
37
|
+
}
|
|
@@ -112,6 +112,7 @@ export interface ILegacyFacade {
|
|
|
112
112
|
isApiV2: () => boolean;
|
|
113
113
|
ProgressBarCtrl: any;
|
|
114
114
|
ProgressBarStateController: any;
|
|
115
|
+
getChartElByCode: (code: string) => Element;
|
|
115
116
|
}
|
|
116
117
|
export interface ModulesLegacyFacade {
|
|
117
118
|
pbi?: {
|
|
@@ -121,6 +122,9 @@ export interface ModulesLegacyFacade {
|
|
|
121
122
|
FormValueManager: any;
|
|
122
123
|
EtlPanel: any;
|
|
123
124
|
};
|
|
125
|
+
dm?: {
|
|
126
|
+
MergeHelper: any;
|
|
127
|
+
};
|
|
124
128
|
mapping?: {
|
|
125
129
|
MappingListExtender: any;
|
|
126
130
|
MappingManager: any;
|
|
@@ -42,7 +42,7 @@ export interface IListControlFacade extends ParentCtrl {
|
|
|
42
42
|
updateCommand(findCondition: (button: ButtonFacade) => boolean, command: Partial<ButtonFacade>): void;
|
|
43
43
|
/** Открыть форму добавления записи */
|
|
44
44
|
openNewRecordForm(): void;
|
|
45
|
-
/** Удалить выделенные
|
|
45
|
+
/** Удалить из списка выделенные записи */
|
|
46
46
|
removeSelectedRows(): void;
|
|
47
47
|
/** Открыть конструктор списка */
|
|
48
48
|
openDesigner(): Promise<void>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { MithrilControl } from "mdtScripts/helpers/types";
|
|
2
|
+
import { IFormLayout } from "../Form/IFormLayout";
|
|
2
3
|
export interface IFormDashboard {
|
|
3
4
|
/**
|
|
4
5
|
* Настройка дашборда. Возвращает объект для управления дашбордом.
|
|
@@ -12,4 +13,8 @@ export interface IFormDashboardFacade {
|
|
|
12
13
|
* Добавляет компонент на дашборд в указанную позицию
|
|
13
14
|
*/
|
|
14
15
|
addComponent: (component: () => MithrilControl, position: ComponentPosition) => void;
|
|
16
|
+
/**
|
|
17
|
+
* Устанавливает настройки лейаута для дашборда
|
|
18
|
+
*/
|
|
19
|
+
configureLayout: (layout: IFormLayout) => void;
|
|
15
20
|
}
|
|
@@ -2,6 +2,7 @@ import { FieldSettings } from "mdtScripts/common/FieldSettings.schema";
|
|
|
2
2
|
export interface IFieldFacade {
|
|
3
3
|
getCode(): string;
|
|
4
4
|
getTitle(): string | undefined;
|
|
5
|
+
getDescription(): string | undefined;
|
|
5
6
|
isPrimary(): boolean;
|
|
6
7
|
getType(): string;
|
|
7
8
|
isNullable(): boolean;
|
|
@@ -13,12 +13,12 @@ export interface IApiFacade {
|
|
|
13
13
|
* Метод получает данные без переводов.
|
|
14
14
|
* Для получения локализованных данных используйте {@link fetchWithExts}
|
|
15
15
|
*/
|
|
16
|
-
fetch<R = FetchResult>(objectCode: string, query?: BaseQuery): Promise<R>;
|
|
17
|
-
fetchWithExts<R = FetchResult>(objectCode: string, query?: BaseQuery): Promise<R>;
|
|
16
|
+
fetch<R = FetchResult>(objectCode: string, query?: BaseQuery, options?: QueryExecutionOptions): Promise<R>;
|
|
17
|
+
fetchWithExts<R = FetchResult>(objectCode: string, query?: BaseQuery, options?: QueryExecutionOptions): Promise<R>;
|
|
18
18
|
/** Отправить запрос к функции */
|
|
19
19
|
fetchFunction<R extends FetchResult = FetchResult>(objectCode: string, params?: AnyObject, query?: BaseQuery): Promise<R>;
|
|
20
20
|
/** Отправить запрос на получение одной записи из объекта */
|
|
21
|
-
fetchRecord<R = MdtRecord>(objectCode: string, query?: BaseQuery): Promise<R>;
|
|
21
|
+
fetchRecord<R = MdtRecord>(objectCode: string, query?: BaseQuery, options?: QueryExecutionOptions): Promise<R>;
|
|
22
22
|
/**
|
|
23
23
|
* @deprecated
|
|
24
24
|
* Отправить запрос к функции
|
|
@@ -54,7 +54,7 @@ export interface IApiFacade {
|
|
|
54
54
|
downloadFile(fileUid: string): void;
|
|
55
55
|
v2: IApiFacadeV2;
|
|
56
56
|
}
|
|
57
|
-
interface QueryExecutionOptions {
|
|
57
|
+
export interface QueryExecutionOptions {
|
|
58
58
|
/**
|
|
59
59
|
* Определяет, должен ли запрос выполняться в фоновом режиме.
|
|
60
60
|
* Если запрос выполняется в фоновом режиме, то он не блокирует интерфейс.
|
|
@@ -89,4 +89,3 @@ export interface MdtQueryResult {
|
|
|
89
89
|
export interface ApiSaveOptions extends QueryExecutionOptions {
|
|
90
90
|
messageAction: MessageMetaData;
|
|
91
91
|
}
|
|
92
|
-
export {};
|
|
@@ -17,6 +17,7 @@ import { ComponentConfigParams } from "mdtScripts/helpers/ui/elementModificators
|
|
|
17
17
|
import { FormattedText } from "../../../../helpers/formattedText";
|
|
18
18
|
import { ChartFormControlFacadeOptions, IChartControlFacade } from "../../../../views/page/charts/facade/IСhartControlFacade";
|
|
19
19
|
import { IMultiPickerFacade, MultiPickerFacadeOptions, MultiPickerItem } from "../../../../views/form/controls/picker/multiPickerFacade/IMultiPickerFacade";
|
|
20
|
+
import { HeaderSize } from "mdtScripts/components/form/header/types";
|
|
20
21
|
export interface IUiComponentsFacade {
|
|
21
22
|
button(button: ButtonFacade, translate?: boolean): ViewElement;
|
|
22
23
|
topNavButton(options: TopNavButton): _mithril.MithrilVirtualElement;
|
|
@@ -54,7 +55,7 @@ export interface IUiComponentsFacade {
|
|
|
54
55
|
* })
|
|
55
56
|
* ```
|
|
56
57
|
*/
|
|
57
|
-
markdown(content: string): ViewElement;
|
|
58
|
+
markdown(content: string, options?: MarkdownOptions): ViewElement;
|
|
58
59
|
}
|
|
59
60
|
export interface IProcessFormBlockOptions {
|
|
60
61
|
title: string;
|
|
@@ -79,3 +80,13 @@ export interface TopNavButton {
|
|
|
79
80
|
execute?: () => void;
|
|
80
81
|
}
|
|
81
82
|
export declare type TooltipContent = (el: HTMLElement) => FormattedText;
|
|
83
|
+
export interface MarkdownOptions {
|
|
84
|
+
type?: string;
|
|
85
|
+
title?: string;
|
|
86
|
+
icon?: string;
|
|
87
|
+
className?: string;
|
|
88
|
+
zones?: {
|
|
89
|
+
end?: ViewElement[];
|
|
90
|
+
};
|
|
91
|
+
headerSize?: HeaderSize;
|
|
92
|
+
}
|
|
@@ -166,6 +166,8 @@ export interface Axes {
|
|
|
166
166
|
* По умолчанию вертикальная.
|
|
167
167
|
*/
|
|
168
168
|
orientation?: Orientation;
|
|
169
|
+
/** @title Общая настройка подписей осей */
|
|
170
|
+
labels?: BaseAxesLabelsOptions;
|
|
169
171
|
/**
|
|
170
172
|
* @title Параметры оси ключей
|
|
171
173
|
*/
|
|
@@ -204,30 +206,52 @@ export interface Axes {
|
|
|
204
206
|
/**
|
|
205
207
|
* @title Параметры оси значений
|
|
206
208
|
*/
|
|
207
|
-
value?: {
|
|
209
|
+
value?: BaseValueAxisOptions & {
|
|
208
210
|
/**
|
|
209
211
|
* @title Позиция оси значений
|
|
210
212
|
* @description По умолчанию равна "start", если диаграмма вертикальная и "end" - если диаграмма горизонтальная
|
|
211
213
|
*/
|
|
212
214
|
position?: AxisPosition;
|
|
213
|
-
/**
|
|
214
|
-
* @title Отображение оси
|
|
215
|
-
* @description По умолчанию не отображается только тогда, когда все диаграммы имеют встроенные лейблы, показывающие значения
|
|
216
|
-
*/
|
|
217
|
-
visible?: boolean;
|
|
218
215
|
/**
|
|
219
216
|
* @title Отображение линий сетки оси
|
|
220
217
|
* @description По умолчанию всегда отображается
|
|
221
218
|
*/
|
|
222
219
|
gridLine?: boolean;
|
|
223
|
-
/** @title Функция форматирования значений */
|
|
224
|
-
formatValue?: string;
|
|
225
|
-
/** @title Размер отступа между подписями в px */
|
|
226
|
-
stepSize?: number;
|
|
227
220
|
line?: {
|
|
228
221
|
visible?: boolean;
|
|
229
222
|
};
|
|
230
223
|
};
|
|
224
|
+
valueSecondary?: BaseValueAxisOptions;
|
|
225
|
+
}
|
|
226
|
+
interface BaseValueAxisOptions {
|
|
227
|
+
/** @title Размер отступа между подписями в px */
|
|
228
|
+
stepSize?: number;
|
|
229
|
+
/**
|
|
230
|
+
* @title Настройка диапазона осей
|
|
231
|
+
* @param options Опции с данными диаграммы
|
|
232
|
+
* @returns Объект с диапазоном осей. Оставить -1 для автоматического определения диапазона
|
|
233
|
+
*/
|
|
234
|
+
domain?: (options: {
|
|
235
|
+
data: MdtChartsDataRow[];
|
|
236
|
+
}) => {
|
|
237
|
+
start: number;
|
|
238
|
+
end: number;
|
|
239
|
+
};
|
|
240
|
+
/** @title Функция форматирования значений */
|
|
241
|
+
formatValue?: string;
|
|
242
|
+
/**
|
|
243
|
+
* @title Отображение оси
|
|
244
|
+
* @description По умолчанию не отображается только тогда, когда все диаграммы имеют встроенные лейблы, показывающие значения
|
|
245
|
+
*/
|
|
246
|
+
visible?: boolean;
|
|
247
|
+
}
|
|
248
|
+
export interface BaseAxesLabelsOptions {
|
|
249
|
+
/**
|
|
250
|
+
* @title Максимальный размер подписи в px
|
|
251
|
+
* @description Для вертикальных осей этот параметр определяет максимальную ширину подписи, а для горизонтальных - максимальную высоту подписи (если подписи расположены вертикально).
|
|
252
|
+
* @default 80
|
|
253
|
+
*/
|
|
254
|
+
maxSize?: number;
|
|
231
255
|
}
|
|
232
256
|
interface BaseChartBlockOptions {
|
|
233
257
|
/**
|
|
@@ -236,6 +260,11 @@ interface BaseChartBlockOptions {
|
|
|
236
260
|
* @default 510
|
|
237
261
|
*/
|
|
238
262
|
height?: number;
|
|
263
|
+
/** @title Настройки стилей */
|
|
264
|
+
style?: {
|
|
265
|
+
/** @title Цвет фона */
|
|
266
|
+
backgroundColor?: string;
|
|
267
|
+
};
|
|
239
268
|
}
|
|
240
269
|
interface GraphicChartBlockOptions extends BaseChartBlockOptions {
|
|
241
270
|
/**
|
|
@@ -318,6 +347,9 @@ export interface TwoDimensionalOptions extends GraphicChartBlockOptions {
|
|
|
318
347
|
};
|
|
319
348
|
valueLabels?: {
|
|
320
349
|
style?: ValueLabelsStyleOptions;
|
|
350
|
+
collision?: {
|
|
351
|
+
otherValueLabels?: "hide" | "none";
|
|
352
|
+
};
|
|
321
353
|
};
|
|
322
354
|
}
|
|
323
355
|
interface ValueLabelsStyleOptions {
|
|
@@ -373,7 +405,23 @@ interface TwoDimensionalChartOptions {
|
|
|
373
405
|
/**
|
|
374
406
|
* @title Отображение подписей значений на диаграмме
|
|
375
407
|
*/
|
|
376
|
-
valueLabels?: boolean;
|
|
408
|
+
valueLabels?: boolean | ValueLabelsChartOptions;
|
|
409
|
+
}
|
|
410
|
+
export declare type ValueLabelsPositionMode = "center" | "afterElement";
|
|
411
|
+
export interface ValueLabelsChartOptions {
|
|
412
|
+
on?: boolean;
|
|
413
|
+
/** @default "afterElement" */
|
|
414
|
+
position?: ValueLabelsPositionMode;
|
|
415
|
+
rotation?: {
|
|
416
|
+
angle?: number;
|
|
417
|
+
};
|
|
418
|
+
handleElement?: (options: {
|
|
419
|
+
element: SVGElement;
|
|
420
|
+
value: number;
|
|
421
|
+
}) => void;
|
|
422
|
+
format?: (options: {
|
|
423
|
+
value: number;
|
|
424
|
+
}) => string | number;
|
|
377
425
|
}
|
|
378
426
|
/**
|
|
379
427
|
* @title Гистограмма
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { ChartControlOptions } from "../ChartControlOptions.schema";
|
|
2
|
+
import { MdtRecord } from "../../../../services/customModules/facades/utils/IApiFacade";
|
|
3
|
+
import { EventEmitterSubscribeController } from "../../../../helpers/events/EventEmitter";
|
|
4
|
+
import { ViewControl } from "../../../../helpers/types";
|
|
5
|
+
export interface ChartControlFacadeData {
|
|
6
|
+
refresh?: number;
|
|
7
|
+
fetch?: () => Promise<MdtRecord[]>;
|
|
8
|
+
}
|
|
9
|
+
export interface ChartFormControlFacadeOptions {
|
|
10
|
+
controlOptions: ChartControlOptions;
|
|
11
|
+
data?: ChartControlFacadeData;
|
|
12
|
+
code?: string;
|
|
13
|
+
}
|
|
14
|
+
export interface ChartEvents {
|
|
15
|
+
selected: {
|
|
16
|
+
records: MdtRecord[];
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
export interface IChartControlFacade extends ViewControl {
|
|
20
|
+
readonly on: EventEmitterSubscribeController<ChartEvents>["subscribe"];
|
|
21
|
+
refreshData(): void;
|
|
22
|
+
reCreate(newOptionsCreator?: () => ChartFormControlFacadeOptions): void;
|
|
23
|
+
init(): void;
|
|
24
|
+
clearSelection(): void;
|
|
25
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { ChartControlOptions } from "../../ChartControlOptions.schema";
|
|
2
|
+
import { FilterableByFieldsElement, ReportDashboardFetchFilter } from "./filterConfig";
|
|
3
|
+
export interface DashboardChartCrossFilter {
|
|
4
|
+
fieldPath?: string;
|
|
5
|
+
dependencies?: DashboardCrossFilterDependency[];
|
|
6
|
+
}
|
|
7
|
+
export interface DashboardCrossFilterDependency {
|
|
8
|
+
chartId: string;
|
|
9
|
+
fieldPath: string;
|
|
10
|
+
}
|
|
11
|
+
export interface DashboardChartConfig extends FilterableByFieldsElement {
|
|
12
|
+
fetch: (options: {
|
|
13
|
+
getEnvVar: (varName: string) => any;
|
|
14
|
+
filter: ReportDashboardFetchFilter;
|
|
15
|
+
}) => Promise<Record<string, any>[]>;
|
|
16
|
+
options: ChartControlOptions;
|
|
17
|
+
filterByCharts?: DashboardChartCrossFilter;
|
|
18
|
+
}
|
|
19
|
+
export interface DashboardDynamicChartConfig extends FilterableByFieldsElement {
|
|
20
|
+
defaultItem?: string;
|
|
21
|
+
items?: string[];
|
|
22
|
+
filterByCharts?: DashboardChartCrossFilter;
|
|
23
|
+
update: (options: {
|
|
24
|
+
type?: string;
|
|
25
|
+
filter?: ReportDashboardFetchFilter;
|
|
26
|
+
}, currentControlOptions?: ChartControlOptions) => Promise<{
|
|
27
|
+
data: Record<string, any>[];
|
|
28
|
+
controlOptions: ChartControlOptions;
|
|
29
|
+
reCreate?: boolean;
|
|
30
|
+
}>;
|
|
31
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { AnyObject } from "mdtScripts/helpers/types";
|
|
2
|
+
import { ApiV2 } from "mdtServices/api/ApiAccessor/apiV2Types";
|
|
3
|
+
import { IFilter } from "mdtServices/IFilter";
|
|
4
|
+
export interface FilterDependencyConfig {
|
|
5
|
+
fieldCode: string;
|
|
6
|
+
fieldPath?: string;
|
|
7
|
+
operation?: ApiV2.Filter.BinaryOp;
|
|
8
|
+
handleValue?: (value: any) => any;
|
|
9
|
+
}
|
|
10
|
+
export interface FilterableByFieldsElement {
|
|
11
|
+
filterByFields?: FilterDependencyConfig[];
|
|
12
|
+
}
|
|
13
|
+
export interface DashboardVirtualObject {
|
|
14
|
+
code: string;
|
|
15
|
+
fields: {
|
|
16
|
+
code: string;
|
|
17
|
+
primary?: boolean;
|
|
18
|
+
default?: boolean;
|
|
19
|
+
}[];
|
|
20
|
+
fetch: () => Promise<AnyObject[]>;
|
|
21
|
+
}
|
|
22
|
+
export interface DashboardFiltersPublicConfig {
|
|
23
|
+
code: string;
|
|
24
|
+
params: FilterFieldConfig[];
|
|
25
|
+
}
|
|
26
|
+
export interface FilterFieldConfig {
|
|
27
|
+
code: string;
|
|
28
|
+
type?: string;
|
|
29
|
+
title?: string;
|
|
30
|
+
defaultValue?: any;
|
|
31
|
+
reference?: FilterableByFieldsElement & {
|
|
32
|
+
type: "single" | "multi";
|
|
33
|
+
datasource: {
|
|
34
|
+
type: "dbObject";
|
|
35
|
+
code: string;
|
|
36
|
+
} | {
|
|
37
|
+
type: "virtualObject";
|
|
38
|
+
object: DashboardVirtualObject;
|
|
39
|
+
} | {
|
|
40
|
+
type: "proxyObject";
|
|
41
|
+
proxyObjectCode?: string;
|
|
42
|
+
originalObjectCode: string;
|
|
43
|
+
primaryFieldCode: string;
|
|
44
|
+
defaultFieldCode?: string;
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
export interface ReportDashboardFetchFilter {
|
|
49
|
+
buildV2(): ApiV2.Filter.Multi | undefined;
|
|
50
|
+
buildV1(): IFilter | undefined;
|
|
51
|
+
getValues(): Record<string, any> | undefined;
|
|
52
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { DashboardChartCrossFilter } from "./chartConfig";
|
|
2
|
+
import { FilterableByFieldsElement } from "./filterConfig";
|
|
3
|
+
export interface DashboardListConfig extends FilterableByFieldsElement {
|
|
4
|
+
id: string;
|
|
5
|
+
filterByCharts?: Omit<DashboardChartCrossFilter, "fieldPath">;
|
|
6
|
+
datasource: {
|
|
7
|
+
objectCode: string;
|
|
8
|
+
};
|
|
9
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { AnyObject } from "mdtScripts/helpers/types";
|
|
2
|
+
import { DashboardChartConfig, DashboardDynamicChartConfig } from "./chartConfig";
|
|
3
|
+
import { JsonVarsMap } from "../utils/formJsonVarParser";
|
|
4
|
+
import { DashboardFiltersPublicConfig, ReportDashboardFetchFilter } from "./filterConfig";
|
|
5
|
+
import { DynamicChartCtrlPublicOptions } from "../controls/dynamicChart/dynamicChartControlPublicOptions";
|
|
6
|
+
import { IChartControlFacade } from "../../facade/IChartControlFacade";
|
|
7
|
+
import { DashboardListConfig } from "./listConfig";
|
|
8
|
+
export interface ReportDashboardConfig<ChartId extends string, DynamicChartId extends string, ListId extends string> {
|
|
9
|
+
filters: DashboardFiltersPublicConfig;
|
|
10
|
+
defaultCharts?: Record<ChartId, DashboardChartConfig>;
|
|
11
|
+
dynamicCharts?: Record<DynamicChartId, DashboardDynamicChartConfig>;
|
|
12
|
+
lists?: DashboardListConfig[];
|
|
13
|
+
bindEnvVariables?: (dashboard: ReportDashboardInstance<ChartId>) => JsonVarsMap;
|
|
14
|
+
mdtLayout: (options: {
|
|
15
|
+
dashboard: ReportDashboardInstance<ChartId>;
|
|
16
|
+
items: {
|
|
17
|
+
field: (code: string, width: number, options?: AnyObject) => AnyObject;
|
|
18
|
+
defaultChart: (id: ChartId, width: number) => AnyObject;
|
|
19
|
+
dynamicChart: (id: DynamicChartId, width: number, options?: DynamicChartCtrlPublicOptions) => AnyObject;
|
|
20
|
+
list: (id: ListId, width: number, options?: AnyObject) => AnyObject;
|
|
21
|
+
};
|
|
22
|
+
}) => AnyObject;
|
|
23
|
+
events?: {
|
|
24
|
+
fieldUpdated?(event: {
|
|
25
|
+
fieldCode: string;
|
|
26
|
+
value: any;
|
|
27
|
+
dashboard: ReportDashboardInstance<ChartId>;
|
|
28
|
+
}): void | Promise<void>;
|
|
29
|
+
clearAllFilters?(): void | Promise<void>;
|
|
30
|
+
stateInited?(event: {
|
|
31
|
+
dashboard: ReportDashboardInstance<ChartId>;
|
|
32
|
+
}): void | Promise<void>;
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
export interface ReportDashboardInstance<ChartId extends string> {
|
|
36
|
+
clearAllFilters(): void;
|
|
37
|
+
fields: {
|
|
38
|
+
setValue(fieldCode: string, value: any, fireEvent?: boolean): void;
|
|
39
|
+
getValue(fieldPath: string): any;
|
|
40
|
+
getFilterBuilderForField(fieldCode: string): ReportDashboardFetchFilter | undefined;
|
|
41
|
+
};
|
|
42
|
+
charts: {
|
|
43
|
+
getDefaultChart(id: ChartId): IChartControlFacade | undefined;
|
|
44
|
+
};
|
|
45
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { CustomNavNode } from "mdtServices/customModules/facades/services/INavigationFacade";
|
|
2
|
+
import { ReportDashboardConfig } from "./config/reportDashboardConfig";
|
|
3
|
+
export interface ReportDashboard {
|
|
4
|
+
createNode<ChartId extends string, DynamicChartId extends string, ListId extends string>(node: CustomNavNode, config: ReportDashboardConfig<ChartId, DynamicChartId, ListId>): void;
|
|
5
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export interface IJsonVarParser {
|
|
2
|
+
getVarValue(varName: string): number | string;
|
|
3
|
+
}
|
|
4
|
+
export declare type JsonVarsMap = {
|
|
5
|
+
[key: string]: () => number | string;
|
|
6
|
+
};
|
|
7
|
+
export declare class JsonVarParser implements IJsonVarParser {
|
|
8
|
+
private readonly jsonVarsMap;
|
|
9
|
+
constructor(jsonVarsMap: JsonVarsMap);
|
|
10
|
+
getVarValue(varName: string): number | string;
|
|
11
|
+
private hasVarName;
|
|
12
|
+
}
|
|
13
|
+
export declare function replaceVariablesInJson<D = any>(data: D, jsonVarParser: IJsonVarParser): D;
|