@infomaximum/widget-sdk 4.0.0-beta47 → 4.0.0-beta49
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 +149 -83
- package/dist/index.esm.js +78 -99
- package/dist/index.js +79 -99
- package/package.json +2 -1
package/dist/index.d.ts
CHANGED
|
@@ -264,8 +264,8 @@ declare enum EDurationUnit {
|
|
|
264
264
|
MINUTES = "MINUTES",
|
|
265
265
|
SECONDS = "SECONDS"
|
|
266
266
|
}
|
|
267
|
-
declare const mapFormulaFilterToCalculatorInput: (filterValue:
|
|
268
|
-
declare const mapFormulaFiltersToInputs: (filters:
|
|
267
|
+
declare const mapFormulaFilterToCalculatorInput: (filterValue: TExtendedFormulaFilterValue) => TNullable<ICalculatorFilter>;
|
|
268
|
+
declare const mapFormulaFiltersToInputs: (filters: TExtendedFormulaFilterValue[]) => ICalculatorFilter[];
|
|
269
269
|
|
|
270
270
|
type TSelectivePartial<T, Keys extends keyof T> = Omit<T, Keys> & Partial<Pick<T, Keys>>;
|
|
271
271
|
declare const formulaFilterMethods: {
|
|
@@ -384,6 +384,9 @@ interface IFormulaFilterValue {
|
|
|
384
384
|
[EFormulaFilterFieldKeys.durationUnit]: EDurationUnit;
|
|
385
385
|
}>;
|
|
386
386
|
}
|
|
387
|
+
type TExtendedFormulaFilterValue = {
|
|
388
|
+
formula: string;
|
|
389
|
+
} | IFormulaFilterValue;
|
|
387
390
|
interface IStagesFilterItem {
|
|
388
391
|
id: number;
|
|
389
392
|
/** Название этапа */
|
|
@@ -419,6 +422,7 @@ interface IWidgetFiltration {
|
|
|
419
422
|
/** Удалить фильтр по этапам */
|
|
420
423
|
removeStagesFilter(widgetKey: string): void;
|
|
421
424
|
}
|
|
425
|
+
declare const isFormulaFilterValue: (value: TExtendedFormulaFilterValue) => value is IFormulaFilterValue;
|
|
422
426
|
|
|
423
427
|
declare enum EWidgetFilterMode {
|
|
424
428
|
DEFAULT = "DEFAULT",
|
|
@@ -520,9 +524,15 @@ interface IWidgetTableColumn {
|
|
|
520
524
|
/** Тип данных колонки */
|
|
521
525
|
dataType: ESimpleDataType;
|
|
522
526
|
}
|
|
527
|
+
interface IScripField {
|
|
528
|
+
guid: string;
|
|
529
|
+
name: string;
|
|
530
|
+
dataType: ESimpleDataType;
|
|
531
|
+
}
|
|
523
532
|
interface IActionScript {
|
|
524
|
-
|
|
525
|
-
|
|
533
|
+
key: string;
|
|
534
|
+
name: string;
|
|
535
|
+
fields: IScripField[];
|
|
526
536
|
}
|
|
527
537
|
interface IWidgetTable {
|
|
528
538
|
/** Имя таблицы */
|
|
@@ -555,7 +565,7 @@ interface IWidgetsContext {
|
|
|
555
565
|
variables: Map<string, TWidgetVariable>;
|
|
556
566
|
/** Метод установки значения переменной отчета */
|
|
557
567
|
setVariableValue(name: string, value: TNullable<string> | string[]): void;
|
|
558
|
-
|
|
568
|
+
states: Map<string, ICommonState>;
|
|
559
569
|
reportName: string;
|
|
560
570
|
/**
|
|
561
571
|
* режим дашборда
|
|
@@ -574,104 +584,146 @@ interface IWidgetsContext {
|
|
|
574
584
|
fetchColumnsByTableName(tableName: string): Promise<IWidgetTableColumn[] | undefined>;
|
|
575
585
|
}
|
|
576
586
|
|
|
577
|
-
declare enum
|
|
578
|
-
|
|
579
|
-
|
|
587
|
+
declare enum EWidgetActionInputMethod {
|
|
588
|
+
COLUMN = "COLUMN",
|
|
589
|
+
VARIABLE = "VARIABLE",
|
|
580
590
|
STATIC_LIST = "STATIC_LIST",
|
|
581
591
|
DYNAMIC_LIST = "DYNAMIC_LIST",
|
|
582
592
|
FORMULA = "FORMULA",
|
|
583
|
-
MANUALLY = "MANUALLY"
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
name: string;
|
|
593
|
+
MANUALLY = "MANUALLY",
|
|
594
|
+
EVENT = "EVENT",
|
|
595
|
+
START_EVENT = "START_EVENT",
|
|
596
|
+
FINISH_EVENT = "FINISH_EVENT"
|
|
588
597
|
}
|
|
589
598
|
declare enum EActionTypes {
|
|
590
|
-
|
|
599
|
+
OPEN_URL = "OPEN_URL",
|
|
591
600
|
UPDATE_VARIABLE = "UPDATE_VARIABLE",
|
|
592
|
-
|
|
601
|
+
EXECUTE_SCRIPT = "EXECUTE_SCRIPT",
|
|
593
602
|
OPEN_VIEW = "OPEN_VIEW"
|
|
594
603
|
}
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
url: string;
|
|
598
|
-
targetBlank: boolean;
|
|
599
|
-
}
|
|
600
|
-
interface IActionScriptField {
|
|
601
|
-
name: string;
|
|
602
|
-
id: number;
|
|
603
|
-
value: TWidgetActionInputValue;
|
|
604
|
-
}
|
|
605
|
-
interface IActionRunScript extends IActionCommon {
|
|
606
|
-
description: string;
|
|
607
|
-
type: EActionTypes.RUN_SCRIPT;
|
|
608
|
-
filters: (IFormulaFilterValue | string)[];
|
|
609
|
-
inputs: IActionScriptField[];
|
|
610
|
-
scriptName: string;
|
|
611
|
-
shouldRefreshWidgetsAfterExecution: boolean;
|
|
612
|
-
}
|
|
613
|
-
interface IActionUpdateVariable extends IActionCommon {
|
|
614
|
-
type: EActionTypes.UPDATE_VARIABLE;
|
|
615
|
-
variables: Array<string>;
|
|
616
|
-
}
|
|
617
|
-
declare enum EViewType {
|
|
618
|
-
CREATED_VIEW = "CREATED_VIEW",
|
|
604
|
+
declare enum EViewMode {
|
|
605
|
+
EXISTED_VIEW = "EXISTED_VIEW",
|
|
619
606
|
GENERATED_BY_SCRIPT = "GENERATED_BY_SCRIPT"
|
|
620
607
|
}
|
|
621
|
-
declare enum
|
|
608
|
+
declare enum EViewOpenIn {
|
|
622
609
|
NEW_WINDOW = "NEW_WINDOW",
|
|
610
|
+
CURRENT_WINDOW = "CURRENT_WINDOW",
|
|
623
611
|
PLACEHOLDER = "PLACEHOLDER",
|
|
624
|
-
|
|
625
|
-
|
|
612
|
+
MODAL_WINDOW = "MODAL_WINDOW",
|
|
613
|
+
DRAWER_WINDOW = "DRAWER_WINDOW"
|
|
626
614
|
}
|
|
627
615
|
declare enum EDrawerPlacement {
|
|
628
616
|
LEFT = "LEFT",
|
|
629
617
|
RIGHT = "RIGHT"
|
|
630
618
|
}
|
|
631
|
-
interface
|
|
632
|
-
|
|
633
|
-
viewName: string;
|
|
634
|
-
viewKey: string;
|
|
635
|
-
openMode: EOpenViewMode;
|
|
636
|
-
viewType: EViewType;
|
|
637
|
-
drawerPlacement: EDrawerPlacement;
|
|
638
|
-
placeholderName: string;
|
|
639
|
-
inputs: IActionScriptField[];
|
|
640
|
-
isOpenInCurrentWindow?: boolean;
|
|
641
|
-
}
|
|
642
|
-
type TActionsOnClick = IActionGoToUrl | IActionRunScript | IActionUpdateVariable | IActionOpenView;
|
|
643
|
-
type TWidgetActionCommonInputValue = {
|
|
644
|
-
name: string;
|
|
645
|
-
isHidden: boolean;
|
|
646
|
-
};
|
|
647
|
-
type TWidgetActionInputValue = TWidgetActionCommonInputValue & ({
|
|
648
|
-
mode: EWidgetActionInputMode.FROM_COLUMN;
|
|
619
|
+
interface IParameterFromColumn {
|
|
620
|
+
inputMethod: EWidgetActionInputMethod.COLUMN;
|
|
649
621
|
tableName: string;
|
|
650
622
|
columnName: string;
|
|
651
|
-
}
|
|
652
|
-
|
|
623
|
+
}
|
|
624
|
+
interface IParameterFromVariable {
|
|
625
|
+
inputMethod: EWidgetActionInputMethod.VARIABLE;
|
|
653
626
|
sourceVariable: string;
|
|
654
|
-
}
|
|
655
|
-
|
|
627
|
+
}
|
|
628
|
+
interface IParameterFromFormula {
|
|
629
|
+
inputMethod: EWidgetActionInputMethod.FORMULA;
|
|
656
630
|
formula: string;
|
|
657
|
-
}
|
|
658
|
-
|
|
631
|
+
}
|
|
632
|
+
interface IParameterFromEvent {
|
|
633
|
+
inputMethod: EWidgetActionInputMethod.EVENT;
|
|
634
|
+
}
|
|
635
|
+
interface IParameterFromStartEvent {
|
|
636
|
+
inputMethod: EWidgetActionInputMethod.START_EVENT;
|
|
637
|
+
}
|
|
638
|
+
interface IParameterFromEndEvent {
|
|
639
|
+
inputMethod: EWidgetActionInputMethod.FINISH_EVENT;
|
|
640
|
+
}
|
|
641
|
+
interface IParameterFromManualInput {
|
|
642
|
+
inputMethod: EWidgetActionInputMethod.MANUALLY;
|
|
659
643
|
description: string;
|
|
660
|
-
}
|
|
661
|
-
|
|
644
|
+
}
|
|
645
|
+
interface IParameterFromStaticList {
|
|
646
|
+
inputMethod: EWidgetActionInputMethod.STATIC_LIST;
|
|
662
647
|
options: string[];
|
|
663
648
|
defaultOptionIndex: number;
|
|
664
|
-
}
|
|
665
|
-
|
|
649
|
+
}
|
|
650
|
+
interface IParameterFromDynamicList {
|
|
651
|
+
inputMethod: EWidgetActionInputMethod.DYNAMIC_LIST;
|
|
666
652
|
formula: string;
|
|
667
653
|
defaultValue: string;
|
|
668
|
-
filters:
|
|
669
|
-
}
|
|
670
|
-
interface
|
|
654
|
+
filters: TExtendedFormulaFilterValue[];
|
|
655
|
+
}
|
|
656
|
+
interface IWidgetActionParameterCommon {
|
|
657
|
+
name: string;
|
|
658
|
+
displayName: string;
|
|
659
|
+
isHidden: boolean;
|
|
660
|
+
}
|
|
661
|
+
type TWidgetActionParameter = IWidgetActionParameterCommon & (IParameterFromColumn | IParameterFromVariable | IParameterFromFormula | IParameterFromManualInput | IParameterFromStaticList | IParameterFromDynamicList);
|
|
662
|
+
interface IActionOnClickParameterCommon {
|
|
663
|
+
/** @deprecated удалить [BI-13546] */
|
|
664
|
+
id: number;
|
|
665
|
+
name: string;
|
|
666
|
+
}
|
|
667
|
+
type TActionOnClickParameter = IActionOnClickParameterCommon & (IParameterFromColumn | IParameterFromVariable | IParameterFromFormula | IParameterFromEvent | IParameterFromStartEvent | IParameterFromEndEvent);
|
|
668
|
+
interface IActionCommon {
|
|
669
|
+
/** @deprecated удалить [BI-13546] */
|
|
670
|
+
id: number;
|
|
671
671
|
name: string;
|
|
672
|
-
value: TWidgetActionInputValue;
|
|
673
672
|
}
|
|
674
|
-
|
|
673
|
+
interface IActionGoToUrl extends IActionCommon {
|
|
674
|
+
type: EActionTypes.OPEN_URL;
|
|
675
|
+
url: string;
|
|
676
|
+
newWindow: boolean;
|
|
677
|
+
}
|
|
678
|
+
interface IActionRunScript extends IActionCommon {
|
|
679
|
+
type: EActionTypes.EXECUTE_SCRIPT;
|
|
680
|
+
parameters: TActionOnClickParameter[];
|
|
681
|
+
scriptKey: string;
|
|
682
|
+
updateDashboard: boolean;
|
|
683
|
+
}
|
|
684
|
+
interface IActionUpdateVariable extends IActionCommon {
|
|
685
|
+
type: EActionTypes.UPDATE_VARIABLE;
|
|
686
|
+
variables: TActionOnClickParameter[];
|
|
687
|
+
}
|
|
688
|
+
type TActionOpenViewMode = {
|
|
689
|
+
mode: EViewMode.GENERATED_BY_SCRIPT;
|
|
690
|
+
scriptKey: string;
|
|
691
|
+
parameters: TActionOnClickParameter[];
|
|
692
|
+
displayName: string;
|
|
693
|
+
} | {
|
|
694
|
+
mode: EViewMode.EXISTED_VIEW;
|
|
695
|
+
viewKey: string;
|
|
696
|
+
parameters: TActionOnClickParameter[];
|
|
697
|
+
};
|
|
698
|
+
type TActionOpenIn = {
|
|
699
|
+
openIn: EViewOpenIn.DRAWER_WINDOW;
|
|
700
|
+
alignment: EDrawerPlacement;
|
|
701
|
+
} | {
|
|
702
|
+
openIn: EViewOpenIn.PLACEHOLDER;
|
|
703
|
+
placeholderName: string;
|
|
704
|
+
} | {
|
|
705
|
+
openIn: EViewOpenIn.NEW_WINDOW;
|
|
706
|
+
} | {
|
|
707
|
+
openIn: EViewOpenIn.MODAL_WINDOW;
|
|
708
|
+
} | {
|
|
709
|
+
openIn: EViewOpenIn.CURRENT_WINDOW;
|
|
710
|
+
};
|
|
711
|
+
type TActionOpenView = {
|
|
712
|
+
type: EActionTypes.OPEN_VIEW;
|
|
713
|
+
} & TActionOpenViewMode & TActionOpenIn & IActionCommon;
|
|
714
|
+
type TActionsOnClick = IActionGoToUrl | IActionRunScript | IActionUpdateVariable | TActionOpenView;
|
|
715
|
+
interface IWidgetAction extends IActionCommon {
|
|
716
|
+
filters: TExtendedFormulaFilterValue[];
|
|
717
|
+
parameters: TWidgetActionParameter[];
|
|
718
|
+
type: EActionTypes.EXECUTE_SCRIPT;
|
|
719
|
+
scriptKey: string;
|
|
720
|
+
updateDashboard: boolean;
|
|
721
|
+
description: string;
|
|
722
|
+
}
|
|
723
|
+
type TAction = TActionsOnClick | IWidgetAction;
|
|
724
|
+
declare const isExecuteScriptActionValid: (action: Extract<TAction, {
|
|
725
|
+
type: EActionTypes.EXECUTE_SCRIPT;
|
|
726
|
+
}>, { scripts, tables, variables }: IWidgetsContext) => boolean;
|
|
675
727
|
|
|
676
728
|
declare enum ESortDirection {
|
|
677
729
|
descend = "DESC",
|
|
@@ -781,8 +833,15 @@ declare enum ESortingValueModes {
|
|
|
781
833
|
/** Сортировка по мере пространства */
|
|
782
834
|
IN_WORKSPACE = "IN_WORKSPACE"
|
|
783
835
|
}
|
|
836
|
+
interface ICommonState {
|
|
837
|
+
name: string;
|
|
838
|
+
/** @deprecated удалить после выполнения BI-13602, задача BI-13650 */
|
|
839
|
+
guid: string;
|
|
840
|
+
}
|
|
784
841
|
interface ICommonColumnIndicator {
|
|
785
842
|
name: string;
|
|
843
|
+
/** @deprecated удалить после выполнения BI-13602, задача BI-13650 */
|
|
844
|
+
guid: string;
|
|
786
845
|
formula: string;
|
|
787
846
|
}
|
|
788
847
|
type TColumnIndicatorValue = {
|
|
@@ -862,6 +921,8 @@ type TWidgetVariable = {
|
|
|
862
921
|
defaultValue: string;
|
|
863
922
|
/** Тип данных */
|
|
864
923
|
dataType: ESimpleDataType;
|
|
924
|
+
/** @deprecated удалить после выполнения BI-13602, задача BI-13650 */
|
|
925
|
+
guid: string;
|
|
865
926
|
} | {
|
|
866
927
|
/** Тип переменной */
|
|
867
928
|
type: EIndicatorType.STATIC_LIST;
|
|
@@ -877,6 +938,8 @@ type TWidgetVariable = {
|
|
|
877
938
|
dataType: ESimpleDataType.STRING;
|
|
878
939
|
/** Множественный выбор */
|
|
879
940
|
multipleChoice: boolean;
|
|
941
|
+
/** @deprecated удалить после выполнения BI-13602, задача BI-13650 */
|
|
942
|
+
guid: string;
|
|
880
943
|
} | {
|
|
881
944
|
/** Тип переменной */
|
|
882
945
|
type: EIndicatorType.DYNAMIC_LIST;
|
|
@@ -893,22 +956,24 @@ type TWidgetVariable = {
|
|
|
893
956
|
/** Множественный выбор */
|
|
894
957
|
multipleChoice: boolean;
|
|
895
958
|
/** Фильтры */
|
|
896
|
-
filters:
|
|
959
|
+
filters: TExtendedFormulaFilterValue[];
|
|
960
|
+
/** @deprecated удалить после выполнения BI-13602, задача BI-13650 */
|
|
961
|
+
guid: string;
|
|
897
962
|
};
|
|
898
963
|
declare function isHierarchy(indicator: IWidgetColumnIndicator): indicator is IWidgetDimensionHierarchy;
|
|
899
964
|
|
|
900
965
|
interface IBaseWidgetSettings {
|
|
901
|
-
|
|
902
|
-
|
|
966
|
+
title?: string;
|
|
967
|
+
titleSize?: number;
|
|
903
968
|
stateName?: string | null;
|
|
904
969
|
showMarkdown?: boolean;
|
|
905
970
|
markdownMeasures?: IMarkdownMeasure[];
|
|
906
971
|
markdownText?: string;
|
|
907
|
-
filters?:
|
|
972
|
+
filters?: TExtendedFormulaFilterValue[];
|
|
908
973
|
filterMode?: EWidgetFilterMode;
|
|
909
974
|
ignoreFilters?: boolean;
|
|
910
975
|
sorting?: IWidgetSortingIndicator[];
|
|
911
|
-
actions?:
|
|
976
|
+
actions?: IWidgetAction[];
|
|
912
977
|
displayCondition?: TDisplayCondition;
|
|
913
978
|
displayConditionComment?: string;
|
|
914
979
|
}
|
|
@@ -1317,7 +1382,7 @@ interface IGroupSetDescription<Settings extends object, GroupSettings extends ob
|
|
|
1317
1382
|
/** Конфигурация левой панели */
|
|
1318
1383
|
interface IPanelDescription<Settings extends object, GroupSettings extends IGroupSettings = IGroupSettings> {
|
|
1319
1384
|
/** Добавить заголовок для виджета */
|
|
1320
|
-
|
|
1385
|
+
useTitle?: boolean;
|
|
1321
1386
|
/** Добавить описание для виджета */
|
|
1322
1387
|
useMarkdown?: boolean;
|
|
1323
1388
|
/** Конфигурация настроек данных виджета */
|
|
@@ -1438,10 +1503,11 @@ type TContextMenuButtonOptions = {
|
|
|
1438
1503
|
};
|
|
1439
1504
|
|
|
1440
1505
|
type TLaunchActionParams = {
|
|
1441
|
-
action:
|
|
1506
|
+
action: TAction;
|
|
1442
1507
|
onSuccess: () => void;
|
|
1443
1508
|
filters: ICalculatorFilter[];
|
|
1444
1509
|
needConfirmation?: boolean;
|
|
1510
|
+
eventNames?: [string] | [string, string];
|
|
1445
1511
|
};
|
|
1446
1512
|
type TWidgetContainer = {
|
|
1447
1513
|
/** Имеет ли контейнер виджета ограниченную максимальную высоту */
|
|
@@ -1656,4 +1722,4 @@ declare global {
|
|
|
1656
1722
|
}
|
|
1657
1723
|
}
|
|
1658
1724
|
|
|
1659
|
-
export { EActionTypes, ECalculatorFilterMethods, EColorMode, EColorScope, EControlType, ECustomSelectTemplates, EDbType, EDimensionTemplateNames, EDisplayConditionMode, EDrawerPlacement, EDurationUnit, EEventMeasureTemplateNames, EFormatTypes, EFormattingPresets, EFormulaFilterFieldKeys, EIndicatorType, ELastTimeUnit, EMarkdownDisplayMode, EMeasureTemplateNames,
|
|
1725
|
+
export { EActionTypes, ECalculatorFilterMethods, EColorMode, EColorScope, EControlType, ECustomSelectTemplates, EDbType, EDimensionTemplateNames, EDisplayConditionMode, EDrawerPlacement, EDurationUnit, EEventMeasureTemplateNames, EFormatTypes, EFormattingPresets, EFormulaFilterFieldKeys, EIndicatorType, ELastTimeUnit, EMarkdownDisplayMode, EMeasureTemplateNames, EProcessFilterNames, ESelectOptionTypes, ESimpleDataType, ESortDirection, ESortingValueModes, ETransitionMeasureTemplateNames, 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 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 IColoredValue, type ICommonColumnIndicator, 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 IGraphElement, type IGroupSetDescription, type IGroupSetRecord, type IGroupSettings, type IHistogramBin, type IHistogramCalculator, type IHistogramCalculatorInput, type IHistogramCalculatorOutput, type ILens, type IMarkdownMeasure, type IMeasureMenuConfig, 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 ISortingMenuConfig, type IStagesFilterValue, type ITwoLimitsCalculator, type ITwoLimitsCalculatorExportInput, type ITwoLimitsCalculatorInput, type ITwoLimitsCalculatorOutput, type ITypeCalculator, type ITypeCalculatorInput, type ITypeCalculatorOutput, type IVertex, type IWidget, type IWidgetAction, type IWidgetColumnIndicator, type IWidgetDimension, type IWidgetDimensionHierarchy, type IWidgetEntity, type IWidgetFilter, type IWidgetFiltration, type IWidgetFormatting, type IWidgetFormulaFilterValue, type IWidgetIndicator, type IWidgetIndicatorMenuConfig, type IWidgetMeasure, type IWidgetPersistValue, type IWidgetPlaceholderController, type IWidgetPlaceholderValues, type IWidgetProcess, type IWidgetProps, type IWidgetSortingIndicator, type IWidgetTable, type IWidgetTableColumn, type IWidgetsContext, type TAction, type TActionOnClickParameter, type TActionOpenView, type TActionsOnClick, 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 TUpdateSelection, type TValuePath, type TWidgetActionParameter, 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, isExecuteScriptActionValid, isFormulaFilterValue, isHierarchy, mapDimensionsToInputs, mapEventMeasuresToInputs, mapFormulaFilterToCalculatorInput, mapFormulaFiltersToInputs, mapMeasuresToInputs, mapSortingToInputs, mapTransitionMeasuresToInputs, measureTemplateFormulas, prepareValuesForSql, replaceDisplayCondition, replaceFiltersBySelection, replaceHierarchiesWithDimensions, selectDimensionFromHierarchy, transitionMeasureTemplateFormulas, unescapeSpecialCharacters, updateDefaultModeSelection, updateMultiModeSelection, updateSingleModeSelection };
|
package/dist/index.esm.js
CHANGED
|
@@ -2,129 +2,72 @@ import { Localization } from '@infomaximum/localization';
|
|
|
2
2
|
export { ELanguages } from '@infomaximum/localization';
|
|
3
3
|
export { EFilteringMethodValues } from '@infomaximum/base-filter';
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
18
|
-
***************************************************************************** */
|
|
19
|
-
/* global Reflect, Promise, SuppressedError, Symbol */
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
var __assign = function() {
|
|
23
|
-
__assign = Object.assign || function __assign(t) {
|
|
24
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
25
|
-
s = arguments[i];
|
|
26
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
27
|
-
}
|
|
28
|
-
return t;
|
|
29
|
-
};
|
|
30
|
-
return __assign.apply(this, arguments);
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
function __read(o, n) {
|
|
34
|
-
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
35
|
-
if (!m) return o;
|
|
36
|
-
var i = m.call(o), r, ar = [], e;
|
|
37
|
-
try {
|
|
38
|
-
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
39
|
-
}
|
|
40
|
-
catch (error) { e = { error: error }; }
|
|
41
|
-
finally {
|
|
42
|
-
try {
|
|
43
|
-
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
44
|
-
}
|
|
45
|
-
finally { if (e) throw e.error; }
|
|
46
|
-
}
|
|
47
|
-
return ar;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
function __spreadArray(to, from, pack) {
|
|
51
|
-
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
52
|
-
if (ar || !(i in from)) {
|
|
53
|
-
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
54
|
-
ar[i] = from[i];
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
61
|
-
var e = new Error(message);
|
|
62
|
-
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
63
|
-
};
|
|
64
|
-
|
|
65
|
-
var EWidgetActionInputMode;
|
|
66
|
-
(function (EWidgetActionInputMode) {
|
|
67
|
-
EWidgetActionInputMode["FROM_COLUMN"] = "FROM_COLUMN";
|
|
68
|
-
EWidgetActionInputMode["FROM_VARIABLE"] = "FROM_VARIABLE";
|
|
69
|
-
EWidgetActionInputMode["STATIC_LIST"] = "STATIC_LIST";
|
|
70
|
-
EWidgetActionInputMode["DYNAMIC_LIST"] = "DYNAMIC_LIST";
|
|
71
|
-
EWidgetActionInputMode["FORMULA"] = "FORMULA";
|
|
72
|
-
EWidgetActionInputMode["MANUALLY"] = "MANUALLY";
|
|
73
|
-
})(EWidgetActionInputMode || (EWidgetActionInputMode = {}));
|
|
5
|
+
var EWidgetActionInputMethod;
|
|
6
|
+
(function (EWidgetActionInputMethod) {
|
|
7
|
+
EWidgetActionInputMethod["COLUMN"] = "COLUMN";
|
|
8
|
+
EWidgetActionInputMethod["VARIABLE"] = "VARIABLE";
|
|
9
|
+
EWidgetActionInputMethod["STATIC_LIST"] = "STATIC_LIST";
|
|
10
|
+
EWidgetActionInputMethod["DYNAMIC_LIST"] = "DYNAMIC_LIST";
|
|
11
|
+
EWidgetActionInputMethod["FORMULA"] = "FORMULA";
|
|
12
|
+
EWidgetActionInputMethod["MANUALLY"] = "MANUALLY";
|
|
13
|
+
EWidgetActionInputMethod["EVENT"] = "EVENT";
|
|
14
|
+
EWidgetActionInputMethod["START_EVENT"] = "START_EVENT";
|
|
15
|
+
EWidgetActionInputMethod["FINISH_EVENT"] = "FINISH_EVENT";
|
|
16
|
+
})(EWidgetActionInputMethod || (EWidgetActionInputMethod = {}));
|
|
74
17
|
var EActionTypes;
|
|
75
18
|
(function (EActionTypes) {
|
|
76
|
-
EActionTypes["
|
|
19
|
+
EActionTypes["OPEN_URL"] = "OPEN_URL";
|
|
77
20
|
EActionTypes["UPDATE_VARIABLE"] = "UPDATE_VARIABLE";
|
|
78
|
-
EActionTypes["
|
|
21
|
+
EActionTypes["EXECUTE_SCRIPT"] = "EXECUTE_SCRIPT";
|
|
79
22
|
EActionTypes["OPEN_VIEW"] = "OPEN_VIEW";
|
|
80
23
|
})(EActionTypes || (EActionTypes = {}));
|
|
81
|
-
var
|
|
82
|
-
(function (
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
})(
|
|
86
|
-
var
|
|
87
|
-
(function (
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
24
|
+
var EViewMode;
|
|
25
|
+
(function (EViewMode) {
|
|
26
|
+
EViewMode["EXISTED_VIEW"] = "EXISTED_VIEW";
|
|
27
|
+
EViewMode["GENERATED_BY_SCRIPT"] = "GENERATED_BY_SCRIPT";
|
|
28
|
+
})(EViewMode || (EViewMode = {}));
|
|
29
|
+
var EViewOpenIn;
|
|
30
|
+
(function (EViewOpenIn) {
|
|
31
|
+
EViewOpenIn["NEW_WINDOW"] = "NEW_WINDOW";
|
|
32
|
+
EViewOpenIn["CURRENT_WINDOW"] = "CURRENT_WINDOW";
|
|
33
|
+
EViewOpenIn["PLACEHOLDER"] = "PLACEHOLDER";
|
|
34
|
+
EViewOpenIn["MODAL_WINDOW"] = "MODAL_WINDOW";
|
|
35
|
+
EViewOpenIn["DRAWER_WINDOW"] = "DRAWER_WINDOW";
|
|
36
|
+
})(EViewOpenIn || (EViewOpenIn = {}));
|
|
93
37
|
var EDrawerPlacement;
|
|
94
38
|
(function (EDrawerPlacement) {
|
|
95
39
|
EDrawerPlacement["LEFT"] = "LEFT";
|
|
96
40
|
EDrawerPlacement["RIGHT"] = "RIGHT";
|
|
97
41
|
})(EDrawerPlacement || (EDrawerPlacement = {}));
|
|
98
|
-
var
|
|
42
|
+
var isExecuteScriptActionValid = function (action, _a) {
|
|
99
43
|
var _b;
|
|
100
44
|
var scripts = _a.scripts, tables = _a.tables, variables = _a.variables;
|
|
101
|
-
|
|
102
|
-
return false;
|
|
103
|
-
}
|
|
104
|
-
var currentScript = scripts.get((_b = action.scriptName) !== null && _b !== void 0 ? _b : "");
|
|
45
|
+
var currentScript = scripts.get((_b = action.scriptKey) !== null && _b !== void 0 ? _b : "");
|
|
105
46
|
if (!currentScript) {
|
|
106
47
|
return false;
|
|
107
48
|
}
|
|
108
|
-
var actionInputsMap = new Map(action.
|
|
109
|
-
if (actionInputsMap.size < currentScript.
|
|
49
|
+
var actionInputsMap = new Map(action.parameters.map(function (parameter) { return [parameter.name, parameter]; }));
|
|
50
|
+
if (actionInputsMap.size < currentScript.fields.length) {
|
|
110
51
|
return false;
|
|
111
52
|
}
|
|
112
|
-
return
|
|
53
|
+
return currentScript.fields.every(function (_a) {
|
|
54
|
+
var name = _a.name;
|
|
113
55
|
var actionInput = actionInputsMap.get(name !== null && name !== void 0 ? name : "");
|
|
114
56
|
if (!actionInput) {
|
|
115
57
|
return false;
|
|
116
58
|
}
|
|
117
|
-
|
|
118
|
-
|
|
59
|
+
if (actionInput.inputMethod === EWidgetActionInputMethod.VARIABLE &&
|
|
60
|
+
!variables.has(actionInput.sourceVariable)) {
|
|
119
61
|
return false;
|
|
120
62
|
}
|
|
121
|
-
if (
|
|
63
|
+
if (actionInput.inputMethod === EWidgetActionInputMethod.FORMULA && !actionInput.formula) {
|
|
122
64
|
return false;
|
|
123
65
|
}
|
|
124
|
-
if (
|
|
66
|
+
if (actionInput.inputMethod === EWidgetActionInputMethod.DYNAMIC_LIST && !actionInput.formula) {
|
|
125
67
|
return false;
|
|
126
68
|
}
|
|
127
|
-
if (
|
|
69
|
+
if (actionInput.inputMethod === EWidgetActionInputMethod.COLUMN &&
|
|
70
|
+
!tables.has(actionInput.tableName)) {
|
|
128
71
|
return false;
|
|
129
72
|
}
|
|
130
73
|
return true;
|
|
@@ -159,6 +102,39 @@ var escapeSingularQuotes = function (formula) {
|
|
|
159
102
|
return formula.replaceAll("'", "\\'");
|
|
160
103
|
};
|
|
161
104
|
|
|
105
|
+
/******************************************************************************
|
|
106
|
+
Copyright (c) Microsoft Corporation.
|
|
107
|
+
|
|
108
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
109
|
+
purpose with or without fee is hereby granted.
|
|
110
|
+
|
|
111
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
112
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
113
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
114
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
115
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
116
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
117
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
118
|
+
***************************************************************************** */
|
|
119
|
+
/* global Reflect, Promise, SuppressedError, Symbol */
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
var __assign = function() {
|
|
123
|
+
__assign = Object.assign || function __assign(t) {
|
|
124
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
125
|
+
s = arguments[i];
|
|
126
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
127
|
+
}
|
|
128
|
+
return t;
|
|
129
|
+
};
|
|
130
|
+
return __assign.apply(this, arguments);
|
|
131
|
+
};
|
|
132
|
+
|
|
133
|
+
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
134
|
+
var e = new Error(message);
|
|
135
|
+
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
136
|
+
};
|
|
137
|
+
|
|
162
138
|
var ECalculatorFilterMethods;
|
|
163
139
|
(function (ECalculatorFilterMethods) {
|
|
164
140
|
ECalculatorFilterMethods["EQUAL_TO"] = "EQUAL_TO";
|
|
@@ -203,6 +179,9 @@ var EFormulaFilterFieldKeys;
|
|
|
203
179
|
EFormulaFilterFieldKeys["lastTimeUnit"] = "lastTimeUnit";
|
|
204
180
|
EFormulaFilterFieldKeys["durationUnit"] = "durationUnit";
|
|
205
181
|
})(EFormulaFilterFieldKeys || (EFormulaFilterFieldKeys = {}));
|
|
182
|
+
var isFormulaFilterValue = function (value) {
|
|
183
|
+
return "filteringMethod" in value;
|
|
184
|
+
};
|
|
206
185
|
|
|
207
186
|
var compact = function (items) { return ((items === null || items === void 0 ? void 0 : items.filter(Boolean)) || []); };
|
|
208
187
|
var compactMap = function (items, f) {
|
|
@@ -465,10 +444,10 @@ var mapFormulaFilterToCalculatorInput = function (filterValue) {
|
|
|
465
444
|
if (!filterValue) {
|
|
466
445
|
return null;
|
|
467
446
|
}
|
|
468
|
-
if (
|
|
447
|
+
if (!isFormulaFilterValue(filterValue)) {
|
|
469
448
|
return {
|
|
470
449
|
dataType: ESimpleDataType.OTHER,
|
|
471
|
-
formula: filterValue,
|
|
450
|
+
formula: filterValue.formula,
|
|
472
451
|
values: ["1"],
|
|
473
452
|
filteringMethod: formulaFilterMethods.EQUAL_TO,
|
|
474
453
|
};
|
|
@@ -1104,4 +1083,4 @@ var getLocalizedText = function (language, locObj, props) {
|
|
|
1104
1083
|
return localization.getLocalized(locObj, props);
|
|
1105
1084
|
};
|
|
1106
1085
|
|
|
1107
|
-
export { EActionTypes, ECalculatorFilterMethods, EColorMode, EColorScope, EControlType, ECustomSelectTemplates, EDbType, EDimensionTemplateNames, EDisplayConditionMode, EDrawerPlacement, EDurationUnit, EEventMeasureTemplateNames, EFormatTypes, EFormattingPresets, EFormulaFilterFieldKeys, EIndicatorType, ELastTimeUnit, EMarkdownDisplayMode, EMeasureTemplateNames,
|
|
1086
|
+
export { EActionTypes, ECalculatorFilterMethods, EColorMode, EColorScope, EControlType, ECustomSelectTemplates, EDbType, EDimensionTemplateNames, EDisplayConditionMode, EDrawerPlacement, EDurationUnit, EEventMeasureTemplateNames, EFormatTypes, EFormattingPresets, EFormulaFilterFieldKeys, EIndicatorType, ELastTimeUnit, EMarkdownDisplayMode, EMeasureTemplateNames, EProcessFilterNames, ESelectOptionTypes, ESimpleDataType, ESortDirection, ESortingValueModes, ETransitionMeasureTemplateNames, EViewMode, EViewOpenIn, EWidgetActionInputMethod, EWidgetFilterMode, EWidgetIndicatorType, EWidgetIndicatorValueModes, bindContentWithIndicator, bindContentsWithIndicators, checkDisplayCondition, dimensionTemplateFormulas, escapeSpecialCharacters, eventMeasureTemplateFormulas, fillTemplateString, formulaFilterMethods, generateColumnFormula, getDimensionFormula, getDisplayConditionFormula, getEventMeasureFormula, getLocalizedText, getMeasureFormula, getTransitionMeasureFormula, isExecuteScriptActionValid, isFormulaFilterValue, isHierarchy, mapDimensionsToInputs, mapEventMeasuresToInputs, mapFormulaFilterToCalculatorInput, mapFormulaFiltersToInputs, mapMeasuresToInputs, mapSortingToInputs, mapTransitionMeasuresToInputs, measureTemplateFormulas, prepareValuesForSql, replaceDisplayCondition, replaceFiltersBySelection, replaceHierarchiesWithDimensions, selectDimensionFromHierarchy, transitionMeasureTemplateFormulas, unescapeSpecialCharacters, updateDefaultModeSelection, updateMultiModeSelection, updateSingleModeSelection };
|
package/dist/index.js
CHANGED
|
@@ -3,129 +3,72 @@
|
|
|
3
3
|
var localization$1 = require('@infomaximum/localization');
|
|
4
4
|
var baseFilter = require('@infomaximum/base-filter');
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
19
|
-
***************************************************************************** */
|
|
20
|
-
/* global Reflect, Promise, SuppressedError, Symbol */
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
var __assign = function() {
|
|
24
|
-
__assign = Object.assign || function __assign(t) {
|
|
25
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
26
|
-
s = arguments[i];
|
|
27
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
28
|
-
}
|
|
29
|
-
return t;
|
|
30
|
-
};
|
|
31
|
-
return __assign.apply(this, arguments);
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
function __read(o, n) {
|
|
35
|
-
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
36
|
-
if (!m) return o;
|
|
37
|
-
var i = m.call(o), r, ar = [], e;
|
|
38
|
-
try {
|
|
39
|
-
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
40
|
-
}
|
|
41
|
-
catch (error) { e = { error: error }; }
|
|
42
|
-
finally {
|
|
43
|
-
try {
|
|
44
|
-
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
45
|
-
}
|
|
46
|
-
finally { if (e) throw e.error; }
|
|
47
|
-
}
|
|
48
|
-
return ar;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
function __spreadArray(to, from, pack) {
|
|
52
|
-
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
53
|
-
if (ar || !(i in from)) {
|
|
54
|
-
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
55
|
-
ar[i] = from[i];
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
62
|
-
var e = new Error(message);
|
|
63
|
-
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
64
|
-
};
|
|
65
|
-
|
|
66
|
-
exports.EWidgetActionInputMode = void 0;
|
|
67
|
-
(function (EWidgetActionInputMode) {
|
|
68
|
-
EWidgetActionInputMode["FROM_COLUMN"] = "FROM_COLUMN";
|
|
69
|
-
EWidgetActionInputMode["FROM_VARIABLE"] = "FROM_VARIABLE";
|
|
70
|
-
EWidgetActionInputMode["STATIC_LIST"] = "STATIC_LIST";
|
|
71
|
-
EWidgetActionInputMode["DYNAMIC_LIST"] = "DYNAMIC_LIST";
|
|
72
|
-
EWidgetActionInputMode["FORMULA"] = "FORMULA";
|
|
73
|
-
EWidgetActionInputMode["MANUALLY"] = "MANUALLY";
|
|
74
|
-
})(exports.EWidgetActionInputMode || (exports.EWidgetActionInputMode = {}));
|
|
6
|
+
exports.EWidgetActionInputMethod = void 0;
|
|
7
|
+
(function (EWidgetActionInputMethod) {
|
|
8
|
+
EWidgetActionInputMethod["COLUMN"] = "COLUMN";
|
|
9
|
+
EWidgetActionInputMethod["VARIABLE"] = "VARIABLE";
|
|
10
|
+
EWidgetActionInputMethod["STATIC_LIST"] = "STATIC_LIST";
|
|
11
|
+
EWidgetActionInputMethod["DYNAMIC_LIST"] = "DYNAMIC_LIST";
|
|
12
|
+
EWidgetActionInputMethod["FORMULA"] = "FORMULA";
|
|
13
|
+
EWidgetActionInputMethod["MANUALLY"] = "MANUALLY";
|
|
14
|
+
EWidgetActionInputMethod["EVENT"] = "EVENT";
|
|
15
|
+
EWidgetActionInputMethod["START_EVENT"] = "START_EVENT";
|
|
16
|
+
EWidgetActionInputMethod["FINISH_EVENT"] = "FINISH_EVENT";
|
|
17
|
+
})(exports.EWidgetActionInputMethod || (exports.EWidgetActionInputMethod = {}));
|
|
75
18
|
exports.EActionTypes = void 0;
|
|
76
19
|
(function (EActionTypes) {
|
|
77
|
-
EActionTypes["
|
|
20
|
+
EActionTypes["OPEN_URL"] = "OPEN_URL";
|
|
78
21
|
EActionTypes["UPDATE_VARIABLE"] = "UPDATE_VARIABLE";
|
|
79
|
-
EActionTypes["
|
|
22
|
+
EActionTypes["EXECUTE_SCRIPT"] = "EXECUTE_SCRIPT";
|
|
80
23
|
EActionTypes["OPEN_VIEW"] = "OPEN_VIEW";
|
|
81
24
|
})(exports.EActionTypes || (exports.EActionTypes = {}));
|
|
82
|
-
exports.
|
|
83
|
-
(function (
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
})(exports.
|
|
87
|
-
exports.
|
|
88
|
-
(function (
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
25
|
+
exports.EViewMode = void 0;
|
|
26
|
+
(function (EViewMode) {
|
|
27
|
+
EViewMode["EXISTED_VIEW"] = "EXISTED_VIEW";
|
|
28
|
+
EViewMode["GENERATED_BY_SCRIPT"] = "GENERATED_BY_SCRIPT";
|
|
29
|
+
})(exports.EViewMode || (exports.EViewMode = {}));
|
|
30
|
+
exports.EViewOpenIn = void 0;
|
|
31
|
+
(function (EViewOpenIn) {
|
|
32
|
+
EViewOpenIn["NEW_WINDOW"] = "NEW_WINDOW";
|
|
33
|
+
EViewOpenIn["CURRENT_WINDOW"] = "CURRENT_WINDOW";
|
|
34
|
+
EViewOpenIn["PLACEHOLDER"] = "PLACEHOLDER";
|
|
35
|
+
EViewOpenIn["MODAL_WINDOW"] = "MODAL_WINDOW";
|
|
36
|
+
EViewOpenIn["DRAWER_WINDOW"] = "DRAWER_WINDOW";
|
|
37
|
+
})(exports.EViewOpenIn || (exports.EViewOpenIn = {}));
|
|
94
38
|
exports.EDrawerPlacement = void 0;
|
|
95
39
|
(function (EDrawerPlacement) {
|
|
96
40
|
EDrawerPlacement["LEFT"] = "LEFT";
|
|
97
41
|
EDrawerPlacement["RIGHT"] = "RIGHT";
|
|
98
42
|
})(exports.EDrawerPlacement || (exports.EDrawerPlacement = {}));
|
|
99
|
-
var
|
|
43
|
+
var isExecuteScriptActionValid = function (action, _a) {
|
|
100
44
|
var _b;
|
|
101
45
|
var scripts = _a.scripts, tables = _a.tables, variables = _a.variables;
|
|
102
|
-
|
|
103
|
-
return false;
|
|
104
|
-
}
|
|
105
|
-
var currentScript = scripts.get((_b = action.scriptName) !== null && _b !== void 0 ? _b : "");
|
|
46
|
+
var currentScript = scripts.get((_b = action.scriptKey) !== null && _b !== void 0 ? _b : "");
|
|
106
47
|
if (!currentScript) {
|
|
107
48
|
return false;
|
|
108
49
|
}
|
|
109
|
-
var actionInputsMap = new Map(action.
|
|
110
|
-
if (actionInputsMap.size < currentScript.
|
|
50
|
+
var actionInputsMap = new Map(action.parameters.map(function (parameter) { return [parameter.name, parameter]; }));
|
|
51
|
+
if (actionInputsMap.size < currentScript.fields.length) {
|
|
111
52
|
return false;
|
|
112
53
|
}
|
|
113
|
-
return
|
|
54
|
+
return currentScript.fields.every(function (_a) {
|
|
55
|
+
var name = _a.name;
|
|
114
56
|
var actionInput = actionInputsMap.get(name !== null && name !== void 0 ? name : "");
|
|
115
57
|
if (!actionInput) {
|
|
116
58
|
return false;
|
|
117
59
|
}
|
|
118
|
-
|
|
119
|
-
|
|
60
|
+
if (actionInput.inputMethod === exports.EWidgetActionInputMethod.VARIABLE &&
|
|
61
|
+
!variables.has(actionInput.sourceVariable)) {
|
|
120
62
|
return false;
|
|
121
63
|
}
|
|
122
|
-
if (
|
|
64
|
+
if (actionInput.inputMethod === exports.EWidgetActionInputMethod.FORMULA && !actionInput.formula) {
|
|
123
65
|
return false;
|
|
124
66
|
}
|
|
125
|
-
if (
|
|
67
|
+
if (actionInput.inputMethod === exports.EWidgetActionInputMethod.DYNAMIC_LIST && !actionInput.formula) {
|
|
126
68
|
return false;
|
|
127
69
|
}
|
|
128
|
-
if (
|
|
70
|
+
if (actionInput.inputMethod === exports.EWidgetActionInputMethod.COLUMN &&
|
|
71
|
+
!tables.has(actionInput.tableName)) {
|
|
129
72
|
return false;
|
|
130
73
|
}
|
|
131
74
|
return true;
|
|
@@ -160,6 +103,39 @@ var escapeSingularQuotes = function (formula) {
|
|
|
160
103
|
return formula.replaceAll("'", "\\'");
|
|
161
104
|
};
|
|
162
105
|
|
|
106
|
+
/******************************************************************************
|
|
107
|
+
Copyright (c) Microsoft Corporation.
|
|
108
|
+
|
|
109
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
110
|
+
purpose with or without fee is hereby granted.
|
|
111
|
+
|
|
112
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
113
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
114
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
115
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
116
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
117
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
118
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
119
|
+
***************************************************************************** */
|
|
120
|
+
/* global Reflect, Promise, SuppressedError, Symbol */
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
var __assign = function() {
|
|
124
|
+
__assign = Object.assign || function __assign(t) {
|
|
125
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
126
|
+
s = arguments[i];
|
|
127
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
128
|
+
}
|
|
129
|
+
return t;
|
|
130
|
+
};
|
|
131
|
+
return __assign.apply(this, arguments);
|
|
132
|
+
};
|
|
133
|
+
|
|
134
|
+
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
135
|
+
var e = new Error(message);
|
|
136
|
+
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
137
|
+
};
|
|
138
|
+
|
|
163
139
|
exports.ECalculatorFilterMethods = void 0;
|
|
164
140
|
(function (ECalculatorFilterMethods) {
|
|
165
141
|
ECalculatorFilterMethods["EQUAL_TO"] = "EQUAL_TO";
|
|
@@ -204,6 +180,9 @@ exports.EFormulaFilterFieldKeys = void 0;
|
|
|
204
180
|
EFormulaFilterFieldKeys["lastTimeUnit"] = "lastTimeUnit";
|
|
205
181
|
EFormulaFilterFieldKeys["durationUnit"] = "durationUnit";
|
|
206
182
|
})(exports.EFormulaFilterFieldKeys || (exports.EFormulaFilterFieldKeys = {}));
|
|
183
|
+
var isFormulaFilterValue = function (value) {
|
|
184
|
+
return "filteringMethod" in value;
|
|
185
|
+
};
|
|
207
186
|
|
|
208
187
|
var compact = function (items) { return ((items === null || items === void 0 ? void 0 : items.filter(Boolean)) || []); };
|
|
209
188
|
var compactMap = function (items, f) {
|
|
@@ -466,10 +445,10 @@ var mapFormulaFilterToCalculatorInput = function (filterValue) {
|
|
|
466
445
|
if (!filterValue) {
|
|
467
446
|
return null;
|
|
468
447
|
}
|
|
469
|
-
if (
|
|
448
|
+
if (!isFormulaFilterValue(filterValue)) {
|
|
470
449
|
return {
|
|
471
450
|
dataType: exports.ESimpleDataType.OTHER,
|
|
472
|
-
formula: filterValue,
|
|
451
|
+
formula: filterValue.formula,
|
|
473
452
|
values: ["1"],
|
|
474
453
|
filteringMethod: formulaFilterMethods.EQUAL_TO,
|
|
475
454
|
};
|
|
@@ -1128,7 +1107,8 @@ exports.getEventMeasureFormula = getEventMeasureFormula;
|
|
|
1128
1107
|
exports.getLocalizedText = getLocalizedText;
|
|
1129
1108
|
exports.getMeasureFormula = getMeasureFormula;
|
|
1130
1109
|
exports.getTransitionMeasureFormula = getTransitionMeasureFormula;
|
|
1131
|
-
exports.
|
|
1110
|
+
exports.isExecuteScriptActionValid = isExecuteScriptActionValid;
|
|
1111
|
+
exports.isFormulaFilterValue = isFormulaFilterValue;
|
|
1132
1112
|
exports.isHierarchy = isHierarchy;
|
|
1133
1113
|
exports.mapDimensionsToInputs = mapDimensionsToInputs;
|
|
1134
1114
|
exports.mapEventMeasuresToInputs = mapEventMeasuresToInputs;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@infomaximum/widget-sdk",
|
|
3
|
-
"version": "4.0.0-
|
|
3
|
+
"version": "4.0.0-beta49",
|
|
4
4
|
"main": "./dist/index.js",
|
|
5
5
|
"module": "./dist/index.esm.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -25,6 +25,7 @@
|
|
|
25
25
|
"@rollup/plugin-commonjs": "25.0.7",
|
|
26
26
|
"@rollup/plugin-node-resolve": "15.2.3",
|
|
27
27
|
"@rollup/plugin-typescript": "11.1.5",
|
|
28
|
+
"core-js": "^3.38.0",
|
|
28
29
|
"prettier": "3.2.5",
|
|
29
30
|
"rollup": "4.14.3",
|
|
30
31
|
"rollup-plugin-delete": "2.0.0",
|