@databrainhq/plugin 0.14.45 → 0.14.47

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.
Files changed (30) hide show
  1. package/dist/components/DateRangePicker/index.d.ts +7 -6
  2. package/dist/components/FilterDropDown/index.d.ts +6 -5
  3. package/dist/components/FilterField/index.d.ts +2 -0
  4. package/dist/components/FloatingDropDown/index.d.ts +2 -1
  5. package/dist/components/GlobalFilters/SearchField.d.ts +8 -0
  6. package/dist/components/Icons/icons.d.ts +1 -1
  7. package/dist/components/MetricFilterDropDown/components/OldMetricFilterComponents.d.ts +16 -0
  8. package/dist/components/MetricFilterDropDown/components/SearchField.d.ts +7 -0
  9. package/dist/components/MetricFilterDropDown/components/StringAutoCustomFilterField.d.ts +17 -0
  10. package/dist/components/MetricFilterDropDown/components/StringManualFilterField.d.ts +11 -0
  11. package/dist/components/MetricFilterDropDown/components/TimeFilterField.d.ts +11 -0
  12. package/dist/components/MetricFilterDropDown/components/VariableTimeFilterField.d.ts +11 -0
  13. package/dist/components/MetricFilterDropDown/index.d.ts +8 -7
  14. package/dist/components/PopoverMenu/index.d.ts +5 -0
  15. package/dist/components/SkeletonLoader/index.d.ts +2 -1
  16. package/dist/consts/api.d.ts +1 -1
  17. package/dist/consts/app.d.ts +28 -1
  18. package/dist/consts/metricOptions.d.ts +1 -0
  19. package/dist/helpers/adaptiveFormatter.d.ts +6 -0
  20. package/dist/helpers/getModifiedQuery.d.ts +14 -4
  21. package/dist/helpers/numberFormatter.d.ts +1 -0
  22. package/dist/helpers/tooltipFormatter.d.ts +1 -0
  23. package/dist/types/app.d.ts +3 -0
  24. package/dist/types/metricCreate.d.ts +6 -0
  25. package/dist/utils/getChartOptions.d.ts +24 -1
  26. package/dist/utils/getNoAxisChartOptions.d.ts +14 -0
  27. package/dist/webcomponents.es.js +54019 -53791
  28. package/dist/webcomponents.umd.js +218 -209
  29. package/package.json +1 -1
  30. package/dist/helpers/getTimeFilteredData.d.ts +0 -11
@@ -0,0 +1,16 @@
1
+ import React from 'react';
2
+ import { FilterClause } from '@/components';
3
+ import { MetricFilterDemoThemeType, OnChangeFilterValueType, RlsCondition } from '@/types';
4
+ type OldMetricFilterComponentProps = {
5
+ filter: RlsCondition;
6
+ onChangeFilterValue: OnChangeFilterValueType;
7
+ className: string;
8
+ isVariableFilter: boolean;
9
+ dropdownTheme?: MetricFilterDemoThemeType;
10
+ workspaceId: string;
11
+ filterClause: FilterClause[];
12
+ };
13
+ export declare const OldMetricFilterComponents: ({ props: { filter, onChangeFilterValue, className, isVariableFilter, dropdownTheme, filterClause, workspaceId, }, }: {
14
+ props: OldMetricFilterComponentProps;
15
+ }) => React.JSX.Element;
16
+ export {};
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ import { OnChangeFilterValueType } from '@/types';
3
+ export declare const SearchField: ({ name, onChangeFilterValue, value, }: {
4
+ value: string;
5
+ name: string;
6
+ onChangeFilterValue: OnChangeFilterValueType;
7
+ }) => React.JSX.Element;
@@ -0,0 +1,17 @@
1
+ import React from 'react';
2
+ import { FilterClause } from '@/components/FilterDropDown';
3
+ import { MetricFilterDemoThemeType, OnChangeFilterValueType, RlsCondition } from '@/types';
4
+ type StringAutoCustomFilterFieldProps = {
5
+ filter: RlsCondition;
6
+ tenancyLevel: string;
7
+ clientId: string;
8
+ isAllClient: boolean;
9
+ onChangeFilterValue: OnChangeFilterValueType;
10
+ dropdownTheme?: MetricFilterDemoThemeType;
11
+ workspaceId: string;
12
+ filterClause: FilterClause[];
13
+ };
14
+ export declare const StringAutoCustomFilterField: ({ props: { filter, tenancyLevel, clientId, isAllClient, onChangeFilterValue, dropdownTheme, workspaceId, filterClause, }, }: {
15
+ props: StringAutoCustomFilterFieldProps;
16
+ }) => React.JSX.Element;
17
+ export {};
@@ -0,0 +1,11 @@
1
+ import React from 'react';
2
+ import { MetricFilterDemoThemeType, OnChangeFilterValueType, RlsCondition } from '@/types';
3
+ type StringManualFilterFieldProps = {
4
+ filter: RlsCondition;
5
+ onChangeFilterValue: OnChangeFilterValueType;
6
+ dropdownTheme?: MetricFilterDemoThemeType;
7
+ };
8
+ export declare const StringManualFilterField: ({ props: { filter, onChangeFilterValue, dropdownTheme }, }: {
9
+ props: StringManualFilterFieldProps;
10
+ }) => React.JSX.Element;
11
+ export {};
@@ -0,0 +1,11 @@
1
+ import React from 'react';
2
+ import { MetricFilterDemoThemeType, OnChangeFilterValueType, RlsCondition } from '@/types';
3
+ type TimeFilterFieldProps = {
4
+ filter: RlsCondition;
5
+ dropdownTheme?: MetricFilterDemoThemeType;
6
+ onChangeFilterValue: OnChangeFilterValueType;
7
+ };
8
+ export declare const TimeFilterField: ({ props: { filter, dropdownTheme, onChangeFilterValue }, }: {
9
+ props: TimeFilterFieldProps;
10
+ }) => React.JSX.Element;
11
+ export {};
@@ -0,0 +1,11 @@
1
+ import React from 'react';
2
+ import { MetricFilterDemoThemeType, OnChangeFilterValueType, RlsCondition } from '@/types';
3
+ type VariableTimeFilterFieldProps = {
4
+ filter: RlsCondition;
5
+ dropdownTheme?: MetricFilterDemoThemeType;
6
+ onChangeFilterValue: OnChangeFilterValueType;
7
+ };
8
+ export declare const VariableTimeFilterField: ({ props: { filter, dropdownTheme, onChangeFilterValue }, }: {
9
+ props: VariableTimeFilterFieldProps;
10
+ }) => React.JSX.Element;
11
+ export {};
@@ -1,20 +1,21 @@
1
1
  import React from 'react';
2
- import { FloatingDropDownOption, RlsCondition } from '@/types';
2
+ import { FloatingDropDownOption, MetricFilterDemoThemeType, RlsCondition } from '@/types';
3
3
  type Props = {
4
- rlsConditions?: RlsCondition;
4
+ rlsConditions: RlsCondition;
5
5
  onChangeFilterValue?: (name: string, value: string, customValue?: Record<string, Date>, stringValues?: FloatingDropDownOption[]) => void;
6
6
  workspaceId: string;
7
7
  clientId?: string;
8
8
  className?: string;
9
9
  rlsConditionList: RlsCondition[];
10
10
  isAllClient?: boolean;
11
- dropdownTheme?: {
12
- width: string;
13
- variant: 'static' | 'floating';
14
- radius: string;
15
- };
11
+ dropdownTheme?: MetricFilterDemoThemeType;
16
12
  tenancyLevel?: string;
17
13
  };
14
+ export type DateSelectedOption = {
15
+ value: string;
16
+ label: string;
17
+ labelType?: string;
18
+ };
18
19
  export declare const MetricFilterDropDown: ({ rlsConditions, onChangeFilterValue, workspaceId, clientId, className, rlsConditionList, isAllClient, dropdownTheme, tenancyLevel, }: Props) => React.JSX.Element;
19
20
  declare const _default: React.MemoExoticComponent<({ rlsConditions, onChangeFilterValue, workspaceId, clientId, className, rlsConditionList, isAllClient, dropdownTheme, tenancyLevel, }: Props) => React.JSX.Element>;
20
21
  export default _default;
@@ -5,6 +5,8 @@ type PopoverMenuStateProp = {
5
5
  id: string;
6
6
  isOpen?: boolean;
7
7
  setOpen?: React.Dispatch<React.SetStateAction<boolean>>;
8
+ isMenuOpen?: boolean;
9
+ setMenuOpen?: React.Dispatch<React.SetStateAction<boolean>>;
8
10
  popperElement?: Node | HTMLDivElement | null;
9
11
  referenceElement?: Node | HTMLDivElement | null;
10
12
  };
@@ -23,6 +25,9 @@ export type PopoverMenuProps = React.PropsWithChildren & {
23
25
  bgColor?: Colors;
24
26
  autoCloseParent?: boolean;
25
27
  getIsOpen?: (isOpen: boolean) => void;
28
+ isClearEnabled?: boolean;
29
+ isMenuOpen?: boolean;
30
+ setMenuOpen?: React.Dispatch<React.SetStateAction<boolean>>;
26
31
  };
27
32
  export declare const PopoverMenu: React.FC<PopoverMenuProps>;
28
33
  export {};
@@ -3,6 +3,7 @@ type Props = {
3
3
  height?: string;
4
4
  className?: string;
5
5
  variant?: 'table' | 'card' | 'list';
6
+ tableRows?: number;
6
7
  };
7
- export declare const SkeletonLoader: ({ height, className, variant }: Props) => React.JSX.Element;
8
+ export declare const SkeletonLoader: ({ height, className, variant, tableRows, }: Props) => React.JSX.Element;
8
9
  export {};
@@ -1,4 +1,4 @@
1
- export declare const API_BASE_URL: string;
1
+ export declare const API_BASE_URL: any;
2
2
  export declare const DASHBOARD_PATH = "/api/v2/dashboard";
3
3
  export declare const METRIC_PATH = "/api/v2/metric";
4
4
  export declare const DASHBOARD_DATA_QUERY = "dashboardData";
@@ -90,8 +90,35 @@ export declare const RAW_CSV_OPTIONS: string[];
90
90
  export declare const NONE = "NONE";
91
91
  export declare const REQUESTED = "REQUESTED";
92
92
  export declare const AVAILABLE = "AVAILABLE";
93
+ export declare const NA_VALUE = "N/A";
93
94
  export declare const NUMBER_FORMAT: {
94
95
  label: string;
95
96
  value: string;
96
97
  }[];
97
- export declare const ICONS_LIST: readonly ["circle", "group-by", "undo", "redo", "maximize", "minimize", "fullscreen", "download", "archive", "format", "company", "profile", "users", "bar-chart", "bar-chart-2", "kebab-menu-horizontal", "kebab-menu-vertical", "paint-brush", "funnel", "funnel-simple", "cross", "columns", "gear", "presentation-chart", "chevron-down", "plus", "info", "arrow-down", "arrow-up", "arrow-left", "arrow-right", "double-arrow-left", "double-arrow-right", "expand-arrows", "eye", "eye-slash", "database", "magnifying-glass", "pencil-simple-line", "pencil-simple", "file-sql", "code", "sign-out", "save", "delete", "align-space-even", "align-bottom", "align-left", "align-right", "align-top", "trend-up", "trend-up-chart", "caret-down-fill", "caret-up-fill", "caret-up-down", "pie-chart", "table-view", "task-done-file", "right-angle", "text-rotation-angle-up", "text-rotation-none", "text-rotation-up", "preview-file", "share", "image", "text", "color-palette", "shuffle", "table", "chart", "calendar", "horizontal-rule", "short-text", "subheader", "copy", "timer", "link", "not-found", "bar-chart-horizontal", "line-chart", "line-chart-trend-up", "globe", "map", "leaderboard", "radar", "scale", "scatter-plot", "tree", "donut-chart", "scatter-chart", "waterfall-chart", "area-chart", "bubble-chart", "candlestick-chart", "string", "boolean", "date", "number", "unknown", "array", "right-join", "left-join", "outer-join", "right-full-join", "left-full-join", "inner-join", "full-join", "version-history", "roles"];
98
+ export declare const ICONS_LIST: readonly ["new-window", "circle", "group-by", "undo", "redo", "maximize", "minimize", "fullscreen", "download", "archive", "format", "company", "profile", "users", "bar-chart", "bar-chart-2", "kebab-menu-horizontal", "kebab-menu-vertical", "paint-brush", "funnel", "funnel-simple", "cross", "columns", "gear", "presentation-chart", "chevron-down", "plus", "info", "arrow-down", "arrow-up", "arrow-left", "arrow-right", "double-arrow-left", "double-arrow-right", "expand-arrows", "eye", "eye-slash", "database", "magnifying-glass", "pencil-simple-line", "pencil-simple", "file-sql", "code", "sign-out", "save", "delete", "align-space-even", "align-bottom", "align-left", "align-right", "align-top", "trend-up", "trend-up-chart", "caret-down-fill", "caret-up-fill", "caret-up-down", "pie-chart", "table-view", "task-done-file", "right-angle", "text-rotation-angle-up", "text-rotation-none", "text-rotation-up", "preview-file", "share", "image", "text", "color-palette", "shuffle", "table", "chart", "calendar", "horizontal-rule", "short-text", "subheader", "copy", "timer", "link", "not-found", "bar-chart-horizontal", "line-chart", "line-chart-trend-up", "globe", "map", "leaderboard", "radar", "scale", "scatter-plot", "tree", "donut-chart", "scatter-chart", "waterfall-chart", "area-chart", "bubble-chart", "candlestick-chart", "string", "boolean", "date", "number", "unknown", "array", "right-join", "left-join", "outer-join", "right-full-join", "left-full-join", "inner-join", "full-join", "version-history", "roles"];
99
+ export declare const NUMBER = "number";
100
+ export declare const STRING = "string";
101
+ export declare const BOOLEAN = "boolean";
102
+ export declare const DEFAULT = "default";
103
+ export declare const DATE = "date";
104
+ export declare const AND = "AND";
105
+ export declare const IS_NOT_NULL = "IS NOT NULL";
106
+ export declare const AS_SIGNED = "AS SIGNED";
107
+ export declare const AS_BIGINT = "AS BIGINT";
108
+ export declare const AS_VARCHAR = "AS VARCHAR";
109
+ export declare const AS_CHAR = "AS CHAR";
110
+ export declare const AS_STRING = "AS STRING";
111
+ export declare const AS_DATE = "AS DATE";
112
+ export declare const CAST = "CAST";
113
+ export declare const IN = "IN";
114
+ export declare const EQUAL_OPERATOR = "=";
115
+ export declare const YEAR = "year";
116
+ export declare const LAST = "last";
117
+ export declare const LIKE = "like";
118
+ export declare const MULTI_SELECT = "MULTI_SELECT";
119
+ export declare const SINGLE_SELECT = "SINGLE_SELECT";
120
+ export declare const SEARCH = "SEARCH";
121
+ export declare const DATE_PICKER = "DATE_PICKER";
122
+ export declare const NUMBER_FIELD = "NUMBER_FIELD";
123
+ export declare const BETWEEN = "BETWEEN";
124
+ export declare const CUSTOM = "custom";
@@ -126,3 +126,4 @@ export declare const POSTGRES = "postgres";
126
126
  export declare const MONGODB = "mongodb";
127
127
  export declare const DATABRICKS = "databricks";
128
128
  export declare const CLICKHOUSE = "clickhouse";
129
+ export declare const CUSTOM_FILTER_TABLE_ALIAS = "custom_table_alias_rls";
@@ -0,0 +1,6 @@
1
+ /**
2
+ * @name adaptiveFormatter - helps in formatting the data in adaptive format (eg. k, M, B etc)
3
+ * @params - takes the value that needs to be formatted and a flag that tells if the value is in decimals or not
4
+ * @returns - value in adaptive format
5
+ */
6
+ export declare const adaptiveFormatter: (val: any, isDecimal: boolean) => string;
@@ -1,5 +1,13 @@
1
- import { MetricCardProps } from '@/components';
2
- import { RlsCondition } from '@/types/app';
1
+ import React from 'react';
2
+ import { FilterFieldType, MetricCardProps } from '@/components';
3
+ import { GlobalFilterColumn, RlsCondition } from '@/types/app';
4
+ type OnChangeGlobalFilterParams = {
5
+ value: any;
6
+ setAppliedFilters: React.Dispatch<React.SetStateAction<FilterFieldType[]>>;
7
+ column: GlobalFilterColumn;
8
+ operator: string;
9
+ type: string;
10
+ };
3
11
  type GetSqlStatement = {
4
12
  query: string;
5
13
  clientId?: string;
@@ -29,12 +37,13 @@ export declare const replaceClientVariable: ({ clientId, query, tenancyLevel, is
29
37
  export declare const replaceVariable: ({ query, rlsConditions, tenancyLevel, clientId, values, isAllClient, globalFilters, }: ReplaceVariable) => string;
30
38
  export declare const nameSpace: (name: string, dbName: string) => string;
31
39
  export declare const nameSpaceSpecification: (parentAlias: string, columnName: string, dbName: string) => string;
32
- export declare const cteQuery: (queryStr: string, groupedConditions: Record<string, RlsCondition[]>, dbName: string) => string;
33
- export declare const subQuery: (queryStr: string, groupedConditions: Record<string, RlsCondition[]>, dbName: string) => string;
34
40
  export declare const getReplacedQuery: (table: {
35
41
  tableName: string;
36
42
  condition: string;
37
43
  }, query: string, dbName: string) => string;
44
+ export declare const dateWhereClause: (condition: RlsCondition, dbName: string) => string;
45
+ export declare const otherWhereClause: (condition: RlsCondition, dbName: string) => string;
46
+ export declare const stringClause: (condition: RlsCondition, dbName: string) => string;
38
47
  export declare const replaceWhereClauses: (queryStr: string, groupedConditions: Record<string, RlsCondition[]>, dbName: string) => string;
39
48
  export declare const getModifiedQuery: ({ rlsConditions, dbName, query, }: {
40
49
  rlsConditions: RlsCondition[];
@@ -43,4 +52,5 @@ export declare const getModifiedQuery: ({ rlsConditions, dbName, query, }: {
43
52
  }) => string;
44
53
  export declare const getSqlStatement: ({ query, clientId, rlsConditions, globalFilters, dbName, tenancyLevel, values, isAllClient, }: GetSqlStatement) => string;
45
54
  export declare const isAppliedFilter: (filter: RlsCondition) => number | boolean | Date | undefined;
55
+ export declare const onChangeGlobalFilter: ({ column, setAppliedFilters, value, operator, type, }: OnChangeGlobalFilterParams) => void;
46
56
  export {};
@@ -0,0 +1 @@
1
+ export declare const numberFormatter: (val: any, formatter: any) => any;
@@ -0,0 +1 @@
1
+ export declare const tooltipFormatter: (params: any, chartOptions: any) => string;
@@ -377,6 +377,7 @@ export type FloatingDropDownOption = {
377
377
  aggregate?: string;
378
378
  alias?: string;
379
379
  table?: TableObjectType;
380
+ clickActions?: any;
380
381
  };
381
382
  export type FilterType = {
382
383
  tableName: string;
@@ -410,6 +411,7 @@ export type GlobalFilterColumn = {
410
411
  columnName: string;
411
412
  dataType: string;
412
413
  }[];
414
+ filterVariant?: FloatingDropDownOption;
413
415
  };
414
416
  export type GlobalFilterType = {
415
417
  tableName: string;
@@ -481,6 +483,7 @@ export type RlsCondition = {
481
483
  query: string;
482
484
  columnName: string;
483
485
  };
486
+ filterVariant?: FloatingDropDownOption;
484
487
  };
485
488
  export type PythonMetricFilter = {
486
489
  name: string;
@@ -474,4 +474,10 @@ export type DatasetConfig = {
474
474
  chart: string;
475
475
  setChartSettings: React.Dispatch<React.SetStateAction<ChartSettingsType>>;
476
476
  };
477
+ export type OnChangeFilterValueType = ((name: string, value: string, customValue?: Record<string, Date>, stringValues?: FloatingDropDownOption[]) => void) | undefined;
478
+ export type MetricFilterDemoThemeType = {
479
+ width: string;
480
+ variant: 'static' | 'floating';
481
+ radius: string;
482
+ };
477
483
  export {};
@@ -1,5 +1,28 @@
1
1
  import { ChartSettingsType } from '@/types';
2
- export declare const adaptiveFormatter: (val: any, decimal: boolean) => string;
2
+ export declare const truncateText: (label: string, maxLength: number) => string;
3
+ export declare const addPrefixAndSuffix: (val: any, prefix?: any, suffix?: any) => string;
4
+ export declare const findLegendPosition: (val: string | undefined) => {
5
+ top: string;
6
+ left: string;
7
+ right?: undefined;
8
+ bottom?: undefined;
9
+ } | {
10
+ top: string;
11
+ right: string;
12
+ left?: undefined;
13
+ bottom?: undefined;
14
+ } | {
15
+ bottom: string;
16
+ left: string;
17
+ top?: undefined;
18
+ right?: undefined;
19
+ } | {
20
+ bottom: string;
21
+ right: string;
22
+ top?: undefined;
23
+ left?: undefined;
24
+ };
25
+ export declare const validateColor: (color: any) => boolean;
3
26
  export type GetChartOptionsParams = {
4
27
  chartOptions: ChartSettingsType;
5
28
  data: Record<string, any>[];
@@ -0,0 +1,14 @@
1
+ import { ChartSettingsType } from '@/types';
2
+ export type GetNoAxisChartOptionsParams = {
3
+ chartOptions: ChartSettingsType;
4
+ data: Record<string, any>[];
5
+ colors?: string[];
6
+ datasets?: any;
7
+ labels?: any;
8
+ funnelData?: {
9
+ value: any;
10
+ name: any;
11
+ }[];
12
+ singleValueData?: any;
13
+ };
14
+ export declare const getNoAxisChartOptions: ({ chartOptions, data, colors, datasets, funnelData, labels, singleValueData, }: GetNoAxisChartOptionsParams) => Record<string, any>;