@sisense/sdk-ui 2.8.0 → 2.9.0
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/ai.cjs +17 -17
- package/dist/ai.js +111 -110
- package/dist/analytics-composer/node.cjs +1 -0
- package/dist/analytics-composer/node.d.ts +1 -0
- package/dist/analytics-composer/node.js +897 -0
- package/dist/analytics-composer.cjs +118 -118
- package/dist/analytics-composer.js +2211 -2906
- package/dist/{derive-chart-family-6PZA-xZh.js → derive-chart-family-BLG1sO1D.js} +40042 -45188
- package/dist/derive-chart-family-QPmz5DJ3.cjs +656 -0
- package/dist/{dimensions-b8xRITJn.js → dimensions-B2jz151s.js} +3 -3
- package/dist/dimensions-CVJeJ8mi.cjs +1 -0
- package/dist/execute-query-Cp3se7Yb.cjs +1 -0
- package/dist/execute-query-agpyzZz6.js +6406 -0
- package/dist/index.cjs +25 -25
- package/dist/index.js +5519 -5368
- package/dist/index.umd.js +338 -398
- package/dist/packages/sdk-ui/src/analytics-composer/index-node.d.ts +9 -0
- package/dist/packages/sdk-ui/src/analytics-composer/index.d.ts +1 -0
- package/dist/packages/sdk-ui/src/analytics-composer/new-nlq-translator/common.d.ts +26 -0
- package/dist/packages/sdk-ui/src/analytics-composer/new-nlq-translator/index.d.ts +2 -0
- package/dist/packages/sdk-ui/src/analytics-composer/new-nlq-translator/translate-dimensions.d.ts +3 -0
- package/dist/packages/sdk-ui/src/analytics-composer/new-nlq-translator/translate-filters.d.ts +44 -0
- package/dist/packages/sdk-ui/src/analytics-composer/new-nlq-translator/translate-measures.d.ts +30 -0
- package/dist/packages/sdk-ui/src/analytics-composer/new-nlq-translator/translate-query-to-jaql.d.ts +18 -0
- package/dist/packages/sdk-ui/src/analytics-composer/new-nlq-translator/translate-query.d.ts +224 -0
- package/dist/packages/sdk-ui/src/analytics-composer/types.d.ts +28 -1
- package/dist/packages/sdk-ui/src/chart/helpers/get-load-data-function.d.ts +3 -1
- package/dist/packages/sdk-ui/src/chart/helpers/use-chart-data-preparation.d.ts +3 -1
- package/dist/packages/sdk-ui/src/chart/helpers/use-translated-data-options.d.ts +1 -1
- package/dist/packages/sdk-ui/src/chart/restructured-charts/highchart-based-charts/cartesians/helpers/highchart-options/axis.d.ts +5 -0
- package/dist/packages/sdk-ui/src/chart/restructured-charts/highchart-based-charts/cartesians/helpers/highchart-options/y-axis.d.ts +28 -0
- package/dist/packages/sdk-ui/src/chart/restructured-charts/highchart-based-charts/cartesians/line-chart/helpers/design-options.d.ts +12 -0
- package/dist/packages/sdk-ui/src/chart/restructured-charts/highchart-based-charts/cartesians/line-chart/highchart-options/axes.d.ts +6 -0
- package/dist/packages/sdk-ui/src/chart/restructured-charts/highchart-based-charts/cartesians/line-chart/highcharts-options-builder.d.ts +2 -0
- package/dist/packages/sdk-ui/src/chart/restructured-charts/highchart-based-charts/cartesians/line-chart/line-chart-builder.d.ts +2 -0
- package/dist/packages/sdk-ui/src/chart/restructured-charts/highchart-based-charts/cartesians/polar-chart/data/index.d.ts +10 -0
- package/dist/packages/sdk-ui/src/chart/restructured-charts/highchart-based-charts/cartesians/polar-chart/data-options/index.d.ts +12 -0
- package/dist/packages/sdk-ui/src/chart/restructured-charts/highchart-based-charts/cartesians/polar-chart/design-options/index.d.ts +18 -0
- package/dist/packages/sdk-ui/src/chart/restructured-charts/highchart-based-charts/cartesians/polar-chart/highchart-options/axes.d.ts +6 -0
- package/dist/packages/sdk-ui/src/chart/restructured-charts/highchart-based-charts/cartesians/polar-chart/highchart-options/highcharts-options-builder.d.ts +2 -0
- package/dist/packages/sdk-ui/src/chart/restructured-charts/highchart-based-charts/cartesians/polar-chart/polar-chart-builder.d.ts +2 -0
- package/dist/packages/sdk-ui/src/chart/restructured-charts/highchart-based-charts/cartesians/stackable/area-chart/area-chart-builder.d.ts +2 -0
- package/dist/packages/sdk-ui/src/chart/restructured-charts/highchart-based-charts/cartesians/stackable/area-chart/helpers/design-options.d.ts +12 -0
- package/dist/packages/sdk-ui/src/chart/restructured-charts/highchart-based-charts/cartesians/stackable/area-chart/highchart-options/axes.d.ts +6 -0
- package/dist/packages/sdk-ui/src/chart/restructured-charts/highchart-based-charts/cartesians/stackable/area-chart/highchart-options/highcharts-options-builder.d.ts +2 -0
- package/dist/packages/sdk-ui/src/chart/restructured-charts/highchart-based-charts/cartesians/stackable/area-chart/highchart-options/labels-spacing.d.ts +8 -0
- package/dist/packages/sdk-ui/src/chart/restructured-charts/highchart-based-charts/cartesians/stackable/bar-chart/highchart-options/axes.d.ts +6 -0
- package/dist/packages/sdk-ui/src/chart/restructured-charts/highchart-based-charts/cartesians/stackable/bar-chart/highchart-options/labels-spacing.d.ts +9 -0
- package/dist/packages/sdk-ui/src/chart/restructured-charts/highchart-based-charts/cartesians/stackable/column-chart/highchart-options/axes.d.ts +6 -0
- package/dist/packages/sdk-ui/src/chart/restructured-charts/highchart-based-charts/cartesians/stackable/column-chart/highchart-options/labels-spacing.d.ts +9 -0
- package/dist/packages/sdk-ui/src/chart/restructured-charts/highchart-based-charts/cartesians/stackable/helpers/highchart-options/stacking.d.ts +21 -0
- package/dist/packages/sdk-ui/src/chart/restructured-charts/highchart-based-charts/cartesians/stackable/types.d.ts +1 -0
- package/dist/packages/sdk-ui/src/chart/restructured-charts/highchart-based-charts/cartesians/types.d.ts +1 -1
- package/dist/packages/sdk-ui/src/chart/restructured-charts/highchart-based-charts/highcharts-based-chart-renderer/build-highchart-options.d.ts +9 -4
- package/dist/packages/sdk-ui/src/chart/restructured-charts/highchart-based-charts/highcharts-based-chart-renderer/utils.d.ts +2 -1
- package/dist/packages/sdk-ui/src/chart/restructured-charts/highchart-based-charts/types.d.ts +1 -1
- package/dist/packages/sdk-ui/src/chart/restructured-charts/types.d.ts +7 -7
- package/dist/packages/sdk-ui/src/chart/restructured-charts/utils.d.ts +5 -0
- package/dist/packages/sdk-ui/src/chart-data/data-coloring/types.d.ts +6 -0
- package/dist/packages/sdk-ui/src/chart-options-processor/cartesian/utils/axis/axis-builders.d.ts +155 -0
- package/dist/packages/sdk-ui/src/chart-options-processor/cartesian/utils/axis/axis-settings.d.ts +39 -0
- package/dist/packages/sdk-ui/src/chart-options-processor/cartesian/utils/axis/axis-transformers.d.ts +45 -0
- package/dist/packages/sdk-ui/src/chart-options-processor/cartesian/utils/axis/axis-utils.d.ts +1 -0
- package/dist/packages/sdk-ui/src/chart-options-processor/cartesian/utils/axis/date-utils.d.ts +27 -0
- package/dist/packages/sdk-ui/src/chart-options-processor/cartesian/utils/axis/index.d.ts +3 -0
- package/dist/packages/sdk-ui/src/chart-options-processor/cartesian/utils/chart-configuration.d.ts +33 -3
- package/dist/packages/sdk-ui/src/chart-options-processor/chart-options-service.d.ts +0 -10
- package/dist/packages/sdk-ui/src/chart-options-processor/defaults/cartesian.d.ts +4 -3
- package/dist/packages/sdk-ui/src/chart-options-processor/translations/axis-section.d.ts +5 -12
- package/dist/packages/sdk-ui/src/chart-options-processor/translations/design-options.d.ts +1 -1
- package/dist/packages/sdk-ui/src/chart-options-processor/translations/legend-section.d.ts +2 -2
- package/dist/packages/sdk-ui/src/chart-options-processor/translations/types.d.ts +13 -0
- package/dist/packages/sdk-ui/src/chart-options-processor/translations/value-label-section.d.ts +2 -2
- package/dist/packages/sdk-ui/src/const.d.ts +2 -0
- package/dist/packages/sdk-ui/src/pivot-table/formatters/data-cell-formatters/index.d.ts +1 -0
- package/dist/packages/sdk-ui/src/pivot-table/formatters/formatter-utils.d.ts +23 -0
- package/dist/packages/sdk-ui/src/pivot-table/formatters/types.d.ts +45 -2
- package/dist/packages/sdk-ui/src/pivot-table/formatters/utils.d.ts +1 -0
- package/dist/packages/sdk-ui/src/pivot-table/hooks/use-apply-pivot-table-formatting.d.ts +4 -1
- package/dist/packages/sdk-ui/src/props.d.ts +89 -0
- package/dist/packages/sdk-ui/src/query/date-formats/apply-date-format.d.ts +7 -6
- package/dist/packages/sdk-ui/src/query/date-formats/index.d.ts +1 -1
- package/dist/packages/sdk-ui/src/query/execute-query.d.ts +3 -1
- package/dist/packages/sdk-ui/src/query-execution/index.d.ts +1 -1
- package/dist/packages/sdk-ui/src/query-execution/types.d.ts +9 -2
- package/dist/packages/sdk-ui/src/utils/__development-utils__/highcharts-options-builder-collector.d.ts +61 -0
- package/dist/packages/sdk-ui/src/utils/__development-utils__/input-output-collector.d.ts +125 -0
- package/dist/packages/sdk-ui/src/widget-by-id/translate-dashboard-filters.d.ts +1 -1
- package/dist/packages/sdk-ui/src/widget-by-id/translate-panel-color-format.d.ts +9 -0
- package/dist/packages/sdk-ui/src/widget-by-id/translate-statistical-models.d.ts +10 -0
- package/dist/packages/sdk-ui/src/widget-by-id/translate-widget-data-options.d.ts +0 -14
- package/dist/packages/sdk-ui/src/widget-by-id/types.d.ts +6 -4
- package/dist/types-BYUVZb6u.js +80 -0
- package/dist/types-QUSMO7gF.cjs +1 -0
- package/dist/use-common-filters-DmdADAhl.cjs +350 -0
- package/dist/{use-common-filters-BHBy4uv6.js → use-common-filters-wo5IRF5u.js} +5378 -5624
- package/dist/{widget-composer-SGEFYrXY.js → widget-composer-BG4HonVl.js} +143 -217
- package/dist/{widget-composer-BPlNiX_P.cjs → widget-composer-CGp5yOny.cjs} +9 -9
- package/package.json +18 -8
- package/dist/derive-chart-family-DQUVKMcV.cjs +0 -656
- package/dist/dimensions-x8nnAUew.cjs +0 -1
- package/dist/packages/sdk-ui/src/chart-options-processor/cartesian/utils/axis-configuration.d.ts +0 -41
- package/dist/use-common-filters-Cg217teN.cjs +0 -350
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { CustomDataCellFormatter, CustomHeaderCellFormatter, CellFormattingResult } from './types.js';
|
|
2
|
+
import type { JaqlPanel, PivotDataNode, PivotTreeNode } from '@sisense/sdk-pivot-client';
|
|
3
|
+
import type { PivotTableDataOptionsInternal } from '../../chart-data-options/types';
|
|
4
|
+
/**
|
|
5
|
+
* Applies a formatting result to a data cell, mutating the cell object
|
|
6
|
+
* @param cell - The cell to apply formatting to
|
|
7
|
+
* @param result - The formatting result to apply
|
|
8
|
+
*/
|
|
9
|
+
export declare function applyCellFormattingResult(cell: PivotDataNode | PivotTreeNode, result: CellFormattingResult): void;
|
|
10
|
+
/**
|
|
11
|
+
* Creates a unified formatter that handles functional formatters by applying their results
|
|
12
|
+
*
|
|
13
|
+
* @param formatter - A functional formatter that returns formatting information
|
|
14
|
+
* @returns A function that applies the formatter result to the cell
|
|
15
|
+
*/
|
|
16
|
+
export declare function createUnifiedDataCellFormatter(formatter: CustomDataCellFormatter, dataOptions: PivotTableDataOptionsInternal): (cell: PivotDataNode, rowItem: PivotTreeNode, columnItem: PivotTreeNode, jaqlPanelItem: JaqlPanel) => void;
|
|
17
|
+
/**
|
|
18
|
+
* Creates a unified header cell formatter that handles functional formatters by applying their results
|
|
19
|
+
*
|
|
20
|
+
* @param formatter - A functional header formatter that returns formatting information
|
|
21
|
+
* @returns A function that applies the formatter result to the header cell
|
|
22
|
+
*/
|
|
23
|
+
export declare function createUnifiedHeaderCellFormatter(formatter: CustomHeaderCellFormatter, dataOptions: PivotTableDataOptionsInternal): (cell: PivotTreeNode, jaqlPanelItem: JaqlPanel | undefined) => void;
|
|
@@ -1,4 +1,47 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import type { JaqlPanel, JaqlRequest, PivotDataNode, PivotTreeNode } from '@sisense/sdk-pivot-client';
|
|
2
|
-
|
|
3
|
-
|
|
3
|
+
import { AnyColumn } from '../../chart-data-options/types';
|
|
4
|
+
/**
|
|
5
|
+
* Formatting result that can be applied to a header cell
|
|
6
|
+
*/
|
|
7
|
+
export interface CellFormattingResult {
|
|
8
|
+
/** Text content to display in the cell */
|
|
9
|
+
content?: string;
|
|
10
|
+
/** Inline styles to apply to the cell */
|
|
11
|
+
style?: React.CSSProperties;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Data cell formatter that returns formatting information instead of mutating parameters
|
|
15
|
+
*/
|
|
16
|
+
export type DataCellFormatter = (cell: PivotDataNode, rowItem: PivotTreeNode, columnItem: PivotTreeNode, jaqlPanelItem: JaqlPanel) => CellFormattingResult | void;
|
|
17
|
+
/**
|
|
18
|
+
* Applies custom formatting to pivot table data cells.
|
|
19
|
+
*
|
|
20
|
+
* This function is called for each data cell in the pivot table and can return
|
|
21
|
+
* formatting information to customize the cell's appearance and behavior.
|
|
22
|
+
*
|
|
23
|
+
* @param cell - The pivot data cell being formatted
|
|
24
|
+
* @param jaqlPanelItem - JAQL panel metadata for the cell
|
|
25
|
+
* @param dataOption - The data option configuration for this cell
|
|
26
|
+
* @param id - Unique identifier for the data option
|
|
27
|
+
* @returns Formatting result object or void to skip formatting
|
|
28
|
+
*/
|
|
29
|
+
export type CustomDataCellFormatter = (cell: PivotDataNode, jaqlPanelItem: JaqlPanel, dataOption: AnyColumn, id: string) => CellFormattingResult | void;
|
|
30
|
+
/**
|
|
31
|
+
* Header cell formatter that returns formatting information instead of mutating parameters
|
|
32
|
+
*/
|
|
33
|
+
export type HeaderCellFormatter = (cell: PivotTreeNode, jaqlPanelItem: JaqlPanel, jaql: JaqlRequest) => CellFormattingResult | void;
|
|
34
|
+
/**
|
|
35
|
+
* Applies custom formatting to pivot table header cells.
|
|
36
|
+
*
|
|
37
|
+
* This function is called for each row and column header cell in the pivot table
|
|
38
|
+
* and can return formatting information to customize the header's appearance and behavior.
|
|
39
|
+
*
|
|
40
|
+
* @param cell - The pivot header cell being formatted
|
|
41
|
+
* @param jaqlPanelItem - JAQL panel metadata for the cell (may be undefined for certain header types)
|
|
42
|
+
* @param dataOption - The data option configuration for this cell (optional)
|
|
43
|
+
* @param id - Unique identifier for the data option (optional)
|
|
44
|
+
* @returns Formatting result object or void to skip formatting
|
|
45
|
+
*/
|
|
46
|
+
export type CustomHeaderCellFormatter = (cell: PivotTreeNode, jaqlPanelItem: JaqlPanel | undefined, dataOption?: AnyColumn, id?: string) => CellFormattingResult | void;
|
|
4
47
|
export type DateFormatter = (date: Date, format: string) => string;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type Column } from '@sisense/sdk-data';
|
|
2
2
|
import { type PivotTableDataOptions, type StyledColumn, type AnyColumn } from '../../chart-data-options/types';
|
|
3
3
|
export declare const getPivotDataOptionByJaqlIndex: (dataOptions: PivotTableDataOptions, dataOptionIndex?: number) => AnyColumn | undefined;
|
|
4
|
+
export declare const getPivotDataOptionIdByJaqlIndex: (dataOptions: PivotTableDataOptions, dataOptionIndex?: number) => string | undefined;
|
|
4
5
|
export declare const getNumberFormatConfig: (dataOption?: AnyColumn) => Required<import("../..").NumberFormatConfig>;
|
|
5
6
|
export declare const getDateFormatConfig: (dataOption: Column | StyledColumn) => string | undefined;
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import { type DataService } from '@sisense/sdk-pivot-client';
|
|
2
2
|
import { type PivotTableDataOptionsInternal } from '../../chart-data-options/types';
|
|
3
|
+
import { type CustomDataCellFormatter, type CustomHeaderCellFormatter } from '../../pivot-table/formatters/types';
|
|
3
4
|
/**
|
|
4
5
|
* A hook that applies formatting over pivot table cells.
|
|
5
6
|
*
|
|
6
7
|
* @internal
|
|
7
8
|
*/
|
|
8
|
-
export declare const useApplyPivotTableFormatting: ({ dataService, dataOptions, }: {
|
|
9
|
+
export declare const useApplyPivotTableFormatting: ({ dataService, dataOptions, onDataCellFormat, onHeaderCellFormat, }: {
|
|
9
10
|
dataService: DataService;
|
|
10
11
|
dataOptions: PivotTableDataOptionsInternal;
|
|
12
|
+
onDataCellFormat?: CustomDataCellFormatter | undefined;
|
|
13
|
+
onHeaderCellFormat?: CustomHeaderCellFormatter | undefined;
|
|
11
14
|
}) => void;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Attribute, Filter, Measure, DataSource, Data, QueryResultData, FilterRelations } from '@sisense/sdk-data';
|
|
2
2
|
import { ChartDataOptions, CartesianChartDataOptions, CategoricalChartDataOptions, ThemeSettings, PolarStyleOptions, PieStyleOptions, StackableStyleOptions, LineStyleOptions, AreaStyleOptions, FunnelStyleOptions, ScatterStyleOptions, ChartStyleOptions, ChartType, IndicatorStyleOptions, DrilldownOptions, ThemeOid, TreemapStyleOptions, CustomDrilldownResult, MenuPosition, MenuAlignment, MenuItemSection, SunburstStyleOptions, ChartWidgetStyleOptions, TableWidgetStyleOptions, WidgetByIdStyleOptions, BoxplotStyleOptions, ScattermapStyleOptions, AreamapStyleOptions, DataPoint, ScatterDataPoint, AreamapDataPoint, BoxplotDataPoint, ChartDataPoints, ScattermapDataPoint, PivotTableStyleOptions, PivotTableWidgetStyleOptions, RegularChartType, RegularChartStyleOptions, TabularChartStyleOptions, TableStyleOptions, AreaRangeStyleOptions, DrilldownSelection, TextWidgetStyleOptions, GenericDataOptions, IndicatorRenderOptions, TabberStyleProps, IndicatorDataPoint, TextWidgetDataPoint, CustomWidgetStyleOptions, PivotTableDataPoint } from './types';
|
|
3
|
+
import { type CustomDataCellFormatter, type CustomHeaderCellFormatter } from './pivot-table/formatters/types';
|
|
3
4
|
import { HighchartsOptions } from './chart-options-processor/chart-options-service';
|
|
4
5
|
import { ComponentType, PropsWithChildren, ReactNode } from 'react';
|
|
5
6
|
import { IndicatorChartDataOptions, BoxplotChartCustomDataOptions, BoxplotChartDataOptions, ScatterChartDataOptions, TableDataOptions, ScattermapChartDataOptions, AreamapChartDataOptions, PivotTableDataOptions, RegularChartDataOptions, TabularChartDataOptions, RangeChartDataOptions } from './chart-data-options/types';
|
|
@@ -891,6 +892,50 @@ export interface PivotTableProps {
|
|
|
891
892
|
* @internal
|
|
892
893
|
*/
|
|
893
894
|
onDataPointContextMenu?: PivotTableDataPointEventHandler;
|
|
895
|
+
/**
|
|
896
|
+
* Applies custom styling and behavior to pivot table data cells.
|
|
897
|
+
*
|
|
898
|
+
* This formatter function returns formatting objects instead of mutating parameters,
|
|
899
|
+
* following functional programming principles. Use this single callback to combine
|
|
900
|
+
* multiple handlers and control the call sequence from outside the pivot.
|
|
901
|
+
*
|
|
902
|
+
* @example
|
|
903
|
+
* ```typescript
|
|
904
|
+
* const customDataFormatter: CustomDataCellFormatter = (cell, jaqlPanelItem, dataOption, id) => {
|
|
905
|
+
* if (cell.value > 1000) {
|
|
906
|
+
* return {
|
|
907
|
+
* style: { backgroundColor: 'lightgreen' },
|
|
908
|
+
* content: `${cell.value} (High)`
|
|
909
|
+
* };
|
|
910
|
+
* }
|
|
911
|
+
* };
|
|
912
|
+
* ```
|
|
913
|
+
*
|
|
914
|
+
* @internal
|
|
915
|
+
*/
|
|
916
|
+
onDataCellFormat?: CustomDataCellFormatter;
|
|
917
|
+
/**
|
|
918
|
+
* Applies custom styling and behavior to pivot table row and column headers.
|
|
919
|
+
*
|
|
920
|
+
* This formatter function returns formatting objects instead of mutating parameters,
|
|
921
|
+
* following functional programming principles. Use this single callback to combine
|
|
922
|
+
* multiple handlers and control the call sequence from outside the pivot.
|
|
923
|
+
*
|
|
924
|
+
* @example
|
|
925
|
+
* ```typescript
|
|
926
|
+
* const customHeaderFormatter: CustomHeaderCellFormatter = (cell, jaqlPanelItem, dataOption, id) => {
|
|
927
|
+
* if (cell.content === 'Total') {
|
|
928
|
+
* return {
|
|
929
|
+
* style: { fontWeight: 'bold', color: 'blue' },
|
|
930
|
+
* className: 'total-header'
|
|
931
|
+
* };
|
|
932
|
+
* }
|
|
933
|
+
* };
|
|
934
|
+
* ```
|
|
935
|
+
*
|
|
936
|
+
* @internal
|
|
937
|
+
*/
|
|
938
|
+
onHeaderCellFormat?: CustomHeaderCellFormatter;
|
|
894
939
|
}
|
|
895
940
|
/**
|
|
896
941
|
* Props of the {@link ScatterChart} component.
|
|
@@ -1214,6 +1259,50 @@ export interface PivotTableWidgetProps {
|
|
|
1214
1259
|
* @internal
|
|
1215
1260
|
*/
|
|
1216
1261
|
onDataPointContextMenu?: PivotTableDataPointEventHandler;
|
|
1262
|
+
/**
|
|
1263
|
+
* Applies custom styling and behavior to pivot table data cells.
|
|
1264
|
+
*
|
|
1265
|
+
* This formatter function returns formatting objects instead of mutating parameters,
|
|
1266
|
+
* following functional programming principles. Use this single callback to combine
|
|
1267
|
+
* multiple handlers and control the call sequence from outside the pivot.
|
|
1268
|
+
*
|
|
1269
|
+
* @example
|
|
1270
|
+
* ```typescript
|
|
1271
|
+
* const customDataFormatter: CustomDataCellFormatter = (cell, jaqlPanelItem, dataOption, id) => {
|
|
1272
|
+
* if (cell.value > 1000) {
|
|
1273
|
+
* return {
|
|
1274
|
+
* style: { backgroundColor: 'lightgreen' },
|
|
1275
|
+
* content: `${cell.value} (High)`
|
|
1276
|
+
* };
|
|
1277
|
+
* }
|
|
1278
|
+
* };
|
|
1279
|
+
* ```
|
|
1280
|
+
*
|
|
1281
|
+
* @internal
|
|
1282
|
+
*/
|
|
1283
|
+
onDataCellFormat?: CustomDataCellFormatter;
|
|
1284
|
+
/**
|
|
1285
|
+
* Applies custom styling and behavior to pivot table row and column headers.
|
|
1286
|
+
*
|
|
1287
|
+
* This formatter function returns formatting objects instead of mutating parameters,
|
|
1288
|
+
* following functional programming principles. Use this single callback to combine
|
|
1289
|
+
* multiple handlers and control the call sequence from outside the pivot.
|
|
1290
|
+
*
|
|
1291
|
+
* @example
|
|
1292
|
+
* ```typescript
|
|
1293
|
+
* const customHeaderFormatter: CustomHeaderCellFormatter = (cell, jaqlPanelItem, dataOption, id) => {
|
|
1294
|
+
* if (cell.content === 'Total') {
|
|
1295
|
+
* return {
|
|
1296
|
+
* style: { fontWeight: 'bold', color: 'blue' },
|
|
1297
|
+
* className: 'total-header'
|
|
1298
|
+
* };
|
|
1299
|
+
* }
|
|
1300
|
+
* };
|
|
1301
|
+
* ```
|
|
1302
|
+
*
|
|
1303
|
+
* @internal
|
|
1304
|
+
*/
|
|
1305
|
+
onHeaderCellFormat?: CustomHeaderCellFormatter;
|
|
1217
1306
|
}
|
|
1218
1307
|
/**
|
|
1219
1308
|
* Props for the `TextWidget` component.
|
|
@@ -53,13 +53,14 @@ export type DateConfig = {
|
|
|
53
53
|
};
|
|
54
54
|
export declare const defaultDateConfig: DateConfig;
|
|
55
55
|
/**
|
|
56
|
-
*
|
|
56
|
+
* Safely formats a date value, handling special cases like 'N\A'
|
|
57
57
|
*
|
|
58
|
-
* @param date
|
|
59
|
-
* @param format -
|
|
60
|
-
* @param locale -
|
|
61
|
-
* @param cfg -
|
|
58
|
+
* @param value - The date value to format, can be a Date object, ISO string, or special value like 'N\A'
|
|
59
|
+
* @param format - The date format to apply
|
|
60
|
+
* @param locale - Optional locale for formatting
|
|
61
|
+
* @param cfg - Optional date configuration
|
|
62
|
+
* @returns Formatted date string or the original value for special cases
|
|
62
63
|
*/
|
|
63
|
-
export declare function
|
|
64
|
+
export declare function formatDateValue(value: Date | string, format: DateFormat, locale?: Locale, cfg?: DateConfig): string;
|
|
64
65
|
export declare function getDefaultDateMask(granularity?: string): "HH:mm:ss" | "yyyy" | "MM/yyyy" | "ww yyyy" | "HH:mm" | "Q yyyy" | "shortDate" | "fullDate";
|
|
65
66
|
export {};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export type { DateFormat, DateConfig } from './apply-date-format';
|
|
2
|
-
export {
|
|
2
|
+
export { formatDateValue, defaultDateConfig } from './apply-date-format';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { CreateCacheKeyFn } from '../utils/create-cache';
|
|
2
|
-
import { Attribute, Measure, PivotAttribute, PivotMeasure, PivotQueryResultData, QueryResultData } from '@sisense/sdk-data';
|
|
2
|
+
import { Attribute, DataSource, Measure, PivotAttribute, PivotMeasure, PivotQueryResultData, QueryResultData } from '@sisense/sdk-data';
|
|
3
3
|
import type { QueryDescription as InternalQueryDescription, PivotQueryDescription as InternalPivotQueryDescription, QueryExecutionConfig } from '@sisense/sdk-query-client';
|
|
4
4
|
import { ClientApplication } from '../app/client-application';
|
|
5
5
|
/**
|
|
@@ -26,6 +26,8 @@ export type PivotQueryDescription = Partial<Omit<InternalPivotQueryDescription,
|
|
|
26
26
|
values?: (Measure | PivotMeasure)[];
|
|
27
27
|
};
|
|
28
28
|
/** @internal */
|
|
29
|
+
export declare const prepareQueryParams: (queryDescription: QueryDescription, defaultDataSource?: DataSource) => InternalQueryDescription;
|
|
30
|
+
/** @internal */
|
|
29
31
|
export declare function executeQuery(queryDescription: QueryDescription, app: ClientApplication, executionConfig?: QueryExecutionConfig): Promise<QueryResultData>;
|
|
30
32
|
/** @internal */
|
|
31
33
|
export declare const executeCsvQuery: (queryDescription: QueryDescription, app: ClientApplication, executionConfig?: QueryExecutionConfig) => Promise<Blob>;
|
|
@@ -5,4 +5,4 @@ export { ExecuteQueryByWidgetId } from './execute-query-by-widget-id';
|
|
|
5
5
|
export { useExecuteQueryByWidgetId, executeQueryByWidgetId, } from './use-execute-query-by-widget-id';
|
|
6
6
|
export { useExecutePivotQuery } from './use-execute-pivot-query';
|
|
7
7
|
export { useQueryCache } from './use-query-cache';
|
|
8
|
-
export type { QueryState, QueryLoadingState, QuerySuccessState, QueryErrorState, CsvQueryState, CsvQueryLoadingState, CsvQuerySuccessState, CsvQueryErrorState, PivotQueryState, PivotQueryLoadingState, PivotQuerySuccessState, PivotQueryErrorState, ExecuteQueryParams, ExecuteQueryResult, ExecuteCsvQueryParams, ExecuteCSVQueryConfig, ExecuteQueryByWidgetIdParams, QueryByWidgetIdState, QueryByWidgetIdQueryParams, ExecutePivotQueryParams, } from './types';
|
|
8
|
+
export type { QueryState, QueryLoadingState, QuerySuccessState, QueryErrorState, CsvQueryState, CsvQueryLoadingState, CsvQuerySuccessState, CsvQueryErrorState, PivotQueryState, PivotQueryLoadingState, PivotQuerySuccessState, PivotQueryErrorState, BaseQueryParams, ExecuteQueryParams, ExecuteQueryResult, ExecuteCsvQueryParams, ExecuteCSVQueryConfig, ExecuteQueryByWidgetIdParams, QueryByWidgetIdState, QueryByWidgetIdQueryParams, ExecutePivotQueryParams, } from './types';
|
|
@@ -171,9 +171,11 @@ export type QueryByWidgetIdQueryParams = {
|
|
|
171
171
|
*/
|
|
172
172
|
export type QueryByWidgetIdState = QueryState & QueryByWidgetIdQueryParams;
|
|
173
173
|
/**
|
|
174
|
-
*
|
|
174
|
+
* Base query parameters
|
|
175
|
+
*
|
|
176
|
+
* @internal
|
|
175
177
|
*/
|
|
176
|
-
export interface
|
|
178
|
+
export interface BaseQueryParams {
|
|
177
179
|
/**
|
|
178
180
|
* Data source the query is run against - e.g. `Sample ECommerce`
|
|
179
181
|
*
|
|
@@ -188,6 +190,11 @@ export interface ExecuteQueryParams {
|
|
|
188
190
|
filters?: Filter[] | FilterRelations;
|
|
189
191
|
/** Highlight filters that will highlight results that pass filter criteria */
|
|
190
192
|
highlights?: Filter[];
|
|
193
|
+
}
|
|
194
|
+
/**
|
|
195
|
+
* Parameters for {@link useExecuteQuery} hook.
|
|
196
|
+
*/
|
|
197
|
+
export interface ExecuteQueryParams extends BaseQueryParams {
|
|
191
198
|
/**
|
|
192
199
|
* Number of rows to return in the query result
|
|
193
200
|
*
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Utility for decorating HighchartsOptionsBuilder objects with input/output collection.
|
|
3
|
+
* This enables comprehensive runtime data collection for all builder methods,
|
|
4
|
+
* making it easier to generate unit tests and understand builder behavior.
|
|
5
|
+
*/
|
|
6
|
+
import { HighchartsOptionsBuilder, HighchartBasedChartTypes } from '../../chart/restructured-charts/highchart-based-charts/types';
|
|
7
|
+
/**
|
|
8
|
+
* Generic decorator that wraps all methods of an object with input/output collection.
|
|
9
|
+
* Uses currying pattern: withMethodsInputOutputCollection(config)(objectToDecorate)
|
|
10
|
+
*
|
|
11
|
+
* This enables comprehensive runtime data collection for all object methods,
|
|
12
|
+
* making it easier to generate unit tests and understand object behavior.
|
|
13
|
+
*
|
|
14
|
+
* @param options - Configuration options for the collection behavior
|
|
15
|
+
* @returns Function that takes the object to decorate and returns the decorated object
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```ts
|
|
19
|
+
* // Basic usage:
|
|
20
|
+
* const instrumentedBuilder = withMethodsInputOutputCollection({
|
|
21
|
+
* objectName: 'myChartBuilder',
|
|
22
|
+
* maxSnapshots: 50
|
|
23
|
+
* })(myChartBuilder);
|
|
24
|
+
*
|
|
25
|
+
* // After running the application:
|
|
26
|
+
* printCollectedInfo(); // Shows data for all object methods
|
|
27
|
+
* ```
|
|
28
|
+
*/
|
|
29
|
+
export declare function withMethodsInputOutputCollection<T extends Record<string, any>>(options: {
|
|
30
|
+
/** Name identifier for the object (used in collection namespacing) */
|
|
31
|
+
objectName: string;
|
|
32
|
+
/** Maximum number of unique snapshots to collect per method (default: 100) */
|
|
33
|
+
maxSnapshots?: number;
|
|
34
|
+
}): (obj: T) => T;
|
|
35
|
+
/**
|
|
36
|
+
* Specific decorator for HighchartsOptionsBuilder that follows the generic pattern.
|
|
37
|
+
* Uses currying pattern: withHighchartsOptionsBuilderCollection(config)(builderToDecorate)
|
|
38
|
+
*
|
|
39
|
+
* Each method gets its own collection namespace (e.g., "barBuilder.getChart", "barBuilder.getSeries")
|
|
40
|
+
* to enable granular analysis of how different parts of the chart configuration are built.
|
|
41
|
+
*
|
|
42
|
+
* @param options - Configuration options for the collection behavior
|
|
43
|
+
* @returns Function that takes the builder to decorate and returns the decorated builder
|
|
44
|
+
*
|
|
45
|
+
* @example
|
|
46
|
+
* ```ts
|
|
47
|
+
* const instrumentedBuilder = withHighchartsOptionsBuilderDataCollections({
|
|
48
|
+
* builderName: 'myChartBuilder',
|
|
49
|
+
* maxSnapshots: 50
|
|
50
|
+
* })(myChartBuilder);
|
|
51
|
+
*
|
|
52
|
+
* // After running the application:
|
|
53
|
+
* printCollectedInfo(); // Shows data for all builder methods
|
|
54
|
+
* ```
|
|
55
|
+
*/
|
|
56
|
+
export declare function withHighchartsOptionsBuilderDataCollection<CT extends HighchartBasedChartTypes>(options: {
|
|
57
|
+
/** Name identifier for the builder (used in collection namespacing) */
|
|
58
|
+
builderName: string;
|
|
59
|
+
/** Maximum number of unique snapshots to collect per method (default: 100) */
|
|
60
|
+
maxSnapshots?: number;
|
|
61
|
+
}): (builder: HighchartsOptionsBuilder<CT>) => HighchartsOptionsBuilder<CT>;
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Input/Output Collection Decorator for Runtime Test Data Generation
|
|
3
|
+
*
|
|
4
|
+
* This module provides a decorator that collects unique input/output snapshots
|
|
5
|
+
* of function calls during runtime. This is useful for generating unit test data
|
|
6
|
+
* from actual application usage.
|
|
7
|
+
*
|
|
8
|
+
* Usage:
|
|
9
|
+
* 1. Wrap your function with the decorator:
|
|
10
|
+
* ```ts
|
|
11
|
+
* // With configuration:
|
|
12
|
+
* const myFunction = withInputOutputCollection({ maxSnapshots: 100 })(originalFunction);
|
|
13
|
+
*
|
|
14
|
+
* // With custom function name:
|
|
15
|
+
* const myFunction = withInputOutputCollection({
|
|
16
|
+
* maxSnapshots: 100,
|
|
17
|
+
* functionName: 'myCustomName'
|
|
18
|
+
* })(originalFunction);
|
|
19
|
+
*
|
|
20
|
+
|
|
21
|
+
* ```
|
|
22
|
+
*
|
|
23
|
+
* 2. Run your application and exercise the function with various inputs
|
|
24
|
+
*
|
|
25
|
+
* 3. In the browser console (development only), call:
|
|
26
|
+
* - `printCollectedInfo()` - to view all collected data
|
|
27
|
+
* - `getCollectedData()` - to get data programmatically
|
|
28
|
+
* - `exportCollectedDataAsJson()` - to export as JSON string with function serialization
|
|
29
|
+
* - `parseCollectedDataFromJson(jsonString)` - to parse exported JSON and get function placeholders
|
|
30
|
+
* - `clearCollectedData()` - to clear collected data
|
|
31
|
+
* - `cleanup()` - to completely clean up the collector
|
|
32
|
+
*
|
|
33
|
+
* Features:
|
|
34
|
+
* - Intelligent deduplication prevents collecting identical input/output pairs
|
|
35
|
+
* - Robust deep equality checking handles functions, dates, and complex objects
|
|
36
|
+
* - Statistics tracking shows total calls vs unique snapshots
|
|
37
|
+
* - Configurable maximum number of snapshots
|
|
38
|
+
* - Deep cloning of inputs and outputs to avoid reference issues
|
|
39
|
+
* - Proper function serialization for unit test generation
|
|
40
|
+
* - Browser console integration for easy access (development only)
|
|
41
|
+
* - Automatic cleanup when no collected data remains
|
|
42
|
+
*/
|
|
43
|
+
interface CollectedData {
|
|
44
|
+
id: string;
|
|
45
|
+
timestamp: number;
|
|
46
|
+
args: any[];
|
|
47
|
+
result: any;
|
|
48
|
+
}
|
|
49
|
+
interface CollectionStore {
|
|
50
|
+
functionName: string;
|
|
51
|
+
data: CollectedData[];
|
|
52
|
+
totalCalls: number;
|
|
53
|
+
duplicateSkips: number;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Decorator that collects unique input/output snapshots for a function during runtime.
|
|
57
|
+
* Useful for generating unit test data from actual application usage.
|
|
58
|
+
*
|
|
59
|
+
* Uses currying pattern: withInputOutputCollection(config)(functionToDecorate)
|
|
60
|
+
*
|
|
61
|
+
* @param options - Configuration options for the collector
|
|
62
|
+
* @returns Function that takes the function to decorate and returns the decorated function
|
|
63
|
+
*/
|
|
64
|
+
export declare function withInputOutputCollection<TFunction extends (...args: any[]) => any>(options?: {
|
|
65
|
+
/** Maximum number of unique snapshots to collect (default: 100) */
|
|
66
|
+
maxSnapshots?: number;
|
|
67
|
+
/** Custom equality function for comparing arguments (default: deep equality) */
|
|
68
|
+
equalityFn?: (a: any[], b: any[]) => boolean;
|
|
69
|
+
/** Optional custom function name (defaults to function.name) */
|
|
70
|
+
functionName?: string;
|
|
71
|
+
}): (originalFunction: TFunction) => TFunction;
|
|
72
|
+
/**
|
|
73
|
+
* Prints all collected input/output data to the console.
|
|
74
|
+
* This function is attached to the window object for easy access in the browser.
|
|
75
|
+
*/
|
|
76
|
+
export declare function printCollectedInfo(): void;
|
|
77
|
+
/**
|
|
78
|
+
* Returns all collected data as a serializable object.
|
|
79
|
+
* Useful for exporting test data programmatically.
|
|
80
|
+
*/
|
|
81
|
+
export declare function getCollectedData(): Record<string, CollectionStore>;
|
|
82
|
+
/**
|
|
83
|
+
* Clears all collected data.
|
|
84
|
+
* Useful for resetting the collection state.
|
|
85
|
+
* Removes window utilities if no data remains.
|
|
86
|
+
*/
|
|
87
|
+
export declare function clearCollectedData(functionName?: string): void;
|
|
88
|
+
/**
|
|
89
|
+
* Completely cleans up the input/output collector.
|
|
90
|
+
* Clears all data and removes window utilities.
|
|
91
|
+
* Useful for cleanup in test environments or when the collector is no longer needed.
|
|
92
|
+
*/
|
|
93
|
+
export declare function cleanup(): void;
|
|
94
|
+
/**
|
|
95
|
+
* Exports collected data as JSON string with proper function serialization.
|
|
96
|
+
* Functions are represented as `[[Function - {functionName}]]` strings for easy replacement in unit tests.
|
|
97
|
+
*
|
|
98
|
+
* Example output:
|
|
99
|
+
* ```json
|
|
100
|
+
* {
|
|
101
|
+
* "buildHighchartsOptions": {
|
|
102
|
+
* "functionName": "buildHighchartsOptions",
|
|
103
|
+
* "data": [{
|
|
104
|
+
* "args": [{ "onBeforeRender": "[[Function - customRenderer]]" }],
|
|
105
|
+
* "result": { "chart": { "type": "line" } }
|
|
106
|
+
* }]
|
|
107
|
+
* }
|
|
108
|
+
* }
|
|
109
|
+
* ```
|
|
110
|
+
*
|
|
111
|
+
* Useful for saving test data to files.
|
|
112
|
+
*/
|
|
113
|
+
export declare function exportCollectedDataAsJson(): string;
|
|
114
|
+
/**
|
|
115
|
+
* Parses JSON data exported by exportCollectedDataAsJson and provides a function map for mocking.
|
|
116
|
+
* This is a utility function for unit tests to easily replace function placeholders with mocks.
|
|
117
|
+
*
|
|
118
|
+
* @param jsonData - The JSON string exported by exportCollectedDataAsJson
|
|
119
|
+
* @returns Object containing parsed data and a list of function placeholders found
|
|
120
|
+
*/
|
|
121
|
+
export declare function parseCollectedDataFromJson(jsonData: string): {
|
|
122
|
+
data: Record<string, CollectionStore>;
|
|
123
|
+
functionPlaceholders: string[];
|
|
124
|
+
};
|
|
125
|
+
export {};
|
|
@@ -4781,7 +4781,7 @@ export declare function getDashboardFilters(dashboardFilters: Array<FilterDto |
|
|
|
4781
4781
|
column: string;
|
|
4782
4782
|
datasource?: import("@sisense/sdk-data").JaqlDataSource | undefined;
|
|
4783
4783
|
title: string;
|
|
4784
|
-
level?: "years" | "quarters" | "months" | "weeks" | "
|
|
4784
|
+
level?: "years" | "quarters" | "months" | "weeks" | "days" | "minutes" | undefined;
|
|
4785
4785
|
sort?: "desc" | "asc" | undefined;
|
|
4786
4786
|
in?: {
|
|
4787
4787
|
selected?: {
|
|
@@ -3,4 +3,13 @@ import { ValueToColorMap, MultiColumnValueToColorMap, Color } from '../types.js'
|
|
|
3
3
|
import { PanelColorFormat, PanelItem, PanelMembersFormat } from './types.js';
|
|
4
4
|
export declare const createValueColorOptions: (format?: PanelColorFormat, customPaletteColors?: Color[]) => DataColorOptions | undefined;
|
|
5
5
|
export declare const createValueToColorMap: (membersFormat: PanelMembersFormat) => ValueToColorMap;
|
|
6
|
+
/**
|
|
7
|
+
* Creates a PanelColorFormat from DataColorOptions
|
|
8
|
+
*
|
|
9
|
+
* TODO: basic use cases done for the studio assistant, need more testing with real Fusion widgets
|
|
10
|
+
*
|
|
11
|
+
* @param options The DataColorOptions to convert
|
|
12
|
+
* @returns The corresponding PanelColorFormat
|
|
13
|
+
*/
|
|
14
|
+
export declare const createPanelColorFormat: (options: DataColorOptions | undefined, paletteColors?: Color[]) => PanelColorFormat | undefined;
|
|
6
15
|
export declare const createValueToColorMultiColumnsMap: (items: PanelItem[]) => MultiColumnValueToColorMap;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { StyledMeasureColumn } from '../types.js';
|
|
2
|
+
import { StatisticalModels } from './types.js';
|
|
3
|
+
/** @internal */
|
|
4
|
+
export declare function applyStatisticalModels(dataOption: StyledMeasureColumn, statisticalModels?: StatisticalModels): StyledMeasureColumn;
|
|
5
|
+
/**
|
|
6
|
+
* Create statistical models from styled measure column
|
|
7
|
+
*
|
|
8
|
+
* @internal
|
|
9
|
+
*/
|
|
10
|
+
export declare function createStatisticalModels(column: StyledMeasureColumn): StatisticalModels | undefined;
|
|
@@ -2,20 +2,6 @@ import { JaqlDataSource } from '@sisense/sdk-data';
|
|
|
2
2
|
import { StyledMeasureColumn, StyledColumn, Color } from '../types.js';
|
|
3
3
|
import { Panel, PanelItem, FusionWidgetType, WidgetStyle, BoxplotWidgetStyle } from './types.js';
|
|
4
4
|
import { WidgetDataOptions } from '../models/index.js';
|
|
5
|
-
/** @internal */
|
|
6
|
-
export declare function applyStatisticalModels(dataOption: StyledMeasureColumn, statisticalModels?: {
|
|
7
|
-
forecast?: {
|
|
8
|
-
isEnabled: boolean;
|
|
9
|
-
isViewerDisabled: boolean;
|
|
10
|
-
confidence: number;
|
|
11
|
-
forecastPeriod: number;
|
|
12
|
-
};
|
|
13
|
-
trend?: {
|
|
14
|
-
isEnabled: boolean;
|
|
15
|
-
isViewerDisabled: boolean;
|
|
16
|
-
trendType: string;
|
|
17
|
-
};
|
|
18
|
-
}): StyledMeasureColumn;
|
|
19
5
|
export declare function createDataColumn(item: PanelItem, customPaletteColors?: Color[]): StyledColumn | StyledMeasureColumn;
|
|
20
6
|
/** @internal */
|
|
21
7
|
export declare function createPanelItem(column: StyledColumn | StyledMeasureColumn): PanelItem;
|
|
@@ -184,25 +184,26 @@ export type StatisticalModels = {
|
|
|
184
184
|
};
|
|
185
185
|
forecastPeriod: number;
|
|
186
186
|
confidence: number;
|
|
187
|
-
modelType:
|
|
187
|
+
modelType: 'en' | 'aa' | 'hw' | 'fb';
|
|
188
188
|
boundaries: {
|
|
189
189
|
upper: {
|
|
190
190
|
isEnabled: boolean;
|
|
191
|
-
value: null;
|
|
191
|
+
value: number | null;
|
|
192
192
|
};
|
|
193
193
|
lower: {
|
|
194
194
|
isEnabled: boolean;
|
|
195
|
-
value: null;
|
|
195
|
+
value: number | null;
|
|
196
196
|
};
|
|
197
197
|
isInt: {
|
|
198
198
|
isEnabled: boolean;
|
|
199
199
|
};
|
|
200
200
|
};
|
|
201
|
+
isAccessible: boolean;
|
|
201
202
|
};
|
|
202
203
|
trend?: {
|
|
203
204
|
isEnabled: boolean;
|
|
204
205
|
isViewerDisabled: boolean;
|
|
205
|
-
trendType:
|
|
206
|
+
trendType: 'linear' | 'logarithmic' | 'smooth' | 'local';
|
|
206
207
|
ignoreAnomalies: boolean;
|
|
207
208
|
trendOnForecast: boolean;
|
|
208
209
|
compare: {
|
|
@@ -261,6 +262,7 @@ export type PanelColorFormatSingle = {
|
|
|
261
262
|
type: 'color';
|
|
262
263
|
color?: string;
|
|
263
264
|
colorIndex?: number;
|
|
265
|
+
isHandPickedColor?: boolean;
|
|
264
266
|
};
|
|
265
267
|
export type PanelColorFormatRange = {
|
|
266
268
|
type: 'range';
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { f as i, g as l, h as n, i as o, D as d, k as u, M as s } from "./execute-query-agpyzZz6.js";
|
|
2
|
+
class m extends d {
|
|
3
|
+
constructor(e, t) {
|
|
4
|
+
var r;
|
|
5
|
+
super((r = e.jaql.title) !== null && r !== void 0 ? r : "", t), this.__serializable = "JaqlElement", this.expression = e.jaql.dim || e.jaql.formula, this.metadataItem = e, e.jaql.agg ? this.aggregation = e.jaql.agg : delete this.aggregation, e.jaql.formula ? this.formula = e.jaql.formula : delete this.formula, e.jaql.sort ? this.sortType = u(e.jaql.sort) : delete this.sortType, this.skipValidation = !0;
|
|
6
|
+
}
|
|
7
|
+
get id() {
|
|
8
|
+
return this.expression;
|
|
9
|
+
}
|
|
10
|
+
jaql(e) {
|
|
11
|
+
return e === !0 ? this.metadataItem.jaql : this.metadataItem;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Gets a serializable representation of the element
|
|
15
|
+
*/
|
|
16
|
+
serialize() {
|
|
17
|
+
const e = super.serialize();
|
|
18
|
+
return e.metadataItem = this.metadataItem, e.type = this.type, e;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
const c = {
|
|
22
|
+
text: s.TextAttribute,
|
|
23
|
+
numeric: s.NumericAttribute,
|
|
24
|
+
datetime: s.DateLevel
|
|
25
|
+
}, h = (a) => a && a.__serializable === "JaqlElement";
|
|
26
|
+
function p(a) {
|
|
27
|
+
var e;
|
|
28
|
+
return new m(a, (e = c[a.jaql.datatype]) !== null && e !== void 0 ? e : "numeric");
|
|
29
|
+
}
|
|
30
|
+
function y(a) {
|
|
31
|
+
const { jaql: e } = a;
|
|
32
|
+
if (e.formula)
|
|
33
|
+
return i(e);
|
|
34
|
+
const t = l(e);
|
|
35
|
+
return "agg" in e && e.dim && e.datatype ? n({
|
|
36
|
+
expression: e.dim,
|
|
37
|
+
dataType: e.datatype,
|
|
38
|
+
agg: e.agg || "",
|
|
39
|
+
granularity: t,
|
|
40
|
+
format: void 0,
|
|
41
|
+
sort: e.sort,
|
|
42
|
+
title: e.title,
|
|
43
|
+
dataSource: e.datasource
|
|
44
|
+
}) : e.dim && e.datatype ? o({
|
|
45
|
+
expression: e.dim,
|
|
46
|
+
dataType: e.datatype,
|
|
47
|
+
granularity: t,
|
|
48
|
+
sort: e.sort,
|
|
49
|
+
title: e.title,
|
|
50
|
+
panel: a.panel,
|
|
51
|
+
dataSource: e.datasource
|
|
52
|
+
}) : p(a);
|
|
53
|
+
}
|
|
54
|
+
const q = {
|
|
55
|
+
jaql: {
|
|
56
|
+
datasource: {
|
|
57
|
+
title: "",
|
|
58
|
+
type: "elasticube"
|
|
59
|
+
},
|
|
60
|
+
metadata: []
|
|
61
|
+
},
|
|
62
|
+
queryTitle: "",
|
|
63
|
+
chartRecommendations: {}
|
|
64
|
+
}, f = {
|
|
65
|
+
model: "",
|
|
66
|
+
metadata: [],
|
|
67
|
+
chart: {},
|
|
68
|
+
queryTitle: ""
|
|
69
|
+
}, E = (a) => "widgetProps" in a, j = (a) => "dashboardOid" in a && "widgetOid" in a, b = (a) => "dashboardProps" in a, T = (a) => "dashboardOid" in a;
|
|
70
|
+
export {
|
|
71
|
+
f as E,
|
|
72
|
+
m as J,
|
|
73
|
+
T as a,
|
|
74
|
+
q as b,
|
|
75
|
+
y as c,
|
|
76
|
+
E as d,
|
|
77
|
+
b as e,
|
|
78
|
+
h as f,
|
|
79
|
+
j as i
|
|
80
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const a=require("./execute-query-Cp3se7Yb.cjs");class s extends a.DimensionalElement{constructor(e,r){var i;super((i=e.jaql.title)!==null&&i!==void 0?i:"",r),this.__serializable="JaqlElement",this.expression=e.jaql.dim||e.jaql.formula,this.metadataItem=e,e.jaql.agg?this.aggregation=e.jaql.agg:delete this.aggregation,e.jaql.formula?this.formula=e.jaql.formula:delete this.formula,e.jaql.sort?this.sortType=a.getSortType(e.jaql.sort):delete this.sortType,this.skipValidation=!0}get id(){return this.expression}jaql(e){return e===!0?this.metadataItem.jaql:this.metadataItem}serialize(){const e=super.serialize();return e.metadataItem=this.metadataItem,e.type=this.type,e}}const l={text:a.MetadataTypes.TextAttribute,numeric:a.MetadataTypes.NumericAttribute,datetime:a.MetadataTypes.DateLevel},d=t=>t&&t.__serializable==="JaqlElement";function n(t){var e;return new s(t,(e=l[t.jaql.datatype])!==null&&e!==void 0?e:"numeric")}function o(t){const{jaql:e}=t;if(e.formula)return a.createCalculatedMeasureHelper(e);const r=a.getGranularityFromJaql(e);return"agg"in e&&e.dim&&e.datatype?a.createMeasureHelper({expression:e.dim,dataType:e.datatype,agg:e.agg||"",granularity:r,format:void 0,sort:e.sort,title:e.title,dataSource:e.datasource}):e.dim&&e.datatype?a.createAttributeHelper({expression:e.dim,dataType:e.datatype,granularity:r,sort:e.sort,title:e.title,panel:t.panel,dataSource:e.datasource}):n(t)}const u={jaql:{datasource:{title:"",type:"elasticube"},metadata:[]},queryTitle:"",chartRecommendations:{}},m={model:"",metadata:[],chart:{},queryTitle:""},c=t=>"widgetProps"in t,p=t=>"dashboardOid"in t&&"widgetOid"in t,g=t=>"dashboardProps"in t,y=t=>"dashboardOid"in t;exports.EMPTY_EXPANDED_QUERY_MODEL=u;exports.EMPTY_SIMPLE_QUERY_MODEL=m;exports.JaqlElement=s;exports.createDimensionalElementFromMetadataItem=o;exports.isByIdDashboardCodeParams=y;exports.isByIdWidgetCodeParams=p;exports.isClientSideDashboardCodeParams=g;exports.isClientSideWidgetCodeParams=c;exports.isJaqlElement=d;
|