@databrainhq/plugin 0.14.51 → 0.14.53

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.
@@ -8,9 +8,9 @@ export type AutoCompleteDropdownProps = {
8
8
  isDisabled?: boolean;
9
9
  placeholder?: string;
10
10
  functionOptions?: (col?: SelectedColumn | undefined, colDatatype?: string | undefined) => FloatingDropDownOption[];
11
- onChangeHelperFunction?: ({ column, helperFunction, functionConfiguration, }: OnChangeHelperFunctionParams) => void;
11
+ onChangeHelperFunction?: ({ column, helperFunction, functionConfiguration, type, }: OnChangeHelperFunctionParams) => void;
12
12
  onChangeAlias: ({ alias, column }: OnChangeAliasParams) => void;
13
- isRef: boolean;
14
- setRef: React.Dispatch<React.SetStateAction<boolean>>;
13
+ isRef?: boolean;
14
+ setRef?: React.Dispatch<React.SetStateAction<boolean>>;
15
15
  };
16
16
  export declare const AutoCompleteDropdown: ({ label, selectedOption, setSelectedOptions, options, isDisabled, placeholder, functionOptions, onChangeHelperFunction, onChangeAlias, isRef, setRef, }: AutoCompleteDropdownProps) => React.JSX.Element;
@@ -13,6 +13,11 @@ export type SingleValueChartProps = {
13
13
  fontColor?: string;
14
14
  suffix?: string;
15
15
  prefix?: string;
16
+ conditionalFormatter?: {
17
+ min: number;
18
+ max: number;
19
+ color: string;
20
+ }[];
16
21
  };
17
22
  value: string | number;
18
23
  hideBorder?: boolean;
@@ -8,7 +8,7 @@ export type FilterClause = {
8
8
  as?: string;
9
9
  };
10
10
  export type FilterDropDownProps = Omit<FloatingDropDownProps, 'options'> & {
11
- filter: Pick<RlsFilterObjectType, 'columnName' | 'tableName' | 'defaultValue' | 'value'>;
11
+ filter: Pick<RlsFilterObjectType, 'columnName' | 'tableName' | 'defaultValue' | 'value' | 'labelColumnName'>;
12
12
  autoSelected?: boolean;
13
13
  workspaceId: string;
14
14
  filterClause?: FilterClause[];
@@ -2,6 +2,7 @@ import React from 'react';
2
2
  import { FloatingDropDownOption } from '@/types';
3
3
  export type FilterFieldType = {
4
4
  column: string;
5
+ labelColumnName?: string;
5
6
  operator: string;
6
7
  applyOnTables?: {
7
8
  tableName: string;
@@ -17,6 +18,7 @@ export type FilterFieldType = {
17
18
  variableStrings?: string[];
18
19
  label: string;
19
20
  filterVariant?: FloatingDropDownOption;
21
+ selectedDropdownValue?: FloatingDropDownOption | FloatingDropDownOption[];
20
22
  };
21
23
  export type FilterFieldProps = {
22
24
  tableName: string;
@@ -1,8 +1,9 @@
1
1
  import React from 'react';
2
- import { GlobalFilterColumn } from '@/types';
2
+ import { FloatingDropDownOption, GlobalFilterColumn } from '@/types';
3
3
  type SearchFieldProps = {
4
4
  column: GlobalFilterColumn;
5
5
  onClickSearch: (value: string | undefined) => void;
6
+ selectedValue: FloatingDropDownOption;
6
7
  };
7
- declare const SearchField: ({ column, onClickSearch }: SearchFieldProps) => React.JSX.Element;
8
+ declare const SearchField: ({ column, onClickSearch, selectedValue, }: SearchFieldProps) => React.JSX.Element;
8
9
  export default SearchField;
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import { FilterFieldType, MetricCardProps } from '@/components';
3
- import { GlobalFilterColumn, GlobalFilterType } from '@/types/app';
3
+ import { FilterValueType, GlobalFilterColumn, GlobalFilterType } from '@/types/app';
4
4
  type GlobalFiltersProps = {
5
5
  filters: GlobalFilterType[];
6
6
  onApply: (filters: MetricCardProps['globalFilters']) => void;
@@ -19,6 +19,12 @@ type GlobalFiltersProps = {
19
19
  addGlobalFilter?: JSX.Element;
20
20
  filterOptions?: (column: string) => JSX.Element;
21
21
  tenancyLevel: string;
22
+ setSelectedFilterVal?: React.Dispatch<React.SetStateAction<{
23
+ name: string;
24
+ value: FilterValueType;
25
+ }[]>>;
26
+ appliedFilterPairs?: Record<string, string | string[]>;
27
+ workspaceId?: string;
22
28
  };
23
29
  export declare const getFormattedFilterValue: (obj: {
24
30
  operator: string;
@@ -2,7 +2,7 @@ import React from 'react';
2
2
  import { FloatingDropDownOption, MetricFilterDemoThemeType, RlsCondition } from '@/types';
3
3
  type Props = {
4
4
  rlsConditions: RlsCondition;
5
- onChangeFilterValue?: (name: string, value: string, customValue?: Record<string, Date>, stringValues?: FloatingDropDownOption[]) => void;
5
+ onChangeFilterValue?: (name: string, value: string, labelValue?: string, customValue?: Record<string, Date>, stringValues?: FloatingDropDownOption[]) => void;
6
6
  workspaceId: string;
7
7
  clientId?: string;
8
8
  className?: string;
@@ -0,0 +1,12 @@
1
+ import React from 'react';
2
+ type DataRow = Record<string, any>;
3
+ type PivotTableProps = {
4
+ data: DataRow[];
5
+ columns: string[];
6
+ rows: string[];
7
+ values: string[];
8
+ };
9
+ export declare const PivotTableV2: ({ props: { data, rows, columns, values }, }: {
10
+ props: PivotTableProps;
11
+ }) => React.JSX.Element;
12
+ export {};
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ export declare const SelfHostControl: ({ children, }: {
3
+ children: React.ReactNode;
4
+ }) => React.JSX.Element;
@@ -53,3 +53,6 @@ export * from './DraggableItem';
53
53
  export * from './SkeletonLoader';
54
54
  export * from './Flex';
55
55
  export * from './ThemeBlock';
56
+ export * from './AutoCompleteDropdown';
57
+ export * from './SelfHostControl';
58
+ export * from './PivotTable/PivotTableV2';
@@ -22,6 +22,7 @@ export declare const CHART_TYPES: {
22
22
  table: string;
23
23
  timeSeries: string;
24
24
  pivot: string;
25
+ pivotV2: string;
25
26
  rose: string;
26
27
  horizontalStack: string;
27
28
  treeMap: string;
@@ -122,3 +123,4 @@ export declare const DATE_PICKER = "DATE_PICKER";
122
123
  export declare const NUMBER_FIELD = "NUMBER_FIELD";
123
124
  export declare const BETWEEN = "BETWEEN";
124
125
  export declare const CUSTOM = "custom";
126
+ export declare const IS_SELF_HOSTED: any;
@@ -127,4 +127,12 @@ export declare const POSTGRES = "postgres";
127
127
  export declare const MONGODB = "mongodb";
128
128
  export declare const DATABRICKS = "databricks";
129
129
  export declare const CLICKHOUSE = "clickhouse";
130
+ export declare const MSSQL = "mssql";
131
+ export declare const DOWNLOAD_DATA_OPTIONS: {
132
+ RAW_DATA: string;
133
+ DOWNLOAD_WITHOUT_FILTERS: string;
134
+ EMAIL_RAW_DATA: string;
135
+ PIVOT_CSV: string;
136
+ SAVE_AS_PNG: string;
137
+ };
130
138
  export declare const CUSTOM_FILTER_TABLE_ALIAS = "custom_table_alias_rls";
@@ -25,5 +25,7 @@ export interface EmbeddedDashboardProps {
25
25
  };
26
26
  themeName?: string;
27
27
  setAdminTheme: (theme?: AdminThemeOptionsType) => void;
28
+ token: string;
29
+ dashboardId?: string;
28
30
  }
29
- export declare const EmbeddedDashboard: React.MemoExoticComponent<({ options, theme, adminThemeOption, customMessages, themeName, setAdminTheme, }: EmbeddedDashboardProps) => React.JSX.Element>;
31
+ export declare const EmbeddedDashboard: React.MemoExoticComponent<({ options, theme, adminThemeOption, customMessages, themeName, setAdminTheme, token, dashboardId, }: EmbeddedDashboardProps) => React.JSX.Element>;
@@ -0,0 +1,11 @@
1
+ export declare const setOnDateChange: (start: Date | null | undefined, end: Date | null | undefined, timeGrain?: string) => {
2
+ value: string;
3
+ startDate: Date;
4
+ endDate: Date;
5
+ timeGrainValue: string;
6
+ } | {
7
+ value?: undefined;
8
+ startDate?: undefined;
9
+ endDate?: undefined;
10
+ timeGrainValue?: undefined;
11
+ };
@@ -31,7 +31,7 @@ export declare const useMetricCard: ({ metric, globalFilters, rlsFilters, client
31
31
  setData: import("react").Dispatch<import("react").SetStateAction<any[]>>;
32
32
  setLoading: import("react").Dispatch<import("react").SetStateAction<boolean>>;
33
33
  }) => void;
34
- onChangeFilterValue: (name: string, value: string, customValue?: Record<string, Date>, stringValues?: FloatingDropDownOption[]) => void;
34
+ onChangeFilterValue: (name: string, value: string, labelValue?: string, customValue?: Record<string, Date>, stringValues?: FloatingDropDownOption[]) => void;
35
35
  isShowChartPopup: boolean;
36
36
  setShowChartPopup: import("react").Dispatch<import("react").SetStateAction<boolean>>;
37
37
  columnName: string | undefined;
@@ -76,5 +76,6 @@ export declare const useMetricCard: ({ metric, globalFilters, rlsFilters, client
76
76
  drillType: any;
77
77
  tableResultsDownloadData: Record<string, any>[];
78
78
  appliedMetricFilters: RlsCondition[];
79
+ pivotHeaderOptions: FloatingDropDownOption[];
79
80
  };
80
81
  export {};
@@ -111,10 +111,16 @@ export type CustomSettings = {
111
111
  comparisonValueFontSize?: number;
112
112
  singleValueSuffix?: string;
113
113
  singleValuePrefix?: string;
114
+ singleValConditionalFormatter?: {
115
+ min: number;
116
+ max: number;
117
+ color: string;
118
+ }[];
114
119
  comparisonSuffix?: string;
115
120
  subHeaderFontSize?: number;
116
121
  dateFormatter?: string;
117
122
  numberFormatter?: string;
123
+ isEnableLabelTooltip?: boolean;
118
124
  showLabelValues?: boolean;
119
125
  showFullStacked?: boolean;
120
126
  showConversionRate?: boolean;
@@ -251,6 +257,7 @@ export type LabelSettings = {
251
257
  weight?: number;
252
258
  color?: string;
253
259
  axisName?: string;
260
+ axisPadding?: number;
254
261
  };
255
262
  YAxisStyle?: {
256
263
  size?: number;
@@ -258,6 +265,7 @@ export type LabelSettings = {
258
265
  weight?: number;
259
266
  color?: string;
260
267
  axisName?: string;
268
+ axisPadding?: number;
261
269
  };
262
270
  };
263
271
  export type AxisSettings = {
@@ -267,6 +275,12 @@ export type PivotSettingsType = {
267
275
  rows?: string[];
268
276
  columns?: string[];
269
277
  };
278
+ export type PivotSettingsType2 = {
279
+ measures?: string[];
280
+ dimensions?: string[];
281
+ headers?: string[];
282
+ isDynamicHeaders?: boolean;
283
+ };
270
284
  export type GaugeSettingsType = {
271
285
  metric?: string;
272
286
  dimensions?: string[];
@@ -289,6 +303,7 @@ export type ChartSettingsType = {
289
303
  customSettings?: CustomSettings;
290
304
  tableSettings?: TableSettings;
291
305
  pivotTableSettings?: PivotSettingsType;
306
+ pivotTableSettings2?: PivotSettingsType2;
292
307
  gaugeSettings?: GaugeSettingsType;
293
308
  axisSettings?: AxisSettings;
294
309
  backGroundColor?: BackgroundSettings;
@@ -343,6 +358,7 @@ export type RlsFilterObjectType = {
343
358
  id: any;
344
359
  name: string;
345
360
  tableName: string;
361
+ labelColumnName?: string;
346
362
  operator?: string | 'and' | 'or';
347
363
  user: {
348
364
  id: any;
@@ -385,7 +401,7 @@ export type FloatingDropDownOption = {
385
401
  aggregate?: string;
386
402
  alias?: string;
387
403
  table?: TableObjectType;
388
- clickActions?: any;
404
+ isImportEnabled?: boolean;
389
405
  };
390
406
  export type FilterType = {
391
407
  tableName: string;
@@ -398,6 +414,9 @@ export type GlobalFilterColumn = {
398
414
  as: any;
399
415
  dataType: string;
400
416
  name: string;
417
+ labelColumnName?: string;
418
+ labelColumnDatatype?: string;
419
+ customLabelColumn?: string;
401
420
  isDefault?: boolean;
402
421
  label?: string;
403
422
  isShowHorizontal?: boolean;
@@ -459,11 +478,13 @@ export type CustomOption = {
459
478
  export type RlsCondition = {
460
479
  name: string;
461
480
  columnName: string;
481
+ labelColumnName?: string;
462
482
  tableName: string;
463
483
  datatype: string;
464
484
  isAddOnMetrics: boolean;
465
- options: string[] | number[] | DateOptionType[];
485
+ options: FloatingDropDownOption[] | number[] | DateOptionType[];
466
486
  value?: string | DateOptionType | string[];
487
+ selectedDropdownValue?: FloatingDropDownOption[] | FloatingDropDownOption;
467
488
  dimensionColumn?: string;
468
489
  measureColumn?: string;
469
490
  client?: {
@@ -583,3 +604,4 @@ export type AdminThemeOptionsType = {
583
604
  shadow?: string;
584
605
  };
585
606
  };
607
+ export type FilterValueType = string | string[] | number | number[] | boolean | boolean[] | null | Record<string, any>;
@@ -103,9 +103,9 @@ export type SelectedColumn = {
103
103
  synonyms?: string[];
104
104
  sortType?: 'ASC' | 'DESC';
105
105
  limit?: number;
106
- filterMethod: string;
107
- filterType: 'custom' | 'default' | 'agr' | 'dimension' | 'time' | 'client' | 'rls_filter';
108
- filterValue: {
106
+ filterMethod?: string;
107
+ filterType?: 'custom' | 'default' | 'agr' | 'dimension' | 'time' | 'client' | 'rls_filter';
108
+ filterValue?: {
109
109
  stringValue?: string;
110
110
  numberValue?: number;
111
111
  stringArray?: string[];
@@ -426,10 +426,12 @@ export type OnChangeHelperFunctionParams = {
426
426
  functionConfiguration?: {
427
427
  dateFormat?: string;
428
428
  };
429
+ type?: 'METRIC' | 'DIMENSION';
429
430
  };
430
431
  export type OnChangeAliasParams = {
431
432
  column: SelectedColumn;
432
433
  alias: string;
434
+ type?: 'METRIC' | 'DIMENSION';
433
435
  };
434
436
  export type ConfigType = {
435
437
  clientId: string;
@@ -475,7 +477,7 @@ export type DatasetConfig = {
475
477
  setChartSettings: React.Dispatch<React.SetStateAction<ChartSettingsType>>;
476
478
  dbName?: string;
477
479
  };
478
- export type OnChangeFilterValueType = ((name: string, value: string, customValue?: Record<string, Date>, stringValues?: FloatingDropDownOption[]) => void) | undefined;
480
+ export type OnChangeFilterValueType = ((name: string, value: string, labelValue?: string, customValue?: Record<string, Date>, stringValues?: FloatingDropDownOption[]) => void) | undefined;
479
481
  export type MetricFilterDemoThemeType = {
480
482
  width: string;
481
483
  variant: 'static' | 'floating';
@@ -69,6 +69,7 @@ export type UseMetricColumnMutationInputType = {
69
69
  query: string;
70
70
  alias: string;
71
71
  };
72
+ labelColumnName?: string;
72
73
  };
73
74
  export type UseMetricUnderlyingDataMutationInputType = {
74
75
  columnName?: string;