@databrainhq/plugin 0.14.22 → 0.14.23
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/AutoCompleteDropdown/index.d.ts +14 -0
- package/dist/consts/metricOptions.d.ts +10 -0
- package/dist/hooks/useExternalMetric.d.ts +1 -0
- package/dist/hooks/useGenerateMetric.d.ts +6 -1
- package/dist/types/metricCreate.d.ts +27 -1
- package/dist/webcomponents.es.js +28319 -27474
- package/dist/webcomponents.umd.js +171 -171
- package/package.json +1 -1
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { FloatingDropDownOption, OnChangeAliasParams, OnChangeHelperFunctionParams, SelectedColumn } from '@/types';
|
|
3
|
+
export type AutoCompleteDropdownProps = {
|
|
4
|
+
setSelectedOptions: React.Dispatch<React.SetStateAction<SelectedColumn[]>>;
|
|
5
|
+
selectedOption: SelectedColumn[];
|
|
6
|
+
options: SelectedColumn[];
|
|
7
|
+
label?: string;
|
|
8
|
+
isDisabled?: boolean;
|
|
9
|
+
placeholder?: string;
|
|
10
|
+
functionOptions?: (col?: SelectedColumn | undefined, colDatatype?: string | undefined) => FloatingDropDownOption[];
|
|
11
|
+
onChangeHelperFunction?: ({ column, helperFunction, functionConfiguration, }: OnChangeHelperFunctionParams) => void;
|
|
12
|
+
onChangeAlias: ({ alias, column }: OnChangeAliasParams) => void;
|
|
13
|
+
};
|
|
14
|
+
export declare const AutoCompleteDropdown: ({ label, selectedOption, setSelectedOptions, options, isDisabled, placeholder, functionOptions, onChangeHelperFunction, onChangeAlias, }: AutoCompleteDropdownProps) => React.JSX.Element;
|
|
@@ -82,6 +82,8 @@ export declare const DATASET_NUMBER_HELPER_FUNCTIONS: {
|
|
|
82
82
|
label: string;
|
|
83
83
|
}[];
|
|
84
84
|
export declare const aggregateStrings: string[];
|
|
85
|
+
export declare const FUNCTIONS_SYNONYMNS: Record<string, string[]>;
|
|
86
|
+
export declare const SORT_SYNONYMNS: Record<string, string[]>;
|
|
85
87
|
export declare const DATASET_OTHER_HELPER_FUNCTIONS: {
|
|
86
88
|
value: string;
|
|
87
89
|
label: string;
|
|
@@ -90,3 +92,11 @@ export declare const DATASET_NUM_HELPER_FUNCTIONS: {
|
|
|
90
92
|
value: string;
|
|
91
93
|
label: string;
|
|
92
94
|
}[];
|
|
95
|
+
export declare const REDSHIFT = "redshift";
|
|
96
|
+
export declare const SNOWFLAKE = "snowflake";
|
|
97
|
+
export declare const BIGQUERY = "bigquery";
|
|
98
|
+
export declare const MYSQL = "mysql";
|
|
99
|
+
export declare const POSTGRES = "postgres";
|
|
100
|
+
export declare const MONGODB = "mongodb";
|
|
101
|
+
export declare const DATABRICKS = "databricks";
|
|
102
|
+
export declare const CLICKHOUSE = "clickhouse";
|
|
@@ -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, SelectedColumn, TableObjectType } from '@/types';
|
|
5
|
+
import { ChartSettingsType, ConfigType, FloatingDropDownOption, GenerateMetricState, OnChangeAliasParams, OnChangeHelperFunctionParams, 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>>;
|
|
@@ -45,5 +45,10 @@ declare const useGenerateMetric: (config: ConfigType) => {
|
|
|
45
45
|
selectedColumns: SelectedColumn[];
|
|
46
46
|
setSelectedColumns: import("react").Dispatch<import("react").SetStateAction<SelectedColumn[]>>;
|
|
47
47
|
functionOptions: (col?: SelectedColumn, colDatatype?: string) => FloatingDropDownOption[];
|
|
48
|
+
setChartFields: ({ chartType, chartDimensions, chartMetrics, chartAggregateColumns, }: SetChartFieldParams) => void;
|
|
49
|
+
onSubmitSearch: () => void;
|
|
50
|
+
onChangeHelperFunction: ({ column, helperFunction, functionConfiguration, }: OnChangeHelperFunctionParams) => void;
|
|
51
|
+
onChangeAlias: ({ alias, column }: OnChangeAliasParams) => void;
|
|
52
|
+
chartOptions: FloatingDropDownOption[];
|
|
48
53
|
};
|
|
49
54
|
export default useGenerateMetric;
|
|
@@ -79,6 +79,12 @@ export type DraggableMetricItemData = {
|
|
|
79
79
|
table: TableObjectType;
|
|
80
80
|
column: TableColumn;
|
|
81
81
|
};
|
|
82
|
+
export type SetChartFieldParams = {
|
|
83
|
+
chartMetrics?: string[];
|
|
84
|
+
chartDimensions?: string[];
|
|
85
|
+
chartAggregateColumns?: string[];
|
|
86
|
+
chartType?: ChartSettingsType['chartType'];
|
|
87
|
+
};
|
|
82
88
|
export type SelectedColumn = {
|
|
83
89
|
name: string;
|
|
84
90
|
datatype: string;
|
|
@@ -283,6 +289,7 @@ export type Table = {
|
|
|
283
289
|
schema: string;
|
|
284
290
|
id: string;
|
|
285
291
|
joins: Join[];
|
|
292
|
+
type?: 'custom' | 'default';
|
|
286
293
|
};
|
|
287
294
|
export type Aggregate = {
|
|
288
295
|
method: string;
|
|
@@ -301,6 +308,9 @@ export type Dimension = {
|
|
|
301
308
|
dataType: string;
|
|
302
309
|
helperFunction?: string;
|
|
303
310
|
labelType?: string;
|
|
311
|
+
functionConfiguration?: {
|
|
312
|
+
dateFormat?: string;
|
|
313
|
+
};
|
|
304
314
|
};
|
|
305
315
|
export type Filter = {
|
|
306
316
|
method: string;
|
|
@@ -340,6 +350,7 @@ export type Forcast = {
|
|
|
340
350
|
};
|
|
341
351
|
growth: string;
|
|
342
352
|
};
|
|
353
|
+
export type TableType = string;
|
|
343
354
|
export type GroupByColumn = {
|
|
344
355
|
columnName: string;
|
|
345
356
|
alias: string;
|
|
@@ -348,8 +359,10 @@ export type GroupByColumn = {
|
|
|
348
359
|
helperFunction?: string;
|
|
349
360
|
type: 'custom' | 'default';
|
|
350
361
|
dataType: string;
|
|
362
|
+
functionConfiguration?: {
|
|
363
|
+
dateFormat?: string;
|
|
364
|
+
};
|
|
351
365
|
};
|
|
352
|
-
export type TableType = string;
|
|
353
366
|
export type DatasetMetricCreationConfiguration = {
|
|
354
367
|
table: Table;
|
|
355
368
|
aggregates: Aggregate[];
|
|
@@ -361,6 +374,19 @@ export type DatasetMetricCreationConfiguration = {
|
|
|
361
374
|
forecast?: Forcast;
|
|
362
375
|
rlsValues?: Record<string, string | number>;
|
|
363
376
|
groupByColumnList?: GroupByColumn[];
|
|
377
|
+
rlsConditions?: RlsCondition[];
|
|
378
|
+
isAllClient?: boolean;
|
|
379
|
+
};
|
|
380
|
+
export type OnChangeHelperFunctionParams = {
|
|
381
|
+
column: SelectedColumn;
|
|
382
|
+
helperFunction: FloatingDropDownOption;
|
|
383
|
+
functionConfiguration?: {
|
|
384
|
+
dateFormat?: string;
|
|
385
|
+
};
|
|
386
|
+
};
|
|
387
|
+
export type OnChangeAliasParams = {
|
|
388
|
+
column: SelectedColumn;
|
|
389
|
+
alias: string;
|
|
364
390
|
};
|
|
365
391
|
export type ConfigType = {
|
|
366
392
|
clientId: string;
|