@databrainhq/plugin 0.14.22 → 0.14.24
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 +12 -0
- package/dist/hooks/useExternalMetric.d.ts +1 -0
- package/dist/hooks/useGenerateMetric.d.ts +6 -1
- package/dist/types/metricCreate.d.ts +30 -1
- package/dist/webcomponents.es.js +30726 -29541
- package/dist/webcomponents.umd.js +176 -176
- 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,10 @@ 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[]>;
|
|
87
|
+
export declare const NUMBER_SYNONYMNS: Record<string, number>;
|
|
88
|
+
export declare const questionKeywords: string[];
|
|
85
89
|
export declare const DATASET_OTHER_HELPER_FUNCTIONS: {
|
|
86
90
|
value: string;
|
|
87
91
|
label: string;
|
|
@@ -90,3 +94,11 @@ export declare const DATASET_NUM_HELPER_FUNCTIONS: {
|
|
|
90
94
|
value: string;
|
|
91
95
|
label: string;
|
|
92
96
|
}[];
|
|
97
|
+
export declare const REDSHIFT = "redshift";
|
|
98
|
+
export declare const SNOWFLAKE = "snowflake";
|
|
99
|
+
export declare const BIGQUERY = "bigquery";
|
|
100
|
+
export declare const MYSQL = "mysql";
|
|
101
|
+
export declare const POSTGRES = "postgres";
|
|
102
|
+
export declare const MONGODB = "mongodb";
|
|
103
|
+
export declare const DATABRICKS = "databricks";
|
|
104
|
+
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;
|
|
@@ -96,6 +102,8 @@ export type SelectedColumn = {
|
|
|
96
102
|
dateFormat?: string;
|
|
97
103
|
};
|
|
98
104
|
synonyms?: string[];
|
|
105
|
+
sortType?: 'ASC' | 'DESC';
|
|
106
|
+
limit?: number;
|
|
99
107
|
};
|
|
100
108
|
export type DatasetSettings = {
|
|
101
109
|
timeColumn: FloatingDropDownOption;
|
|
@@ -283,6 +291,7 @@ export type Table = {
|
|
|
283
291
|
schema: string;
|
|
284
292
|
id: string;
|
|
285
293
|
joins: Join[];
|
|
294
|
+
type?: 'custom' | 'default';
|
|
286
295
|
};
|
|
287
296
|
export type Aggregate = {
|
|
288
297
|
method: string;
|
|
@@ -301,6 +310,9 @@ export type Dimension = {
|
|
|
301
310
|
dataType: string;
|
|
302
311
|
helperFunction?: string;
|
|
303
312
|
labelType?: string;
|
|
313
|
+
functionConfiguration?: {
|
|
314
|
+
dateFormat?: string;
|
|
315
|
+
};
|
|
304
316
|
};
|
|
305
317
|
export type Filter = {
|
|
306
318
|
method: string;
|
|
@@ -319,6 +331,7 @@ export type Filter = {
|
|
|
319
331
|
export type Order = {
|
|
320
332
|
method: string;
|
|
321
333
|
name: string;
|
|
334
|
+
type?: 'custom' | 'default' | 'selected_column';
|
|
322
335
|
};
|
|
323
336
|
export type Forcast = {
|
|
324
337
|
isEnable: boolean;
|
|
@@ -340,6 +353,7 @@ export type Forcast = {
|
|
|
340
353
|
};
|
|
341
354
|
growth: string;
|
|
342
355
|
};
|
|
356
|
+
export type TableType = string;
|
|
343
357
|
export type GroupByColumn = {
|
|
344
358
|
columnName: string;
|
|
345
359
|
alias: string;
|
|
@@ -348,8 +362,10 @@ export type GroupByColumn = {
|
|
|
348
362
|
helperFunction?: string;
|
|
349
363
|
type: 'custom' | 'default';
|
|
350
364
|
dataType: string;
|
|
365
|
+
functionConfiguration?: {
|
|
366
|
+
dateFormat?: string;
|
|
367
|
+
};
|
|
351
368
|
};
|
|
352
|
-
export type TableType = string;
|
|
353
369
|
export type DatasetMetricCreationConfiguration = {
|
|
354
370
|
table: Table;
|
|
355
371
|
aggregates: Aggregate[];
|
|
@@ -361,6 +377,19 @@ export type DatasetMetricCreationConfiguration = {
|
|
|
361
377
|
forecast?: Forcast;
|
|
362
378
|
rlsValues?: Record<string, string | number>;
|
|
363
379
|
groupByColumnList?: GroupByColumn[];
|
|
380
|
+
rlsConditions?: RlsCondition[];
|
|
381
|
+
isAllClient?: boolean;
|
|
382
|
+
};
|
|
383
|
+
export type OnChangeHelperFunctionParams = {
|
|
384
|
+
column: SelectedColumn;
|
|
385
|
+
helperFunction: FloatingDropDownOption;
|
|
386
|
+
functionConfiguration?: {
|
|
387
|
+
dateFormat?: string;
|
|
388
|
+
};
|
|
389
|
+
};
|
|
390
|
+
export type OnChangeAliasParams = {
|
|
391
|
+
column: SelectedColumn;
|
|
392
|
+
alias: string;
|
|
364
393
|
};
|
|
365
394
|
export type ConfigType = {
|
|
366
395
|
clientId: string;
|