@infomaximum/widget-sdk 3.22.0 → 3.24.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.
- package/dist/index.d.ts +48 -18
- package/dist/index.esm.js +9 -8
- package/dist/index.js +9 -8
- 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
|
interface IPlacement {
|
|
379
407
|
left: number;
|
|
@@ -1152,6 +1180,12 @@ interface IDefinition<WidgetSettings extends IBaseWidgetSettings, GroupSettings
|
|
|
1152
1180
|
getMeasures?(settings: WidgetSettings): IWidgetMeasure[];
|
|
1153
1181
|
}
|
|
1154
1182
|
|
|
1183
|
+
type TLaunchActionParams = {
|
|
1184
|
+
action: IWidgetAction;
|
|
1185
|
+
onSuccess: () => void;
|
|
1186
|
+
filters: ICalculatorFilter[];
|
|
1187
|
+
needConfirmation?: boolean;
|
|
1188
|
+
};
|
|
1155
1189
|
interface IWidgetProps<WidgetSettings extends IBaseWidgetSettings = IBaseWidgetSettings> {
|
|
1156
1190
|
/** guid виджета */
|
|
1157
1191
|
guid: string;
|
|
@@ -1174,12 +1208,8 @@ interface IWidgetProps<WidgetSettings extends IBaseWidgetSettings = IBaseWidgetS
|
|
|
1174
1208
|
placeholder: IWidgetPlaceholderController;
|
|
1175
1209
|
/** Контекст виджета */
|
|
1176
1210
|
widgetsContext: IWidgetsContext;
|
|
1177
|
-
/**
|
|
1178
|
-
launchAction(params:
|
|
1179
|
-
action: IWidgetAction;
|
|
1180
|
-
onSuccess: () => void;
|
|
1181
|
-
filters: ICalculatorFilter[];
|
|
1182
|
-
}): void;
|
|
1211
|
+
/** Запуск действия */
|
|
1212
|
+
launchAction(params: TLaunchActionParams): void;
|
|
1183
1213
|
}
|
|
1184
1214
|
interface ICustomWidgetProps<WidgetSettings extends IBaseWidgetSettings = IBaseWidgetSettings> extends IWidgetProps<WidgetSettings> {
|
|
1185
1215
|
/** @deprecated - нужно использовать из widgetsContext */
|
|
@@ -1351,4 +1381,4 @@ declare global {
|
|
|
1351
1381
|
}
|
|
1352
1382
|
}
|
|
1353
1383
|
|
|
1354
|
-
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 IPlacement, 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 };
|
|
1384
|
+
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 IPlacement, 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 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
|
@@ -513,6 +513,14 @@ var replaceDisplayCondition = function (dimension, displayCondition) {
|
|
|
513
513
|
: __assign(__assign({}, dimension), { displayCondition: displayCondition });
|
|
514
514
|
};
|
|
515
515
|
|
|
516
|
+
var escapeSpecialCharacters = function (formula) {
|
|
517
|
+
return formula
|
|
518
|
+
.replaceAll("\\", "\\\\")
|
|
519
|
+
.replaceAll('"', '\\"')
|
|
520
|
+
.replaceAll("`", "\\`")
|
|
521
|
+
.replaceAll("-", "\\-");
|
|
522
|
+
};
|
|
523
|
+
|
|
516
524
|
function generateColumnFormula(tableName, columnName) {
|
|
517
525
|
var preparedTableName = escapeSpecialCharacters(tableName);
|
|
518
526
|
var preparedColumnName = escapeSpecialCharacters(columnName);
|
|
@@ -913,14 +921,6 @@ function bindContentsWithIndicators(outputs, indicators) {
|
|
|
913
921
|
});
|
|
914
922
|
}
|
|
915
923
|
|
|
916
|
-
var escapeSpecialCharacters = function (formula) {
|
|
917
|
-
return formula
|
|
918
|
-
.replaceAll("\\", "\\\\")
|
|
919
|
-
.replaceAll('"', '\\"')
|
|
920
|
-
.replaceAll("`", "\\`")
|
|
921
|
-
.replaceAll("-", "\\-");
|
|
922
|
-
};
|
|
923
|
-
|
|
924
924
|
var EControlType;
|
|
925
925
|
(function (EControlType) {
|
|
926
926
|
EControlType["inputNumber"] = "inputNumber";
|
|
@@ -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
|
@@ -514,6 +514,14 @@ var replaceDisplayCondition = function (dimension, displayCondition) {
|
|
|
514
514
|
: __assign(__assign({}, dimension), { displayCondition: displayCondition });
|
|
515
515
|
};
|
|
516
516
|
|
|
517
|
+
var escapeSpecialCharacters = function (formula) {
|
|
518
|
+
return formula
|
|
519
|
+
.replaceAll("\\", "\\\\")
|
|
520
|
+
.replaceAll('"', '\\"')
|
|
521
|
+
.replaceAll("`", "\\`")
|
|
522
|
+
.replaceAll("-", "\\-");
|
|
523
|
+
};
|
|
524
|
+
|
|
517
525
|
function generateColumnFormula(tableName, columnName) {
|
|
518
526
|
var preparedTableName = escapeSpecialCharacters(tableName);
|
|
519
527
|
var preparedColumnName = escapeSpecialCharacters(columnName);
|
|
@@ -914,14 +922,6 @@ function bindContentsWithIndicators(outputs, indicators) {
|
|
|
914
922
|
});
|
|
915
923
|
}
|
|
916
924
|
|
|
917
|
-
var escapeSpecialCharacters = function (formula) {
|
|
918
|
-
return formula
|
|
919
|
-
.replaceAll("\\", "\\\\")
|
|
920
|
-
.replaceAll('"', '\\"')
|
|
921
|
-
.replaceAll("`", "\\`")
|
|
922
|
-
.replaceAll("-", "\\-");
|
|
923
|
-
};
|
|
924
|
-
|
|
925
925
|
exports.EControlType = void 0;
|
|
926
926
|
(function (EControlType) {
|
|
927
927
|
EControlType["inputNumber"] = "inputNumber";
|
|
@@ -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;
|