@infomaximum/widget-sdk 4.0.0-beta3 → 4.0.0-beta6
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 +53 -22
- package/dist/index.esm.js +1 -0
- package/dist/index.js +1 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -33,7 +33,8 @@ declare enum EControlType {
|
|
|
33
33
|
displayCondition = "displayCondition",
|
|
34
34
|
eventsColor = "eventsColor",
|
|
35
35
|
inputMarkdown = "inputMarkdown",
|
|
36
|
-
filter = "filter"
|
|
36
|
+
filter = "filter",
|
|
37
|
+
actionOnClick = "actionOnClick"
|
|
37
38
|
}
|
|
38
39
|
/** Конфигурация элемента управления настройкой */
|
|
39
40
|
interface IControlRecord<Settings extends object, Value, ControlType = EControlType> {
|
|
@@ -259,6 +260,7 @@ declare enum EDurationUnit {
|
|
|
259
260
|
declare const mapFormulaFilterToCalculatorInput: (filterValue: IFormulaFilterValue | string) => TNullable<ICalculatorFilter>;
|
|
260
261
|
declare const mapFormulaFiltersToInputs: (filters: (string | IFormulaFilterValue)[]) => ICalculatorFilter[];
|
|
261
262
|
|
|
263
|
+
type TSelectivePartial<T, Keys extends keyof T> = Omit<T, Keys> & Partial<Pick<T, Keys>>;
|
|
262
264
|
declare const formulaFilterMethods: {
|
|
263
265
|
readonly LAST_TIME: "LAST_TIME";
|
|
264
266
|
readonly EQUAL_TO: ECalculatorFilterMethods.EQUAL_TO;
|
|
@@ -288,6 +290,7 @@ declare enum EProcessFilterNames {
|
|
|
288
290
|
/** Длительность перехода */
|
|
289
291
|
durationOfTransition = "durationOfTransition"
|
|
290
292
|
}
|
|
293
|
+
/** @deprecated необходимо использовать @see {@link IFormulaFilterValue} */
|
|
291
294
|
interface IWidgetFormulaFilterValue extends ICalculatorFilter {
|
|
292
295
|
/**
|
|
293
296
|
* Название фильтра
|
|
@@ -328,15 +331,6 @@ interface IAddPresenceOfTransitionFilter {
|
|
|
328
331
|
interface IAddDurationOfTransitionFilter {
|
|
329
332
|
(name: EProcessFilterNames.durationOfTransition, value: IProcessTransitionFilterValue): void;
|
|
330
333
|
}
|
|
331
|
-
interface IWidgetFiltration {
|
|
332
|
-
/** Значения фильтров, подготовленные для передачи в вычислитель */
|
|
333
|
-
preparedFilterValues: ICalculatorFilter[];
|
|
334
|
-
/** Добавить фильтр по формуле */
|
|
335
|
-
addFormulaFilter(value: IWidgetFormulaFilterValue): void;
|
|
336
|
-
/** Удалить фильтр по формуле */
|
|
337
|
-
removeFormulaFilter(formula: string): void;
|
|
338
|
-
addProcessFilter(...args: Parameters<IAddPresenceOfEventFilter> | Parameters<IAddRepetitionOfEventFilter> | Parameters<IAddPresenceOfTransitionFilter> | Parameters<IAddDurationOfTransitionFilter>): void;
|
|
339
|
-
}
|
|
340
334
|
declare enum EFormulaFilterFieldKeys {
|
|
341
335
|
date = "date",
|
|
342
336
|
dateRange = "dateRange",
|
|
@@ -360,7 +354,7 @@ interface IFormulaFilterValue {
|
|
|
360
354
|
/** Метод фильтрации */
|
|
361
355
|
filteringMethod: valueof<typeof formulaFilterMethods>;
|
|
362
356
|
/** Выбранные в списке значения в виде моделей */
|
|
363
|
-
checkedValues: string[];
|
|
357
|
+
checkedValues: (string | null)[];
|
|
364
358
|
/** Значения полей формы редактора */
|
|
365
359
|
formValues: Partial<{
|
|
366
360
|
[EFormulaFilterFieldKeys.date]: string | null;
|
|
@@ -374,6 +368,40 @@ interface IFormulaFilterValue {
|
|
|
374
368
|
[EFormulaFilterFieldKeys.durationUnit]: EDurationUnit;
|
|
375
369
|
}>;
|
|
376
370
|
}
|
|
371
|
+
interface IStagesFilterItem {
|
|
372
|
+
/** Название этапа */
|
|
373
|
+
name: string;
|
|
374
|
+
/** Формула фильтра этапа */
|
|
375
|
+
formula: string;
|
|
376
|
+
isSelected: boolean;
|
|
377
|
+
}
|
|
378
|
+
interface IStagesFilterValue {
|
|
379
|
+
/** Ключ виджета */
|
|
380
|
+
widgetKey: string;
|
|
381
|
+
/** Заголовок фильтра */
|
|
382
|
+
name: TNullable<string>;
|
|
383
|
+
/** Этапы */
|
|
384
|
+
stages: IStagesFilterItem[];
|
|
385
|
+
}
|
|
386
|
+
type TWidgetFilterValue = IFormulaFilterValue | IStagesFilterValue | IProcessEventFilterValue | IProcessTransitionFilterValue;
|
|
387
|
+
interface IWidgetFilter {
|
|
388
|
+
filterValue: TWidgetFilterValue;
|
|
389
|
+
preparedFilterValue: ICalculatorFilter;
|
|
390
|
+
}
|
|
391
|
+
interface IWidgetFiltration {
|
|
392
|
+
/** Значения фильтров, подготовленные для передачи в вычислитель */
|
|
393
|
+
preparedFilterValues: ICalculatorFilter[];
|
|
394
|
+
filters: IWidgetFilter[];
|
|
395
|
+
/** Добавить фильтр по формуле */
|
|
396
|
+
addFormulaFilter(value: IWidgetFormulaFilterValue | TSelectivePartial<IFormulaFilterValue, "format" | "formValues">): void;
|
|
397
|
+
/** Удалить фильтр по формуле */
|
|
398
|
+
removeFormulaFilter(formula: string): void;
|
|
399
|
+
addProcessFilter(...args: Parameters<IAddPresenceOfEventFilter> | Parameters<IAddRepetitionOfEventFilter> | Parameters<IAddPresenceOfTransitionFilter> | Parameters<IAddDurationOfTransitionFilter>): void;
|
|
400
|
+
/** Добавить фильтр по этапам */
|
|
401
|
+
addStagesFilter(value: Omit<IStagesFilterValue, "widgetKey">): void;
|
|
402
|
+
/** Удалить фильтр по этапам */
|
|
403
|
+
removeStagesFilter(widgetKey: string): void;
|
|
404
|
+
}
|
|
377
405
|
|
|
378
406
|
declare enum EWidgetFilterMode {
|
|
379
407
|
DEFAULT = "DEFAULT",
|
|
@@ -1144,6 +1172,16 @@ interface IDefinition<WidgetSettings extends IBaseWidgetSettings, GroupSettings
|
|
|
1144
1172
|
getMeasures?(settings: WidgetSettings): IWidgetMeasure[];
|
|
1145
1173
|
}
|
|
1146
1174
|
|
|
1175
|
+
type TLaunchActionParams = {
|
|
1176
|
+
action: IWidgetAction;
|
|
1177
|
+
onSuccess: () => void;
|
|
1178
|
+
filters: ICalculatorFilter[];
|
|
1179
|
+
needConfirmation?: boolean;
|
|
1180
|
+
};
|
|
1181
|
+
type TWidgetContainer = {
|
|
1182
|
+
/** Имеет ли контейнер виджета ограниченную максимальную высоту */
|
|
1183
|
+
isMaxHeightLimited: boolean;
|
|
1184
|
+
};
|
|
1147
1185
|
interface IWidgetProps<WidgetSettings extends IBaseWidgetSettings = IBaseWidgetSettings> {
|
|
1148
1186
|
/** guid виджета */
|
|
1149
1187
|
guid: string;
|
|
@@ -1166,17 +1204,10 @@ interface IWidgetProps<WidgetSettings extends IBaseWidgetSettings = IBaseWidgetS
|
|
|
1166
1204
|
placeholder: IWidgetPlaceholderController;
|
|
1167
1205
|
/** Контекст виджетов */
|
|
1168
1206
|
widgetsContext: IWidgetsContext;
|
|
1169
|
-
/** Вызывает модальное окно для запуска действия */
|
|
1170
|
-
launchAction(params: {
|
|
1171
|
-
action: IWidgetAction;
|
|
1172
|
-
onSuccess: () => void;
|
|
1173
|
-
filters: ICalculatorFilter[];
|
|
1174
|
-
}): void;
|
|
1175
1207
|
/** Данные о контейнере виджета */
|
|
1176
|
-
widgetContainer:
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
};
|
|
1208
|
+
widgetContainer: TWidgetContainer;
|
|
1209
|
+
/** Запуск действия */
|
|
1210
|
+
launchAction(params: TLaunchActionParams): void;
|
|
1180
1211
|
}
|
|
1181
1212
|
interface ICustomWidgetProps<WidgetSettings extends IBaseWidgetSettings = IBaseWidgetSettings> extends IWidgetProps<WidgetSettings> {
|
|
1182
1213
|
/** @deprecated - нужно использовать из widgetsContext */
|
|
@@ -1348,4 +1379,4 @@ declare global {
|
|
|
1348
1379
|
}
|
|
1349
1380
|
}
|
|
1350
1381
|
|
|
1351
|
-
export { ECalculatorFilterMethods, EColorMode, EControlType, EDbType, EDimensionTemplateNames, EDisplayConditionMode, EDurationUnit, EEventMeasureTemplateNames, EFormatTypes, EFormattingPresets, EFormulaFilterFieldKeys, EIndicatorType, ELastTimeUnit, EMeasureTemplateNames, EProcessFilterNames, ESimpleDataType, ESortDirection, ESortingValueModes, ETransitionMeasureTemplateNames, EWidgetActionInputMode, EWidgetFilterMode, EWidgetIndicatorType, EWidgetIndicatorValueModes, type IActionScript, type IAddDurationOfTransitionFilter, type IAddPresenceOfEventFilter, type IAddPresenceOfTransitionFilter, type IAddRepetitionOfEventFilter, type IBaseDimensionsAndMeasuresCalculator, type IBaseDimensionsAndMeasuresCalculatorInput, type IBaseDimensionsAndMeasuresCalculatorOutput, type IBaseWidgetSettings, type ICalculator, type ICalculatorDimensionInput, type ICalculatorDimensionOutput, type ICalculatorFactory, type ICalculatorFilter, type ICalculatorIndicatorInput, type ICalculatorIndicatorOutput, type ICalculatorMeasureInput, type ICalculatorMeasureOutput, type ICalculatorVariable, type ICalculatorVariablesValues, type ICommonColumnIndicator, type IControlRecord, type ICustomAddButtonProps, type ICustomWidgetProps, type IDefinition, type IDimensionSelection, type IDimensionSelectionByFormula, type IDisplayPredicate, type IDivePanelDescription, type IDividerRecord, type IEdge, type IExportColumnOrder, type IFillSettings, type IFormulaFilterValue, type IGeneralCalculator, type IGeneralCalculatorExportInput, type IGeneralCalculatorInput, type IGeneralCalculatorOutput, type IGraphElement, type IGroupSetDescription, type IGroupSetRecord, type IGroupSettings, type IHistogramBin, type IHistogramCalculator, type IHistogramCalculatorInput, type IHistogramCalculatorOutput, type ILens, type IPanelDescription, type IPanelDescriptionCreator, type IPieCalculator, type IPieCalculatorInput, type IPieCalculatorOutput, type IProcessEventFilterValue, type IProcessEventIndicator, type IProcessGraphCalculator, type IProcessGraphCalculatorInput, type IProcessGraphCalculatorOutput, type IProcessIndicator, type IProcessTransitionFilterValue, type IProcessTransitionIndicator, type IRange, type ISelectOption, type ISortOrder, type ITwoLimitsCalculator, type ITwoLimitsCalculatorExportInput, type ITwoLimitsCalculatorInput, type ITwoLimitsCalculatorOutput, type ITypeCalculator, type ITypeCalculatorInput, type ITypeCalculatorOutput, type IVertex, type IWidget, type IWidgetAction, type IWidgetActionInput, type IWidgetColumnIndicator, type IWidgetDimension, type IWidgetDimensionHierarchy, type IWidgetEntity, type IWidgetFiltration, type IWidgetFormatting, type IWidgetFormulaFilterValue, type IWidgetIndicator, type IWidgetMeasure, type IWidgetPlaceholderController, type IWidgetProcess, type IWidgetProps, type IWidgetSortingIndicator, type IWidgetTable, type IWidgetTableColumn, type IWidgetsContext, type TBoundedContentWithIndicator, type TColor, type TColumnIndicatorValue, type TDefineWidgetOptions, type TDisplayCondition, type TDisplayMode, type TEmptyRecord, type TGroupLevelRecord, type TProcessIndicatorValue, type TRecordAccessor, type TSortDirection, type TUpdateSelection, type TValuePath, type TWidgetActionInputValue, type TWidgetFiltering, type TWidgetLevelRecord, type TWidgetSortingValue, type TWidgetSortingValueRelatedWidgetDimension, type TWidgetSortingValueRelatedWidgetIndicator, type TWidgetSortingValueRelatedWidgetMeasure, type TWidgetVariable, bindContentWithIndicator, bindContentsWithIndicators, checkDisplayCondition, dimensionTemplateFormulas, escapeSpecialCharacters, eventMeasureTemplateFormulas, fillTemplateString, formulaFilterMethods, generateColumnFormula, getDimensionFormula, getDisplayConditionFormula, getEventMeasureFormula, getLocalizedText, getMeasureFormula, getTransitionMeasureFormula, isActionValid, isHierarchy, mapDimensionsToInputs, mapEventMeasuresToInputs, mapFormulaFilterToCalculatorInput, mapFormulaFiltersToInputs, mapMeasuresToInputs, mapSortingToInputs, mapTransitionMeasuresToInputs, mapVariablesToInputs, measureTemplateFormulas, prepareValuesForSql, replaceDisplayCondition, replaceFiltersBySelection, replaceHierarchiesWithDimensions, selectDimensionFromHierarchy, transitionMeasureTemplateFormulas, updateDefaultModeSelection, updateMultiModeSelection, updateSingleModeSelection };
|
|
1382
|
+
export { ECalculatorFilterMethods, EColorMode, EControlType, EDbType, EDimensionTemplateNames, EDisplayConditionMode, EDurationUnit, EEventMeasureTemplateNames, EFormatTypes, EFormattingPresets, EFormulaFilterFieldKeys, EIndicatorType, ELastTimeUnit, EMeasureTemplateNames, EProcessFilterNames, ESimpleDataType, ESortDirection, ESortingValueModes, ETransitionMeasureTemplateNames, EWidgetActionInputMode, EWidgetFilterMode, EWidgetIndicatorType, EWidgetIndicatorValueModes, type IActionScript, type IAddDurationOfTransitionFilter, type IAddPresenceOfEventFilter, type IAddPresenceOfTransitionFilter, type IAddRepetitionOfEventFilter, type IBaseDimensionsAndMeasuresCalculator, type IBaseDimensionsAndMeasuresCalculatorInput, type IBaseDimensionsAndMeasuresCalculatorOutput, type IBaseWidgetSettings, type ICalculator, type ICalculatorDimensionInput, type ICalculatorDimensionOutput, type ICalculatorFactory, type ICalculatorFilter, type ICalculatorIndicatorInput, type ICalculatorIndicatorOutput, type ICalculatorMeasureInput, type ICalculatorMeasureOutput, type ICalculatorVariable, type ICalculatorVariablesValues, type ICommonColumnIndicator, type IControlRecord, type ICustomAddButtonProps, type ICustomWidgetProps, type IDefinition, type IDimensionSelection, type IDimensionSelectionByFormula, type IDisplayPredicate, type IDivePanelDescription, type IDividerRecord, type IEdge, type IExportColumnOrder, type IFillSettings, type IFormulaFilterValue, type IGeneralCalculator, type IGeneralCalculatorExportInput, type IGeneralCalculatorInput, type IGeneralCalculatorOutput, type IGraphElement, type IGroupSetDescription, type IGroupSetRecord, type IGroupSettings, type IHistogramBin, type IHistogramCalculator, type IHistogramCalculatorInput, type IHistogramCalculatorOutput, type ILens, type IPanelDescription, type IPanelDescriptionCreator, type IPieCalculator, type IPieCalculatorInput, type IPieCalculatorOutput, type IProcessEventFilterValue, type IProcessEventIndicator, type IProcessGraphCalculator, type IProcessGraphCalculatorInput, type IProcessGraphCalculatorOutput, type IProcessIndicator, type IProcessTransitionFilterValue, type IProcessTransitionIndicator, type IRange, type ISelectOption, type ISortOrder, type IStagesFilterValue, type ITwoLimitsCalculator, type ITwoLimitsCalculatorExportInput, type ITwoLimitsCalculatorInput, type ITwoLimitsCalculatorOutput, type ITypeCalculator, type ITypeCalculatorInput, type ITypeCalculatorOutput, type IVertex, type IWidget, type IWidgetAction, type IWidgetActionInput, type IWidgetColumnIndicator, type IWidgetDimension, type IWidgetDimensionHierarchy, type IWidgetEntity, type IWidgetFilter, type IWidgetFiltration, type IWidgetFormatting, type IWidgetFormulaFilterValue, type IWidgetIndicator, type IWidgetMeasure, type IWidgetPlaceholderController, type IWidgetProcess, type IWidgetProps, type IWidgetSortingIndicator, type IWidgetTable, type IWidgetTableColumn, type IWidgetsContext, type TBoundedContentWithIndicator, type TColor, type TColumnIndicatorValue, type TDefineWidgetOptions, type TDisplayCondition, type TDisplayMode, type TEmptyRecord, type TGroupLevelRecord, type TLaunchActionParams, type TProcessIndicatorValue, type TRecordAccessor, type TSelectivePartial, type TSortDirection, type TUpdateSelection, type TValuePath, type TWidgetActionInputValue, type TWidgetContainer, type TWidgetFilterValue, type TWidgetFiltering, type TWidgetLevelRecord, type TWidgetSortingValue, type TWidgetSortingValueRelatedWidgetDimension, type TWidgetSortingValueRelatedWidgetIndicator, type TWidgetSortingValueRelatedWidgetMeasure, type TWidgetVariable, bindContentWithIndicator, bindContentsWithIndicators, checkDisplayCondition, dimensionTemplateFormulas, escapeSpecialCharacters, eventMeasureTemplateFormulas, fillTemplateString, formulaFilterMethods, generateColumnFormula, getDimensionFormula, getDisplayConditionFormula, getEventMeasureFormula, getLocalizedText, getMeasureFormula, getTransitionMeasureFormula, isActionValid, isHierarchy, mapDimensionsToInputs, mapEventMeasuresToInputs, mapFormulaFilterToCalculatorInput, mapFormulaFiltersToInputs, mapMeasuresToInputs, mapSortingToInputs, mapTransitionMeasuresToInputs, mapVariablesToInputs, measureTemplateFormulas, prepareValuesForSql, replaceDisplayCondition, replaceFiltersBySelection, replaceHierarchiesWithDimensions, selectDimensionFromHierarchy, transitionMeasureTemplateFormulas, updateDefaultModeSelection, updateMultiModeSelection, updateSingleModeSelection };
|
package/dist/index.esm.js
CHANGED
|
@@ -940,6 +940,7 @@ var EControlType;
|
|
|
940
940
|
EControlType["eventsColor"] = "eventsColor";
|
|
941
941
|
EControlType["inputMarkdown"] = "inputMarkdown";
|
|
942
942
|
EControlType["filter"] = "filter";
|
|
943
|
+
EControlType["actionOnClick"] = "actionOnClick";
|
|
943
944
|
})(EControlType || (EControlType = {}));
|
|
944
945
|
|
|
945
946
|
var ESortDirection;
|
package/dist/index.js
CHANGED
|
@@ -941,6 +941,7 @@ exports.EControlType = void 0;
|
|
|
941
941
|
EControlType["eventsColor"] = "eventsColor";
|
|
942
942
|
EControlType["inputMarkdown"] = "inputMarkdown";
|
|
943
943
|
EControlType["filter"] = "filter";
|
|
944
|
+
EControlType["actionOnClick"] = "actionOnClick";
|
|
944
945
|
})(exports.EControlType || (exports.EControlType = {}));
|
|
945
946
|
|
|
946
947
|
exports.ESortDirection = void 0;
|