@databrainhq/plugin 0.14.56 → 0.14.57
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/components/Chart/index.d.ts +4 -2
- package/dist/components/MetricCreation/components/MetricOutput/MetricOutput.d.ts +1 -1
- package/dist/components/MetricCreation/components/MetricOutput/components/ChartTab/index.d.ts +3 -2
- package/dist/components/PivotTable/PivotTableV2.d.ts +6 -2
- package/dist/components/Text/index.d.ts +1 -1
- package/dist/consts/api.d.ts +2 -0
- package/dist/helpers/createMetric.d.ts +3 -1
- package/dist/hooks/useDatasetMetric.d.ts +2 -1
- package/dist/hooks/useGenerateMetric.d.ts +2 -1
- package/dist/hooks/useMetricCard.d.ts +3 -1
- package/dist/queries/index.d.ts +1 -0
- package/dist/queries/metric.mutation.d.ts +9 -1
- package/dist/types/app.d.ts +19 -0
- package/dist/types/metricCreate.d.ts +6 -1
- package/dist/types/queryTypes.d.ts +5 -0
- package/dist/webcomponents.es.js +39525 -39128
- package/dist/webcomponents.umd.js +190 -189
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { ChartSettingsType } from '@/types';
|
|
2
|
+
import { ChartSettingsType, OnDrillPivotTableParams, PivotDrillState } from '@/types';
|
|
3
3
|
export type ChartProps = {
|
|
4
4
|
chartOptions: ChartSettingsType;
|
|
5
5
|
data: Record<string, any>[];
|
|
@@ -11,6 +11,8 @@ export type ChartProps = {
|
|
|
11
11
|
isShowFullScreenEnabled?: boolean;
|
|
12
12
|
filterValues?: Record<string, any>;
|
|
13
13
|
onMaximize?: () => void;
|
|
14
|
+
onDrillPivotTable?: (value: OnDrillPivotTableParams) => void;
|
|
15
|
+
pivotDrillState: PivotDrillState;
|
|
14
16
|
};
|
|
15
17
|
/**
|
|
16
18
|
* @name Chart - The metric visualization component.
|
|
@@ -22,4 +24,4 @@ export type ChartProps = {
|
|
|
22
24
|
* @prop colors (optional) - the admin provided chart color palettes.
|
|
23
25
|
* @returns JSX - chart visaulization content.
|
|
24
26
|
*/
|
|
25
|
-
export declare const Chart: React.MemoExoticComponent<({ chartOptions, data, events, colors, config, className, isShowFullScreen, isShowFullScreenEnabled, onMaximize, }: ChartProps) => React.JSX.Element>;
|
|
27
|
+
export declare const Chart: React.MemoExoticComponent<({ chartOptions, data, events, colors, config, className, isShowFullScreen, isShowFullScreenEnabled, onMaximize, onDrillPivotTable, pivotDrillState, }: ChartProps) => React.JSX.Element>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { MetricOutputProps } from '@/types/metricCreate';
|
|
3
|
-
export declare const MetricOutput: ({ data, error, isLoading, previewTableDataList, moreTabs, chartColors, chartSettings, setChartSettings, isUpdateMetric, isDisableSqlBtn, setShowSqlModal, isEnablePivotTable, groupbyList, hasNumberKeys, isEnableGauge, outputHeaderProps, metrics, dimensions, onGenerateChart, setMetrics, setColumn, isEnableSingleDimension, isEnableSingleMetrics, functionOptions, configuration, dbName, }: MetricOutputProps) => React.JSX.Element;
|
|
3
|
+
export declare const MetricOutput: ({ data, error, isLoading, previewTableDataList, moreTabs, chartColors, chartSettings, setChartSettings, isUpdateMetric, isDisableSqlBtn, setShowSqlModal, isEnablePivotTable, groupbyList, hasNumberKeys, isEnableGauge, outputHeaderProps, metrics, dimensions, onGenerateChart, setMetrics, setColumn, isEnableSingleDimension, isEnableSingleMetrics, functionOptions, configuration, dbName, pivotDrillState, }: MetricOutputProps) => React.JSX.Element;
|
package/dist/components/MetricCreation/components/MetricOutput/components/ChartTab/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { ClickActionsConfig, ChartSettingsType } from '@/types';
|
|
2
|
+
import { ClickActionsConfig, ChartSettingsType, PivotDrillState } from '@/types';
|
|
3
3
|
type Props = {
|
|
4
4
|
data?: Record<string, any>[];
|
|
5
5
|
isLoading: boolean;
|
|
@@ -15,6 +15,7 @@ type Props = {
|
|
|
15
15
|
hasNumberKeys: boolean;
|
|
16
16
|
isEnableGauge: boolean;
|
|
17
17
|
error: string;
|
|
18
|
+
pivotDrillState: PivotDrillState;
|
|
18
19
|
};
|
|
19
|
-
export declare const ChartTab: ({ data, isLoading, headerChild, chartSettings, setChartSettings, chartColors, handleChartRightClick, chartClickConfig, chartPopupChild, isEnablePivotTable, groupbyList, hasNumberKeys, isEnableGauge, error, }: Props) => React.JSX.Element;
|
|
20
|
+
export declare const ChartTab: ({ data, isLoading, headerChild, chartSettings, setChartSettings, chartColors, handleChartRightClick, chartClickConfig, chartPopupChild, isEnablePivotTable, groupbyList, hasNumberKeys, isEnableGauge, pivotDrillState, error, }: Props) => React.JSX.Element;
|
|
20
21
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { Aggregate } from '@/types';
|
|
2
|
+
import { Aggregate, OnDrillPivotTableParams, PivotDrillState } from '@/types';
|
|
3
3
|
type DataRow = Record<string, any>;
|
|
4
4
|
type PivotTableProps = {
|
|
5
5
|
data: DataRow[];
|
|
@@ -12,8 +12,12 @@ type PivotTableProps = {
|
|
|
12
12
|
isEnabled?: boolean;
|
|
13
13
|
};
|
|
14
14
|
measures: Aggregate[];
|
|
15
|
+
isEnableStripedRows: boolean;
|
|
16
|
+
dimensions: string[];
|
|
17
|
+
onDrillPivotTable?: (value: OnDrillPivotTableParams) => void;
|
|
18
|
+
pivotDrillState: PivotDrillState;
|
|
15
19
|
};
|
|
16
|
-
export declare const PivotTableV2: ({ props: { data, rows, columns, values, headerSettings, measures }, }: {
|
|
20
|
+
export declare const PivotTableV2: ({ props: { data, rows, columns, values, headerSettings, measures, isEnableStripedRows, dimensions, onDrillPivotTable, pivotDrillState, }, }: {
|
|
17
21
|
props: PivotTableProps;
|
|
18
22
|
}) => React.JSX.Element;
|
|
19
23
|
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Colors } from '@/types';
|
|
3
3
|
interface Props {
|
|
4
|
-
variant?: 'heading-lg' | 'heading' | 'body-text-lg' | 'body-text' | 'body-text-sm' | 'btn' | 'label' | 'display' | 'body-text-xs';
|
|
4
|
+
variant?: 'heading-xl' | 'heading-lg' | 'heading' | 'body-text-lg' | 'body-text' | 'body-text-sm' | 'btn' | 'label' | 'sub-label' | 'display' | 'body-text-xs';
|
|
5
5
|
color?: Colors;
|
|
6
6
|
children: React.ReactNode;
|
|
7
7
|
onClick?: () => void;
|
package/dist/consts/api.d.ts
CHANGED
|
@@ -36,6 +36,8 @@ export declare const DASHBOARD_THEME_QUERY = "getTheme";
|
|
|
36
36
|
export declare const METRIC_QUERY_PATH: string;
|
|
37
37
|
export declare const NEW_METRIC_QUERY_PATH: string;
|
|
38
38
|
export declare const METRIC_QUERY_QUERY = "query";
|
|
39
|
+
export declare const NEW_METRIC_DATASET_METRIC_PATH: string;
|
|
40
|
+
export declare const NEW_METRIC_DATASET_METRIC_MUTATION = "newDatasetMetricCreation";
|
|
39
41
|
export declare const METRIC_RAW_DOWNLOAD_SETTINGS_PATH: string;
|
|
40
42
|
export declare const METRIC_RAW_DOWNLOAD_SETTINGS_QUERY = "rawDownloadSettings";
|
|
41
43
|
export declare const METRIC_COLUMN_PATH: string;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import { Aggregate, Dimension, FloatingDropDownOption, SelectedColumn } from '@/types';
|
|
1
|
+
import { Aggregate, Dimension, FloatingDropDownOption, RlsCondition, SelectedColumn } from '@/types';
|
|
2
2
|
export declare const functionOptions: (col?: SelectedColumn, dataType?: string) => FloatingDropDownOption[];
|
|
3
3
|
export declare const getColumnType: (column: SelectedColumn) => "default" | "custom" | "arithmetic_column";
|
|
4
4
|
export declare const getDimensionsAndAggregates: (columns: SelectedColumn[]) => {
|
|
5
5
|
dimensions: Dimension[];
|
|
6
6
|
aggregates: Aggregate[];
|
|
7
7
|
};
|
|
8
|
+
export declare const getChartFields: (colList: SelectedColumn[], dbName: string) => string[];
|
|
9
|
+
export declare const getAppliedFilters: (filterList: RlsCondition[], companyTenancyType: string, clientId: string) => RlsCondition[];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import ReactAce from 'react-ace/lib/ace';
|
|
3
|
-
import { CreateNewFilter, CreateNewSort, DatasetConfig, DatasetMetricCreationConfiguration, FloatingDropDownOption, SelectedColumn, TableType } from '@/types';
|
|
3
|
+
import { CreateNewFilter, CreateNewSort, DatasetConfig, DatasetMetricCreationConfiguration, FloatingDropDownOption, PivotDrillState, SelectedColumn, TableType } from '@/types';
|
|
4
4
|
declare const useDatasetMetric: ({ ...config }: DatasetConfig) => {
|
|
5
5
|
configuration: DatasetMetricCreationConfiguration;
|
|
6
6
|
setConfiguration: import("react").Dispatch<import("react").SetStateAction<DatasetMetricCreationConfiguration>>;
|
|
@@ -41,5 +41,6 @@ declare const useDatasetMetric: ({ ...config }: DatasetConfig) => {
|
|
|
41
41
|
label: string;
|
|
42
42
|
}[];
|
|
43
43
|
getChartFields: (colList: SelectedColumn[]) => string[];
|
|
44
|
+
pivotDrillState: PivotDrillState;
|
|
44
45
|
};
|
|
45
46
|
export default useDatasetMetric;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { FieldValues } from 'react-hook-form';
|
|
3
3
|
import EChartsReact from 'echarts-for-react';
|
|
4
4
|
import { ColumnSizingState } from '@tanstack/react-table';
|
|
5
|
-
import { ChartSettingsType, ConfigType, FloatingDropDownOption, GenerateMetricState, OnChangeAliasParams, OnChangeHelperFunctionParams, SelectedColumn, SetChartFieldParams, TableObjectType } from '@/types';
|
|
5
|
+
import { ChartSettingsType, ConfigType, FloatingDropDownOption, GenerateMetricState, OnChangeAliasParams, OnChangeHelperFunctionParams, PivotDrillState, SelectedColumn, SetChartFieldParams, TableObjectType } from '@/types';
|
|
6
6
|
declare const useGenerateMetric: (config: ConfigType) => {
|
|
7
7
|
isDisableSaveBtn: boolean;
|
|
8
8
|
setChartSettings: import("react").Dispatch<import("react").SetStateAction<ChartSettingsType>>;
|
|
@@ -59,5 +59,6 @@ declare const useGenerateMetric: (config: ConfigType) => {
|
|
|
59
59
|
}[];
|
|
60
60
|
isRef: boolean;
|
|
61
61
|
setRef: import("react").Dispatch<import("react").SetStateAction<boolean>>;
|
|
62
|
+
pivotDrillState: PivotDrillState;
|
|
62
63
|
};
|
|
63
64
|
export default useGenerateMetric;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { ChartSettingsType, FloatingDropDownOption, RlsCondition, DatasetSettings, MetricFilterOptionsType } from '@/types';
|
|
2
|
+
import { ChartSettingsType, FloatingDropDownOption, RlsCondition, DatasetSettings, MetricFilterOptionsType, PivotDrillState, OnDrillPivotTableParams } from '@/types';
|
|
3
3
|
import { MetricCardProps } from '@/components';
|
|
4
4
|
type UseMetricCardProps = {
|
|
5
5
|
metric: Record<string, any>;
|
|
@@ -80,5 +80,7 @@ export declare const useMetricCard: ({ metric, globalFilters, rlsFilters, client
|
|
|
80
80
|
tableResultsDownloadData: Record<string, any>[];
|
|
81
81
|
appliedMetricFilters: RlsCondition[];
|
|
82
82
|
pivotHeaderOptions: FloatingDropDownOption[];
|
|
83
|
+
pivotDrillState: PivotDrillState;
|
|
84
|
+
onDrillPivotTable: ({ filters, nextLevel, currentValue, }: OnDrillPivotTableParams) => void;
|
|
83
85
|
};
|
|
84
86
|
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './metric.mutation';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { UseMetricColumnMutationInputType, UseMetricUnderlyingDataMutationInputType, UseMetricShareCsvMutationInputType, UseMarkArchivedMutationInputType, UseExecutePythonMutationInputType } from '@/types/queryTypes';
|
|
1
|
+
import { UseMetricColumnMutationInputType, UseMetricUnderlyingDataMutationInputType, UseMetricShareCsvMutationInputType, UseMarkArchivedMutationInputType, UseExecutePythonMutationInputType, UseNewDatatsetMetricMutationInputType } from '@/types/queryTypes';
|
|
2
2
|
export declare const useMetricColumnMutation: () => import("react-query").UseMutationResult<{
|
|
3
3
|
data: unknown;
|
|
4
4
|
}, unknown, UseMetricColumnMutationInputType, unknown>;
|
|
@@ -14,3 +14,11 @@ export declare const useMarkArchivedMutation: () => import("react-query").UseMut
|
|
|
14
14
|
export declare const useExecutePythonMutation: () => import("react-query").UseMutationResult<{
|
|
15
15
|
data: unknown;
|
|
16
16
|
}, unknown, UseExecutePythonMutationInputType, unknown>;
|
|
17
|
+
export declare const useGenerateMetricDataMutation: () => import("react-query").UseMutationResult<{
|
|
18
|
+
data: unknown;
|
|
19
|
+
}, unknown, {
|
|
20
|
+
data: UseNewDatatsetMetricMutationInputType;
|
|
21
|
+
token: string;
|
|
22
|
+
clientId: string;
|
|
23
|
+
isFrontendApp: boolean;
|
|
24
|
+
}, unknown>;
|
package/dist/types/app.d.ts
CHANGED
|
@@ -297,6 +297,7 @@ export type PivotSettingsType2 = {
|
|
|
297
297
|
headers?: string[];
|
|
298
298
|
isDynamicHeaders?: boolean;
|
|
299
299
|
aggregates?: Aggregate[];
|
|
300
|
+
dims?: string[];
|
|
300
301
|
};
|
|
301
302
|
export type GaugeSettingsType = {
|
|
302
303
|
metric?: string;
|
|
@@ -623,3 +624,21 @@ export type AdminThemeOptionsType = {
|
|
|
623
624
|
};
|
|
624
625
|
};
|
|
625
626
|
export type FilterValueType = string | string[] | number | number[] | boolean | boolean[] | null | Record<string, any>;
|
|
627
|
+
export type PivotFilterType = {
|
|
628
|
+
columnName: string;
|
|
629
|
+
value: any;
|
|
630
|
+
};
|
|
631
|
+
export type OnDrillPivotTableParams = {
|
|
632
|
+
filters: PivotFilterType[];
|
|
633
|
+
nextLevel: number;
|
|
634
|
+
currentValue: string;
|
|
635
|
+
};
|
|
636
|
+
export type PivotDrillState = {
|
|
637
|
+
isLoading: boolean;
|
|
638
|
+
error: string;
|
|
639
|
+
data: {
|
|
640
|
+
key: string;
|
|
641
|
+
data: Record<string, any>[];
|
|
642
|
+
}[];
|
|
643
|
+
currentValue: string;
|
|
644
|
+
};
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { Dispatch, SetStateAction } from 'react';
|
|
2
2
|
import { FieldValues } from 'react-hook-form';
|
|
3
|
-
import { RlsCondition, FloatingDropDownOption, ChartSettingsType, TableColumn } from '@/types';
|
|
3
|
+
import { RlsCondition, FloatingDropDownOption, ChartSettingsType, TableColumn, PivotDrillState } from '@/types';
|
|
4
4
|
import { ExternalMetrics } from '@/types/queryTypes';
|
|
5
|
+
import { MetricCardProps } from '@/components';
|
|
5
6
|
type ColumnData = {
|
|
6
7
|
name: string;
|
|
7
8
|
datatype: string;
|
|
@@ -240,6 +241,7 @@ export type MetricOutputProps = {
|
|
|
240
241
|
label: string;
|
|
241
242
|
}[]>>;
|
|
242
243
|
setColumn: React.Dispatch<React.SetStateAction<FloatingDropDownOption[]>>;
|
|
244
|
+
pivotDrillState: PivotDrillState;
|
|
243
245
|
};
|
|
244
246
|
export type CompanyIntegration = {
|
|
245
247
|
id: string;
|
|
@@ -440,6 +442,9 @@ export type DatasetMetricCreationConfiguration = {
|
|
|
440
442
|
groupByColumnList?: GroupByColumn[];
|
|
441
443
|
rlsConditions?: RlsCondition[];
|
|
442
444
|
isAllClient?: boolean;
|
|
445
|
+
globalFilters?: MetricCardProps['globalFilters'];
|
|
446
|
+
isApplyMetricFilter?: boolean;
|
|
447
|
+
isApplyGlobalFilter?: boolean;
|
|
443
448
|
};
|
|
444
449
|
export type OnChangeHelperFunctionParams = {
|
|
445
450
|
column: SelectedColumn;
|
|
@@ -53,6 +53,7 @@ export type UseMetricQueryQueryInputType = {
|
|
|
53
53
|
offset?: number;
|
|
54
54
|
isAllClient?: boolean;
|
|
55
55
|
disableStringify?: boolean;
|
|
56
|
+
pivotHeaders?: string[];
|
|
56
57
|
};
|
|
57
58
|
export type UseMetricQueryQueryOutputType = {
|
|
58
59
|
data?: any | null;
|
|
@@ -188,6 +189,10 @@ export type UseDatatsetMetricMutationInputType = {
|
|
|
188
189
|
configuration: DatasetMetricCreationConfiguration;
|
|
189
190
|
id: string;
|
|
190
191
|
};
|
|
192
|
+
export type UseNewDatatsetMetricMutationInputType = {
|
|
193
|
+
configuration: DatasetMetricCreationConfiguration;
|
|
194
|
+
id: string;
|
|
195
|
+
};
|
|
191
196
|
export type UseCreateMetricMutationInputType = {
|
|
192
197
|
chartOptions?: any;
|
|
193
198
|
companyId?: string;
|