@infomaximum/widget-sdk 4.13.0 → 5.0.0-beta10

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/README.md CHANGED
@@ -11,6 +11,6 @@
11
11
  | Версия `widget-sdk` | Версия системы |
12
12
  | ------------------- | -------------- |
13
13
  | 3.x.x | 2401 - 2407 |
14
- | 4.x.x | 2408 - latest |
15
-
14
+ | 4.x.x | 2408 - 2410 |
15
+ | 5.x.x | 2411 - latest |
16
16
  ---
package/dist/index.d.ts CHANGED
@@ -6,17 +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 ESimpleDataType {
10
- OTHER = "OTHER",
11
- DATE = "DATE",
12
- FLOAT = "FLOAT",
13
- DATETIME = "DATETIME",
14
- STRING = "STRING",
15
- INTEGER = "INTEGER",
16
- DATETIME64 = "DATETIME64",
17
- BOOLEAN = "BOOLEAN"
18
- }
19
-
20
9
  declare enum EUnitMode {
21
10
  PIXEL = "PIXEL",
22
11
  PERCENT = "PERCENT"
@@ -82,9 +71,9 @@ interface ICalculatorIndicatorInput {
82
71
  /**
83
72
  * Информация о типе данных:
84
73
  * - Если тип не передан, не производится дополнительной обработки формулы.
85
- * - Если передан тип "OTHER", формула дополнительно будет обернута в toString().
74
+ * - Если передан тип, соответствующий "OTHER", формула дополнительно будет обернута в toString().
86
75
  */
87
- dataType?: ESimpleDataType;
76
+ dbDataType?: string;
88
77
  displayConditionFormula?: TNullable<string>;
89
78
  }
90
79
  interface ICalculatorIndicatorOutput {
@@ -125,8 +114,8 @@ declare enum ECalculatorFilterMethods {
125
114
  interface ICalculatorFilter {
126
115
  /** Формула фильтра */
127
116
  formula: string;
128
- /** Тип данных для формулы фильтра */
129
- dataType: ESimpleDataType;
117
+ /** Тип данных для formula и values */
118
+ dbDataType: string;
130
119
  /** Значения фильтра */
131
120
  values: (null | string)[];
132
121
  /** Метод фильтрации */
@@ -260,7 +249,7 @@ interface IWidgetFormatting {
260
249
  getFormattedValue: (value: string, formatType: EFormatTypes, formatting: EFormattingPresets, formatTemplate: TNullable<string>) => string;
261
250
  }
262
251
  declare const formattingConfig: {
263
- readonly availableFormatsByDataType: {
252
+ readonly availableFormatsBySimpleType: {
264
253
  OTHER: EFormatTypes[];
265
254
  STRING: EFormatTypes[];
266
255
  FLOAT: EFormatTypes[];
@@ -388,7 +377,7 @@ interface IFormulaFilterValue {
388
377
  /** Формула */
389
378
  formula: string;
390
379
  /** Тип данных формулы */
391
- dataType: ESimpleDataType;
380
+ dbDataType: string;
392
381
  /** Формат */
393
382
  format: EFormatTypes;
394
383
  /** Метод фильтрации */
@@ -427,7 +416,7 @@ interface IStagesFilterValue {
427
416
  /** Этапы */
428
417
  stages: IStagesFilterItem[];
429
418
  }
430
- type TWidgetFilterValue = IFormulaFilterValue | IStagesFilterValue | IProcessEventFilterValue | IProcessTransitionFilterValue;
419
+ type TWidgetFilterValue = TExtendedFormulaFilterValue | IStagesFilterValue | IProcessEventFilterValue | IProcessTransitionFilterValue;
431
420
  interface IWidgetFilter {
432
421
  /** Значение фильтра */
433
422
  filterValue: TWidgetFilterValue;
@@ -514,13 +503,12 @@ interface IWidgetTableColumn {
514
503
  /** Имя колонки */
515
504
  name: string;
516
505
  /** Тип данных колонки */
517
- dataType: ESimpleDataType;
506
+ dbDataType: string;
518
507
  }
519
508
  interface IScriptField {
520
509
  /** @deprecated */
521
510
  guid: string;
522
511
  name: string;
523
- dataType: ESimpleDataType;
524
512
  isRequired: boolean;
525
513
  }
526
514
  interface IActionScript {
@@ -579,9 +567,9 @@ interface IGlobalContext {
579
567
  /** Пользовательские переменные уровня отчета */
580
568
  variables: Map<string, TWidgetVariable>;
581
569
  /** Метод установки значения пользовательской переменной уровня отчета */
582
- setVariableValue(name: string, value: TNullable<string> | string[]): void;
583
- /** Системные переменные */
584
- systemVariables: Map<string, TSystemVariable>;
570
+ setVariableValue(name: string, value: TWidgetVariable["value"]): TWidgetVariable["value"];
571
+ /** Метод очистки значения пользовательской переменной уровня отчета */
572
+ unsetVariableValue(name: string): TWidgetVariable["value"];
585
573
  /** Состояния(название сущности) отчета */
586
574
  states: Map<string, ICommonState>;
587
575
  /** Процессы из модели данных */
@@ -676,8 +664,6 @@ interface IBaseWidgetSettings {
676
664
  ignoreFilters?: boolean;
677
665
  sorting?: IWidgetSortingIndicator[];
678
666
  actions?: IWidgetAction[];
679
- displayCondition?: TDisplayCondition;
680
- displayConditionComment?: string;
681
667
  appearance?: TAppearanceSettings;
682
668
  }
683
669
 
@@ -830,13 +816,6 @@ interface IWidgetAction extends IActionCommon {
830
816
  }
831
817
  type TAction = TActionsOnClick | IWidgetAction;
832
818
  type TActionValidator = (action: TAction) => boolean;
833
- /**
834
- * @deprecated Функция может работать некорректно и будет удалена в будущих версиях.
835
- * Необходимо использовать {@link IWidgetProps.actionValidator }.
836
- */
837
- declare const isExecuteScriptActionValid: (action: Extract<TAction, {
838
- type: EActionTypes.EXECUTE_SCRIPT;
839
- }>, { scripts, tables, variables, systemVariables, }: Pick<IGlobalContext, "scripts" | "tables" | "variables" | "systemVariables">) => boolean;
840
819
  declare enum EActionButtonsTypes {
841
820
  LINK = "link",
842
821
  BASE = "primary",
@@ -851,15 +830,19 @@ declare enum ESortDirection {
851
830
  }
852
831
  type TSortDirection = ESortDirection.ascend | ESortDirection.descend;
853
832
  interface ISortOrder {
833
+ /** Формула сортировки */
854
834
  formula: string;
855
- dataType?: ESimpleDataType;
835
+ /** Тип данных формулы */
836
+ dbDataType: TNullable<string>;
837
+ /** Направление сортировки */
856
838
  direction: TSortDirection;
839
+ /** Условие применения сортировки */
857
840
  displayCondition?: TNullable<string>;
858
841
  }
859
842
  type TWidgetSortingValue = {
860
843
  mode: ESortingValueModes.FORMULA;
861
844
  formula: string;
862
- dataType?: ESimpleDataType;
845
+ dbDataType: string;
863
846
  } | {
864
847
  mode: ESortingValueModes.IN_WIDGET;
865
848
  group: string;
@@ -873,10 +856,6 @@ declare enum EWidgetIndicatorType {
873
856
  DIMENSION = "DIMENSION",
874
857
  SORTING = "SORTING"
875
858
  }
876
- declare enum EDbType {
877
- CH = "CH",
878
- HADOOP = "HADOOP"
879
- }
880
859
  interface IWidgetIndicator extends IAutoIdentifiedArrayItem {
881
860
  name: string;
882
861
  }
@@ -885,19 +864,12 @@ type TProcessIndicatorValue = {
885
864
  formula: string;
886
865
  } | {
887
866
  mode: EWidgetIndicatorValueModes.TEMPLATE;
888
- /** Тип базы данных */
889
- dbType: EDbType;
890
867
  /** Имя шаблонной формулы, использующей колонку таблицы */
891
868
  templateName: string;
892
869
  };
893
- /** Общий интерфейс разреза и меры */
894
870
  interface IProcessIndicator extends IWidgetIndicator {
895
871
  value?: TProcessIndicatorValue;
896
- /**
897
- * Тип данных. Добавляется в показатель автоматически
898
- * (нужен только для определения доступных форматов)
899
- */
900
- dataType?: ESimpleDataType;
872
+ dbDataType?: string;
901
873
  format?: EFormatTypes;
902
874
  formatting?: EFormattingPresets;
903
875
  formattingTemplate?: string;
@@ -943,26 +915,20 @@ interface ICommonDimensions {
943
915
  }
944
916
  type TColumnIndicatorValue = {
945
917
  mode: EWidgetIndicatorValueModes.FORMULA;
946
- formula: string;
918
+ formula?: string;
947
919
  } | {
948
920
  mode: EWidgetIndicatorValueModes.TEMPLATE;
949
- /** Тип базы данных */
950
- dbType: EDbType;
951
921
  /** Имя шаблонной формулы, использующей колонку таблицы */
952
- templateName: string;
922
+ templateName?: string;
953
923
  /** Имя таблицы */
954
- tableName: string;
924
+ tableName?: string;
955
925
  /** Имя колонки */
956
- columnName: string;
926
+ columnName?: string;
957
927
  };
958
928
  /** Общий интерфейс разреза и меры */
959
929
  interface IWidgetColumnIndicator extends IWidgetIndicator {
960
930
  value?: TColumnIndicatorValue;
961
- /**
962
- * Тип данных. Добавляется в показатель автоматически
963
- * (нужен только для определения доступных форматов)
964
- */
965
- dataType?: ESimpleDataType;
931
+ dbDataType?: string;
966
932
  format?: EFormatTypes;
967
933
  formatting?: EFormattingPresets;
968
934
  formattingTemplate?: string;
@@ -987,12 +953,14 @@ interface IMarkdownMeasure extends IWidgetMeasure {
987
953
  declare enum EIndicatorType {
988
954
  /** Показатели процесса */
989
955
  PROCESS_MEASURE = "PROCESS_MEASURE",
990
- /** Статичное значение */
956
+ /** Вводимое значение */
991
957
  STATIC = "STATIC",
992
958
  /** Статический список */
993
959
  STATIC_LIST = "STATIC_LIST",
994
960
  /** Динамический список */
995
961
  DYNAMIC_LIST = "DYNAMIC_LIST",
962
+ /** Список колонок */
963
+ COLUMN_LIST = "COLUMN_LIST",
996
964
  /** Разрез */
997
965
  DIMENSION = "DIMENSION",
998
966
  /** Мера */
@@ -1002,70 +970,66 @@ declare enum EIndicatorType {
1002
970
  /** Пользовательская сортировка */
1003
971
  USER_SORTING = "USER_SORTING"
1004
972
  }
1005
- type TSystemVariable = {
973
+ interface IBaseWidgetVariable {
1006
974
  /** Имя переменной */
1007
975
  name: string;
1008
- /** Значение */
1009
- value: string;
1010
- /** Тип данных */
1011
- dataType: ESimpleDataType;
1012
- };
1013
- type TWidgetVariable = {
976
+ /** @deprecated */
977
+ guid: string;
978
+ }
979
+ /** Обобщенные типы значений переменных */
980
+ declare enum ESimpleInputType {
981
+ /** Число (точность Float64) */
982
+ NUMBER = "FLOAT",
983
+ /** Целое число (точность Int64) */
984
+ INTEGER_NUMBER = "INTEGER",
985
+ /** Текст */
986
+ TEXT = "STRING",
987
+ /** Дата (точность Date) */
988
+ DATE = "DATE",
989
+ /** Дата и время (точность DateTime64) */
990
+ DATE_AND_TIME = "DATETIME"
991
+ }
992
+ interface IWidgetStaticVariable extends IBaseWidgetVariable {
1014
993
  /** Тип переменной */
1015
994
  type: EIndicatorType.STATIC;
1016
- /** Имя переменной */
1017
- name: string;
1018
995
  /** Значение */
1019
996
  value: string;
1020
- /** Дефолтное значение */
1021
- defaultValue: string;
1022
- /** Тип данных */
1023
- dataType: ESimpleDataType;
1024
- /** Общее значения */
1025
- isValueShared: boolean;
1026
- /** @deprecated */
1027
- guid: string;
1028
- } | {
997
+ /** Обобщенный тип данных */
998
+ simpleInputType: ESimpleInputType;
999
+ }
1000
+ interface IWidgetStaticListVariable extends IBaseWidgetVariable {
1029
1001
  /** Тип переменной */
1030
1002
  type: EIndicatorType.STATIC_LIST;
1031
- /** Имя переменной */
1032
- name: string;
1033
1003
  /** Значение */
1034
- value: TNullable<string> | string[];
1035
- /** Дефолтное значение */
1036
- defaultValue: TNullable<string>;
1004
+ value: string | string[];
1037
1005
  /** Элементы статического списка */
1038
- options: TNullable<string>[];
1039
- /** Тип данных */
1040
- dataType: ESimpleDataType.STRING;
1006
+ options: string[];
1041
1007
  /** Множественный выбор */
1042
1008
  multipleChoice: boolean;
1043
- /** Общее значения */
1044
- isValueShared: boolean;
1045
- /** @deprecated */
1046
- guid: string;
1047
- } | {
1009
+ }
1010
+ interface IWidgetDynamicListVariable extends IBaseWidgetVariable {
1048
1011
  /** Тип переменной */
1049
1012
  type: EIndicatorType.DYNAMIC_LIST;
1050
- /** Имя переменной */
1051
- name: string;
1052
1013
  /** Значение */
1053
1014
  value: string | string[];
1054
- /** Дефолтное значение */
1055
- defaultValue: string;
1056
1015
  /** Формула для отображения списка */
1057
1016
  listFormula: TNullable<string>;
1058
1017
  /** Тип данных */
1059
- dataType: ESimpleDataType;
1018
+ dbDataType: string;
1060
1019
  /** Множественный выбор */
1061
1020
  multipleChoice: boolean;
1062
- /** Общее значения */
1063
- isValueShared: boolean;
1064
1021
  /** Фильтры */
1065
1022
  filters: TExtendedFormulaFilterValue[];
1066
- /** @deprecated */
1067
- guid: string;
1068
- };
1023
+ }
1024
+ interface IWidgetColumnListVariable extends IBaseWidgetVariable {
1025
+ /** Тип переменной */
1026
+ type: EIndicatorType.COLUMN_LIST;
1027
+ /** Имя таблицы */
1028
+ tableName: string;
1029
+ /** Значение (имя колонки) */
1030
+ value: string;
1031
+ }
1032
+ type TWidgetVariable = IWidgetStaticVariable | IWidgetStaticListVariable | IWidgetDynamicListVariable | IWidgetColumnListVariable;
1069
1033
  declare function isDimensionsHierarchy(indicator: IWidgetColumnIndicator): indicator is IWidgetDimensionHierarchy;
1070
1034
 
1071
1035
  /** Формат входного параметра GeneralCalculator */
@@ -1086,13 +1050,10 @@ interface IBaseDimensionsAndMeasuresCalculatorInput {
1086
1050
  isHideEmptyMeasures?: boolean;
1087
1051
  /** Сортировка */
1088
1052
  sortOrders?: ISortOrder[];
1089
- /** Формула условия отображения */
1090
- displayConditionFormula?: TNullable<string>;
1091
1053
  }
1092
1054
  interface IBaseDimensionsAndMeasuresCalculatorOutput {
1093
1055
  dimensions: Map<string, ICalculatorDimensionOutput>;
1094
1056
  measures: Map<string, ICalculatorMeasureOutput>;
1095
- isDisplay: boolean;
1096
1057
  isValuesEmpty: boolean;
1097
1058
  }
1098
1059
  interface IBaseDimensionsAndMeasuresCalculator<Input extends IBaseDimensionsAndMeasuresCalculatorInput, Output extends IBaseDimensionsAndMeasuresCalculatorOutput> extends ICalculator<Input, Output> {
@@ -1123,8 +1084,6 @@ interface IHistogramCalculatorInput {
1123
1084
  dimensions: ICalculatorDimensionInput[];
1124
1085
  /** Лимит корзин */
1125
1086
  binsLimit: number;
1126
- /** Формула условия отображения */
1127
- displayConditionFormula?: TNullable<string>;
1128
1087
  /** Фильтры, использующие WHERE */
1129
1088
  filters: ICalculatorFilter[];
1130
1089
  /** Имя таблицы */
@@ -1137,7 +1096,6 @@ interface IHistogramBin {
1137
1096
  }
1138
1097
  interface IHistogramCalculatorOutput {
1139
1098
  bins: IHistogramBin[];
1140
- isDisplay: boolean;
1141
1099
  dimensionAlias: string;
1142
1100
  }
1143
1101
  interface IHistogramCalculator extends ICalculator<IHistogramCalculatorInput, IHistogramCalculatorOutput> {
@@ -1174,7 +1132,6 @@ interface IProcessGraphCalculatorInput {
1174
1132
  edgeMeasures: ICalculatorMeasureInput[];
1175
1133
  filters: ICalculatorFilter[];
1176
1134
  eventFilters?: ICalculatorFilter[];
1177
- displayConditionFormula?: TNullable<string>;
1178
1135
  }
1179
1136
  interface IProcessGraphCalculatorOutput {
1180
1137
  vertexMaxLimit: number;
@@ -1187,7 +1144,6 @@ interface IProcessGraphCalculatorOutput {
1187
1144
  /** alias'ы мер, попавших под условие отображения */
1188
1145
  edgeMeasuresAliases: Set<string>;
1189
1146
  edges: IEdge[];
1190
- isDisplay: boolean;
1191
1147
  }
1192
1148
  interface IProcessGraphCalculator extends ICalculator<IProcessGraphCalculatorInput, IProcessGraphCalculatorOutput> {
1193
1149
  }
@@ -1209,8 +1165,6 @@ interface ITwoLimitsCalculatorInput {
1209
1165
  isHideEmptyMeasures?: boolean;
1210
1166
  /** Сортировка */
1211
1167
  sortOrders?: ISortOrder[];
1212
- /** Формула условия отображения */
1213
- displayConditionFormula?: TNullable<string>;
1214
1168
  /** Лимит строк */
1215
1169
  limit?: number;
1216
1170
  /** Второй лимит */
@@ -1225,7 +1179,6 @@ interface ITwoLimitsCalculatorExportInput extends ITwoLimitsCalculatorInput {
1225
1179
  interface ITwoLimitsCalculatorOutput {
1226
1180
  dimensions: Map<string, ICalculatorDimensionOutput>;
1227
1181
  measures: Map<string, ICalculatorMeasureOutput>;
1228
- isDisplay: boolean;
1229
1182
  isValuesEmpty: boolean;
1230
1183
  }
1231
1184
  interface ITwoLimitsCalculator extends ICalculator<ITwoLimitsCalculatorInput, ITwoLimitsCalculatorOutput> {
@@ -1243,9 +1196,7 @@ interface ITypeCalculatorInput {
1243
1196
  }[];
1244
1197
  }
1245
1198
  interface ITypeCalculatorOutputItem {
1246
- simpleType: ESimpleDataType;
1247
- dataType: ESimpleDataType;
1248
- isArrayDataType: boolean;
1199
+ dbDataType: string;
1249
1200
  }
1250
1201
  interface ITypeCalculatorOutput {
1251
1202
  types: Map<string, ITypeCalculatorOutputItem>;
@@ -1253,7 +1204,30 @@ interface ITypeCalculatorOutput {
1253
1204
  interface ITypeCalculator extends ICalculator<ITypeCalculatorInput, ITypeCalculatorOutput> {
1254
1205
  }
1255
1206
 
1256
- declare const prepareValuesForSql: (dataType: ESimpleDataType, values: (string | null)[]) => (string | null)[];
1207
+ declare enum ESimpleDataType {
1208
+ OTHER = "OTHER",
1209
+ DATE = "DATE",
1210
+ FLOAT = "FLOAT",
1211
+ DATETIME = "DATETIME",
1212
+ STRING = "STRING",
1213
+ INTEGER = "INTEGER",
1214
+ DATETIME64 = "DATETIME64",
1215
+ BOOLEAN = "BOOLEAN"
1216
+ }
1217
+ type TDbTypeContainer = "Array" | "Nullable";
1218
+ /** Результат разбора типа данных из базы данных (в будущем возможна поддержка других СУБД помимо ClickHouse) */
1219
+ interface IParsedDbType<T extends TNullable<string> = string> {
1220
+ /** Контейнеры над базовым типом в порядке от внешнего к внутреннему */
1221
+ containers: TDbTypeContainer[];
1222
+ /** Исходный базовый тип (без контейнеров) */
1223
+ dbBaseDataType: T;
1224
+ /** Обобщенный базовый тип */
1225
+ simpleBaseType: ESimpleDataType;
1226
+ /** Обобщенный исходный тип (при наличии контейнера `Array` классифицируется как `OTHER`) */
1227
+ simpleType: ESimpleDataType;
1228
+ }
1229
+
1230
+ declare const prepareValuesForSql: (simpleType: ESimpleDataType, values: (string | null)[]) => (string | null)[];
1257
1231
 
1258
1232
  declare function checkDisplayCondition(displayCondition: TNullable<TDisplayCondition>, variables: Map<string, TWidgetVariable>): boolean;
1259
1233
  declare function getDisplayConditionFormula(displayCondition: TNullable<TDisplayCondition>): TNullable<string>;
@@ -1527,22 +1501,22 @@ interface ISelectBranchOption {
1527
1501
  icon?: string;
1528
1502
  disabled?: boolean;
1529
1503
  }
1530
- interface ISelectLeafOption {
1504
+ interface ISelectLeafOption<U extends object> {
1531
1505
  type: ESelectOptionTypes.LEAF;
1532
1506
  label: string;
1533
1507
  value: string;
1534
- onSelect: <T extends object>(value: string, update: <R extends object>(f: (prevItems: (T | R)[]) => (T | R)[]) => void) => void;
1508
+ onSelect: (value: string, update: (f: (prevItems: U) => U) => void) => void;
1535
1509
  /** Строка в формате base64 */
1536
1510
  icon?: string;
1537
1511
  disabled?: boolean;
1538
1512
  }
1539
- type IAddButtonSelectOption = ISelectDividerOption | ISelectGroupOption | ISelectBranchOption | ISelectLeafOption;
1513
+ type IAddButtonSelectOption = ISelectDividerOption | ISelectGroupOption | ISelectBranchOption | ISelectLeafOption<object[]>;
1540
1514
  type TCustomAddButtonSelectOption = ISelectSystemOption<ECustomSelectTemplates> | IAddButtonSelectOption;
1541
1515
  type TMeasureAddButtonSelectOption = IAddButtonSelectOption;
1542
1516
  interface ICustomAddButtonProps {
1543
1517
  options: TSelectChildOptions;
1544
1518
  hasDropdown?: boolean;
1545
- onClick?: ISelectLeafOption["onSelect"];
1519
+ onClick?: ISelectLeafOption<object[]>["onSelect"];
1546
1520
  }
1547
1521
  interface IWidgetIndicatorAddButtonProps {
1548
1522
  hideTablesColumnsOptions?: boolean;
@@ -1574,8 +1548,8 @@ interface IGroupSettings extends IAutoIdentifiedArrayItem, Record<string, any> {
1574
1548
  /** Конфигурация разреза */
1575
1549
  type TWidgetDimensionData = {
1576
1550
  type: EWidgetIndicatorType.DIMENSION;
1577
- /** Типы данных, поддерживаемые разрезом */
1578
- dataTypes?: ESimpleDataType[];
1551
+ /** Обобщенные типы данных, поддерживаемые разрезом */
1552
+ simpleTypes?: ESimpleDataType[];
1579
1553
  /** Шаблоны формул, доступные для выбора в разрезе */
1580
1554
  templates?: Partial<Record<ESimpleDataType, EDimensionTemplateNames[]>>;
1581
1555
  };
@@ -1599,11 +1573,7 @@ interface IGroupSetDescription<Settings extends object, GroupSettings extends ob
1599
1573
  /** Конфигурация кнопок добавления группы в набор */
1600
1574
  addButtons: TAddButton[];
1601
1575
  /** Получить название, отображаемое на плашке (по умолчанию используется поле name из группы) */
1602
- getGroupTitle?(group: IGroupSettings): string;
1603
- /**
1604
- * @deprecated Необходимо использовать {@link IGroupSetDescription.getIndicatorData }.
1605
- */
1606
- getType?: (settings: IInitialSettings) => EWidgetIndicatorType;
1576
+ getGroupTitle?(group: IGroupSettings, index: number): string;
1607
1577
  /**
1608
1578
  * Получить описание показателя для группы, если группа описывает системный показатель.
1609
1579
  *
@@ -1614,9 +1584,9 @@ interface IGroupSetDescription<Settings extends object, GroupSettings extends ob
1614
1584
  */
1615
1585
  getIndicatorData?: (settings: IInitialSettings) => EWidgetIndicatorType | TWidgetIndicatorData;
1616
1586
  /** Создать конфигурацию группы для вкладки настроек данных */
1617
- createDataRecords?(group: IGroupSettings): TGroupLevelRecord<GroupSettings>[];
1587
+ createDataRecords?(group: IGroupSettings, index: number): TGroupLevelRecord<GroupSettings>[];
1618
1588
  /** Создать конфигурацию группы для вкладки настроек отображения */
1619
- createDisplayRecords?(group: IGroupSettings): TGroupLevelRecord<GroupSettings>[];
1589
+ createDisplayRecords?(group: IGroupSettings, index: number): TGroupLevelRecord<GroupSettings>[];
1620
1590
  /** Находится ли группа в состоянии загрузки (по умолчанию false) */
1621
1591
  isLoading?(group: IGroupSettings): boolean;
1622
1592
  /** Является ли группа валидной (по умолчанию true) */
@@ -1668,9 +1638,9 @@ interface IWidgetProcess {
1668
1638
  /** Имя колонки CaseId события */
1669
1639
  eventCaseIdColumnName: string;
1670
1640
  /** Тип данных CaseId */
1671
- caseIdDataType: ESimpleDataType;
1641
+ caseIdDbDataType: string;
1672
1642
  /** Тип данных времени события */
1673
- eventTimeDataType: ESimpleDataType;
1643
+ eventTimeDbDataType: string;
1674
1644
  /** Является ли процесс валидным */
1675
1645
  isValid: boolean;
1676
1646
  }
@@ -1692,11 +1662,9 @@ declare enum ESystemRecordKey {
1692
1662
 
1693
1663
  interface IWidgetPlaceholderController {
1694
1664
  setError(value: Error | null): void;
1695
- setConfigured(value: boolean): void;
1696
1665
  /**
1697
- * Устанавливает состояние видимости виджета.
1666
+ * Сообщает о готовности виджета к отображению.
1698
1667
  *
1699
- * После вызова данного метода виджет станет доступен для отображения.
1700
1668
  * Это предотвращает мерцание при первом появлении виджета на экране.
1701
1669
  * Метод должен быть вызван после полной готовности виджета: все необходимые данные загружены, высота установлена.
1702
1670
  */
@@ -1706,12 +1674,22 @@ interface IWidgetPlaceholderController {
1706
1674
  }
1707
1675
  interface IWidgetPlaceholderValues {
1708
1676
  error: Error | null;
1709
- isConfigured: boolean;
1710
1677
  isDisplay: boolean | undefined;
1711
1678
  isEmpty: boolean;
1712
1679
  isOverlay: boolean;
1713
1680
  }
1714
1681
 
1682
+ interface IWidgetPresetSettings {
1683
+ appearance: TAppearanceSettings;
1684
+ filterMode: EWidgetFilterMode;
1685
+ ignoreFilters: boolean;
1686
+ stateName: string | null;
1687
+ titleColor: TColor;
1688
+ titleSize: number;
1689
+ titleWeight: EFontWeight;
1690
+ textSize: number;
1691
+ }
1692
+
1715
1693
  type TVersion = string;
1716
1694
  type TMigrationStruct = Record<string, any>;
1717
1695
  interface IWidgetStruct<Settings extends IBaseWidgetSettings = IBaseWidgetSettings> {
@@ -1737,6 +1715,8 @@ interface IDefinition<WidgetSettings extends IBaseWidgetSettings, GroupSettings
1737
1715
  createPanelDescription: IPanelDescriptionCreator<WidgetSettings, GroupSettings>;
1738
1716
  /** заполняет настройки значениями по умолчанию */
1739
1717
  fillSettings: IFillSettings<WidgetSettings>;
1718
+ /** получить начальные настройки виджета, используя заданный пользователем шаблон настроек */
1719
+ getInitialSettings?: (settings: Partial<IWidgetPresetSettings>) => Partial<IBaseWidgetSettings>;
1740
1720
  /** возвращает ключи показателей(разрезов или мер), для которых должна работать системная сортировка */
1741
1721
  getSortableIndicatorsKeys?(): Readonly<StringKeyOf<WidgetSettings>[]>;
1742
1722
  /** Регистрация системных миграторов виджета */
@@ -1812,13 +1792,8 @@ type TContextMenuButtonOptions = {
1812
1792
  items: TContextMenuRow[];
1813
1793
  };
1814
1794
 
1815
- interface IViewInputValue {
1816
- value: TNullable<string> | TNullable<string>[];
1817
- dataType: ESimpleDataType;
1818
- }
1795
+ /** Контекст с данными образа (будет заполняться по мере необходимости) */
1819
1796
  interface IViewContext {
1820
- /** Пользовательские переменные уровня образа */
1821
- variables: Map<string, IViewInputValue>;
1822
1797
  }
1823
1798
 
1824
1799
  type TLaunchActionParams = {
@@ -1832,10 +1807,8 @@ type TLaunchActionParams = {
1832
1807
  filters: ICalculatorFilter[];
1833
1808
  /** Выбранные имена событий для способа ввода EVENT, START_EVENT и FINISH_EVENT */
1834
1809
  eventNames?: [string] | [string, string];
1835
- /** Callback, вызывается при успешном получении данных модального окна запуска действия,
1836
- * а так же при клике на другое действие, вызовется для предыдущего действия
1837
- */
1838
- resetAndHandleModalData?: () => void;
1810
+ /** Callback вызывается при успешном открытии модального окна подтверждения или при прерывании открытия */
1811
+ onConfirmationOpenSettled?: () => void;
1839
1812
  };
1840
1813
  type TWidgetContainer = {
1841
1814
  /** Имеет ли контейнер виджета ограниченную максимальную высоту */
@@ -1965,7 +1938,7 @@ interface IWidget<WidgetSettings extends IBaseWidgetSettings> {
1965
1938
  unmount(container: HTMLElement): void;
1966
1939
  }
1967
1940
  interface IFillSettings<WidgetSettings extends IBaseWidgetSettings> {
1968
- (settings: Partial<WidgetSettings>, context: IGlobalContext): void;
1941
+ (settings: Partial<WidgetSettings>, context: IGlobalContext, prevSettings: Partial<WidgetSettings> | undefined): void;
1969
1942
  }
1970
1943
  interface IWidgetEntity<WidgetSettings extends IBaseWidgetSettings, GroupSettings extends IGroupSettings> {
1971
1944
  new (): IWidget<WidgetSettings>;
@@ -1993,6 +1966,37 @@ declare const replaceFiltersBySelection: (filters: ICalculatorFilter[], selectio
1993
1966
  */
1994
1967
  declare const getLocalizedText: <L extends TLocalizationDescription, P extends ILocalizationProps = TExtractLocalizationParams<L>>(language: ELanguages, locObj: L, props?: P) => string;
1995
1968
 
1969
+ declare enum EClickHouseBaseTypes {
1970
+ Date = "Date",
1971
+ Date32 = "Date32",
1972
+ DateTime = "DateTime",
1973
+ DateTime32 = "DateTime32",
1974
+ DateTime64 = "DateTime64",
1975
+ FixedString = "FixedString",
1976
+ String = "String",
1977
+ Decimal = "Decimal",
1978
+ Decimal32 = "Decimal32",
1979
+ Decimal64 = "Decimal64",
1980
+ Decimal128 = "Decimal128",
1981
+ Decimal256 = "Decimal256",
1982
+ Float32 = "Float32",
1983
+ Float64 = "Float64",
1984
+ Int8 = "Int8",
1985
+ Int16 = "Int16",
1986
+ Int32 = "Int32",
1987
+ Int64 = "Int64",
1988
+ Int128 = "Int128",
1989
+ Int256 = "Int256",
1990
+ UInt8 = "UInt8",
1991
+ UInt16 = "UInt16",
1992
+ UInt32 = "UInt32",
1993
+ UInt64 = "UInt64",
1994
+ UInt128 = "UInt128",
1995
+ UInt256 = "UInt256",
1996
+ Bool = "Bool"
1997
+ }
1998
+ declare const parseClickHouseType: (arg: TNullable<string>) => IParsedDbType<EClickHouseBaseTypes | undefined>;
1999
+
1996
2000
  type TDefineWidgetOptions = {
1997
2001
  manifest?: IWidgetManifest;
1998
2002
  };
@@ -2005,4 +2009,4 @@ declare global {
2005
2009
  }
2006
2010
  }
2007
2011
 
2008
- export { EActionButtonsTypes, EActionTypes, ECalculatorFilterMethods, EColorMode, EControlType, ECustomSelectTemplates, EDbType, EDimensionTemplateNames, EDisplayConditionMode, EDrawerPlacement, EDurationUnit, EEventMeasureTemplateNames, EFontWeight, EFormatTypes, EFormattingPresets, EFormulaFilterFieldKeys, EIndicatorType, ELastTimeUnit, EMarkdownDisplayMode, EMeasureTemplateNames, EProcessFilterNames, ESelectOptionTypes, ESimpleDataType, 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 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 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 ITwoLimitsCalculator, type ITwoLimitsCalculatorExportInput, type ITwoLimitsCalculatorInput, type ITwoLimitsCalculatorOutput, type ITypeCalculator, type ITypeCalculatorInput, type ITypeCalculatorOutput, type ITypeCalculatorOutputItem, type IVertex, type IViewContext, type IViewInputValue, type IWidget, type IWidgetAction, type IWidgetColumnIndicator, type IWidgetDimension, type IWidgetDimensionHierarchy, 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 IWidgetProcess, type IWidgetProps, type IWidgetSortingIndicator, type IWidgetStruct, type IWidgetTable, type IWidgetTableColumn, type TAction, type TActionOnClickParameter, type TActionOpenView, type TActionValidator, type TActionsOnClick, type TAddButton, type TAppearanceSettings, 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 TExtendedFormulaFilterValue, type TFiltrationMode, type TGroupLevelRecord, type TLaunchActionParams, type TMeasureAddButtonSelectOption, type TMigrateProcessor, type TMigrationStruct, type TProcessIndicatorValue, type TRecordAccessor, type TSelectChildOptions, type TSelectFetchNodes, type TSelectFetchOptions, type TSelectivePartial, type TSortDirection, type TSystemVariable, type TUpdateSelection, type TValuePath, type TVersion, type TWidgetActionParameter, type TWidgetContainer, type TWidgetDimensionData, type TWidgetFilterValue, type TWidgetFiltering, type TWidgetIndicatorData, type TWidgetLevelRecord, type TWidgetSortingValue, type TWidgetVariable, bindContentWithIndicator, bindContentsWithIndicators, checkDisplayCondition, colors, dashboardLinkRegExp, dimensionTemplateFormulas, escapeSpecialCharacters, eventMeasureTemplateFormulas, fillTemplateString, formattingConfig, formulaFilterMethods, generateColumnFormula, getColorByIndex, getDefaultSortOrders, getDimensionFormula, getDisplayConditionFormula, getEventMeasureFormula, getLocalizedText, getMeasureFormula, getRuleColor, getTransitionMeasureFormula, isDimensionsHierarchy, isExecuteScriptActionValid, isFormulaFilterValue, isValidColor, linkNameRegExp, mapDimensionsToInputs, mapEventMeasuresToInputs, mapFormulaFilterToCalculatorInput, mapFormulaFiltersToInputs, mapMeasuresToInputs, mapSortingToInputs, mapTransitionMeasuresToInputs, measureTemplateFormulas, parseIndicatorLink, prepareSortOrders, prepareValuesForSql, replaceDisplayCondition, replaceFiltersBySelection, replaceHierarchiesWithDimensions, selectDimensionFromHierarchy, transitionMeasureTemplateFormulas, unescapeSpecialCharacters, updateDefaultModeSelection, updateMultiModeSelection, updateSingleModeSelection, workspaceLinkRegExp };
2012
+ export { EActionButtonsTypes, EActionTypes, ECalculatorFilterMethods, EClickHouseBaseTypes, EColorMode, EControlType, ECustomSelectTemplates, EDimensionTemplateNames, EDisplayConditionMode, EDrawerPlacement, EDurationUnit, EEventMeasureTemplateNames, EFontWeight, EFormatTypes, EFormattingPresets, EFormulaFilterFieldKeys, EIndicatorType, ELastTimeUnit, EMarkdownDisplayMode, EMeasureTemplateNames, 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 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 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 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, 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 TFiltrationMode, type TGroupLevelRecord, type TLaunchActionParams, type TMeasureAddButtonSelectOption, type TMigrateProcessor, type TMigrationStruct, type TProcessIndicatorValue, type TRecordAccessor, type TSelectChildOptions, type TSelectFetchNodes, type TSelectFetchOptions, type TSelectivePartial, type TSortDirection, type TUpdateSelection, type TValuePath, type TVersion, type TWidgetActionParameter, type TWidgetContainer, type TWidgetDimensionData, type TWidgetFilterValue, type TWidgetFiltering, type TWidgetIndicatorData, type TWidgetLevelRecord, type TWidgetSortingValue, type TWidgetVariable, bindContentWithIndicator, bindContentsWithIndicators, checkDisplayCondition, colors, dashboardLinkRegExp, dimensionTemplateFormulas, 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, measureTemplateFormulas, parseClickHouseType, parseIndicatorLink, prepareSortOrders, prepareValuesForSql, replaceDisplayCondition, replaceFiltersBySelection, replaceHierarchiesWithDimensions, selectDimensionFromHierarchy, transitionMeasureTemplateFormulas, unescapeSpecialCharacters, updateDefaultModeSelection, updateMultiModeSelection, updateSingleModeSelection, workspaceLinkRegExp };