@infomaximum/widget-sdk 4.0.0-beta4 → 4.0.0-beta41
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 +458 -158
- package/dist/index.esm.js +108 -49
- package/dist/index.js +110 -51
- package/package.json +9 -7
package/dist/index.d.ts
CHANGED
|
@@ -34,7 +34,8 @@ declare enum EControlType {
|
|
|
34
34
|
eventsColor = "eventsColor",
|
|
35
35
|
inputMarkdown = "inputMarkdown",
|
|
36
36
|
filter = "filter",
|
|
37
|
-
actionOnClick = "actionOnClick"
|
|
37
|
+
actionOnClick = "actionOnClick",
|
|
38
|
+
eventsPicker = "eventsPicker"
|
|
38
39
|
}
|
|
39
40
|
/** Конфигурация элемента управления настройкой */
|
|
40
41
|
interface IControlRecord<Settings extends object, Value, ControlType = EControlType> {
|
|
@@ -43,6 +44,7 @@ interface IControlRecord<Settings extends object, Value, ControlType = EControlT
|
|
|
43
44
|
title?: string;
|
|
44
45
|
/** Тип используемого элемента управления настройкой из предложенных нашей системой */
|
|
45
46
|
type: ControlType | string;
|
|
47
|
+
marginTop?: number;
|
|
46
48
|
/** Объект дополнительных параметров элемента управления */
|
|
47
49
|
props?: object | ((settings: Settings) => object);
|
|
48
50
|
/** Описание доступа к значению настройки */
|
|
@@ -78,6 +80,9 @@ interface ICalculatorIndicatorOutput {
|
|
|
78
80
|
interface ICalculatorDimensionInput extends ICalculatorIndicatorInput {
|
|
79
81
|
formula: string;
|
|
80
82
|
hideEmpty?: boolean;
|
|
83
|
+
/** Временно поддерживается обратная совместимость с форматом { alias: string; formula: string }[] */
|
|
84
|
+
/** Появилась необходимость в ленточном графике, т.к. разрез длительность используется, как мера */
|
|
85
|
+
additionalFormulas?: Map<string, string>;
|
|
81
86
|
}
|
|
82
87
|
interface ICalculatorDimensionOutput extends ICalculatorIndicatorOutput {
|
|
83
88
|
}
|
|
@@ -260,6 +265,7 @@ declare enum EDurationUnit {
|
|
|
260
265
|
declare const mapFormulaFilterToCalculatorInput: (filterValue: IFormulaFilterValue | string) => TNullable<ICalculatorFilter>;
|
|
261
266
|
declare const mapFormulaFiltersToInputs: (filters: (string | IFormulaFilterValue)[]) => ICalculatorFilter[];
|
|
262
267
|
|
|
268
|
+
type TSelectivePartial<T, Keys extends keyof T> = Omit<T, Keys> & Partial<Pick<T, Keys>>;
|
|
263
269
|
declare const formulaFilterMethods: {
|
|
264
270
|
readonly LAST_TIME: "LAST_TIME";
|
|
265
271
|
readonly EQUAL_TO: ECalculatorFilterMethods.EQUAL_TO;
|
|
@@ -289,6 +295,7 @@ declare enum EProcessFilterNames {
|
|
|
289
295
|
/** Длительность перехода */
|
|
290
296
|
durationOfTransition = "durationOfTransition"
|
|
291
297
|
}
|
|
298
|
+
/** @deprecated необходимо использовать @see {@link IFormulaFilterValue} */
|
|
292
299
|
interface IWidgetFormulaFilterValue extends ICalculatorFilter {
|
|
293
300
|
/**
|
|
294
301
|
* Название фильтра
|
|
@@ -305,38 +312,38 @@ interface IProcessFilterValue {
|
|
|
305
312
|
* События, доступные при выборе процесса.
|
|
306
313
|
* Если параметр не передан, используются все события процесса на основе запроса к вычислителю.
|
|
307
314
|
*/
|
|
308
|
-
|
|
315
|
+
eventsNamesByProcessNameMap?: Map<string, (string | null)[]>;
|
|
309
316
|
}
|
|
310
317
|
interface IProcessEventFilterValue extends IProcessFilterValue {
|
|
311
|
-
|
|
318
|
+
processName: string;
|
|
312
319
|
eventName: string;
|
|
313
320
|
}
|
|
314
321
|
interface IProcessTransitionFilterValue extends IProcessFilterValue {
|
|
315
|
-
|
|
322
|
+
startEventProcessName: string;
|
|
316
323
|
startEventName: string;
|
|
317
|
-
|
|
324
|
+
endEventProcessName: string;
|
|
318
325
|
endEventName: string;
|
|
319
326
|
}
|
|
327
|
+
interface IClickPosition {
|
|
328
|
+
x: number;
|
|
329
|
+
y: number;
|
|
330
|
+
elementWidth: number;
|
|
331
|
+
elementHeight: number;
|
|
332
|
+
}
|
|
333
|
+
interface IPositionConfig extends IClickPosition {
|
|
334
|
+
type: string;
|
|
335
|
+
}
|
|
320
336
|
interface IAddPresenceOfEventFilter {
|
|
321
|
-
(name: EProcessFilterNames.presenceOfEvent, value: IProcessEventFilterValue): void;
|
|
337
|
+
(name: EProcessFilterNames.presenceOfEvent, value: IProcessEventFilterValue, positionConfig?: IPositionConfig): void;
|
|
322
338
|
}
|
|
323
339
|
interface IAddRepetitionOfEventFilter {
|
|
324
|
-
(name: EProcessFilterNames.repetitionOfEvent, value: IProcessEventFilterValue): void;
|
|
340
|
+
(name: EProcessFilterNames.repetitionOfEvent, value: IProcessEventFilterValue, positionConfig?: IPositionConfig): void;
|
|
325
341
|
}
|
|
326
342
|
interface IAddPresenceOfTransitionFilter {
|
|
327
|
-
(name: EProcessFilterNames.presenceOfTransition, value: IProcessTransitionFilterValue): void;
|
|
343
|
+
(name: EProcessFilterNames.presenceOfTransition, value: IProcessTransitionFilterValue, positionConfig?: IPositionConfig): void;
|
|
328
344
|
}
|
|
329
345
|
interface IAddDurationOfTransitionFilter {
|
|
330
|
-
(name: EProcessFilterNames.durationOfTransition, value: IProcessTransitionFilterValue): void;
|
|
331
|
-
}
|
|
332
|
-
interface IWidgetFiltration {
|
|
333
|
-
/** Значения фильтров, подготовленные для передачи в вычислитель */
|
|
334
|
-
preparedFilterValues: ICalculatorFilter[];
|
|
335
|
-
/** Добавить фильтр по формуле */
|
|
336
|
-
addFormulaFilter(value: IWidgetFormulaFilterValue): void;
|
|
337
|
-
/** Удалить фильтр по формуле */
|
|
338
|
-
removeFormulaFilter(formula: string): void;
|
|
339
|
-
addProcessFilter(...args: Parameters<IAddPresenceOfEventFilter> | Parameters<IAddRepetitionOfEventFilter> | Parameters<IAddPresenceOfTransitionFilter> | Parameters<IAddDurationOfTransitionFilter>): void;
|
|
346
|
+
(name: EProcessFilterNames.durationOfTransition, value: IProcessTransitionFilterValue, positionConfig?: IPositionConfig): void;
|
|
340
347
|
}
|
|
341
348
|
declare enum EFormulaFilterFieldKeys {
|
|
342
349
|
date = "date",
|
|
@@ -361,7 +368,7 @@ interface IFormulaFilterValue {
|
|
|
361
368
|
/** Метод фильтрации */
|
|
362
369
|
filteringMethod: valueof<typeof formulaFilterMethods>;
|
|
363
370
|
/** Выбранные в списке значения в виде моделей */
|
|
364
|
-
checkedValues: string[];
|
|
371
|
+
checkedValues: (string | null)[];
|
|
365
372
|
/** Значения полей формы редактора */
|
|
366
373
|
formValues: Partial<{
|
|
367
374
|
[EFormulaFilterFieldKeys.date]: string | null;
|
|
@@ -375,6 +382,41 @@ interface IFormulaFilterValue {
|
|
|
375
382
|
[EFormulaFilterFieldKeys.durationUnit]: EDurationUnit;
|
|
376
383
|
}>;
|
|
377
384
|
}
|
|
385
|
+
interface IStagesFilterItem {
|
|
386
|
+
id: number;
|
|
387
|
+
/** Название этапа */
|
|
388
|
+
name: string;
|
|
389
|
+
/** Формула фильтра этапа */
|
|
390
|
+
formula: string;
|
|
391
|
+
isSelected: boolean;
|
|
392
|
+
}
|
|
393
|
+
interface IStagesFilterValue {
|
|
394
|
+
/** Ключ виджета */
|
|
395
|
+
widgetKey: string;
|
|
396
|
+
/** Заголовок фильтра */
|
|
397
|
+
name: TNullable<string>;
|
|
398
|
+
/** Этапы */
|
|
399
|
+
stages: IStagesFilterItem[];
|
|
400
|
+
}
|
|
401
|
+
type TWidgetFilterValue = IFormulaFilterValue | IStagesFilterValue | IProcessEventFilterValue | IProcessTransitionFilterValue;
|
|
402
|
+
interface IWidgetFilter {
|
|
403
|
+
filterValue: TWidgetFilterValue;
|
|
404
|
+
preparedFilterValue: ICalculatorFilter;
|
|
405
|
+
}
|
|
406
|
+
interface IWidgetFiltration {
|
|
407
|
+
/** Значения фильтров, подготовленные для передачи в вычислитель */
|
|
408
|
+
preparedFilterValues: ICalculatorFilter[];
|
|
409
|
+
filters: IWidgetFilter[];
|
|
410
|
+
/** Добавить фильтр по формуле */
|
|
411
|
+
addFormulaFilter(value: IWidgetFormulaFilterValue | TSelectivePartial<IFormulaFilterValue, "format" | "formValues">): void;
|
|
412
|
+
/** Удалить фильтр по формуле */
|
|
413
|
+
removeFormulaFilter(formula: string): void;
|
|
414
|
+
addProcessFilter(...args: Parameters<IAddPresenceOfEventFilter> | Parameters<IAddRepetitionOfEventFilter> | Parameters<IAddPresenceOfTransitionFilter> | Parameters<IAddDurationOfTransitionFilter>): void;
|
|
415
|
+
/** Добавить фильтр по этапам */
|
|
416
|
+
addStagesFilter(value: Omit<IStagesFilterValue, "widgetKey">): void;
|
|
417
|
+
/** Удалить фильтр по этапам */
|
|
418
|
+
removeStagesFilter(widgetKey: string): void;
|
|
419
|
+
}
|
|
378
420
|
|
|
379
421
|
declare enum EWidgetFilterMode {
|
|
380
422
|
DEFAULT = "DEFAULT",
|
|
@@ -390,25 +432,62 @@ type TWidgetFiltering = {
|
|
|
390
432
|
mode: EWidgetFilterMode;
|
|
391
433
|
};
|
|
392
434
|
declare enum EColorMode {
|
|
435
|
+
DISABLED = "DISABLED",
|
|
393
436
|
FORMULA = "FORMULA",
|
|
394
437
|
BASE = "BASE",
|
|
395
438
|
GRADIENT = "GRADIENT",
|
|
396
|
-
AUTO = "AUTO"
|
|
439
|
+
AUTO = "AUTO",
|
|
440
|
+
RULE = "RULE",
|
|
441
|
+
VALUES = "VALUES",
|
|
442
|
+
BY_DIMENSION = "BY_DIMENSION"
|
|
397
443
|
}
|
|
398
|
-
|
|
399
|
-
type TColor = {
|
|
400
|
-
mode: EColorMode.FORMULA;
|
|
401
|
-
formula: string;
|
|
402
|
-
} | {
|
|
444
|
+
type TColorBase = {
|
|
403
445
|
mode: EColorMode.BASE;
|
|
404
446
|
value?: string;
|
|
405
447
|
defaultColor?: string;
|
|
448
|
+
};
|
|
449
|
+
declare enum EColorScope {
|
|
450
|
+
WORKSPACE = "WORKSPACE",
|
|
451
|
+
DASHBOARD = "DASHBOARD"
|
|
452
|
+
}
|
|
453
|
+
type TColorRuleCommon = {
|
|
454
|
+
mode: EColorMode.RULE;
|
|
455
|
+
ruleName: string;
|
|
456
|
+
};
|
|
457
|
+
type TColorRule = ({
|
|
458
|
+
scope: EColorScope.DASHBOARD | null;
|
|
406
459
|
} | {
|
|
460
|
+
scope: EColorScope.WORKSPACE;
|
|
461
|
+
workspaceGroupId: number | null;
|
|
462
|
+
}) & TColorRuleCommon;
|
|
463
|
+
interface IColoredValue {
|
|
464
|
+
value: string;
|
|
465
|
+
color: TColorBase | TColorRule;
|
|
466
|
+
}
|
|
467
|
+
declare enum EMarkdownDisplayMode {
|
|
468
|
+
NONE = "NONE",
|
|
469
|
+
INDICATOR = "INDICATOR"
|
|
470
|
+
}
|
|
471
|
+
/** Настройка цвета */
|
|
472
|
+
type TColor = {
|
|
473
|
+
mode: EColorMode.FORMULA;
|
|
474
|
+
formula: string;
|
|
475
|
+
} | TColorBase | {
|
|
407
476
|
mode: EColorMode.GRADIENT;
|
|
408
477
|
startValue: string;
|
|
409
478
|
endValue: string;
|
|
410
479
|
} | {
|
|
411
480
|
mode: EColorMode.AUTO;
|
|
481
|
+
} | TColorRule | {
|
|
482
|
+
mode: EColorMode.VALUES;
|
|
483
|
+
dimensionFormula: string;
|
|
484
|
+
items: IColoredValue[];
|
|
485
|
+
} | {
|
|
486
|
+
mode: EColorMode.BY_DIMENSION;
|
|
487
|
+
dimensionName: string;
|
|
488
|
+
items: IColoredValue[];
|
|
489
|
+
} | {
|
|
490
|
+
mode: EColorMode.DISABLED;
|
|
412
491
|
};
|
|
413
492
|
declare enum EDisplayConditionMode {
|
|
414
493
|
DISABLED = "DISABLED",
|
|
@@ -423,7 +502,7 @@ type TDisplayCondition = {
|
|
|
423
502
|
formula: TNullable<string>;
|
|
424
503
|
} | {
|
|
425
504
|
mode: EDisplayConditionMode.VARIABLE;
|
|
426
|
-
|
|
505
|
+
variableName: TNullable<string>;
|
|
427
506
|
variableValue: TNullable<string>;
|
|
428
507
|
};
|
|
429
508
|
interface IRange {
|
|
@@ -432,6 +511,165 @@ interface IRange {
|
|
|
432
511
|
max?: number;
|
|
433
512
|
}
|
|
434
513
|
|
|
514
|
+
interface IWidgetTableColumn {
|
|
515
|
+
/** Имя колонки */
|
|
516
|
+
name: string;
|
|
517
|
+
/** Тип данных колонки */
|
|
518
|
+
dataType: ESimpleDataType;
|
|
519
|
+
}
|
|
520
|
+
interface IActionScript {
|
|
521
|
+
name: string | undefined;
|
|
522
|
+
fieldsNames: Set<string>;
|
|
523
|
+
}
|
|
524
|
+
interface IWidgetTable {
|
|
525
|
+
/** Имя таблицы */
|
|
526
|
+
name: string;
|
|
527
|
+
/** Колонки таблицы */
|
|
528
|
+
columns: Map<string, IWidgetTableColumn>;
|
|
529
|
+
}
|
|
530
|
+
/**
|
|
531
|
+
* simplified - упрощенный для работы фильтрации в образах открытых в дровере/модальном окне
|
|
532
|
+
*
|
|
533
|
+
* full - полный
|
|
534
|
+
*/
|
|
535
|
+
type TFiltrationMode = "simplified" | "full";
|
|
536
|
+
/**
|
|
537
|
+
* preview - упрощенный
|
|
538
|
+
*
|
|
539
|
+
* full - полный
|
|
540
|
+
*/
|
|
541
|
+
type TDisplayMode = "preview" | "full";
|
|
542
|
+
interface IDisplayRule {
|
|
543
|
+
color: TColor;
|
|
544
|
+
}
|
|
545
|
+
interface IWidgetsContext {
|
|
546
|
+
/** используемый язык в системе */
|
|
547
|
+
language: ELanguages;
|
|
548
|
+
processes: Map<string, IWidgetProcess>;
|
|
549
|
+
reportMeasures: TNullable<Map<string, ICommonColumnIndicator>>;
|
|
550
|
+
workspaceMeasures: TNullable<Map<string, ICommonColumnIndicator>>;
|
|
551
|
+
/** Переменные отчета */
|
|
552
|
+
variables: Map<string, TWidgetVariable>;
|
|
553
|
+
/** Метод установки значения переменной отчета */
|
|
554
|
+
setVariableValue(name: string, value: TNullable<string> | string[]): void;
|
|
555
|
+
statesNames: Set<string>;
|
|
556
|
+
reportName: string;
|
|
557
|
+
/**
|
|
558
|
+
* режим дашборда
|
|
559
|
+
* @deprecated 2401 - необходимо использовать displayMode */
|
|
560
|
+
isViewMode: boolean;
|
|
561
|
+
/** Режим отображения виджета */
|
|
562
|
+
displayMode: TDisplayMode;
|
|
563
|
+
/** @deprecated необходимо получать из системной переменной "Login" */
|
|
564
|
+
userLogin: string;
|
|
565
|
+
scripts: Map<string, IActionScript>;
|
|
566
|
+
tables: Set<string>;
|
|
567
|
+
filtrationMode: TFiltrationMode;
|
|
568
|
+
reportDisplayRules: Map<string, IDisplayRule>;
|
|
569
|
+
workspaceDisplayRules: Map<number, Map<string, IDisplayRule>>;
|
|
570
|
+
viewKeyByName: Map<string, string>;
|
|
571
|
+
fetchColumnsByTableName(tableName: string): Promise<IWidgetTableColumn[] | undefined>;
|
|
572
|
+
}
|
|
573
|
+
|
|
574
|
+
declare enum EWidgetActionInputMode {
|
|
575
|
+
FROM_COLUMN = "FROM_COLUMN",
|
|
576
|
+
FROM_VARIABLE = "FROM_VARIABLE",
|
|
577
|
+
STATIC_LIST = "STATIC_LIST",
|
|
578
|
+
DYNAMIC_LIST = "DYNAMIC_LIST",
|
|
579
|
+
FORMULA = "FORMULA",
|
|
580
|
+
MANUALLY = "MANUALLY"
|
|
581
|
+
}
|
|
582
|
+
interface IActionCommon {
|
|
583
|
+
id: number;
|
|
584
|
+
name: string;
|
|
585
|
+
}
|
|
586
|
+
declare enum EActionTypes {
|
|
587
|
+
URL = "URL",
|
|
588
|
+
UPDATE_VARIABLE = "UPDATE_VARIABLE",
|
|
589
|
+
RUN_SCRIPT = "RUN_SCRIPT",
|
|
590
|
+
OPEN_VIEW = "OPEN_VIEW"
|
|
591
|
+
}
|
|
592
|
+
interface IActionGoToUrl extends IActionCommon {
|
|
593
|
+
type: EActionTypes.URL;
|
|
594
|
+
url: string;
|
|
595
|
+
targetBlank: boolean;
|
|
596
|
+
}
|
|
597
|
+
interface IActionScriptField {
|
|
598
|
+
name: string;
|
|
599
|
+
id: number;
|
|
600
|
+
value: TWidgetActionInputValue;
|
|
601
|
+
}
|
|
602
|
+
interface IActionRunScript extends IActionCommon {
|
|
603
|
+
description: string;
|
|
604
|
+
type: EActionTypes.RUN_SCRIPT;
|
|
605
|
+
filters: (IFormulaFilterValue | string)[];
|
|
606
|
+
inputs: IActionScriptField[];
|
|
607
|
+
scriptName: string;
|
|
608
|
+
shouldRefreshWidgetsAfterExecution: boolean;
|
|
609
|
+
}
|
|
610
|
+
interface IActionUpdateVariable extends IActionCommon {
|
|
611
|
+
type: EActionTypes.UPDATE_VARIABLE;
|
|
612
|
+
variables: Array<string>;
|
|
613
|
+
}
|
|
614
|
+
declare enum EViewType {
|
|
615
|
+
CREATED_VIEW = "CREATED_VIEW",
|
|
616
|
+
GENERATED_BY_SCRIPT = "GENERATED_BY_SCRIPT"
|
|
617
|
+
}
|
|
618
|
+
declare enum EOpenViewMode {
|
|
619
|
+
NEW_WINDOW = "NEW_WINDOW",
|
|
620
|
+
PLACEHOLDER = "PLACEHOLDER",
|
|
621
|
+
MODAL = "MODAL",
|
|
622
|
+
DRAWER = "DRAWER"
|
|
623
|
+
}
|
|
624
|
+
declare enum EDrawerPlacement {
|
|
625
|
+
LEFT = "LEFT",
|
|
626
|
+
RIGHT = "RIGHT"
|
|
627
|
+
}
|
|
628
|
+
interface IActionOpenView extends IActionCommon {
|
|
629
|
+
type: EActionTypes.OPEN_VIEW;
|
|
630
|
+
viewName: string;
|
|
631
|
+
viewKey: string;
|
|
632
|
+
openMode: EOpenViewMode;
|
|
633
|
+
viewType: EViewType;
|
|
634
|
+
drawerPlacement: EDrawerPlacement;
|
|
635
|
+
placeholderName: string;
|
|
636
|
+
inputs: IActionScriptField[];
|
|
637
|
+
isOpenInCurrentWindow?: boolean;
|
|
638
|
+
}
|
|
639
|
+
type TActionsOnClick = IActionGoToUrl | IActionRunScript | IActionUpdateVariable | IActionOpenView;
|
|
640
|
+
type TWidgetActionCommonInputValue = {
|
|
641
|
+
name: string;
|
|
642
|
+
isHidden: boolean;
|
|
643
|
+
};
|
|
644
|
+
type TWidgetActionInputValue = TWidgetActionCommonInputValue & ({
|
|
645
|
+
mode: EWidgetActionInputMode.FROM_COLUMN;
|
|
646
|
+
tableName: string;
|
|
647
|
+
columnName: string;
|
|
648
|
+
} | {
|
|
649
|
+
mode: EWidgetActionInputMode.FROM_VARIABLE;
|
|
650
|
+
sourceVariable: string;
|
|
651
|
+
} | {
|
|
652
|
+
mode: EWidgetActionInputMode.FORMULA;
|
|
653
|
+
formula: string;
|
|
654
|
+
} | {
|
|
655
|
+
mode: EWidgetActionInputMode.MANUALLY;
|
|
656
|
+
description: string;
|
|
657
|
+
} | {
|
|
658
|
+
mode: EWidgetActionInputMode.STATIC_LIST;
|
|
659
|
+
options: string[];
|
|
660
|
+
defaultOptionIndex: number;
|
|
661
|
+
} | {
|
|
662
|
+
mode: EWidgetActionInputMode.DYNAMIC_LIST;
|
|
663
|
+
formula: string;
|
|
664
|
+
defaultValue: string;
|
|
665
|
+
filters: (IFormulaFilterValue | string)[];
|
|
666
|
+
});
|
|
667
|
+
interface IWidgetActionInput {
|
|
668
|
+
name: string;
|
|
669
|
+
value: TWidgetActionInputValue;
|
|
670
|
+
}
|
|
671
|
+
declare const isActionValid: (action: TActionsOnClick, { scripts, tables, variables }: IWidgetsContext) => boolean;
|
|
672
|
+
|
|
435
673
|
declare enum ESortDirection {
|
|
436
674
|
descend = "DESC",
|
|
437
675
|
ascend = "ASC",
|
|
@@ -442,6 +680,7 @@ type TSortDirection = ESortDirection.ascend | ESortDirection.descend;
|
|
|
442
680
|
interface ISortOrder {
|
|
443
681
|
formula: string;
|
|
444
682
|
direction: TSortDirection;
|
|
683
|
+
displayCondition?: TNullable<string>;
|
|
445
684
|
}
|
|
446
685
|
type TWidgetSortingValueRelatedWidgetMeasure = {
|
|
447
686
|
mode: ESortingValueModes.MEASURE_IN_WIDGET;
|
|
@@ -457,7 +696,7 @@ type TWidgetSortingValue = {
|
|
|
457
696
|
formula: string;
|
|
458
697
|
} | TWidgetSortingValueRelatedWidgetIndicator | {
|
|
459
698
|
mode: ESortingValueModes.IN_DASHBOARD | ESortingValueModes.IN_WORKSPACE;
|
|
460
|
-
|
|
699
|
+
name: string;
|
|
461
700
|
formula: string;
|
|
462
701
|
};
|
|
463
702
|
|
|
@@ -540,7 +779,6 @@ declare enum ESortingValueModes {
|
|
|
540
779
|
IN_WORKSPACE = "IN_WORKSPACE"
|
|
541
780
|
}
|
|
542
781
|
interface ICommonColumnIndicator {
|
|
543
|
-
guid: string;
|
|
544
782
|
name: string;
|
|
545
783
|
formula: string;
|
|
546
784
|
}
|
|
@@ -570,6 +808,7 @@ interface IWidgetColumnIndicator extends IWidgetIndicator {
|
|
|
570
808
|
formatting?: EFormattingPresets;
|
|
571
809
|
formattingTemplate?: string;
|
|
572
810
|
displayCondition?: TDisplayCondition;
|
|
811
|
+
onclick?: TActionsOnClick[];
|
|
573
812
|
}
|
|
574
813
|
interface IWidgetDimensionHierarchy<D extends IWidgetDimension = IWidgetDimension> {
|
|
575
814
|
/** Идентификатор, генерируемый на основе текущего времени */
|
|
@@ -586,6 +825,10 @@ interface IWidgetDimension extends IWidgetColumnIndicator {
|
|
|
586
825
|
interface IWidgetMeasure extends IWidgetColumnIndicator {
|
|
587
826
|
type: EWidgetIndicatorType.MEASURE;
|
|
588
827
|
}
|
|
828
|
+
interface IMarkdownMeasure extends IWidgetMeasure {
|
|
829
|
+
format: EFormatTypes;
|
|
830
|
+
displayMode: EMarkdownDisplayMode;
|
|
831
|
+
}
|
|
589
832
|
/** Тип показателя */
|
|
590
833
|
declare enum EIndicatorType {
|
|
591
834
|
/** Показатели процесса */
|
|
@@ -651,110 +894,18 @@ type TWidgetVariable = {
|
|
|
651
894
|
};
|
|
652
895
|
declare function isHierarchy(indicator: IWidgetColumnIndicator): indicator is IWidgetDimensionHierarchy;
|
|
653
896
|
|
|
654
|
-
interface IWidgetTableColumn {
|
|
655
|
-
/** Имя колонки */
|
|
656
|
-
name: string;
|
|
657
|
-
/** Тип данных колонки */
|
|
658
|
-
dataType: ESimpleDataType;
|
|
659
|
-
}
|
|
660
|
-
interface IActionScript {
|
|
661
|
-
guid: string | undefined;
|
|
662
|
-
fieldsGuids: Set<string>;
|
|
663
|
-
}
|
|
664
|
-
interface IWidgetTable {
|
|
665
|
-
/** Имя таблицы */
|
|
666
|
-
name: string;
|
|
667
|
-
/** Колонки таблицы */
|
|
668
|
-
columns: Map<string, IWidgetTableColumn>;
|
|
669
|
-
}
|
|
670
|
-
/**
|
|
671
|
-
* preview - упрощенный
|
|
672
|
-
*
|
|
673
|
-
* full - полный
|
|
674
|
-
*/
|
|
675
|
-
type TDisplayMode = "preview" | "full";
|
|
676
|
-
interface IWidgetsContext {
|
|
677
|
-
/** используемый язык в системе */
|
|
678
|
-
language: ELanguages;
|
|
679
|
-
processes: Map<string, IWidgetProcess>;
|
|
680
|
-
reportMeasures: TNullable<Map<string, ICommonColumnIndicator>>;
|
|
681
|
-
workspaceMeasures: TNullable<Map<string, ICommonColumnIndicator>>;
|
|
682
|
-
/** Переменные отчета */
|
|
683
|
-
variables: Map<string, TWidgetVariable>;
|
|
684
|
-
/** Метод установки значения переменной отчета */
|
|
685
|
-
setVariableValue(guid: string, value: TNullable<string> | string[]): void;
|
|
686
|
-
statesGuids: Set<string>;
|
|
687
|
-
reportName: string;
|
|
688
|
-
/**
|
|
689
|
-
* режим дашборда
|
|
690
|
-
* @deprecated 2401 - необходимо использовать displayMode */
|
|
691
|
-
isViewMode: boolean;
|
|
692
|
-
/** Режим отображения виджета */
|
|
693
|
-
displayMode: TDisplayMode;
|
|
694
|
-
/** @deprecated необходимо получать из системной переменной "Login" */
|
|
695
|
-
userLogin: string;
|
|
696
|
-
scripts: Map<string, IActionScript>;
|
|
697
|
-
tables: Set<string>;
|
|
698
|
-
}
|
|
699
|
-
|
|
700
|
-
declare enum EWidgetActionInputMode {
|
|
701
|
-
FROM_COLUMN = "FROM_COLUMN",
|
|
702
|
-
FROM_VARIABLE = "FROM_VARIABLE",
|
|
703
|
-
STATIC_LIST = "STATIC_LIST",
|
|
704
|
-
DYNAMIC_LIST = "DYNAMIC_LIST",
|
|
705
|
-
FORMULA = "FORMULA",
|
|
706
|
-
MANUALLY = "MANUALLY"
|
|
707
|
-
}
|
|
708
|
-
type TWidgetActionInputValue = {
|
|
709
|
-
mode: EWidgetActionInputMode.FROM_COLUMN;
|
|
710
|
-
tableName: string;
|
|
711
|
-
columnName: string;
|
|
712
|
-
} | {
|
|
713
|
-
mode: EWidgetActionInputMode.FROM_VARIABLE;
|
|
714
|
-
guid: string;
|
|
715
|
-
} | {
|
|
716
|
-
mode: EWidgetActionInputMode.FORMULA;
|
|
717
|
-
formula: string;
|
|
718
|
-
} | {
|
|
719
|
-
mode: EWidgetActionInputMode.MANUALLY;
|
|
720
|
-
description: string;
|
|
721
|
-
} | {
|
|
722
|
-
mode: EWidgetActionInputMode.STATIC_LIST;
|
|
723
|
-
options: string[];
|
|
724
|
-
defaultOptionIndex: number;
|
|
725
|
-
} | {
|
|
726
|
-
mode: EWidgetActionInputMode.DYNAMIC_LIST;
|
|
727
|
-
formula: string;
|
|
728
|
-
defaultValue: string;
|
|
729
|
-
};
|
|
730
|
-
interface IWidgetActionInput {
|
|
731
|
-
guid: string;
|
|
732
|
-
value: TWidgetActionInputValue;
|
|
733
|
-
}
|
|
734
|
-
interface IWidgetAction {
|
|
735
|
-
id: number;
|
|
736
|
-
name: string;
|
|
737
|
-
description: string;
|
|
738
|
-
filters: (IFormulaFilterValue | string)[];
|
|
739
|
-
scriptGuid?: string;
|
|
740
|
-
/** Поле name необходимо, чтобы показать название скрипта, который был удален */
|
|
741
|
-
scriptName?: string;
|
|
742
|
-
inputs: IWidgetActionInput[];
|
|
743
|
-
shouldRefreshWidgetsAfterExecution: boolean;
|
|
744
|
-
}
|
|
745
|
-
declare const isActionValid: (action: IWidgetAction, { scripts, tables }: IWidgetsContext) => boolean;
|
|
746
|
-
|
|
747
897
|
interface IBaseWidgetSettings {
|
|
748
|
-
apiVersion: string;
|
|
749
|
-
type: string;
|
|
750
898
|
header?: string;
|
|
751
899
|
headerSize?: number;
|
|
752
|
-
|
|
900
|
+
stateName?: string | null;
|
|
901
|
+
showMarkdown?: boolean;
|
|
902
|
+
markdownMeasures?: IMarkdownMeasure[];
|
|
903
|
+
markdownText?: string;
|
|
753
904
|
filters?: (IFormulaFilterValue | string)[];
|
|
754
905
|
filterMode?: EWidgetFilterMode;
|
|
755
906
|
ignoreFilters?: boolean;
|
|
756
907
|
sorting?: IWidgetSortingIndicator[];
|
|
757
|
-
actions?:
|
|
908
|
+
actions?: TActionsOnClick[];
|
|
758
909
|
displayCondition?: TDisplayCondition;
|
|
759
910
|
displayConditionComment?: string;
|
|
760
911
|
}
|
|
@@ -786,20 +937,85 @@ type TGroupLevelRecord<LevelGroupSettings extends object> = IControlRecord<Level
|
|
|
786
937
|
interface ISelectOption {
|
|
787
938
|
value: string;
|
|
788
939
|
label: string;
|
|
940
|
+
disabled?: boolean;
|
|
941
|
+
rightIcon?: "fx" | string;
|
|
942
|
+
}
|
|
943
|
+
declare enum ESelectOptionTypes {
|
|
944
|
+
DIVIDER = "DIVIDER",
|
|
945
|
+
SYSTEM = "SYSTEM",
|
|
946
|
+
GROUP = "GROUP",
|
|
947
|
+
BRANCH = "BRANCH",
|
|
948
|
+
LEAF = "LEAF"
|
|
949
|
+
}
|
|
950
|
+
declare enum ECustomSelectTemplates {
|
|
951
|
+
FORMULA = "FORMULA",
|
|
952
|
+
DIMENSION_GROUPS = "DIMENSION_GROUPS"
|
|
953
|
+
}
|
|
954
|
+
interface ISelectDividerOption {
|
|
955
|
+
type: ESelectOptionTypes.DIVIDER;
|
|
956
|
+
}
|
|
957
|
+
interface ISelectSystemOption<T extends string = string> {
|
|
958
|
+
type: ESelectOptionTypes.SYSTEM;
|
|
959
|
+
template: T;
|
|
960
|
+
}
|
|
961
|
+
interface ISelectGroupOption {
|
|
962
|
+
type: ESelectOptionTypes.GROUP;
|
|
963
|
+
label: string;
|
|
964
|
+
options: IAddButtonSelectOption[];
|
|
965
|
+
icon: string;
|
|
966
|
+
}
|
|
967
|
+
type TSelectFetchOptions = () => Promise<IAddButtonSelectOption[]>;
|
|
968
|
+
type TSelectChildOptions = IAddButtonSelectOption[] | TSelectFetchOptions;
|
|
969
|
+
interface ISelectBranchOption {
|
|
970
|
+
type: ESelectOptionTypes.BRANCH;
|
|
971
|
+
label: string;
|
|
972
|
+
options: TSelectChildOptions;
|
|
973
|
+
icon?: string;
|
|
974
|
+
disabled?: boolean;
|
|
975
|
+
}
|
|
976
|
+
interface ISelectLeafOption {
|
|
977
|
+
type: ESelectOptionTypes.LEAF;
|
|
978
|
+
label: string;
|
|
979
|
+
value: string;
|
|
980
|
+
onSelect: <T = object>(value: string, update: <R extends object>(f: (prevItems: (T | R)[]) => (T | R)[]) => void) => void;
|
|
981
|
+
/** Строка в формате base64 */
|
|
982
|
+
icon?: string;
|
|
983
|
+
disabled?: boolean;
|
|
789
984
|
}
|
|
985
|
+
type IAddButtonSelectOption = ISelectDividerOption | ISelectGroupOption | ISelectBranchOption | ISelectLeafOption;
|
|
986
|
+
type TCustomAddButtonSelectOption = ISelectSystemOption<ECustomSelectTemplates> | IAddButtonSelectOption;
|
|
987
|
+
type TMeasureAddButtonSelectOption = IAddButtonSelectOption;
|
|
790
988
|
interface ICustomAddButtonProps {
|
|
791
|
-
options
|
|
792
|
-
|
|
793
|
-
|
|
989
|
+
options: TSelectChildOptions;
|
|
990
|
+
hasDropdown?: boolean;
|
|
991
|
+
onClick?: ISelectLeafOption["onSelect"];
|
|
992
|
+
}
|
|
993
|
+
interface IWidgetIndicatorMenuConfig {
|
|
994
|
+
hideTablesColumnsOptions?: boolean;
|
|
995
|
+
hideCommonOptions?: boolean;
|
|
996
|
+
hideQuantityOption?: boolean;
|
|
997
|
+
}
|
|
998
|
+
interface IMeasureMenuConfig extends IWidgetIndicatorMenuConfig {
|
|
999
|
+
options?: TMeasureAddButtonSelectOption[];
|
|
1000
|
+
}
|
|
1001
|
+
interface ISortingMenuConfig extends IWidgetIndicatorMenuConfig {
|
|
794
1002
|
}
|
|
795
1003
|
/** Кнопка добавления группы в набор */
|
|
796
1004
|
type TAddButton = {
|
|
797
1005
|
title: string;
|
|
798
|
-
indicatorType: Exclude<EWidgetIndicatorType, EWidgetIndicatorType.CUSTOM>;
|
|
1006
|
+
indicatorType: Exclude<EWidgetIndicatorType, EWidgetIndicatorType.CUSTOM | EWidgetIndicatorType.MEASURE | EWidgetIndicatorType.SORTING>;
|
|
799
1007
|
} | {
|
|
800
1008
|
title: string;
|
|
801
1009
|
indicatorType: EWidgetIndicatorType.CUSTOM;
|
|
802
1010
|
props: ICustomAddButtonProps;
|
|
1011
|
+
} | {
|
|
1012
|
+
title: string;
|
|
1013
|
+
indicatorType: EWidgetIndicatorType.MEASURE;
|
|
1014
|
+
menuConfig?: IMeasureMenuConfig;
|
|
1015
|
+
} | {
|
|
1016
|
+
title: string;
|
|
1017
|
+
indicatorType: EWidgetIndicatorType.SORTING;
|
|
1018
|
+
menuConfig?: ISortingMenuConfig;
|
|
803
1019
|
};
|
|
804
1020
|
interface IAutoIdentifiedArrayItem {
|
|
805
1021
|
/**
|
|
@@ -830,9 +1046,19 @@ interface IGroupSetDescription<Settings extends object, GroupSettings extends ob
|
|
|
830
1046
|
isValid?(group: IGroupSettings): boolean;
|
|
831
1047
|
/** Находится ли группа в состоянии загрузки */
|
|
832
1048
|
isLoading?(group: IGroupSettings): boolean;
|
|
1049
|
+
/** Можно ли удалять группу по умолчанию true */
|
|
1050
|
+
isRemovable?(group: IGroupSettings): boolean;
|
|
1051
|
+
/** Можно ли сортировать группу по умолчанию true */
|
|
1052
|
+
isDraggable?: boolean;
|
|
1053
|
+
/** Опциональный верхний отступ для группы */
|
|
1054
|
+
marginTop?: number;
|
|
833
1055
|
}
|
|
834
1056
|
/** Конфигурация левой панели */
|
|
835
1057
|
interface IPanelDescription<Settings extends object, GroupSettings extends IGroupSettings = IGroupSettings> {
|
|
1058
|
+
/** Добавить заголовок для виджета */
|
|
1059
|
+
useHeader?: boolean;
|
|
1060
|
+
/** Добавить описание для виджета */
|
|
1061
|
+
useMarkdown?: boolean;
|
|
836
1062
|
/** Конфигурация настроек данных виджета */
|
|
837
1063
|
dataRecords?: TWidgetLevelRecord<Settings>[];
|
|
838
1064
|
/** Конфигурация настроек отображения виджета */
|
|
@@ -873,15 +1099,14 @@ interface IWidgetPlaceholderController {
|
|
|
873
1099
|
setConfigured(value: boolean): void;
|
|
874
1100
|
setDisplay(value: boolean): void;
|
|
875
1101
|
setEmpty(value: boolean): void;
|
|
1102
|
+
setOverlay(value: boolean): void;
|
|
876
1103
|
}
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
/** Коллекция значений переменных по их имени */
|
|
884
|
-
interface ICalculatorVariablesValues extends Map<string, ICalculatorVariable> {
|
|
1104
|
+
interface IWidgetPlaceholderValues {
|
|
1105
|
+
error: Error | null;
|
|
1106
|
+
isConfigured: boolean;
|
|
1107
|
+
isDisplay: boolean | undefined;
|
|
1108
|
+
isEmpty: boolean;
|
|
1109
|
+
isOverlay: boolean;
|
|
885
1110
|
}
|
|
886
1111
|
|
|
887
1112
|
/** Формат входного параметра GeneralCalculator */
|
|
@@ -890,8 +1115,6 @@ interface IBaseDimensionsAndMeasuresCalculatorInput {
|
|
|
890
1115
|
dimensions: ICalculatorDimensionInput[];
|
|
891
1116
|
/** Меры */
|
|
892
1117
|
measures: ICalculatorMeasureInput[];
|
|
893
|
-
/** Значения переменных */
|
|
894
|
-
variablesValues?: ICalculatorVariablesValues;
|
|
895
1118
|
/** Фильтры, использующие WHERE */
|
|
896
1119
|
filters: ICalculatorFilter[];
|
|
897
1120
|
/** Фильтры, использующие HAVING */
|
|
@@ -945,8 +1168,6 @@ interface IHistogramCalculatorInput {
|
|
|
945
1168
|
dimensions: ICalculatorDimensionInput[];
|
|
946
1169
|
/** Лимит корзин */
|
|
947
1170
|
binsLimit: number;
|
|
948
|
-
/** Значения переменных */
|
|
949
|
-
variablesValues?: ICalculatorVariablesValues;
|
|
950
1171
|
/** Формула условия отображения */
|
|
951
1172
|
displayConditionFormula?: TNullable<string>;
|
|
952
1173
|
/** Фильтры, использующие WHERE */
|
|
@@ -991,7 +1212,7 @@ interface IEdge extends IGraphElement {
|
|
|
991
1212
|
endName: string | null;
|
|
992
1213
|
}
|
|
993
1214
|
interface IProcessGraphCalculatorInput {
|
|
994
|
-
|
|
1215
|
+
processName: string;
|
|
995
1216
|
vertexLimit: number | null;
|
|
996
1217
|
edgeLimit: number;
|
|
997
1218
|
vertexMeasures: ICalculatorMeasureInput[];
|
|
@@ -999,8 +1220,6 @@ interface IProcessGraphCalculatorInput {
|
|
|
999
1220
|
filters: ICalculatorFilter[];
|
|
1000
1221
|
eventFilters?: ICalculatorFilter[];
|
|
1001
1222
|
displayConditionFormula?: TNullable<string>;
|
|
1002
|
-
/** Значения переменных */
|
|
1003
|
-
variablesValues?: ICalculatorVariablesValues;
|
|
1004
1223
|
}
|
|
1005
1224
|
interface IProcessGraphCalculatorOutput {
|
|
1006
1225
|
vertexMaxLimit: number;
|
|
@@ -1025,8 +1244,6 @@ interface ITwoLimitsCalculatorInput {
|
|
|
1025
1244
|
dimensionsSecondGroup: ICalculatorDimensionInput[];
|
|
1026
1245
|
/** Меры */
|
|
1027
1246
|
measures: ICalculatorMeasureInput[];
|
|
1028
|
-
/** Значения переменных */
|
|
1029
|
-
variablesValues?: ICalculatorVariablesValues;
|
|
1030
1247
|
/** Фильтры, использующие WHERE */
|
|
1031
1248
|
filters: ICalculatorFilter[];
|
|
1032
1249
|
/** Фильтры, использующие HAVING */
|
|
@@ -1063,19 +1280,23 @@ interface ITwoLimitsCalculator extends ICalculator<ITwoLimitsCalculatorInput, IT
|
|
|
1063
1280
|
}
|
|
1064
1281
|
|
|
1065
1282
|
interface ITypeCalculatorInput {
|
|
1066
|
-
|
|
1067
|
-
|
|
1283
|
+
dimensions: {
|
|
1284
|
+
alias: string;
|
|
1285
|
+
formula: string;
|
|
1286
|
+
}[];
|
|
1287
|
+
measures: {
|
|
1288
|
+
alias: string;
|
|
1289
|
+
formula: string;
|
|
1290
|
+
}[];
|
|
1068
1291
|
}
|
|
1069
1292
|
interface ITypeCalculatorOutput {
|
|
1070
|
-
|
|
1293
|
+
types: Map<string, ESimpleDataType>;
|
|
1071
1294
|
}
|
|
1072
1295
|
interface ITypeCalculator extends ICalculator<ITypeCalculatorInput, ITypeCalculatorOutput> {
|
|
1073
1296
|
}
|
|
1074
1297
|
|
|
1075
1298
|
declare const prepareValuesForSql: (dataType: ESimpleDataType, values: (string | null)[]) => (string | null)[];
|
|
1076
1299
|
|
|
1077
|
-
declare function mapVariablesToInputs(variables: Map<string, TWidgetVariable>): ICalculatorVariablesValues;
|
|
1078
|
-
|
|
1079
1300
|
declare function checkDisplayCondition(displayCondition: TNullable<TDisplayCondition>, variables: Map<string, TWidgetVariable>): boolean;
|
|
1080
1301
|
declare function getDisplayConditionFormula(displayCondition: TNullable<TDisplayCondition>): TNullable<string>;
|
|
1081
1302
|
declare const replaceDisplayCondition: <I extends IWidgetColumnIndicator>(dimension: I, displayCondition: TNullable<TDisplayCondition>) => TNullable<I>;
|
|
@@ -1084,7 +1305,7 @@ declare const replaceDisplayCondition: <I extends IWidgetColumnIndicator>(dimens
|
|
|
1084
1305
|
declare function mapMeasuresToInputs<T extends IWidgetMeasure>(measures: T[], variables: Map<string, TWidgetVariable>, addFormulas?: (measure: T) => Map<string, string>): ICalculatorMeasureInput[];
|
|
1085
1306
|
|
|
1086
1307
|
/** Конвертировать разрезы виджета во входы для вычислителя */
|
|
1087
|
-
declare function mapDimensionsToInputs(dimensions:
|
|
1308
|
+
declare function mapDimensionsToInputs<T extends IWidgetDimension>(dimensions: T[], variables: Map<string, TWidgetVariable>, addFormulas?: (dimension: T) => Map<string, string>): ICalculatorDimensionInput[];
|
|
1088
1309
|
|
|
1089
1310
|
/** Конвертировать процессные показатели виджета во входы для вычислителя */
|
|
1090
1311
|
declare function mapTransitionMeasuresToInputs<T extends IProcessIndicator>(indicators: T[], process: IWidgetProcess, variables: Map<string, TWidgetVariable>, addFormulas?: (indicator: T) => Map<string, string>): ICalculatorMeasureInput[];
|
|
@@ -1099,7 +1320,7 @@ declare function mapEventMeasuresToInputs<T extends IProcessIndicator>(indicator
|
|
|
1099
1320
|
* @param measuresInOriginalOrder меры виджета (конкретная мера будет браться по индексу)
|
|
1100
1321
|
* @returns
|
|
1101
1322
|
*/
|
|
1102
|
-
declare function mapSortingToInputs(sortingIndicators
|
|
1323
|
+
declare function mapSortingToInputs(sortingIndicators: IWidgetSortingIndicator[] | undefined, dimensionsInOriginalOrder: IWidgetDimension[] | undefined, measuresInOriginalOrder: IWidgetMeasure[] | undefined, variables: Map<string, TWidgetVariable>): ISortOrder[];
|
|
1103
1324
|
|
|
1104
1325
|
/**
|
|
1105
1326
|
* Выбрать активный разрез иерархии на основе активных фильтров.
|
|
@@ -1125,6 +1346,18 @@ declare function bindContentsWithIndicators<Output extends ICalculatorIndicatorO
|
|
|
1125
1346
|
|
|
1126
1347
|
declare const escapeSpecialCharacters: (formula: string) => string;
|
|
1127
1348
|
|
|
1349
|
+
/** Удалить из строки символы экранирования */
|
|
1350
|
+
declare function unescapeSpecialCharacters(str: string): string;
|
|
1351
|
+
|
|
1352
|
+
/** Вид переменной для калькулятора */
|
|
1353
|
+
interface ICalculatorVariable {
|
|
1354
|
+
dataType: ESimpleDataType;
|
|
1355
|
+
value: string | string[];
|
|
1356
|
+
}
|
|
1357
|
+
/** Коллекция значений переменных по их имени */
|
|
1358
|
+
interface ICalculatorVariablesValues extends Map<string, ICalculatorVariable> {
|
|
1359
|
+
}
|
|
1360
|
+
|
|
1128
1361
|
interface ICalculatorFactory {
|
|
1129
1362
|
general: () => IGeneralCalculator;
|
|
1130
1363
|
pie: () => IPieCalculator;
|
|
@@ -1145,16 +1378,77 @@ interface IDefinition<WidgetSettings extends IBaseWidgetSettings, GroupSettings
|
|
|
1145
1378
|
getMeasures?(settings: WidgetSettings): IWidgetMeasure[];
|
|
1146
1379
|
}
|
|
1147
1380
|
|
|
1381
|
+
type TContextMenu = (TContextMenuList | TContextMenuButtonGroup) & {
|
|
1382
|
+
event?: MouseEvent;
|
|
1383
|
+
placement?: "topRight" | "topLeft" | "bottomRight" | "bottomLeft";
|
|
1384
|
+
positionOrigin?: "frame" | "workArea";
|
|
1385
|
+
position?: {
|
|
1386
|
+
unitX?: TContextMenuPositionUnit;
|
|
1387
|
+
unitY?: TContextMenuPositionUnit;
|
|
1388
|
+
x?: number;
|
|
1389
|
+
y?: number;
|
|
1390
|
+
};
|
|
1391
|
+
};
|
|
1392
|
+
type TContextMenuPositionUnit = "%" | "px";
|
|
1393
|
+
type TContextMenuList = {
|
|
1394
|
+
type: "list";
|
|
1395
|
+
items: TContextMenuRow[];
|
|
1396
|
+
};
|
|
1397
|
+
type TContextMenuButtonGroup = {
|
|
1398
|
+
type: "buttonGroup";
|
|
1399
|
+
items: TContextMenuButton[];
|
|
1400
|
+
};
|
|
1401
|
+
type TContextMenuRow = {
|
|
1402
|
+
key: string;
|
|
1403
|
+
label: string;
|
|
1404
|
+
onClick: () => void;
|
|
1405
|
+
};
|
|
1406
|
+
type TContextMenuButton = TContextMenuButtonActions | TContextMenuButtonClose | TContextMenuButtonApply | TContextMenuButtonCustom | TContextMenuButtonOptions;
|
|
1407
|
+
type TContextMenuButtonActions = {
|
|
1408
|
+
type: "actions";
|
|
1409
|
+
actions: TActionsOnClick[];
|
|
1410
|
+
onClick: (action: TActionsOnClick) => void;
|
|
1411
|
+
};
|
|
1412
|
+
type TContextMenuButtonClose = {
|
|
1413
|
+
type: "close";
|
|
1414
|
+
onClick?: () => void;
|
|
1415
|
+
};
|
|
1416
|
+
type TContextMenuButtonApply = {
|
|
1417
|
+
type: "apply";
|
|
1418
|
+
onClick: () => void;
|
|
1419
|
+
};
|
|
1420
|
+
type TContextMenuButtonCustom = {
|
|
1421
|
+
key: string;
|
|
1422
|
+
type: "custom";
|
|
1423
|
+
icon: string;
|
|
1424
|
+
onClick: () => void;
|
|
1425
|
+
};
|
|
1426
|
+
type TContextMenuButtonOptions = {
|
|
1427
|
+
key: string;
|
|
1428
|
+
type: "options";
|
|
1429
|
+
icon: string;
|
|
1430
|
+
items: TContextMenuRow[];
|
|
1431
|
+
};
|
|
1432
|
+
|
|
1148
1433
|
type TLaunchActionParams = {
|
|
1149
|
-
action:
|
|
1434
|
+
action: TActionsOnClick;
|
|
1150
1435
|
onSuccess: () => void;
|
|
1151
1436
|
filters: ICalculatorFilter[];
|
|
1152
1437
|
needConfirmation?: boolean;
|
|
1153
1438
|
};
|
|
1439
|
+
interface ILaunchActionSubscribers {
|
|
1440
|
+
onActionSuccess(callback: () => void): void;
|
|
1441
|
+
}
|
|
1154
1442
|
type TWidgetContainer = {
|
|
1155
1443
|
/** Имеет ли контейнер виджета ограниченную максимальную высоту */
|
|
1156
1444
|
isMaxHeightLimited: boolean;
|
|
1445
|
+
/** Установить минимальную высоту рабочей области виджета */
|
|
1446
|
+
setContentMinHeight(value: number): void;
|
|
1157
1447
|
};
|
|
1448
|
+
interface IWidgetPersistValue<T extends object = object> {
|
|
1449
|
+
get(): T | null;
|
|
1450
|
+
set(value: T | null): void;
|
|
1451
|
+
}
|
|
1158
1452
|
interface IWidgetProps<WidgetSettings extends IBaseWidgetSettings = IBaseWidgetSettings> {
|
|
1159
1453
|
/** guid виджета */
|
|
1160
1454
|
guid: string;
|
|
@@ -1175,12 +1469,18 @@ interface IWidgetProps<WidgetSettings extends IBaseWidgetSettings = IBaseWidgetS
|
|
|
1175
1469
|
rootViewContainer: HTMLDivElement;
|
|
1176
1470
|
/** Объект для управления плейсхолдером */
|
|
1177
1471
|
placeholder: IWidgetPlaceholderController;
|
|
1178
|
-
/**
|
|
1472
|
+
/** Объект для получения значений плейсхолдера */
|
|
1473
|
+
placeholderValues: IWidgetPlaceholderValues;
|
|
1474
|
+
/** Контекст виджета */
|
|
1179
1475
|
widgetsContext: IWidgetsContext;
|
|
1180
1476
|
/** Данные о контейнере виджета */
|
|
1181
1477
|
widgetContainer: TWidgetContainer;
|
|
1182
1478
|
/** Запуск действия */
|
|
1183
|
-
launchAction(params: TLaunchActionParams):
|
|
1479
|
+
launchAction(params: TLaunchActionParams): ILaunchActionSubscribers;
|
|
1480
|
+
/** Значение, сохраняемое в localStorage и URL */
|
|
1481
|
+
persistValue: IWidgetPersistValue;
|
|
1482
|
+
/** функция для управления контекстными меню */
|
|
1483
|
+
setContextMenu: (key: string, value: TContextMenu | null) => void;
|
|
1184
1484
|
}
|
|
1185
1485
|
interface ICustomWidgetProps<WidgetSettings extends IBaseWidgetSettings = IBaseWidgetSettings> extends IWidgetProps<WidgetSettings> {
|
|
1186
1486
|
/** @deprecated - нужно использовать из widgetsContext */
|
|
@@ -1336,7 +1636,7 @@ declare const replaceFiltersBySelection: (filters: ICalculatorFilter[], selectio
|
|
|
1336
1636
|
* @param {P} [props] - Дополнительные параметры локализации.
|
|
1337
1637
|
* @returns {string} - Локализованный текст для указанного языка.
|
|
1338
1638
|
*/
|
|
1339
|
-
declare const getLocalizedText: <L extends TLocalizationDescription, P extends ILocalizationProps = TExtractLocalizationParams<L>>(language: ELanguages, locObj: L, props?: P
|
|
1639
|
+
declare const getLocalizedText: <L extends TLocalizationDescription, P extends ILocalizationProps = TExtractLocalizationParams<L>>(language: ELanguages, locObj: L, props?: P) => string;
|
|
1340
1640
|
|
|
1341
1641
|
type TDefineWidgetOptions = {
|
|
1342
1642
|
manifest?: Record<string, unknown>;
|
|
@@ -1352,4 +1652,4 @@ declare global {
|
|
|
1352
1652
|
}
|
|
1353
1653
|
}
|
|
1354
1654
|
|
|
1355
|
-
export { ECalculatorFilterMethods, EColorMode, EControlType, EDbType, EDimensionTemplateNames, EDisplayConditionMode, EDurationUnit, EEventMeasureTemplateNames, EFormatTypes, EFormattingPresets, EFormulaFilterFieldKeys, EIndicatorType, ELastTimeUnit, EMeasureTemplateNames, EProcessFilterNames, ESimpleDataType, ESortDirection, ESortingValueModes, ETransitionMeasureTemplateNames, EWidgetActionInputMode, EWidgetFilterMode, EWidgetIndicatorType, EWidgetIndicatorValueModes, type IActionScript, type IAddDurationOfTransitionFilter, type IAddPresenceOfEventFilter, type IAddPresenceOfTransitionFilter, type IAddRepetitionOfEventFilter, type IBaseDimensionsAndMeasuresCalculator, type IBaseDimensionsAndMeasuresCalculatorInput, type IBaseDimensionsAndMeasuresCalculatorOutput, type IBaseWidgetSettings, type ICalculator, type ICalculatorDimensionInput, type ICalculatorDimensionOutput, type ICalculatorFactory, type ICalculatorFilter, type ICalculatorIndicatorInput, type ICalculatorIndicatorOutput, type ICalculatorMeasureInput, type ICalculatorMeasureOutput, type ICalculatorVariable, type ICalculatorVariablesValues, type ICommonColumnIndicator, type IControlRecord, type ICustomAddButtonProps, type ICustomWidgetProps, type IDefinition, type IDimensionSelection, type IDimensionSelectionByFormula, type IDisplayPredicate, type IDivePanelDescription, type IDividerRecord, type IEdge, type IExportColumnOrder, type IFillSettings, type IFormulaFilterValue, type IGeneralCalculator, type IGeneralCalculatorExportInput, type IGeneralCalculatorInput, type IGeneralCalculatorOutput, type IGraphElement, type IGroupSetDescription, type IGroupSetRecord, type IGroupSettings, type IHistogramBin, type IHistogramCalculator, type IHistogramCalculatorInput, type IHistogramCalculatorOutput, type ILens, type IPanelDescription, type IPanelDescriptionCreator, type IPieCalculator, type IPieCalculatorInput, type IPieCalculatorOutput, type IProcessEventFilterValue, type IProcessEventIndicator, type IProcessGraphCalculator, type IProcessGraphCalculatorInput, type IProcessGraphCalculatorOutput, type IProcessIndicator, type IProcessTransitionFilterValue, type IProcessTransitionIndicator, type IRange, type ISelectOption, type ISortOrder, type ITwoLimitsCalculator, type ITwoLimitsCalculatorExportInput, type ITwoLimitsCalculatorInput, type ITwoLimitsCalculatorOutput, type ITypeCalculator, type ITypeCalculatorInput, type ITypeCalculatorOutput, type IVertex, type IWidget, type
|
|
1655
|
+
export { EActionTypes, ECalculatorFilterMethods, EColorMode, EColorScope, EControlType, ECustomSelectTemplates, EDbType, EDimensionTemplateNames, EDisplayConditionMode, EDrawerPlacement, EDurationUnit, EEventMeasureTemplateNames, EFormatTypes, EFormattingPresets, EFormulaFilterFieldKeys, EIndicatorType, ELastTimeUnit, EMarkdownDisplayMode, EMeasureTemplateNames, EOpenViewMode, EProcessFilterNames, ESelectOptionTypes, ESimpleDataType, ESortDirection, ESortingValueModes, ETransitionMeasureTemplateNames, EViewType, EWidgetActionInputMode, EWidgetFilterMode, EWidgetIndicatorType, EWidgetIndicatorValueModes, type IActionCommon, type IActionGoToUrl, type IActionOpenView, type IActionRunScript, type IActionScript, type IActionScriptField, type IActionUpdateVariable, type IAddButtonSelectOption, type IAddDurationOfTransitionFilter, type IAddPresenceOfEventFilter, type IAddPresenceOfTransitionFilter, type IAddRepetitionOfEventFilter, type IBaseDimensionsAndMeasuresCalculator, type IBaseDimensionsAndMeasuresCalculatorInput, type IBaseDimensionsAndMeasuresCalculatorOutput, type IBaseWidgetSettings, type ICalculator, type ICalculatorDimensionInput, type ICalculatorDimensionOutput, type ICalculatorFactory, type ICalculatorFilter, type ICalculatorIndicatorInput, type ICalculatorIndicatorOutput, type ICalculatorMeasureInput, type ICalculatorMeasureOutput, type ICalculatorVariable, type ICalculatorVariablesValues, type IColoredValue, type ICommonColumnIndicator, type IControlRecord, type ICustomAddButtonProps, type ICustomWidgetProps, type IDefinition, type IDimensionSelection, type IDimensionSelectionByFormula, type IDisplayPredicate, type IDisplayRule, type IDivePanelDescription, type IDividerRecord, type IEdge, type IExportColumnOrder, type IFillSettings, type IFormulaFilterValue, type IGeneralCalculator, type IGeneralCalculatorExportInput, type IGeneralCalculatorInput, type IGeneralCalculatorOutput, type IGraphElement, type IGroupSetDescription, type IGroupSetRecord, type IGroupSettings, type IHistogramBin, type IHistogramCalculator, type IHistogramCalculatorInput, type IHistogramCalculatorOutput, type ILaunchActionSubscribers, type ILens, type IMarkdownMeasure, type IMeasureMenuConfig, type IPanelDescription, type IPanelDescriptionCreator, type IPieCalculator, type IPieCalculatorInput, type IPieCalculatorOutput, type IProcessEventFilterValue, type IProcessEventIndicator, type IProcessGraphCalculator, type IProcessGraphCalculatorInput, type IProcessGraphCalculatorOutput, type IProcessIndicator, type IProcessTransitionFilterValue, type IProcessTransitionIndicator, type IRange, type ISelectBranchOption, type ISelectDividerOption, type ISelectGroupOption, type ISelectLeafOption, type ISelectOption, type ISelectSystemOption, type ISortOrder, type ISortingMenuConfig, type IStagesFilterValue, type ITwoLimitsCalculator, type ITwoLimitsCalculatorExportInput, type ITwoLimitsCalculatorInput, type ITwoLimitsCalculatorOutput, type ITypeCalculator, type ITypeCalculatorInput, type ITypeCalculatorOutput, type IVertex, type IWidget, type IWidgetActionInput, type IWidgetColumnIndicator, type IWidgetDimension, type IWidgetDimensionHierarchy, type IWidgetEntity, type IWidgetFilter, type IWidgetFiltration, type IWidgetFormatting, type IWidgetFormulaFilterValue, type IWidgetIndicator, type IWidgetIndicatorMenuConfig, type IWidgetMeasure, type IWidgetPersistValue, type IWidgetPlaceholderController, type IWidgetPlaceholderValues, type IWidgetProcess, type IWidgetProps, type IWidgetSortingIndicator, type IWidgetTable, type IWidgetTableColumn, type IWidgetsContext, type TActionsOnClick, type TBoundedContentWithIndicator, type TColor, type TColorRule, type TColumnIndicatorValue, type TContextMenu, type TContextMenuButton, type TContextMenuButtonActions, type TContextMenuButtonApply, type TContextMenuButtonClose, type TContextMenuButtonCustom, type TContextMenuButtonGroup, type TContextMenuButtonOptions, type TContextMenuList, type TContextMenuPositionUnit, type TContextMenuRow, type TCustomAddButtonSelectOption, type TDefineWidgetOptions, type TDisplayCondition, type TDisplayMode, type TEmptyRecord, type TFiltrationMode, type TGroupLevelRecord, type TLaunchActionParams, type TMeasureAddButtonSelectOption, type TProcessIndicatorValue, type TRecordAccessor, type TSelectChildOptions, type TSelectFetchOptions, type TSelectivePartial, type TSortDirection, type TUpdateSelection, type TValuePath, type TWidgetActionCommonInputValue, type TWidgetActionInputValue, type TWidgetContainer, type TWidgetFilterValue, type TWidgetFiltering, type TWidgetLevelRecord, type TWidgetSortingValue, type TWidgetSortingValueRelatedWidgetDimension, type TWidgetSortingValueRelatedWidgetIndicator, type TWidgetSortingValueRelatedWidgetMeasure, type TWidgetVariable, bindContentWithIndicator, bindContentsWithIndicators, checkDisplayCondition, dimensionTemplateFormulas, escapeSpecialCharacters, eventMeasureTemplateFormulas, fillTemplateString, formulaFilterMethods, generateColumnFormula, getDimensionFormula, getDisplayConditionFormula, getEventMeasureFormula, getLocalizedText, getMeasureFormula, getTransitionMeasureFormula, isActionValid, isHierarchy, mapDimensionsToInputs, mapEventMeasuresToInputs, mapFormulaFilterToCalculatorInput, mapFormulaFiltersToInputs, mapMeasuresToInputs, mapSortingToInputs, mapTransitionMeasuresToInputs, measureTemplateFormulas, prepareValuesForSql, replaceDisplayCondition, replaceFiltersBySelection, replaceHierarchiesWithDimensions, selectDimensionFromHierarchy, transitionMeasureTemplateFormulas, unescapeSpecialCharacters, updateDefaultModeSelection, updateMultiModeSelection, updateSingleModeSelection };
|