@infomaximum/widget-sdk 4.2.0 → 4.2.1

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.
Files changed (2) hide show
  1. package/dist/index.d.ts +210 -84
  2. package/package.json +1 -1
package/dist/index.d.ts CHANGED
@@ -44,11 +44,13 @@ declare enum EControlType {
44
44
  }
45
45
  /** Конфигурация элемента управления настройкой */
46
46
  interface IControlRecord<Settings extends object, Value, ControlType = EControlType> {
47
+ /** Ключ, должен быть уникальным в рамках одного уровня вложенности */
47
48
  key: string;
48
- /** Локализация заголовка настройки */
49
+ /** Локализация заголовка */
49
50
  title?: string;
50
- /** Тип используемого элемента управления настройкой из предложенных нашей системой */
51
+ /** Тип используемого элемента управления из предложенных системой */
51
52
  type: ControlType | string;
53
+ /** Кастомный верхний отступ */
52
54
  marginTop?: number;
53
55
  /** Объект дополнительных параметров элемента управления */
54
56
  props?: object | ((settings: Settings) => object);
@@ -56,9 +58,15 @@ interface IControlRecord<Settings extends object, Value, ControlType = EControlT
56
58
  accessor: TRecordAccessor<Settings, Value>;
57
59
  /**
58
60
  * Рекурсивное определение мета-описания, в элемент управления будет передана функция dive
59
- * для погружения на уровень ниже.
61
+ * для перехода в указанное мета-описание.
62
+ *
63
+ * Возможность работает только для элемента управления EControlType.tagSet.
60
64
  */
61
65
  description?: IDivePanelDescription<Settings>;
66
+ /**
67
+ * Предикат, позволяющий скрыть элемент управления.
68
+ * Предоставлен для удобства разработки. Скрыть элемент можно и условно добавляя его в мета-описание.
69
+ */
62
70
  shouldDisplay?: IDisplayPredicate<Settings>;
63
71
  }
64
72
 
@@ -421,18 +429,26 @@ interface IStagesFilterValue {
421
429
  }
422
430
  type TWidgetFilterValue = IFormulaFilterValue | IStagesFilterValue | IProcessEventFilterValue | IProcessTransitionFilterValue;
423
431
  interface IWidgetFilter {
424
- isReadonly: boolean;
432
+ /** Значение фильтра */
425
433
  filterValue: TWidgetFilterValue;
434
+ /** Значение фильтра, подготовленное для передачи в вычислитель */
426
435
  preparedFilterValue: ICalculatorFilter;
436
+ /** Информация о возможности менять фильтр из виджета */
437
+ isReadonly: boolean;
427
438
  }
428
439
  interface IWidgetFiltration {
429
- /** Значения фильтров, подготовленные для передачи в вычислитель */
430
- preparedFilterValues: ICalculatorFilter[];
440
+ /** Информация о внешних фильтрах виджета */
431
441
  filters: IWidgetFilter[];
442
+ /**
443
+ * Значения внешних фильтров виджета, подготовленные для передачи в вычислитель.
444
+ * Использует данные из filters, но предоставлено отдельным полем для удобства разработки.
445
+ */
446
+ preparedFilterValues: ICalculatorFilter[];
432
447
  /** Добавить фильтр по формуле */
433
448
  addFormulaFilter(value: TSelectivePartial<IFormulaFilterValue, "format" | "formValues">): void;
434
449
  /** Удалить фильтр по формуле */
435
450
  removeFormulaFilter(formula: string): void;
451
+ /** Добавить процессный фильтр */
436
452
  addProcessFilter(...args: Parameters<IAddPresenceOfEventFilter> | Parameters<IAddRepetitionOfEventFilter> | Parameters<IAddPresenceOfTransitionFilter> | Parameters<IAddDurationOfTransitionFilter>): void;
437
453
  /** Добавить фильтр по этапам */
438
454
  addStagesFilter(value: Omit<IStagesFilterValue, "widgetKey">): void;
@@ -496,8 +512,8 @@ interface IWidgetTableColumn {
496
512
  /** Тип данных колонки */
497
513
  dataType: ESimpleDataType;
498
514
  }
499
- interface IScripField {
500
- /** @deprecated удалить после выполнения BI-13602, задача BI-13650 */
515
+ interface IScriptField {
516
+ /** @deprecated */
501
517
  guid: string;
502
518
  name: string;
503
519
  dataType: ESimpleDataType;
@@ -505,10 +521,10 @@ interface IScripField {
505
521
  }
506
522
  interface IActionScript {
507
523
  key: string;
508
- /** @deprecated удалить после выполнения BI-13602, задача BI-13650 */
524
+ /** @deprecated */
509
525
  guid: string;
510
526
  name: string;
511
- fields: IScripField[];
527
+ fields: IScriptField[];
512
528
  }
513
529
  interface IWidgetTable {
514
530
  /** Имя таблицы */
@@ -517,7 +533,7 @@ interface IWidgetTable {
517
533
  columns: Map<string, IWidgetTableColumn>;
518
534
  }
519
535
  /**
520
- * simplified - упрощенный для работы фильтрации в образах открытых в дровере/модальном окне
536
+ * simplified - упрощенный (для работы фильтрации в образах, открытых в модальном/боковом окне)
521
537
  *
522
538
  * full - полный
523
539
  */
@@ -532,32 +548,46 @@ interface IDisplayRule {
532
548
  color: TColor;
533
549
  }
534
550
  interface IGlobalContext {
535
- /** используемый язык в системе */
551
+ /** Используемый язык системы */
536
552
  language: ELanguages;
537
- processes: Map<string, IWidgetProcess>;
553
+ /** Имя отчета */
554
+ reportName: string;
555
+ /** Имена образов по их ключу(в текущем отчете) */
556
+ viewNameByKey: Map<string, string>;
557
+ /** Режим отображения виджетов */
558
+ displayMode: TDisplayMode;
559
+ /** Режим фильтрации виджетов */
560
+ filtrationMode: TFiltrationMode;
561
+ /** @deprecated имя группы пространства по ее id */
562
+ workspaceGroupNameById: Map<number, string>;
563
+ /** Меры уровня отчета */
538
564
  reportMeasures: TNullable<Map<string, ICommonMeasures>>;
565
+ /** Меры уровня пространства(из модели данных) */
539
566
  workspaceMeasures: TNullable<Map<string, Map<string, ICommonMeasures>>>;
567
+ /** Разрезы уровня отчета */
540
568
  reportDimensions: TNullable<Map<string, ICommonDimensions>>;
569
+ /** Разрезы уровня пространства(из модели данных) */
541
570
  workspaceDimensions: TNullable<Map<string, Map<string, ICommonDimensions>>>;
542
- /** @deprecated удалить после окончания поддержки миграций BI-13650 */
543
- workspaceGroupNameById: Map<number, string>;
544
- /** Переменные отчета */
571
+ /** Правила отображения уровня */
572
+ reportDisplayRules: Map<string, IDisplayRule>;
573
+ /** Правила отображения уровня пространства(из модели данных) */
574
+ workspaceDisplayRules: Map<string, Map<string, IDisplayRule>>;
575
+ /** Пользовательские переменные уровня отчета */
545
576
  variables: Map<string, TWidgetVariable>;
577
+ /** Метод установки значения пользовательской переменной уровня отчета */
578
+ setVariableValue(name: string, value: TNullable<string> | string[]): void;
546
579
  /** Системные переменные */
547
580
  systemVariables: Map<string, TSystemVariable>;
548
- /** Метод установки значения переменной отчета */
549
- setVariableValue(name: string, value: TNullable<string> | string[]): void;
581
+ /** Состояния(название сущности) отчета */
550
582
  states: Map<string, ICommonState>;
551
- reportName: string;
552
- /** Режим отображения виджета */
553
- displayMode: TDisplayMode;
554
- scripts: Map<string, IActionScript>;
583
+ /** Процессы из модели данных */
584
+ processes: Map<string, IWidgetProcess>;
585
+ /** Имена таблиц из модели данных */
555
586
  tables: Set<string>;
556
- filtrationMode: TFiltrationMode;
557
- reportDisplayRules: Map<string, IDisplayRule>;
558
- workspaceDisplayRules: Map<string, Map<string, IDisplayRule>>;
559
- viewNameByKey: Map<string, string>;
587
+ /** Функция для запроса информации о колонках таблицы из модели данных */
560
588
  fetchColumnsByTableName(tableName: string): Promise<IWidgetTableColumn[] | undefined>;
589
+ /** Скрипты, доступные для запуска из отчета */
590
+ scripts: Map<string, IActionScript>;
561
591
  }
562
592
 
563
593
  declare enum EColorMode {
@@ -871,12 +901,12 @@ declare enum ESortingValueModes {
871
901
  }
872
902
  interface ICommonState {
873
903
  name: string;
874
- /** @deprecated удалить после выполнения BI-13602, задача BI-13650 */
904
+ /** @deprecated */
875
905
  guid: string;
876
906
  }
877
907
  interface ICommonMeasures {
878
908
  name: string;
879
- /** @deprecated удалить после выполнения BI-13602, задача BI-13650 */
909
+ /** @deprecated */
880
910
  guid: string;
881
911
  formula: string;
882
912
  }
@@ -964,7 +994,7 @@ type TWidgetVariable = {
964
994
  defaultValue: string;
965
995
  /** Тип данных */
966
996
  dataType: ESimpleDataType;
967
- /** @deprecated удалить после выполнения BI-13602, задача BI-13650 */
997
+ /** @deprecated */
968
998
  guid: string;
969
999
  } | {
970
1000
  /** Тип переменной */
@@ -981,7 +1011,7 @@ type TWidgetVariable = {
981
1011
  dataType: ESimpleDataType.STRING;
982
1012
  /** Множественный выбор */
983
1013
  multipleChoice: boolean;
984
- /** @deprecated удалить после выполнения BI-13602, задача BI-13650 */
1014
+ /** @deprecated */
985
1015
  guid: string;
986
1016
  } | {
987
1017
  /** Тип переменной */
@@ -1000,7 +1030,7 @@ type TWidgetVariable = {
1000
1030
  multipleChoice: boolean;
1001
1031
  /** Фильтры */
1002
1032
  filters: TExtendedFormulaFilterValue[];
1003
- /** @deprecated удалить после выполнения BI-13602, задача BI-13650 */
1033
+ /** @deprecated */
1004
1034
  guid: string;
1005
1035
  };
1006
1036
  declare function isDimensionsHierarchy(indicator: IWidgetColumnIndicator): indicator is IWidgetDimensionHierarchy;
@@ -1247,12 +1277,53 @@ declare const escapeSpecialCharacters: (formula: string) => string;
1247
1277
  /** Удалить из строки символы экранирования */
1248
1278
  declare function unescapeSpecialCharacters(str: string): string;
1249
1279
 
1280
+ /** Фабрика вычислителей */
1250
1281
  interface ICalculatorFactory {
1282
+ /**
1283
+ * Общий вычислитель.
1284
+ * Вычисляет любое(ограничено только ClickHouse) количество разрезов и мер.
1285
+ * Количество строк ограничивается переданным лимитом.
1286
+ *
1287
+ * Подходит для большинства задач, где требуется сделать одну или несколько группировок
1288
+ * и при необходимости посчитать показатель по каждой группе.
1289
+ */
1251
1290
  general: () => IGeneralCalculator;
1291
+ /**
1292
+ * Вычислитель с двумя лимитами.
1293
+ * Для работы требует ровно 2 разреза(для каждого из которых указывается свой лимит) и
1294
+ * любое количеством мер.
1295
+ *
1296
+ * Используется для отображения данных в виде двумерных матриц со значениями разрезов на осях.
1297
+ */
1298
+ twoLimits: () => ITwoLimitsCalculator;
1299
+ /**
1300
+ * Вычислитель круговой диаграммы.
1301
+ * Для работы требует ровно 1 разрез и 1 меру.
1302
+ *
1303
+ * В отличие от других вычислителей, считает итог по мере как сумму значений по всем строкам,
1304
+ * а не как меру по всему объему данных. Такая особенность необходима для расчета
1305
+ * размера оставшегося сектора круговой диаграммы.
1306
+ */
1252
1307
  pie: () => IPieCalculator;
1308
+ /**
1309
+ * Вычислитель, предназначенный для вычисления графа по переданному процессу.
1310
+ * Возвращает информацию о событиях процесса и связях(переходах) между ними.
1311
+ *
1312
+ * Может вычислять любое количество мер, отдельно для событий и переходов.
1313
+ */
1253
1314
  processGraph: () => IProcessGraphCalculator;
1315
+ /**
1316
+ * Вычислитель гистограммы.
1317
+ * Вычисляет "корзины" для переданного разреза.
1318
+ */
1254
1319
  histogram: () => IHistogramCalculator;
1255
- twoLimits: () => ITwoLimitsCalculator;
1320
+ /**
1321
+ * Вычислитель типа для разрезов и мер.
1322
+ * Принимает любое количество разрезов и мер.
1323
+ *
1324
+ * Под капотом использует general-вычислитель, оборачивая формулы в toTypeName, поэтому
1325
+ * все переданные формулы должны использовать связанные таблицы модели данных.
1326
+ */
1256
1327
  type: () => ITypeCalculator;
1257
1328
  }
1258
1329
 
@@ -1363,7 +1434,14 @@ type TAddButton = {
1363
1434
  };
1364
1435
  interface IGroupSettings extends IAutoIdentifiedArrayItem, Record<string, any> {
1365
1436
  }
1366
- /** Конфигурация набора групп */
1437
+ /**
1438
+ * Конфигурация набора групп настроек.
1439
+ *
1440
+ * Набор групп, как правило, представлен в настройках виджета в виде массива объектов.
1441
+ * Каждый объект в массиве - это группа настроек.
1442
+ *
1443
+ * Группа отображается в виде раскрываемой плашки, может представлять из себя разрез, меру, процесс и др.
1444
+ */
1367
1445
  interface IGroupSetDescription<Settings extends object, GroupSettings extends object> {
1368
1446
  /** Заголовок */
1369
1447
  title: string;
@@ -1371,49 +1449,59 @@ interface IGroupSetDescription<Settings extends object, GroupSettings extends ob
1371
1449
  maxCount: number;
1372
1450
  /** Описание доступа к настройкам групп */
1373
1451
  accessor: TRecordAccessor<Settings, GroupSettings[]>;
1374
- /** Получить тип индикатора */
1375
- getType?: (settings: IInitialSettings) => EWidgetIndicatorType;
1376
- /** Кнопки добавления группы в набор */
1452
+ /** Конфигурация кнопок добавления группы в набор */
1377
1453
  addButtons: TAddButton[];
1378
- /** Создать элементы управления внутри группы (для вкладки настроек данных) */
1454
+ /** Получить название, отображаемое на плашке (по умолчанию используется поле name из группы) */
1455
+ getGroupTitle?(group: IGroupSettings): string;
1456
+ /**
1457
+ * Получить тип показателя для группы, если группа описывает системный показатель.
1458
+ *
1459
+ * Тип будет использоваться для:
1460
+ * - отображения иконки показателя на плашке.
1461
+ * - предустановленного мета-описания показателя.
1462
+ */
1463
+ getType?: (settings: IInitialSettings) => EWidgetIndicatorType;
1464
+ /** Создать конфигурацию группы для вкладки настроек данных */
1379
1465
  createDataRecords?(group: IGroupSettings): TGroupLevelRecord<GroupSettings>[];
1380
- /** Создать элементы управления внутри группы (для вкладки настроек отображения) */
1466
+ /** Создать конфигурацию группы для вкладки настроек отображения */
1381
1467
  createDisplayRecords?(group: IGroupSettings): TGroupLevelRecord<GroupSettings>[];
1382
- /** Получить название для плашки */
1383
- getGroupTitle?(group: IGroupSettings): string;
1384
- /** Валидная ли группа */
1385
- isValid?(group: IGroupSettings): boolean;
1386
- /** Находится ли группа в состоянии загрузки */
1468
+ /** Находится ли группа в состоянии загрузки (по умолчанию false) */
1387
1469
  isLoading?(group: IGroupSettings): boolean;
1388
- /** Можно ли удалять группу по умолчанию true */
1470
+ /** Является ли группа валидной (по умолчанию true) */
1471
+ isValid?(group: IGroupSettings): boolean;
1472
+ /** Можно ли удалить группу (по умолчанию true) */
1389
1473
  isRemovable?(group: IGroupSettings): boolean;
1390
- /** Можно ли сортировать группу по умолчанию true */
1474
+ /** Можно ли менять порядок групп (по умолчанию true) */
1391
1475
  isDraggable?: boolean;
1392
- /** Опциональный верхний отступ для группы */
1476
+ /** Кастомный верхний отступ для набора групп */
1393
1477
  marginTop?: number;
1394
1478
  }
1395
- /** Конфигурация левой панели */
1479
+ /** Конфигурация панели настроек виджета */
1396
1480
  interface IPanelDescription<Settings extends object, GroupSettings extends IGroupSettings = IGroupSettings> {
1397
- /** Добавить заголовок для виджета */
1481
+ /** Добавить поле настройки заголовка */
1398
1482
  useTitle?: boolean;
1399
- /** Добавить описание для виджета */
1483
+ /** Добавить поле настройки описания */
1400
1484
  useMarkdown?: boolean;
1401
- /** Конфигурация настроек данных виджета */
1485
+ /** Конфигурация вкладки настроек данных */
1402
1486
  dataRecords?: TWidgetLevelRecord<Settings>[];
1403
- /** Конфигурация настроек отображения виджета */
1487
+ /** Конфигурация вкладки настроек отображения */
1404
1488
  displayRecords?: TWidgetLevelRecord<Settings>[];
1405
- /** Конфигурации наборов групп */
1489
+ /**
1490
+ * Конфигурация наборов(каждый набор по своему ключу) с группами настроек.
1491
+ * Описанный набор групп можно вставить по ключу в нужное место внутри dataRecords и displayRecords.
1492
+ */
1406
1493
  groupSetDescriptions?: Record<string, IGroupSetDescription<Settings, GroupSettings>>;
1407
- /** Добавить вкладку с действиями (по умолчанию false) */
1494
+ /** Добавить вкладку с настройками действий (по умолчанию false) */
1408
1495
  useActions?: boolean;
1409
- /** Добавить вкладку с фильтрацией (по умолчанию true) */
1496
+ /** Добавить вкладку с настройками фильтрации (по умолчанию true) */
1410
1497
  useFiltration?: boolean;
1411
- /** Конфигурация настроек фильтров */
1498
+ /** Конфигурация вкладки настроек фильтрации */
1412
1499
  filtrationRecords?: Exclude<TWidgetLevelRecord<Settings>, IGroupSetRecord>[];
1413
- /** Режимы фильтрации */
1500
+ /** Доступные для выбора режимы фильтрации (во вкладке настроек фильтрации) */
1414
1501
  filtrationModes?: EWidgetFilterMode[];
1415
1502
  }
1416
1503
  interface IWidgetProcess {
1504
+ /** @deprecated */
1417
1505
  guid: string;
1418
1506
  /** Имя процесса */
1419
1507
  name: string;
@@ -1438,7 +1526,13 @@ interface IWidgetProcess {
1438
1526
  interface IDivePanelDescription<Settings extends object, GroupSettings extends IGroupSettings = IGroupSettings> extends IPanelDescription<Settings, GroupSettings> {
1439
1527
  }
1440
1528
  interface IPanelDescriptionCreator<Settings extends IBaseWidgetSettings, GroupSettings extends IGroupSettings> {
1441
- (context: IGlobalContext, panelSettings: Settings, calculatorFactory: ICalculatorFactory): IPanelDescription<Settings, GroupSettings>;
1529
+ (
1530
+ /** Глобальный контекст */
1531
+ context: IGlobalContext,
1532
+ /** Настройки виджета */
1533
+ settings: Settings,
1534
+ /** Фабрика вычислителей */
1535
+ calculatorFactory: ICalculatorFactory): IPanelDescription<Settings, GroupSettings>;
1442
1536
  }
1443
1537
  declare enum ESystemRecordKey {
1444
1538
  formatting = "formatting"
@@ -1478,16 +1572,24 @@ interface IDefinition<WidgetSettings extends IBaseWidgetSettings, GroupSettings
1478
1572
  }
1479
1573
 
1480
1574
  type TContextMenu = (TContextMenuList | TContextMenuButtonGroup) & {
1575
+ /**
1576
+ * Событие мыши, по которому пользователь открыл меню.
1577
+ * Используется для автоматического определения позиции меню.
1578
+ */
1481
1579
  event?: MouseEvent;
1482
- placement?: "topRight" | "topLeft" | "bottomRight" | "bottomLeft";
1483
- positionOrigin?: "frame" | "workArea" | HTMLElement;
1484
- boundingContainer?: HTMLElement;
1580
+ /** Явно указанная позиция меню */
1485
1581
  position?: {
1486
1582
  unitX?: TContextMenuPositionUnit;
1487
1583
  unitY?: TContextMenuPositionUnit;
1488
1584
  x?: number;
1489
1585
  y?: number;
1490
1586
  };
1587
+ /** Относительно чего позиционируется меню */
1588
+ positionOrigin?: "frame" | "workArea" | HTMLElement;
1589
+ /** Каким элементом ограничено расположение меню */
1590
+ boundingContainer?: HTMLElement;
1591
+ /** Положение меню относительно его позиции */
1592
+ placement?: "topRight" | "topLeft" | "bottomRight" | "bottomLeft";
1491
1593
  };
1492
1594
  type TContextMenuPositionUnit = "%" | "px";
1493
1595
  type TContextMenuList = {
@@ -1539,14 +1641,20 @@ interface IViewInputValue {
1539
1641
  dataType: ESimpleDataType;
1540
1642
  }
1541
1643
  interface IViewContext {
1644
+ /** Пользовательские переменные уровня образа */
1542
1645
  variables: Map<string, IViewInputValue>;
1543
1646
  }
1544
1647
 
1545
1648
  type TLaunchActionParams = {
1649
+ /** Запускаемое действие */
1546
1650
  action: TAction;
1651
+ /** Callback, вызываемый при успешном запуске действия */
1547
1652
  onSuccess: () => void;
1548
- filters: ICalculatorFilter[];
1653
+ /** Требуется ли подтверждение о запуске (откроется модальное окно) */
1549
1654
  needConfirmation?: boolean;
1655
+ /** Фильтрация для способов ввода COLUMN и FORMULA */
1656
+ filters: ICalculatorFilter[];
1657
+ /** Выбранные имена событий для способа ввода EVENT, START_EVENT и FINISH_EVENT */
1550
1658
  eventNames?: [string] | [string, string];
1551
1659
  };
1552
1660
  type TWidgetContainer = {
@@ -1560,50 +1668,68 @@ interface IWidgetPersistValue<T extends object = object> {
1560
1668
  set(value: T | null): void;
1561
1669
  }
1562
1670
  interface IWidgetProps<WidgetSettings extends IBaseWidgetSettings = IBaseWidgetSettings> {
1563
- /** guid виджета */
1671
+ /** @deprecated в качестве guid используется ключ виджета(уникален в рамках образа для каждого экземпляра виджета) */
1564
1672
  guid: string;
1565
1673
  /** Настройки виджета */
1566
1674
  settings: WidgetSettings;
1675
+ /** Фабрика для создания вычислителей */
1676
+ calculatorFactory: ICalculatorFactory;
1567
1677
  /** Объект для взаимодействия с фильтрацией */
1568
1678
  filtration: IWidgetFiltration;
1569
- /** Функция для подписки на расфокусировку виджета */
1570
- subscribeOnFocusOut(subscriber: () => void): void;
1571
- /** Захватить фокус: остальные виджеты будут оповещены о расфокусировке */
1572
- captureFocus(): void;
1573
- /** Фабрика вычислителей. */
1574
- calculatorFactory: ICalculatorFactory;
1679
+ /** Объект для работы с контейнером виджета */
1680
+ widgetContainer: TWidgetContainer;
1575
1681
  /**
1576
- * Корневой контейнер отчета.
1577
- * Служит для возможности использования портала внутри виджетов.
1682
+ * Прокручиваемая область, отображающая образ с виджетами.
1683
+ * Служит пространством для размещения и просмотра виджетов как единого документа.
1578
1684
  */
1579
1685
  rootViewContainer: HTMLDivElement;
1686
+ /** Функция для управления контекстными меню */
1687
+ setContextMenu: (key: string, value: TContextMenu | null) => void;
1580
1688
  /** Объект для управления плейсхолдером */
1581
1689
  placeholder: IWidgetPlaceholderController;
1582
1690
  /** Объект для получения значений плейсхолдера */
1583
1691
  placeholderValues: IWidgetPlaceholderValues;
1692
+ /** Функция для подписки на расфокусировку виджета (например, при фокусировке на другом виджете) */
1693
+ subscribeOnFocusOut(subscriber: () => void): void;
1694
+ /** Функция для захвата фокуса виджетом: остальные виджеты будут оповещены о расфокусировке */
1695
+ captureFocus(): void;
1584
1696
  /** Глобальный контекст. Содержит информацию из отчета, пространства и платформы системы */
1585
1697
  globalContext: IGlobalContext;
1586
1698
  /** Контекст образа */
1587
1699
  viewContext: IViewContext;
1588
- /** Данные о контейнере виджета */
1589
- widgetContainer: TWidgetContainer;
1590
- /** Запуск действия */
1700
+ /** Функция для запуска действия */
1591
1701
  launchAction(params: TLaunchActionParams): void;
1592
- /** Значение, сохраняемое в localStorage и URL */
1593
- persistValue: IWidgetPersistValue;
1594
- /** функция для управления контекстными меню */
1595
- setContextMenu: (key: string, value: TContextMenu | null) => void;
1596
- /** метод валидации действий по клику */
1702
+ /** Функция валидации действия */
1597
1703
  actionValidator: TActionValidator;
1704
+ /** Аксессор для persist-значения виджета, хранимого в localStorage и URL */
1705
+ persistValue: IWidgetPersistValue;
1706
+ }
1707
+ /** Манифест виджета */
1708
+ interface IWidgetManifest {
1709
+ /** Уникальный идентификатор формата uuid */
1710
+ uuid: string;
1711
+ /** Локализация названия */
1712
+ name: Partial<{
1713
+ ru: string;
1714
+ en: string;
1715
+ }>;
1716
+ /** Мажорная версия widget-sdk, использованная при разработке виджета */
1717
+ sdk_version: number;
1718
+ /** Путь до js-файла, который является входной точкой виджета */
1719
+ entry: string;
1720
+ /** Путь до иконки(svg или png) */
1721
+ icon?: string;
1722
+ /** Находится ли виджет на beta-стадии разработки */
1723
+ is_beta?: boolean;
1598
1724
  }
1599
1725
  interface ICustomWidgetProps<WidgetSettings extends IBaseWidgetSettings = IBaseWidgetSettings> extends IWidgetProps<WidgetSettings> {
1600
- /** манифест виджета */
1601
- manifest: Record<string, any>;
1726
+ /** Манифест виджета */
1727
+ manifest: Partial<IWidgetManifest>;
1602
1728
  /** body DOM элемент родительского приложения */
1603
1729
  bodyElement: HTMLBodyElement;
1604
- /** Форматирование */
1730
+ /** Объект для форматирования значений */
1605
1731
  formatting: IWidgetFormatting;
1606
- /** Получить ресурс виджета по имени файла */
1732
+ /** Функция для получения ресурса виджета по имени файла */
1607
1733
  getWidgetAsset: (fileName: string) => Promise<Blob | null>;
1608
1734
  }
1609
1735
  interface IWidget<WidgetSettings extends IBaseWidgetSettings> {
@@ -1764,7 +1890,7 @@ declare const replaceFiltersBySelection: (filters: ICalculatorFilter[], selectio
1764
1890
  declare const getLocalizedText: <L extends TLocalizationDescription, P extends ILocalizationProps = TExtractLocalizationParams<L>>(language: ELanguages, locObj: L, props?: P) => string;
1765
1891
 
1766
1892
  type TDefineWidgetOptions = {
1767
- manifest?: Record<string, unknown>;
1893
+ manifest?: IWidgetManifest;
1768
1894
  };
1769
1895
  declare global {
1770
1896
  interface Infomaximum {
@@ -1775,4 +1901,4 @@ declare global {
1775
1901
  }
1776
1902
  }
1777
1903
 
1778
- export { 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 IAppearanceSettings, 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 ISelectOption, type ISelectSystemOption, 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 IWidgetMeasure, type IWidgetPersistValue, type IWidgetPlaceholderController, type IWidgetPlaceholderValues, type IWidgetProcess, type IWidgetProps, type IWidgetSortingIndicator, type IWidgetTable, type IWidgetTableColumn, type TAction, type TActionOnClickParameter, type TActionOpenView, type TActionValidator, type TActionsOnClick, type TAddButton, 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 TProcessIndicatorValue, type TRecordAccessor, type TSelectChildOptions, type TSelectFetchOptions, type TSelectivePartial, type TSortDirection, type TSystemVariable, type TUpdateSelection, type TValuePath, type TWidgetActionParameter, type TWidgetContainer, type TWidgetFilterValue, type TWidgetFiltering, type TWidgetLevelRecord, type TWidgetSortingValue, type TWidgetVariable, bindContentWithIndicator, bindContentsWithIndicators, checkDisplayCondition, dashboardLinkRegExp, dimensionTemplateFormulas, escapeSpecialCharacters, eventMeasureTemplateFormulas, fillTemplateString, formattingConfig, formulaFilterMethods, generateColumnFormula, getDimensionFormula, getDisplayConditionFormula, getEventMeasureFormula, getLocalizedText, getMeasureFormula, getRuleColor, getTransitionMeasureFormula, isDimensionsHierarchy, isExecuteScriptActionValid, isFormulaFilterValue, isValidColor, linkNameRegExp, mapDimensionsToInputs, mapEventMeasuresToInputs, mapFormulaFilterToCalculatorInput, mapFormulaFiltersToInputs, mapMeasuresToInputs, mapSortingToInputs, mapTransitionMeasuresToInputs, measureTemplateFormulas, parseIndicatorLink, prepareValuesForSql, replaceDisplayCondition, replaceFiltersBySelection, replaceHierarchiesWithDimensions, selectDimensionFromHierarchy, transitionMeasureTemplateFormulas, unescapeSpecialCharacters, updateDefaultModeSelection, updateMultiModeSelection, updateSingleModeSelection, workspaceLinkRegExp };
1904
+ export { 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 IAppearanceSettings, 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 ISelectOption, type ISelectSystemOption, 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 IWidgetPersistValue, type IWidgetPlaceholderController, type IWidgetPlaceholderValues, type IWidgetProcess, type IWidgetProps, type IWidgetSortingIndicator, type IWidgetTable, type IWidgetTableColumn, type TAction, type TActionOnClickParameter, type TActionOpenView, type TActionValidator, type TActionsOnClick, type TAddButton, 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 TProcessIndicatorValue, type TRecordAccessor, type TSelectChildOptions, type TSelectFetchOptions, type TSelectivePartial, type TSortDirection, type TSystemVariable, type TUpdateSelection, type TValuePath, type TWidgetActionParameter, type TWidgetContainer, type TWidgetFilterValue, type TWidgetFiltering, type TWidgetLevelRecord, type TWidgetSortingValue, type TWidgetVariable, bindContentWithIndicator, bindContentsWithIndicators, checkDisplayCondition, dashboardLinkRegExp, dimensionTemplateFormulas, escapeSpecialCharacters, eventMeasureTemplateFormulas, fillTemplateString, formattingConfig, formulaFilterMethods, generateColumnFormula, getDimensionFormula, getDisplayConditionFormula, getEventMeasureFormula, getLocalizedText, getMeasureFormula, getRuleColor, getTransitionMeasureFormula, isDimensionsHierarchy, isExecuteScriptActionValid, isFormulaFilterValue, isValidColor, linkNameRegExp, mapDimensionsToInputs, mapEventMeasuresToInputs, mapFormulaFilterToCalculatorInput, mapFormulaFiltersToInputs, mapMeasuresToInputs, mapSortingToInputs, mapTransitionMeasuresToInputs, measureTemplateFormulas, parseIndicatorLink, prepareValuesForSql, replaceDisplayCondition, replaceFiltersBySelection, replaceHierarchiesWithDimensions, selectDimensionFromHierarchy, transitionMeasureTemplateFormulas, unescapeSpecialCharacters, updateDefaultModeSelection, updateMultiModeSelection, updateSingleModeSelection, workspaceLinkRegExp };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@infomaximum/widget-sdk",
3
- "version": "4.2.0",
3
+ "version": "4.2.1",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/index.esm.js",
6
6
  "types": "./dist/index.d.ts",