@infomaximum/widget-sdk 5.10.0 → 5.11.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 CHANGED
@@ -6,59 +6,6 @@ type TNullable<T> = T | null | undefined;
6
6
  type valueof<T> = T[keyof T];
7
7
  type StringKeyOf<T> = Exclude<keyof T, number | symbol>;
8
8
 
9
- declare enum EUnitMode {
10
- PIXEL = "PIXEL",
11
- PERCENT = "PERCENT"
12
- }
13
- declare enum EControlType {
14
- inputNumber = "inputNumber",
15
- switch = "switch",
16
- input = "input",
17
- formattingTemplate = "formattingTemplate",
18
- radioIconGroup = "radioIconGroup",
19
- select = "select",
20
- tagSet = "tagSet",
21
- formula = "formula",
22
- typedFormula = "typedFormula",
23
- inputRange = "inputRange",
24
- colorPicker = "colorPicker",
25
- displayCondition = "displayCondition",
26
- eventsColor = "eventsColor",
27
- inputMarkdown = "inputMarkdown",
28
- filter = "filter",
29
- actionOnClick = "actionOnClick",
30
- eventsPicker = "eventsPicker",
31
- size = "size",
32
- formatting = "formatting"
33
- }
34
- /** Конфигурация элемента управления настройкой */
35
- interface IControlRecord<Settings extends object, Value, ControlType = EControlType> {
36
- /** Ключ, должен быть уникальным в рамках одного уровня вложенности */
37
- key: string;
38
- /** Локализация заголовка */
39
- title?: string;
40
- /** Тип используемого элемента управления из предложенных системой */
41
- type: ControlType | string;
42
- /** Кастомный верхний отступ */
43
- marginTop?: number;
44
- /** Объект дополнительных параметров элемента управления */
45
- props?: object | ((settings: Settings) => object);
46
- /** Описание доступа к значению настройки */
47
- accessor: TRecordAccessor<Settings, Value>;
48
- /**
49
- * Рекурсивное определение мета-описания, в элемент управления будет передана функция dive
50
- * для перехода в указанное мета-описание.
51
- *
52
- * Возможность работает только для элемента управления EControlType.tagSet.
53
- */
54
- description?: IDivePanelDescription<Settings>;
55
- /**
56
- * Предикат, позволяющий скрыть элемент управления.
57
- * Предоставлен для удобства разработки. Скрыть элемент можно и условно добавляя его в мета-описание.
58
- */
59
- shouldDisplay?: IDisplayPredicate<Settings>;
60
- }
61
-
62
9
  interface ICalculator<Input, Output> {
63
10
  /** Запрос к вычислителю */
64
11
  calculate(input: Input): Promise<Output>;
@@ -156,7 +103,8 @@ declare enum EFormatTypes {
156
103
  /** Неделя */
157
104
  WEEK = "WEEK",
158
105
  /** Логический */
159
- BOOLEAN = "BOOLEAN"
106
+ BOOLEAN = "BOOLEAN",
107
+ PERCENT = "PERCENT"
160
108
  }
161
109
  declare enum EFormattingPresets {
162
110
  "AUTO" = "AUTO",
@@ -275,6 +223,7 @@ declare const formattingConfig: {
275
223
  WEEK: never[];
276
224
  YEAR: never[];
277
225
  BOOLEAN: never[];
226
+ PERCENT: EFormattingPresets[];
278
227
  };
279
228
  };
280
229
 
@@ -508,6 +457,302 @@ interface IAppearanceDisabledSettings {
508
457
  }
509
458
  type TAppearanceSettings = IAppearanceEnabledSettings | IAppearanceDisabledSettings;
510
459
 
460
+ declare enum ESortDirection {
461
+ descend = "DESC",
462
+ ascend = "ASC",
463
+ ASC = "ascend",
464
+ DESC = "descend"
465
+ }
466
+ type TSortDirection = ESortDirection.ascend | ESortDirection.descend;
467
+ interface ISortOrder {
468
+ /** Формула сортировки */
469
+ formula: string;
470
+ /** Тип данных формулы */
471
+ dbDataType: TNullable<string>;
472
+ /** Направление сортировки */
473
+ direction: TSortDirection;
474
+ /** Условие применения сортировки */
475
+ displayCondition?: TNullable<string>;
476
+ }
477
+ type TWidgetSortingValue = {
478
+ mode: ESortingValueModes.FORMULA;
479
+ formula: string;
480
+ dbDataType: string;
481
+ } | {
482
+ mode: ESortingValueModes.IN_WIDGET;
483
+ group: string;
484
+ index: number;
485
+ };
486
+
487
+ declare enum EWidgetIndicatorType {
488
+ MEASURE = "MEASURE",
489
+ EVENT_INDICATOR = "EVENT_INDICATOR",
490
+ TRANSITION_INDICATOR = "TRANSITION_INDICATOR",
491
+ DIMENSION = "DIMENSION",
492
+ SORTING = "SORTING"
493
+ }
494
+ declare enum EOuterAggregation {
495
+ avg = "avg",
496
+ median = "median",
497
+ count = "count",
498
+ countDistinct = "countDistinct",
499
+ min = "min",
500
+ max = "max",
501
+ sum = "sum",
502
+ top = "top"
503
+ }
504
+ interface IWidgetIndicator extends IAutoIdentifiedArrayItem {
505
+ name: string;
506
+ }
507
+ type TProcessIndicatorValue = {
508
+ mode: EWidgetIndicatorValueModes.FORMULA;
509
+ formula: string;
510
+ } | {
511
+ mode: EWidgetIndicatorValueModes.TEMPLATE;
512
+ /** Имя шаблонной формулы, использующей колонку таблицы */
513
+ templateName: string;
514
+ };
515
+ interface IProcessIndicator extends IWidgetIndicator {
516
+ value?: TProcessIndicatorValue;
517
+ dbDataType?: string;
518
+ format?: EFormatTypes;
519
+ formatting?: EFormattingPresets;
520
+ formattingTemplate?: string;
521
+ displayCondition?: TDisplayCondition;
522
+ }
523
+ interface IProcessEventIndicator extends IProcessIndicator {
524
+ }
525
+ interface IProcessTransitionIndicator extends IProcessIndicator {
526
+ }
527
+ /** Индикатор для сортировки */
528
+ interface IWidgetSortingIndicator extends IWidgetIndicator {
529
+ direction: TSortDirection;
530
+ value: TWidgetSortingValue;
531
+ }
532
+ /** Режимы значения показателя (на основе чего генерируется формула) */
533
+ declare enum EWidgetIndicatorValueModes {
534
+ /** Готовая формула (как правило, введенная пользователем через редактор формул) */
535
+ FORMULA = "FORMULA",
536
+ /** Шаблон формулы, предоставляемый системой */
537
+ TEMPLATE = "TEMPLATE",
538
+ AGGREGATION = "AGGREGATION",
539
+ DURATION = "DURATION",
540
+ CONVERSION = "CONVERSION",
541
+ START_TIME = "START_TIME",
542
+ END_TIME = "END_TIME"
543
+ }
544
+ /** Режимы сортировки (на что ссылается сортировка) */
545
+ declare enum ESortingValueModes {
546
+ /** Сортировка по формуле */
547
+ FORMULA = "FORMULA",
548
+ /** Сортировка по показателю(разрезу или мере) виджета */
549
+ IN_WIDGET = "IN_WIDGET"
550
+ }
551
+ interface ICommonState {
552
+ name: string;
553
+ /** @deprecated */
554
+ guid: string;
555
+ }
556
+ interface ICommonMeasures {
557
+ name: string;
558
+ /** @deprecated */
559
+ guid: string;
560
+ formula: string;
561
+ }
562
+ interface ICommonDimensions {
563
+ name: string;
564
+ formula: string;
565
+ }
566
+ type TColumnIndicatorValue = {
567
+ mode: EWidgetIndicatorValueModes.FORMULA;
568
+ formula?: string;
569
+ } | {
570
+ mode: EWidgetIndicatorValueModes.TEMPLATE;
571
+ /** Имя шаблонной формулы, использующей колонку таблицы */
572
+ templateName?: string;
573
+ /** Имя таблицы */
574
+ tableName?: string;
575
+ /** Имя колонки */
576
+ columnName?: string;
577
+ };
578
+ /** Общий интерфейс разреза и меры */
579
+ interface IWidgetColumnIndicator extends IWidgetIndicator {
580
+ dbDataType?: string;
581
+ format?: EFormatTypes;
582
+ formatting?: EFormattingPresets;
583
+ formattingTemplate?: string;
584
+ displayCondition?: TDisplayCondition;
585
+ onClick?: TActionsOnClick[];
586
+ }
587
+ interface IWidgetDimensionHierarchy<D extends IWidgetDimension = IWidgetDimension> extends IAutoIdentifiedArrayItem {
588
+ name: string;
589
+ hierarchyDimensions: D[];
590
+ displayCondition?: TDisplayCondition;
591
+ }
592
+ interface IWidgetDimension extends Omit<IWidgetColumnIndicator, "value"> {
593
+ value?: TColumnIndicatorValue | (TWidgetIndicatorAggregationValue & {
594
+ innerTemplateName?: string;
595
+ }) | TWidgetIndicatorTimeValue;
596
+ hideEmptyValues: boolean;
597
+ }
598
+ interface IWidgetMeasure extends Omit<IWidgetColumnIndicator, "value"> {
599
+ value?: TColumnIndicatorValue | (TWidgetIndicatorAggregationValue & {
600
+ outerAggregation: EOuterAggregation;
601
+ }) | TWidgetIndicatorConversionValue | TWidgetIndicatorDurationValue;
602
+ }
603
+ interface IMarkdownMeasure extends IWidgetMeasure {
604
+ format: EFormatTypes;
605
+ displaySign: EMarkdownDisplayMode;
606
+ }
607
+ /** Тип показателя */
608
+ declare enum EIndicatorType {
609
+ /** Показатели процесса */
610
+ PROCESS_MEASURE = "PROCESS_MEASURE",
611
+ /** Вводимое значение */
612
+ STATIC = "STATIC",
613
+ /** Статический список */
614
+ STATIC_LIST = "STATIC_LIST",
615
+ /** Динамический список */
616
+ DYNAMIC_LIST = "DYNAMIC_LIST",
617
+ /** Список колонок */
618
+ COLUMN_LIST = "COLUMN_LIST",
619
+ /** Разрез */
620
+ DIMENSION = "DIMENSION",
621
+ /** Мера */
622
+ MEASURE = "MEASURE",
623
+ /** Иерархия */
624
+ DYNAMIC_DIMENSION = "DYNAMIC_DIMENSION",
625
+ /** Пользовательская сортировка */
626
+ USER_SORTING = "USER_SORTING"
627
+ }
628
+ interface IBaseWidgetVariable {
629
+ /** Имя переменной */
630
+ name: string;
631
+ /** @deprecated */
632
+ guid: string;
633
+ }
634
+ /** Обобщенные типы значений переменных */
635
+ declare enum ESimpleInputType {
636
+ /** Число (точность Float64) */
637
+ NUMBER = "FLOAT",
638
+ /** Целое число (точность Int64) */
639
+ INTEGER_NUMBER = "INTEGER",
640
+ /** Текст */
641
+ TEXT = "STRING",
642
+ /** Дата (точность Date) */
643
+ DATE = "DATE",
644
+ /** Дата и время (точность DateTime64) */
645
+ DATE_AND_TIME = "DATETIME"
646
+ }
647
+ interface IWidgetStaticVariable extends IBaseWidgetVariable {
648
+ /** Тип переменной */
649
+ type: EIndicatorType.STATIC;
650
+ /** Значение */
651
+ value: string;
652
+ /** Обобщенный тип данных */
653
+ simpleInputType: ESimpleInputType;
654
+ }
655
+ interface IStaticListLabeledOption {
656
+ value: string;
657
+ label: string;
658
+ }
659
+ interface IWidgetStaticListVariable extends IBaseWidgetVariable {
660
+ /** Тип переменной */
661
+ type: EIndicatorType.STATIC_LIST;
662
+ /** Значение */
663
+ value: string | string[];
664
+ /** Элементы статического списка */
665
+ /** @deprecated поле будет удалено, необходимо использовать labeledOptions */
666
+ options: string[];
667
+ /** Объект ключ значение для статического списка */
668
+ labeledOptions: IStaticListLabeledOption[];
669
+ /** Множественный выбор */
670
+ multipleChoice: boolean;
671
+ }
672
+ interface IWidgetDynamicListVariable extends IBaseWidgetVariable {
673
+ /** Тип переменной */
674
+ type: EIndicatorType.DYNAMIC_LIST;
675
+ /** Значение */
676
+ value: string | string[];
677
+ /** Формула для отображения списка */
678
+ listFormula: TNullable<string>;
679
+ /** Тип данных */
680
+ dbDataType: string;
681
+ /** Множественный выбор */
682
+ multipleChoice: boolean;
683
+ /** Фильтры */
684
+ filters: TExtendedFormulaFilterValue[];
685
+ }
686
+ interface IWidgetColumnListVariable extends IBaseWidgetVariable {
687
+ /** Тип переменной */
688
+ type: EIndicatorType.COLUMN_LIST;
689
+ /** Имя таблицы */
690
+ tableName: string;
691
+ /** Значение (имя колонки) */
692
+ value: string;
693
+ }
694
+ type TWidgetVariable = IWidgetStaticVariable | IWidgetStaticListVariable | IWidgetDynamicListVariable | IWidgetColumnListVariable;
695
+ declare function isDimensionsHierarchy(indicator: IWidgetColumnIndicator): indicator is IWidgetDimensionHierarchy;
696
+ declare enum OuterAggregation {
697
+ avg = "avgIf",
698
+ median = "medianIf",
699
+ count = "countIf",
700
+ countDistinct = "countIfDistinct",
701
+ min = "minIf",
702
+ max = "maxIf",
703
+ sum = "sumIf"
704
+ }
705
+ declare enum EDurationTemplateName {
706
+ avg = "avg",
707
+ median = "median"
708
+ }
709
+ type TWidgetIndicatorAggregationValue = {
710
+ mode: EWidgetIndicatorValueModes.AGGREGATION;
711
+ templateName: string;
712
+ processName: string | null;
713
+ eventName: string | null;
714
+ caseCaseIdFormula: string | null;
715
+ eventNameFormula: string | null;
716
+ filters: TExtendedFormulaFilterValue[];
717
+ tableName?: string;
718
+ columnName?: string;
719
+ eventTimeFormula?: string | null;
720
+ };
721
+ declare enum EEventAppearances {
722
+ FIRST = "FIRST",
723
+ LAST = "LAST"
724
+ }
725
+ type TWidgetIndicatorConversionValue = {
726
+ mode: EWidgetIndicatorValueModes.CONVERSION;
727
+ startEventNameFormula: string | null;
728
+ startEventProcessName: string | null;
729
+ startEventName: string | null;
730
+ startEventFilters: TExtendedFormulaFilterValue[];
731
+ startEventTimeFormula: string | null;
732
+ endEventNameFormula: string | null;
733
+ endEventProcessName: string | null;
734
+ endEventName: string | null;
735
+ endEventFilters: TExtendedFormulaFilterValue[];
736
+ endCaseCaseIdFormula: string | null;
737
+ endEventTimeFormula: string | null;
738
+ };
739
+ type TWidgetIndicatorDurationValue = {
740
+ mode: EWidgetIndicatorValueModes.DURATION;
741
+ templateName: string;
742
+ startEventAppearances: EEventAppearances;
743
+ endEventAppearances: EEventAppearances;
744
+ } & Omit<TWidgetIndicatorConversionValue, "mode">;
745
+ type TWidgetIndicatorTimeValue = {
746
+ templateName: string;
747
+ mode: EWidgetIndicatorValueModes.START_TIME | EWidgetIndicatorValueModes.END_TIME;
748
+ processName: string;
749
+ eventName: string;
750
+ eventTimeFormula: string;
751
+ caseCaseIdFormula: string;
752
+ eventNameFormula: string;
753
+ filters: TExtendedFormulaFilterValue[];
754
+ };
755
+
511
756
  interface IWidgetTableColumn {
512
757
  /** Имя колонки */
513
758
  name: string;
@@ -834,300 +1079,377 @@ declare enum EActionButtonsTypes {
834
1079
  SECONDARY = "primary-outlined"
835
1080
  }
836
1081
 
837
- declare enum ESortDirection {
838
- descend = "DESC",
839
- ascend = "ASC",
840
- ASC = "ascend",
841
- DESC = "descend"
1082
+ declare enum ESimpleDataType {
1083
+ OTHER = "OTHER",
1084
+ DATE = "DATE",
1085
+ FLOAT = "FLOAT",
1086
+ DATETIME = "DATETIME",
1087
+ STRING = "STRING",
1088
+ INTEGER = "INTEGER",
1089
+ DATETIME64 = "DATETIME64",
1090
+ BOOLEAN = "BOOLEAN"
842
1091
  }
843
- type TSortDirection = ESortDirection.ascend | ESortDirection.descend;
844
- interface ISortOrder {
845
- /** Формула сортировки */
846
- formula: string;
847
- /** Тип данных формулы */
848
- dbDataType: TNullable<string>;
849
- /** Направление сортировки */
850
- direction: TSortDirection;
851
- /** Условие применения сортировки */
852
- displayCondition?: TNullable<string>;
1092
+ type TDbTypeContainer = "Array" | "Nullable";
1093
+ /** Результат разбора типа данных из базы данных (в будущем возможна поддержка других СУБД помимо ClickHouse) */
1094
+ interface IParsedDbType<T extends TNullable<string> = string> {
1095
+ /** Контейнеры над базовым типом в порядке от внешнего к внутреннему */
1096
+ containers: TDbTypeContainer[];
1097
+ /** Исходный базовый тип (без контейнеров) */
1098
+ dbBaseDataType: T;
1099
+ /** Обобщенный базовый тип */
1100
+ simpleBaseType: ESimpleDataType;
1101
+ /** Обобщенный исходный тип (при наличии контейнера `Array` классифицируется как `OTHER`) */
1102
+ simpleType: ESimpleDataType;
853
1103
  }
854
- type TWidgetSortingValue = {
855
- mode: ESortingValueModes.FORMULA;
856
- formula: string;
857
- dbDataType: string;
858
- } | {
859
- mode: ESortingValueModes.IN_WIDGET;
860
- group: string;
861
- index: number;
862
- };
863
1104
 
864
- declare enum EWidgetIndicatorType {
865
- MEASURE = "MEASURE",
866
- EVENT_INDICATOR = "EVENT_INDICATOR",
867
- TRANSITION_INDICATOR = "TRANSITION_INDICATOR",
868
- DIMENSION = "DIMENSION",
869
- SORTING = "SORTING"
870
- }
871
- declare enum EOuterAggregation {
872
- avg = "avg",
873
- median = "median",
874
- count = "count",
875
- countDistinct = "countDistinct",
876
- min = "min",
877
- max = "max",
878
- sum = "sum"
879
- }
880
- interface IWidgetIndicator extends IAutoIdentifiedArrayItem {
881
- name: string;
882
- }
883
- type TProcessIndicatorValue = {
884
- mode: EWidgetIndicatorValueModes.FORMULA;
885
- formula: string;
886
- } | {
887
- mode: EWidgetIndicatorValueModes.TEMPLATE;
888
- /** Имя шаблонной формулы, использующей колонку таблицы */
889
- templateName: string;
1105
+ declare enum EControlType {
1106
+ /** Ввод текста */
1107
+ input = "input",
1108
+ /** Ввод текста в формате markdown */
1109
+ inputMarkdown = "inputMarkdown",
1110
+ /** Ввод числа */
1111
+ inputNumber = "inputNumber",
1112
+ /** Выбор диапазона чисел */
1113
+ inputRange = "inputRange",
1114
+ /** Ввод размера (число + единица измерения) */
1115
+ size = "size",
1116
+ /** Выбор boolean значения через переключатель */
1117
+ switch = "switch",
1118
+ /** Выбор варианта из выпадающего списка */
1119
+ select = "select",
1120
+ /** Выбор одного из вариантов, представленных через иконки */
1121
+ radioIconGroup = "radioIconGroup",
1122
+ /** Ввод значения показателя */
1123
+ formula = "formula",
1124
+ /** Ввод формулы и ее типа */
1125
+ typedFormula = "typedFormula",
1126
+ /** Выбор настроек форматирования */
1127
+ formatting = "formatting",
1128
+ /** Ввод шаблона форматирования */
1129
+ formattingTemplate = "formattingTemplate",
1130
+ /** Выбор действий по клику */
1131
+ actionOnClick = "actionOnClick",
1132
+ /** Ввод фильтров */
1133
+ filter = "filter",
1134
+ /** Ввод условия отображения */
1135
+ displayCondition = "displayCondition",
1136
+ /** Ввод цвета */
1137
+ colorPicker = "colorPicker",
1138
+ /** Отображение тегов с возможностью "провалиться" внутрь */
1139
+ tagSet = "tagSet",
1140
+ /** Множественный выбор событий процесса */
1141
+ eventsPicker = "eventsPicker",
1142
+ /**
1143
+ * @deprecated используется только для виджета "Маршруты", будет перенесено на уровень виджета.
1144
+ * Ввод цветов для событий процесса.
1145
+ */
1146
+ eventsColor = "eventsColor"
1147
+ }
1148
+ type ControlsMap = {
1149
+ [EControlType.input]: IInputControl;
1150
+ [EControlType.inputMarkdown]: IInputMarkdownControl;
1151
+ [EControlType.inputNumber]: IInputNumberControl;
1152
+ [EControlType.inputRange]: IInputRangeControl;
1153
+ [EControlType.size]: ISizeControl;
1154
+ [EControlType.switch]: ISwitchControl;
1155
+ [EControlType.select]: ISelectControl;
1156
+ [EControlType.radioIconGroup]: IRadioIconGroupControl;
1157
+ [EControlType.formula]: IFormulaControl;
1158
+ [EControlType.typedFormula]: ITypedFormulaControl;
1159
+ [EControlType.formatting]: IFormattingControl;
1160
+ [EControlType.formattingTemplate]: IFormattingTemplateControl;
1161
+ [EControlType.actionOnClick]: IActionOnClickControl;
1162
+ [EControlType.filter]: IFilterControl;
1163
+ [EControlType.displayCondition]: IDisplayConditionControl;
1164
+ [EControlType.colorPicker]: IColorPickerControl;
1165
+ [EControlType.tagSet]: ITagSetControl;
1166
+ [EControlType.eventsPicker]: IEventsPickerControl;
1167
+ [EControlType.eventsColor]: IEventsColorControl;
890
1168
  };
891
- interface IProcessIndicator extends IWidgetIndicator {
892
- value?: TProcessIndicatorValue;
893
- dbDataType?: string;
894
- format?: EFormatTypes;
895
- formatting?: EFormattingPresets;
896
- formattingTemplate?: string;
897
- displayCondition?: TDisplayCondition;
898
- }
899
- interface IProcessEventIndicator extends IProcessIndicator {
900
- }
901
- interface IProcessTransitionIndicator extends IProcessIndicator {
902
- }
903
- /** Индикатор для сортировки */
904
- interface IWidgetSortingIndicator extends IWidgetIndicator {
905
- direction: TSortDirection;
906
- value: TWidgetSortingValue;
907
- }
908
- /** Режимы значения показателя (на основе чего генерируется формула) */
909
- declare enum EWidgetIndicatorValueModes {
910
- /** Готовая формула (как правило, введенная пользователем через редактор формул) */
911
- FORMULA = "FORMULA",
912
- /** Шаблон формулы, предоставляемый системой */
913
- TEMPLATE = "TEMPLATE",
914
- AGGREGATION = "AGGREGATION",
915
- DURATION = "DURATION",
916
- CONVERSION = "CONVERSION",
917
- START_TIME = "START_TIME",
918
- END_TIME = "END_TIME"
919
- }
920
- /** Режимы сортировки (на что ссылается сортировка) */
921
- declare enum ESortingValueModes {
922
- /** Сортировка по формуле */
923
- FORMULA = "FORMULA",
924
- /** Сортировка по показателю(разрезу или мере) виджета */
925
- IN_WIDGET = "IN_WIDGET"
1169
+ type TControlUnion<Settings extends object> = {
1170
+ [K in keyof ControlsMap]: IControlRecord<Settings, ControlsMap[K]>;
1171
+ }[keyof ControlsMap];
1172
+ type TControlConstraint = {
1173
+ type: string;
1174
+ value: unknown;
1175
+ props: object;
1176
+ };
1177
+ /** Конфигурация элемента управления настройкой */
1178
+ interface IControlRecord<Settings extends object, T extends TControlConstraint = TControlConstraint> {
1179
+ /** Ключ, должен быть уникальным в рамках одного уровня вложенности */
1180
+ key: string;
1181
+ /** Локализация заголовка */
1182
+ title?: string;
1183
+ /** Тип используемого элемента управления из предложенных системой */
1184
+ type: T["type"];
1185
+ /** Кастомный верхний отступ */
1186
+ marginTop?: number;
1187
+ /** Объект дополнительных параметров элемента управления */
1188
+ props?: T["props"] | ((settings: Settings) => T["props"]);
1189
+ /** Описание доступа к значению настройки */
1190
+ accessor: TRecordAccessor<Settings, T["value"]>;
1191
+ /**
1192
+ * Рекурсивное определение мета-описания, в элемент управления будет передана функция dive
1193
+ * для перехода в указанное мета-описание.
1194
+ *
1195
+ * Возможность работает только для элемента управления EControlType.tagSet.
1196
+ */
1197
+ description?: T["type"] extends EControlType.tagSet ? IDivePanelDescription<Settings> : never;
1198
+ /**
1199
+ * Предикат, позволяющий скрыть элемент управления.
1200
+ * Предоставлен для удобства разработки. Скрыть элемент можно и условно добавляя его в мета-описание.
1201
+ */
1202
+ shouldDisplay?: IDisplayPredicate<Settings>;
926
1203
  }
927
- interface ICommonState {
928
- name: string;
929
- /** @deprecated */
930
- guid: string;
1204
+ interface IInputControl {
1205
+ type: EControlType.input;
1206
+ value: string;
1207
+ props: {
1208
+ isBordered?: boolean;
1209
+ placeholder?: string;
1210
+ /** Максимальное количество символов которое можно ввести в поле */
1211
+ maxLength?: number;
1212
+ onFocus?: (e: FocusEvent) => void;
1213
+ /** Обрабатывать ли изменения по onBlur */
1214
+ isChangeOnBlur?: boolean;
1215
+ /** Использовать ли уменьшенный размер заголовка */
1216
+ isSmallTitle?: boolean;
1217
+ disabled?: boolean;
1218
+ };
931
1219
  }
932
- interface ICommonMeasures {
933
- name: string;
934
- /** @deprecated */
935
- guid: string;
936
- formula: string;
1220
+ interface IInputMarkdownControl {
1221
+ type: EControlType.inputMarkdown;
1222
+ value: string;
1223
+ props: {};
1224
+ }
1225
+ interface IInputNumberControl {
1226
+ type: EControlType.inputNumber;
1227
+ value: number | null;
1228
+ props: {
1229
+ min?: number;
1230
+ max?: number;
1231
+ /**
1232
+ * Число, на которое увеличивается или уменьшается текущее значение при нажатии на стрелку.
1233
+ * Это может быть целое или десятичное число.
1234
+ */
1235
+ step?: number;
1236
+ placeholder?: string;
1237
+ /**
1238
+ * Текстовая метка, которая отображает любую контекстную информацию о поле, например,
1239
+ * единицы измерения.
1240
+ */
1241
+ unitLabel?: string;
1242
+ isClearable?: boolean;
1243
+ disabled?: boolean;
1244
+ };
937
1245
  }
938
- interface ICommonDimensions {
939
- name: string;
940
- formula: string;
1246
+ interface IInputRangeControl {
1247
+ type: EControlType.inputRange;
1248
+ value: IRange;
1249
+ props: {
1250
+ min?: number;
1251
+ max?: number;
1252
+ units?: {
1253
+ key: string;
1254
+ label: string;
1255
+ }[];
1256
+ prepareValue?: (value: [number?, number?]) => [number?, number?];
1257
+ disabled?: boolean;
1258
+ };
941
1259
  }
942
- type TColumnIndicatorValue = {
943
- mode: EWidgetIndicatorValueModes.FORMULA;
944
- formula?: string;
945
- } | {
946
- mode: EWidgetIndicatorValueModes.TEMPLATE;
947
- /** Имя шаблонной формулы, использующей колонку таблицы */
948
- templateName?: string;
949
- /** Имя таблицы */
950
- tableName?: string;
951
- /** Имя колонки */
952
- columnName?: string;
953
- };
954
- /** Общий интерфейс разреза и меры */
955
- interface IWidgetColumnIndicator extends IWidgetIndicator {
956
- dbDataType?: string;
957
- format?: EFormatTypes;
958
- formatting?: EFormattingPresets;
959
- formattingTemplate?: string;
960
- displayCondition?: TDisplayCondition;
961
- onClick?: TActionsOnClick[];
1260
+ declare enum EUnitMode {
1261
+ PIXEL = "PIXEL",
1262
+ PERCENT = "PERCENT"
962
1263
  }
963
- interface IWidgetDimensionHierarchy<D extends IWidgetDimension = IWidgetDimension> extends IAutoIdentifiedArrayItem {
964
- name: string;
965
- hierarchyDimensions: D[];
966
- displayCondition?: TDisplayCondition;
1264
+ interface ISizeControl {
1265
+ type: EControlType.size;
1266
+ value: {
1267
+ value: number | null;
1268
+ mode: EUnitMode;
1269
+ };
1270
+ props: {
1271
+ placeholder?: string;
1272
+ disabled?: boolean;
1273
+ isClearable?: boolean;
1274
+ minMaxByMode?: {
1275
+ [EUnitMode.PIXEL]: {
1276
+ min?: number;
1277
+ max?: number;
1278
+ };
1279
+ [EUnitMode.PERCENT]: {
1280
+ min?: number;
1281
+ max?: number;
1282
+ };
1283
+ };
1284
+ };
967
1285
  }
968
- interface IWidgetDimension extends Omit<IWidgetColumnIndicator, "value"> {
969
- value?: TColumnIndicatorValue | (TWidgetIndicatorAggregationValue & {
970
- innerTemplateName?: string;
971
- }) | TWidgetIndicatorTimeValue;
972
- hideEmptyValues: boolean;
1286
+ interface ISwitchControl {
1287
+ type: EControlType.switch;
1288
+ value: boolean;
1289
+ props: {
1290
+ size?: "small" | "default";
1291
+ };
973
1292
  }
974
- interface IWidgetMeasure extends Omit<IWidgetColumnIndicator, "value"> {
975
- value?: TColumnIndicatorValue | (TWidgetIndicatorAggregationValue & {
976
- outerAggregation: EOuterAggregation;
977
- }) | TWidgetIndicatorConversionValue | TWidgetIndicatorDurationValue;
1293
+ interface ISelectControl {
1294
+ type: EControlType.select;
1295
+ value: TNullable<string>;
1296
+ props: {
1297
+ fetchOptions?: (searchText?: string) => Promise<ISelectOption[] | {
1298
+ isAllRequested: boolean;
1299
+ options: ISelectOption[];
1300
+ }>;
1301
+ options?: ISelectOption[];
1302
+ withSearch?: boolean;
1303
+ error?: string;
1304
+ allowClear?: boolean;
1305
+ size?: "small" | "default";
1306
+ placeholder?: string;
1307
+ disabled?: boolean;
1308
+ status?: "error" | "warning";
1309
+ };
978
1310
  }
979
- interface IMarkdownMeasure extends IWidgetMeasure {
980
- format: EFormatTypes;
981
- displaySign: EMarkdownDisplayMode;
1311
+ interface IRadioIconGroupControl<Icon = string> {
1312
+ type: EControlType.radioIconGroup;
1313
+ value: string;
1314
+ props: {
1315
+ options: {
1316
+ value: string;
1317
+ /** Иконка */
1318
+ label: Icon;
1319
+ disabled?: boolean;
1320
+ }[];
1321
+ };
982
1322
  }
983
- /** Тип показателя */
984
- declare enum EIndicatorType {
985
- /** Показатели процесса */
986
- PROCESS_MEASURE = "PROCESS_MEASURE",
987
- /** Вводимое значение */
988
- STATIC = "STATIC",
989
- /** Статический список */
990
- STATIC_LIST = "STATIC_LIST",
991
- /** Динамический список */
992
- DYNAMIC_LIST = "DYNAMIC_LIST",
993
- /** Список колонок */
994
- COLUMN_LIST = "COLUMN_LIST",
995
- /** Разрез */
996
- DIMENSION = "DIMENSION",
997
- /** Мера */
998
- MEASURE = "MEASURE",
999
- /** Иерархия */
1000
- DYNAMIC_DIMENSION = "DYNAMIC_DIMENSION",
1001
- /** Пользовательская сортировка */
1002
- USER_SORTING = "USER_SORTING"
1323
+ interface IFormulaControl {
1324
+ type: EControlType.formula;
1325
+ value: {
1326
+ value: TColumnIndicatorValue | (TWidgetIndicatorAggregationValue & {
1327
+ outerAggregation: EOuterAggregation;
1328
+ }) | (TWidgetIndicatorAggregationValue & {
1329
+ innerTemplateName?: string;
1330
+ }) | TWidgetIndicatorConversionValue | TWidgetIndicatorDurationValue | TWidgetIndicatorTimeValue;
1331
+ dbDataType: string | undefined;
1332
+ };
1333
+ props: {
1334
+ showModeToggle?: boolean;
1335
+ indicatorConfig?: ({
1336
+ type: "measure";
1337
+ } & {
1338
+ /** @deprecated временное решение для виджета "Воронка", не следует использовать [BI-14710] */
1339
+ allowClear?: boolean;
1340
+ /** @deprecated временное решение для виджета "Воронка", не следует использовать [BI-14710] */
1341
+ placeholder?: string;
1342
+ /** @deprecated временное решение для виджета "Воронка", не следует использовать [BI-14710] */
1343
+ hideQuantityOption?: boolean;
1344
+ /** @deprecated временное решение для виджета "Воронка", не следует использовать [BI-14710] */
1345
+ options?: TMeasureAddButtonSelectOption[];
1346
+ }) | {
1347
+ type: "dimension";
1348
+ };
1349
+ disabled?: boolean;
1350
+ titleModal?: string;
1351
+ };
1003
1352
  }
1004
- interface IBaseWidgetVariable {
1005
- /** Имя переменной */
1006
- name: string;
1007
- /** @deprecated */
1008
- guid: string;
1353
+ interface ITypedFormulaControl {
1354
+ type: EControlType.typedFormula;
1355
+ value: {
1356
+ formula: string;
1357
+ dbDataType: string;
1358
+ };
1359
+ props: {
1360
+ disabled?: boolean;
1361
+ titleModal?: string;
1362
+ };
1009
1363
  }
1010
- /** Обобщенные типы значений переменных */
1011
- declare enum ESimpleInputType {
1012
- /** Число (точность Float64) */
1013
- NUMBER = "FLOAT",
1014
- /** Целое число (точность Int64) */
1015
- INTEGER_NUMBER = "INTEGER",
1016
- /** Текст */
1017
- TEXT = "STRING",
1018
- /** Дата (точность Date) */
1019
- DATE = "DATE",
1020
- /** Дата и время (точность DateTime64) */
1021
- DATE_AND_TIME = "DATETIME"
1364
+ interface IFormattingControl {
1365
+ type: EControlType.formatting;
1366
+ value: {
1367
+ format: EFormatTypes;
1368
+ formatting: EFormattingPresets;
1369
+ formattingTemplate?: string;
1370
+ };
1371
+ props: {
1372
+ formats?: Partial<Record<ESimpleDataType, EFormatTypes[]>>;
1373
+ formatting?: Partial<Record<EFormatTypes, EFormattingPresets[]>>;
1374
+ dbDataType: TNullable<string>;
1375
+ };
1022
1376
  }
1023
- interface IWidgetStaticVariable extends IBaseWidgetVariable {
1024
- /** Тип переменной */
1025
- type: EIndicatorType.STATIC;
1026
- /** Значение */
1377
+ interface IFormattingTemplateControl {
1378
+ type: EControlType.formattingTemplate;
1027
1379
  value: string;
1028
- /** Обобщенный тип данных */
1029
- simpleInputType: ESimpleInputType;
1380
+ props: {
1381
+ /** Используемый формат (влияет на контент подсказки) */
1382
+ format?: TNullable<EFormatTypes>;
1383
+ };
1030
1384
  }
1031
- interface IStaticListLabeledOption {
1032
- value: string;
1033
- label: string;
1385
+ interface IActionOnClickControl {
1386
+ type: EControlType.actionOnClick;
1387
+ value: TActionsOnClick[];
1388
+ props: {
1389
+ indicator: {
1390
+ name: string;
1391
+ onClick?: TActionsOnClick[];
1392
+ };
1393
+ placeholder?: string;
1394
+ inputMethods: EWidgetActionInputMethod[];
1395
+ };
1034
1396
  }
1035
- interface IWidgetStaticListVariable extends IBaseWidgetVariable {
1036
- /** Тип переменной */
1037
- type: EIndicatorType.STATIC_LIST;
1038
- /** Значение */
1039
- value: string | string[];
1040
- /** Элементы статического списка */
1041
- /** @deprecated поле будет удалено, необходимо использовать labeledOptions */
1042
- options: string[];
1043
- /** Объект ключ значение для статического списка */
1044
- labeledOptions: IStaticListLabeledOption[];
1045
- /** Множественный выбор */
1046
- multipleChoice: boolean;
1397
+ interface IFilterControl {
1398
+ type: EControlType.filter;
1399
+ value: TExtendedFormulaFilterValue[];
1400
+ props: {
1401
+ buttonTitle?: string;
1402
+ };
1047
1403
  }
1048
- interface IWidgetDynamicListVariable extends IBaseWidgetVariable {
1049
- /** Тип переменной */
1050
- type: EIndicatorType.DYNAMIC_LIST;
1051
- /** Значение */
1052
- value: string | string[];
1053
- /** Формула для отображения списка */
1054
- listFormula: TNullable<string>;
1055
- /** Тип данных */
1056
- dbDataType: string;
1057
- /** Множественный выбор */
1058
- multipleChoice: boolean;
1059
- /** Фильтры */
1060
- filters: TExtendedFormulaFilterValue[];
1404
+ interface IDisplayConditionControl {
1405
+ type: EControlType.displayCondition;
1406
+ value: TDisplayCondition;
1407
+ props: {
1408
+ isInMeasure?: boolean;
1409
+ labelFontSize?: number;
1410
+ };
1061
1411
  }
1062
- interface IWidgetColumnListVariable extends IBaseWidgetVariable {
1063
- /** Тип переменной */
1064
- type: EIndicatorType.COLUMN_LIST;
1065
- /** Имя таблицы */
1066
- tableName: string;
1067
- /** Значение (имя колонки) */
1068
- value: string;
1412
+ interface IColorPickerControl {
1413
+ type: EControlType.colorPicker;
1414
+ value: TColor | undefined;
1415
+ props: {
1416
+ ruleModes?: EColorMode[];
1417
+ modes?: EColorMode[];
1418
+ /** Цвет по умолчанию для режима BASE при переключении с другого режима */
1419
+ defaultColor?: string;
1420
+ dimension?: IWidgetDimension;
1421
+ };
1069
1422
  }
1070
- type TWidgetVariable = IWidgetStaticVariable | IWidgetStaticListVariable | IWidgetDynamicListVariable | IWidgetColumnListVariable;
1071
- declare function isDimensionsHierarchy(indicator: IWidgetColumnIndicator): indicator is IWidgetDimensionHierarchy;
1072
- declare enum OuterAggregation {
1073
- avg = "avgIf",
1074
- median = "medianIf",
1075
- count = "countIf",
1076
- countDistinct = "countIfDistinct",
1077
- min = "minIf",
1078
- max = "maxIf",
1079
- sum = "sumIf"
1423
+ interface ITagSetControl {
1424
+ type: EControlType.tagSet;
1425
+ value: string[];
1426
+ props: {
1427
+ placeholder?: string;
1428
+ isError?: boolean;
1429
+ };
1080
1430
  }
1081
- declare enum EDurationTemplateName {
1082
- avg = "avg",
1083
- median = "median"
1431
+ interface IEventsPickerControl {
1432
+ type: EControlType.eventsPicker;
1433
+ value: (string | null)[];
1434
+ props: {
1435
+ process: IWidgetProcess | undefined;
1436
+ withPercentageSelection?: boolean;
1437
+ };
1084
1438
  }
1085
- type TWidgetIndicatorAggregationValue = {
1086
- mode: EWidgetIndicatorValueModes.AGGREGATION;
1087
- templateName: string;
1088
- processName: string | null;
1089
- eventName: string | null;
1090
- caseCaseIdFormula: string | null;
1091
- eventNameFormula: string | null;
1092
- filters: TExtendedFormulaFilterValue[];
1093
- tableName?: string;
1094
- columnName?: string;
1095
- eventTimeFormula?: string | null;
1096
- };
1097
- declare enum EEventAppearances {
1098
- FIRST = "FIRST",
1099
- LAST = "LAST"
1439
+ interface IEventsColorControl {
1440
+ type: EControlType.eventsColor;
1441
+ value: {
1442
+ defaultColor: string;
1443
+ values: Record<string, {
1444
+ mode: EColorMode;
1445
+ value: string;
1446
+ }>;
1447
+ };
1448
+ props: Omit<IColorPickerControl["props"], "defaultColor"> & {
1449
+ defaultColor?: ((eventName: string) => string) | string;
1450
+ processName: string;
1451
+ };
1100
1452
  }
1101
- type TWidgetIndicatorConversionValue = {
1102
- mode: EWidgetIndicatorValueModes.CONVERSION;
1103
- startEventNameFormula: string | null;
1104
- startEventProcessName: string | null;
1105
- startEventName: string | null;
1106
- startEventFilters: TExtendedFormulaFilterValue[];
1107
- startEventTimeFormula: string | null;
1108
- endEventNameFormula: string | null;
1109
- endEventProcessName: string | null;
1110
- endEventName: string | null;
1111
- endEventFilters: TExtendedFormulaFilterValue[];
1112
- endCaseCaseIdFormula: string | null;
1113
- endEventTimeFormula: string | null;
1114
- };
1115
- type TWidgetIndicatorDurationValue = {
1116
- mode: EWidgetIndicatorValueModes.DURATION;
1117
- templateName: string;
1118
- startEventAppearances: EEventAppearances;
1119
- endEventAppearances: EEventAppearances;
1120
- } & Omit<TWidgetIndicatorConversionValue, "mode">;
1121
- type TWidgetIndicatorTimeValue = {
1122
- templateName: string;
1123
- mode: EWidgetIndicatorValueModes.START_TIME | EWidgetIndicatorValueModes.END_TIME;
1124
- processName: string;
1125
- eventName: string;
1126
- eventTimeFormula: string;
1127
- caseCaseIdFormula: string;
1128
- eventNameFormula: string;
1129
- filters: TExtendedFormulaFilterValue[];
1130
- };
1131
1453
 
1132
1454
  /** Формат входного параметра GeneralCalculator */
1133
1455
  interface IBaseDimensionsAndMeasuresCalculatorInput {
@@ -1301,29 +1623,6 @@ interface ITypeCalculatorOutput {
1301
1623
  interface ITypeCalculator extends ICalculator<ITypeCalculatorInput, ITypeCalculatorOutput> {
1302
1624
  }
1303
1625
 
1304
- declare enum ESimpleDataType {
1305
- OTHER = "OTHER",
1306
- DATE = "DATE",
1307
- FLOAT = "FLOAT",
1308
- DATETIME = "DATETIME",
1309
- STRING = "STRING",
1310
- INTEGER = "INTEGER",
1311
- DATETIME64 = "DATETIME64",
1312
- BOOLEAN = "BOOLEAN"
1313
- }
1314
- type TDbTypeContainer = "Array" | "Nullable";
1315
- /** Результат разбора типа данных из базы данных (в будущем возможна поддержка других СУБД помимо ClickHouse) */
1316
- interface IParsedDbType<T extends TNullable<string> = string> {
1317
- /** Контейнеры над базовым типом в порядке от внешнего к внутреннему */
1318
- containers: TDbTypeContainer[];
1319
- /** Исходный базовый тип (без контейнеров) */
1320
- dbBaseDataType: T;
1321
- /** Обобщенный базовый тип */
1322
- simpleBaseType: ESimpleDataType;
1323
- /** Обобщенный исходный тип (при наличии контейнера `Array` классифицируется как `OTHER`) */
1324
- simpleType: ESimpleDataType;
1325
- }
1326
-
1327
1626
  declare const prepareValuesForSql: (simpleType: ESimpleDataType, values: (string | null)[]) => (string | null)[];
1328
1627
 
1329
1628
  declare function checkDisplayCondition(displayCondition: TNullable<TDisplayCondition>, variables: Map<string, TWidgetVariable>): boolean;
@@ -1535,7 +1834,20 @@ declare enum EMeasureAggregationTemplateName {
1535
1834
  countReworks = "countReworks"
1536
1835
  }
1537
1836
  /** Шаблоны процессных метрик меры с режимом AGGREGATION */
1538
- declare const measureAggregationTemplates: Record<EMeasureAggregationTemplateName, string>;
1837
+ declare const measureAggregationTemplates: {
1838
+ agvIf: string;
1839
+ medianIf: string;
1840
+ countIf: string;
1841
+ countIfDistinct: string;
1842
+ minIf: string;
1843
+ maxIf: string;
1844
+ sumIf: string;
1845
+ top: (outerAggregation: EOuterAggregation) => string;
1846
+ firstValue: (outerAggregation: EOuterAggregation) => string;
1847
+ lastValue: (outerAggregation: EOuterAggregation) => string;
1848
+ countExecutions: string;
1849
+ countReworks: string;
1850
+ };
1539
1851
  /** На основе значения режима AGGREGATION подготовить параметры для подстановки в шаблонную формулу */
1540
1852
  declare const prepareMeasureAggregationParams: (value: Extract<IWidgetMeasure["value"], {
1541
1853
  mode: EWidgetIndicatorValueModes.AGGREGATION;
@@ -1551,7 +1863,7 @@ declare const prepareMeasureAggregationParams: (value: Extract<IWidgetMeasure["v
1551
1863
  } | null;
1552
1864
 
1553
1865
  /** Шаблон процессной метрики меры с режимом CONVERSION */
1554
- declare const conversionTemplate = "countIf(\n process(\n minIf(\n {startEventTimeFormula}, \n {startEventNameFormula} = '{startEventName}'{startEventFilters}\n ), \n {endCaseCaseIdFormula}\n ) < \n process(\n maxIf(\n {endEventTimeFormula}, \n {endEventNameFormula} = '{endEventName}'{endEventFilters}\n ), \n {endCaseCaseIdFormula}\n ) \n and \n process(\n countIf(\n {startEventNameFormula} = '{startEventName}'{startEventFilters}\n ) != 0, \n {endCaseCaseIdFormula}\n ) != 0\n) * 100 / countIf(\n process(\n countIf(\n {startEventNameFormula} = '{startEventName}'{startEventFilters}\n ) != 0, \n {endCaseCaseIdFormula}\n ) != 0\n)";
1866
+ declare const conversionTemplate = "countIf(\n process(\n minIf(\n {startEventTimeFormula}, \n {startEventNameFormula} = '{startEventName}'{startEventFilters}\n ), \n {endCaseCaseIdFormula}\n ) < \n process(\n maxIf(\n {endEventTimeFormula}, \n {endEventNameFormula} = '{endEventName}'{endEventFilters}\n ), \n {endCaseCaseIdFormula}\n ) \n and \n process(\n countIf(\n {startEventNameFormula} = '{startEventName}'{startEventFilters}\n ) != 0, \n {endCaseCaseIdFormula}\n ) != 0\n) / countIf(\n process(\n countIf(\n {startEventNameFormula} = '{startEventName}'{startEventFilters}\n ) != 0, \n {endCaseCaseIdFormula}\n ) != 0\n)";
1555
1867
  /** На основе значения режима CONVERSION подготовить параметры для подстановки в шаблонную формулу */
1556
1868
  declare const prepareConversionParams: (value: TWidgetIndicatorConversionValue) => {
1557
1869
  objectFilters: string;
@@ -1637,8 +1949,16 @@ interface ILens<T extends TNullable<object>, Value> {
1637
1949
  get(obj: T): TNullable<Value>;
1638
1950
  set(obj: T, value: Value): void;
1639
1951
  }
1952
+ /**
1953
+ * Линза, которая может вернуть Partial значение из get (будет обработано на стороне control'а),
1954
+ * но требует передачи в set полного значения
1955
+ */
1956
+ interface IPartialLens<T extends TNullable<object>, Value> {
1957
+ get(obj: T): TNullable<Partial<Value>>;
1958
+ set(obj: T, value: Value): void;
1959
+ }
1640
1960
  type TValuePath = string | string[];
1641
- type TRecordAccessor<Settings extends object, Value> = TValuePath | ILens<Settings, Value>;
1961
+ type TRecordAccessor<Settings extends object, Value> = TValuePath | IPartialLens<Settings, Value>;
1642
1962
  interface IDisplayPredicate<Settings> {
1643
1963
  (s: Settings): boolean;
1644
1964
  }
@@ -1656,13 +1976,14 @@ interface IGroupSetRecord {
1656
1976
  interface ICollapseRecord<Settings extends object = object> {
1657
1977
  key: string;
1658
1978
  type: "collapse";
1979
+ title?: string;
1659
1980
  records: TGroupLevelRecord<Settings>[];
1660
1981
  }
1661
1982
  type TEmptyRecord = boolean | null | undefined;
1662
1983
  /** Набор конфигураций, которые могут встречаться на уровне виджета */
1663
- type TWidgetLevelRecord<Settings extends object> = IControlRecord<Settings, any, EControlType> | IDividerRecord<Settings> | IGroupSetRecord | ICollapseRecord<Settings> | TEmptyRecord;
1984
+ type TWidgetLevelRecord<Settings extends object> = ICollapseRecord<Settings> | IDividerRecord<Settings> | IGroupSetRecord | TControlUnion<Settings> | TEmptyRecord;
1664
1985
  /** Набор конфигураций, которые могут встречаться на уровне группы */
1665
- type TGroupLevelRecord<LevelGroupSettings extends object> = IControlRecord<LevelGroupSettings, any, EControlType> | IDividerRecord<LevelGroupSettings> | ICollapseRecord<LevelGroupSettings> | TEmptyRecord;
1986
+ type TGroupLevelRecord<LevelGroupSettings extends object> = ICollapseRecord<LevelGroupSettings> | IDividerRecord<LevelGroupSettings> | TControlUnion<LevelGroupSettings> | TEmptyRecord;
1666
1987
  interface ISelectOption {
1667
1988
  value: string;
1668
1989
  label: string;
@@ -1774,7 +2095,7 @@ interface IGroupSetDescription<Settings extends object, GroupSettings extends ob
1774
2095
  /** Максимальное количество групп в наборе */
1775
2096
  maxCount: number;
1776
2097
  /** Описание доступа к настройкам групп */
1777
- accessor: TRecordAccessor<Settings, GroupSettings[]>;
2098
+ accessor: TValuePath | ILens<Settings, GroupSettings[]>;
1778
2099
  /** Конфигурация кнопок добавления группы в набор */
1779
2100
  addButtons: TAddButton[];
1780
2101
  /** Получить название, отображаемое на плашке (по умолчанию используется поле name из группы) */
@@ -2230,4 +2551,4 @@ declare global {
2230
2551
  }
2231
2552
  }
2232
2553
 
2233
- export { EActionButtonsTypes, EActionTypes, EAutoUpdateMode, EBlockingConditionMode, ECalculatorFilterMethods, EClickHouseBaseTypes, EColorMode, EControlType, ECustomSelectTemplates, EDimensionAggregationTemplateName, EDimensionTemplateNames, EDisplayConditionMode, EDrawerPlacement, EDurationTemplateName, EDurationUnit, EEventAppearances, EEventMeasureTemplateNames, EFontWeight, EFormatTypes, EFormattingPresets, EFormulaFilterFieldKeys, EIndicatorType, ELastTimeUnit, EMarkdownDisplayMode, EMeasureAggregationTemplateName, EMeasureTemplateNames, EOuterAggregation, EProcessFilterNames, ESelectOptionTypes, ESimpleDataType, ESimpleInputType, ESortDirection, ESortingValueModes, ESystemRecordKey, ETransitionMeasureTemplateNames, EUnitMode, EViewMode, EViewOpenIn, EWidgetActionInputMethod, EWidgetFilterMode, EWidgetIndicatorType, EWidgetIndicatorValueModes, type IActionGoToUrl, type IActionRunScript, type IActionScript, type IActionUpdateVariable, type IAddButtonSelectOption, type IAddDurationOfTransitionFilter, type IAddPresenceOfEventFilter, type IAddPresenceOfTransitionFilter, type IAddRepetitionOfEventFilter, type IAutoIdentifiedArrayItem, 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 ICollapseRecord, type IColoredValue, type ICommonDimensions, type ICommonMeasures, type ICommonState, 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 IGlobalContext, type IGraphElement, type IGroupSetDescription, type IGroupSetRecord, type IGroupSettings, type IHistogramBin, type IHistogramCalculator, type IHistogramCalculatorInput, type IHistogramCalculatorOutput, type IIndicatorLink, type IInitialSettings, type ILens, type IMarkdownMeasure, type IMeasureAddButtonProps, type IPanelDescription, type IPanelDescriptionCreator, type IPieCalculator, type IPieCalculatorInput, type IPieCalculatorOutput, type IProcessEventFilterValue, type IProcessEventIndicator, type IProcessFilterPreviewParams, type IProcessGraphCalculator, type IProcessGraphCalculatorInput, type IProcessGraphCalculatorOutput, type IProcessIndicator, type IProcessTransitionFilterValue, type IProcessTransitionIndicator, type IRange, type ISelectBranchOption, type ISelectDividerOption, type ISelectGroupOption, type ISelectLeafOption, type ISelectNode, type ISelectOption, type ISelectSystemOption, type ISettingsMigratorParams, type ISortOrder, type ISortingAddButtonProps, type IStagesFilterValue, type IStaticListLabeledOption, type ITwoLimitsCalculator, type ITwoLimitsCalculatorExportInput, type ITwoLimitsCalculatorInput, type ITwoLimitsCalculatorOutput, type ITypeCalculator, type ITypeCalculatorInput, type ITypeCalculatorOutput, type ITypeCalculatorOutputItem, type IVertex, type IViewContext, type IWidget, type IWidgetAction, type IWidgetColumnIndicator, type IWidgetColumnListVariable, type IWidgetDimension, type IWidgetDimensionHierarchy, type IWidgetDynamicListVariable, type IWidgetEntity, type IWidgetFilter, type IWidgetFiltration, type IWidgetFormatting, type IWidgetIndicator, type IWidgetIndicatorAddButtonProps, type IWidgetManifest, type IWidgetMeasure, type IWidgetMigrator, type IWidgetPersistValue, type IWidgetPlaceholderController, type IWidgetPlaceholderValues, type IWidgetPresetSettings, type IWidgetProcess, type IWidgetProps, type IWidgetSortingIndicator, type IWidgetStaticListVariable, type IWidgetStaticVariable, type IWidgetStruct, type IWidgetTable, type IWidgetTableColumn, OuterAggregation, type TAction, type TActionOnClickParameter, type TActionOpenView, type TActionValidator, type TActionsOnClick, type TAddButton, type TAppearanceSettings, type TBoundedContentWithIndicator, type TColor, type TColorBase, 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 TExtendedFormulaFilterValue, type TFiltrationAccessibility, type TGroupLevelRecord, type TLaunchActionParams, type TMeasureAddButtonSelectOption, type TMigrateProcessor, type TMigrationStruct, type TProcessIndicatorValue, type TRecordAccessor, type TSelectChildOptions, type TSelectFetchNodes, type TSelectivePartial, type TSortDirection, type TUpdateSelection, type TValuePath, type TVersion, type TWidgetActionParameter, type TWidgetContainer, type TWidgetDimensionData, type TWidgetFilterValue, type TWidgetFiltering, type TWidgetIndicatorAggregationValue, type TWidgetIndicatorConversionValue, type TWidgetIndicatorData, type TWidgetIndicatorDurationValue, type TWidgetIndicatorTimeValue, type TWidgetLevelRecord, type TWidgetSortingValue, type TWidgetVariable, bindContentWithIndicator, bindContentsWithIndicators, checkDisplayCondition, clearMultiLineComments, clearSingleLineComments, colors, conversionTemplate, convertFiltersToFormula, convertToFormulasChain, countExecutionsTemplate, dashboardLinkRegExp, dimensionAggregationTemplates, dimensionTemplateFormulas, durationTemplates, escapeSpecialCharacters, eventMeasureTemplateFormulas, fillTemplateString, formattingConfig, formulaFilterMethods, generateColumnFormula, getColorByIndex, getDefaultSortOrders, getDimensionFormula, getDisplayConditionFormula, getEventMeasureFormula, getLocalizedText, getMeasureFormula, getRuleColor, getTransitionMeasureFormula, isDimensionsHierarchy, isFormulaFilterValue, isValidColor, linkNameRegExp, mapDimensionsToInputs, mapEventMeasuresToInputs, mapFormulaFilterToCalculatorInput, mapFormulaFiltersToInputs, mapMeasuresToInputs, mapSortingToInputs, mapTransitionMeasuresToInputs, measureAggregationTemplates, measureTemplateFormulas, parseClickHouseType, parseIndicatorLink, prepareConversionParams, prepareDimensionAggregationParams, prepareDurationParams, prepareFormulaForSql, prepareMeasureAggregationParams, prepareSortOrders, prepareTimeParams, prepareValuesForSql, replaceDisplayCondition, replaceFiltersBySelection, replaceHierarchiesWithDimensions, selectDimensionFromHierarchy, timeTemplates, transitionMeasureTemplateFormulas, unescapeSpecialCharacters, updateDefaultModeSelection, updateMultiModeSelection, updateSingleModeSelection, workspaceLinkRegExp };
2554
+ export { EActionButtonsTypes, EActionTypes, EAutoUpdateMode, EBlockingConditionMode, ECalculatorFilterMethods, EClickHouseBaseTypes, EColorMode, EControlType, ECustomSelectTemplates, EDimensionAggregationTemplateName, EDimensionTemplateNames, EDisplayConditionMode, EDrawerPlacement, EDurationTemplateName, EDurationUnit, EEventAppearances, EEventMeasureTemplateNames, EFontWeight, EFormatTypes, EFormattingPresets, EFormulaFilterFieldKeys, EIndicatorType, ELastTimeUnit, EMarkdownDisplayMode, EMeasureAggregationTemplateName, EMeasureTemplateNames, EOuterAggregation, EProcessFilterNames, ESelectOptionTypes, ESimpleDataType, ESimpleInputType, ESortDirection, ESortingValueModes, ESystemRecordKey, ETransitionMeasureTemplateNames, EUnitMode, EViewMode, EViewOpenIn, EWidgetActionInputMethod, EWidgetFilterMode, EWidgetIndicatorType, EWidgetIndicatorValueModes, type IActionGoToUrl, type IActionOnClickControl, type IActionRunScript, type IActionScript, type IActionUpdateVariable, type IAddButtonSelectOption, type IAddDurationOfTransitionFilter, type IAddPresenceOfEventFilter, type IAddPresenceOfTransitionFilter, type IAddRepetitionOfEventFilter, type IAutoIdentifiedArrayItem, 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 ICollapseRecord, type IColorPickerControl, type IColoredValue, type ICommonDimensions, type ICommonMeasures, type ICommonState, type IControlRecord, type ICustomAddButtonProps, type ICustomWidgetProps, type IDefinition, type IDimensionSelection, type IDimensionSelectionByFormula, type IDisplayConditionControl, type IDisplayPredicate, type IDisplayRule, type IDivePanelDescription, type IDividerRecord, type IEdge, type IEventsColorControl, type IEventsPickerControl, type IExportColumnOrder, type IFillSettings, type IFilterControl, type IFormattingControl, type IFormattingTemplateControl, type IFormulaControl, type IFormulaFilterValue, type IGeneralCalculator, type IGeneralCalculatorExportInput, type IGeneralCalculatorInput, type IGeneralCalculatorOutput, type IGlobalContext, type IGraphElement, type IGroupSetDescription, type IGroupSetRecord, type IGroupSettings, type IHistogramBin, type IHistogramCalculator, type IHistogramCalculatorInput, type IHistogramCalculatorOutput, type IIndicatorLink, type IInitialSettings, type IInputControl, type IInputMarkdownControl, type IInputNumberControl, type IInputRangeControl, type ILens, type IMarkdownMeasure, type IMeasureAddButtonProps, type IPanelDescription, type IPanelDescriptionCreator, type IPieCalculator, type IPieCalculatorInput, type IPieCalculatorOutput, type IProcessEventFilterValue, type IProcessEventIndicator, type IProcessFilterPreviewParams, type IProcessGraphCalculator, type IProcessGraphCalculatorInput, type IProcessGraphCalculatorOutput, type IProcessIndicator, type IProcessTransitionFilterValue, type IProcessTransitionIndicator, type IRadioIconGroupControl, type IRange, type ISelectBranchOption, type ISelectControl, type ISelectDividerOption, type ISelectGroupOption, type ISelectLeafOption, type ISelectNode, type ISelectOption, type ISelectSystemOption, type ISettingsMigratorParams, type ISizeControl, type ISortOrder, type ISortingAddButtonProps, type IStagesFilterValue, type IStaticListLabeledOption, type ISwitchControl, type ITagSetControl, type ITwoLimitsCalculator, type ITwoLimitsCalculatorExportInput, type ITwoLimitsCalculatorInput, type ITwoLimitsCalculatorOutput, type ITypeCalculator, type ITypeCalculatorInput, type ITypeCalculatorOutput, type ITypeCalculatorOutputItem, type ITypedFormulaControl, type IVertex, type IViewContext, type IWidget, type IWidgetAction, type IWidgetColumnIndicator, type IWidgetColumnListVariable, type IWidgetDimension, type IWidgetDimensionHierarchy, type IWidgetDynamicListVariable, type IWidgetEntity, type IWidgetFilter, type IWidgetFiltration, type IWidgetFormatting, type IWidgetIndicator, type IWidgetIndicatorAddButtonProps, type IWidgetManifest, type IWidgetMeasure, type IWidgetMigrator, type IWidgetPersistValue, type IWidgetPlaceholderController, type IWidgetPlaceholderValues, type IWidgetPresetSettings, type IWidgetProcess, type IWidgetProps, type IWidgetSortingIndicator, type IWidgetStaticListVariable, type IWidgetStaticVariable, type IWidgetStruct, type IWidgetTable, type IWidgetTableColumn, OuterAggregation, type TAction, type TActionOnClickParameter, type TActionOpenView, type TActionValidator, type TActionsOnClick, type TAddButton, type TAppearanceSettings, type TBoundedContentWithIndicator, type TColor, type TColorBase, 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 TControlUnion, type TCustomAddButtonSelectOption, type TDefineWidgetOptions, type TDisplayCondition, type TDisplayMode, type TEmptyRecord, type TExtendedFormulaFilterValue, type TFiltrationAccessibility, type TGroupLevelRecord, type TLaunchActionParams, type TMeasureAddButtonSelectOption, type TMigrateProcessor, type TMigrationStruct, type TProcessIndicatorValue, type TRecordAccessor, type TSelectChildOptions, type TSelectFetchNodes, type TSelectivePartial, type TSortDirection, type TUpdateSelection, type TValuePath, type TVersion, type TWidgetActionParameter, type TWidgetContainer, type TWidgetDimensionData, type TWidgetFilterValue, type TWidgetFiltering, type TWidgetIndicatorAggregationValue, type TWidgetIndicatorConversionValue, type TWidgetIndicatorData, type TWidgetIndicatorDurationValue, type TWidgetIndicatorTimeValue, type TWidgetLevelRecord, type TWidgetSortingValue, type TWidgetVariable, bindContentWithIndicator, bindContentsWithIndicators, checkDisplayCondition, clearMultiLineComments, clearSingleLineComments, colors, conversionTemplate, convertFiltersToFormula, convertToFormulasChain, countExecutionsTemplate, dashboardLinkRegExp, dimensionAggregationTemplates, dimensionTemplateFormulas, durationTemplates, escapeSpecialCharacters, eventMeasureTemplateFormulas, fillTemplateString, formattingConfig, formulaFilterMethods, generateColumnFormula, getColorByIndex, getDefaultSortOrders, getDimensionFormula, getDisplayConditionFormula, getEventMeasureFormula, getLocalizedText, getMeasureFormula, getRuleColor, getTransitionMeasureFormula, isDimensionsHierarchy, isFormulaFilterValue, isValidColor, linkNameRegExp, mapDimensionsToInputs, mapEventMeasuresToInputs, mapFormulaFilterToCalculatorInput, mapFormulaFiltersToInputs, mapMeasuresToInputs, mapSortingToInputs, mapTransitionMeasuresToInputs, measureAggregationTemplates, measureTemplateFormulas, parseClickHouseType, parseIndicatorLink, prepareConversionParams, prepareDimensionAggregationParams, prepareDurationParams, prepareFormulaForSql, prepareMeasureAggregationParams, prepareSortOrders, prepareTimeParams, prepareValuesForSql, replaceDisplayCondition, replaceFiltersBySelection, replaceHierarchiesWithDimensions, selectDimensionFromHierarchy, timeTemplates, transitionMeasureTemplateFormulas, unescapeSpecialCharacters, updateDefaultModeSelection, updateMultiModeSelection, updateSingleModeSelection, workspaceLinkRegExp };