@databrainhq/plugin 0.14.39 → 0.14.41
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/FilterField/index.d.ts +8 -0
- package/dist/components/GlobalFilters/Filters.d.ts +4 -19
- package/dist/components/GlobalFilters/HorizontalFilters.d.ts +2 -2
- package/dist/components/GlobalFilters/NumberFilterField.d.ts +2 -8
- package/dist/components/GlobalFilters/index.d.ts +5 -6
- package/dist/components/MetricChart/CsvDownloadButton.d.ts +1 -0
- package/dist/consts/api.d.ts +2 -2
- package/dist/helpers/getModifiedQuery.d.ts +2 -1
- package/dist/types/app.d.ts +33 -0
- package/dist/webcomponents.es.js +15458 -15237
- package/dist/webcomponents.umd.js +145 -144
- package/package.json +2 -1
|
@@ -2,11 +2,19 @@ import React from 'react';
|
|
|
2
2
|
export type FilterFieldType = {
|
|
3
3
|
column: string;
|
|
4
4
|
operator: string;
|
|
5
|
+
applyOnTables?: {
|
|
6
|
+
tableName: string;
|
|
7
|
+
columnName: string;
|
|
8
|
+
dataType: string;
|
|
9
|
+
}[];
|
|
5
10
|
value?: string | string[] | number | number[] | boolean | boolean[] | null | Record<string, any>;
|
|
6
11
|
as?: string;
|
|
7
12
|
defaultValues?: any;
|
|
8
13
|
filterType?: 'global' | 'horizontal';
|
|
9
14
|
isFilterApplied?: boolean;
|
|
15
|
+
isVariableFilter?: boolean;
|
|
16
|
+
variableStrings?: string[];
|
|
17
|
+
label: string;
|
|
10
18
|
};
|
|
11
19
|
export type FilterFieldProps = {
|
|
12
20
|
tableName: string;
|
|
@@ -1,27 +1,12 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { FilterFieldType } from '@/components';
|
|
3
|
-
import {
|
|
4
|
-
export type FilterColumn = {
|
|
5
|
-
as: string;
|
|
6
|
-
dataType: string;
|
|
7
|
-
name: string;
|
|
8
|
-
isDefault?: boolean;
|
|
9
|
-
isShowHorizontal?: boolean;
|
|
10
|
-
label?: string;
|
|
11
|
-
options?: FloatingDropDownOption[];
|
|
12
|
-
isClientScoped?: boolean;
|
|
13
|
-
clientColumn?: string;
|
|
14
|
-
clientColumnType?: string;
|
|
15
|
-
isManualOptions?: boolean;
|
|
16
|
-
manualOptions?: string[];
|
|
17
|
-
dependOn?: FloatingDropDownOption[];
|
|
18
|
-
};
|
|
3
|
+
import { GlobalFilterType, GlobalFilterColumn } from '@/types/app';
|
|
19
4
|
type FiltersProps = {
|
|
20
|
-
filterList:
|
|
21
|
-
setFilterList: React.Dispatch<React.SetStateAction<
|
|
5
|
+
filterList: GlobalFilterColumn[];
|
|
6
|
+
setFilterList: React.Dispatch<React.SetStateAction<GlobalFilterColumn[]>>;
|
|
22
7
|
appliedfilters: FilterFieldType[];
|
|
23
8
|
setAppliedFilters: (value: React.SetStateAction<FilterFieldType[]>) => void;
|
|
24
|
-
filters:
|
|
9
|
+
filters: GlobalFilterType[];
|
|
25
10
|
internal?: {
|
|
26
11
|
isInternal: boolean;
|
|
27
12
|
workspaceId: string;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { GlobalFilterType } from '@/types/app';
|
|
3
3
|
import { FilterFieldType } from '@/components';
|
|
4
4
|
type HorizontalFiltersProps = {
|
|
5
5
|
appliedfilters: FilterFieldType[];
|
|
6
6
|
setAppliedFilters: (value: React.SetStateAction<FilterFieldType[]>) => void;
|
|
7
|
-
filters:
|
|
7
|
+
filters: GlobalFilterType[];
|
|
8
8
|
internal?: {
|
|
9
9
|
isInternal: boolean;
|
|
10
10
|
workspaceId: string;
|
|
@@ -1,14 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { GlobalFilterColumn } from '@/types';
|
|
2
3
|
type NumberFieldProps = {
|
|
3
4
|
setAppliedFilters?: any;
|
|
4
|
-
column?:
|
|
5
|
-
as: any;
|
|
6
|
-
dataType: string;
|
|
7
|
-
name: string;
|
|
8
|
-
isDefault?: boolean | undefined;
|
|
9
|
-
label?: string;
|
|
10
|
-
isShowHorizontal?: boolean;
|
|
11
|
-
};
|
|
5
|
+
column?: GlobalFilterColumn;
|
|
12
6
|
defaultValues?: {
|
|
13
7
|
min: number | null;
|
|
14
8
|
max: number | null;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { FilterColumn } from './Filters';
|
|
3
2
|
import { FilterFieldType, MetricCardProps } from '@/components';
|
|
4
|
-
import {
|
|
3
|
+
import { GlobalFilterColumn, GlobalFilterType } from '@/types/app';
|
|
5
4
|
type GlobalFiltersProps = {
|
|
6
|
-
filters:
|
|
5
|
+
filters: GlobalFilterType[];
|
|
7
6
|
onApply: (filters: MetricCardProps['globalFilters']) => void;
|
|
8
7
|
renderAdditionalHeaderContent?: () => JSX.Element;
|
|
9
8
|
internal?: {
|
|
@@ -26,10 +25,10 @@ export declare const getFormattedFilterValue: (obj: {
|
|
|
26
25
|
}) => any;
|
|
27
26
|
export declare const GlobalFilters: React.FC<GlobalFiltersProps>;
|
|
28
27
|
type FilterPopupProps = {
|
|
29
|
-
filters:
|
|
28
|
+
filters: GlobalFilterType[];
|
|
30
29
|
renderAdditionalHeaderContent?: () => JSX.Element;
|
|
31
|
-
filterList:
|
|
32
|
-
setFilterList: React.Dispatch<React.SetStateAction<
|
|
30
|
+
filterList: GlobalFilterColumn[];
|
|
31
|
+
setFilterList: React.Dispatch<React.SetStateAction<GlobalFilterColumn[]>>;
|
|
33
32
|
appliedfilters: FilterFieldType[];
|
|
34
33
|
setAppliedFilters: (value: React.SetStateAction<FilterFieldType[]>) => void;
|
|
35
34
|
globalFilterRef: React.RefObject<HTMLDivElement>;
|
package/dist/consts/api.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export declare const API_BASE_URL: string;
|
|
2
|
-
export declare const DASHBOARD_PATH = "/dashboard";
|
|
3
|
-
export declare const METRIC_PATH = "/metric";
|
|
2
|
+
export declare const DASHBOARD_PATH = "/api/v2/dashboard";
|
|
3
|
+
export declare const METRIC_PATH = "/api/v2/metric";
|
|
4
4
|
export declare const DASHBOARD_DATA_QUERY = "dashboardData";
|
|
5
5
|
export declare const DASHBOARD_EMBEDDED_METRIC_PATH: string;
|
|
6
6
|
export declare const DASHBOARD_EMBEDDED_METRIC_QUERY = "embeddedMetric";
|
|
@@ -17,8 +17,9 @@ export type ReplaceVariable = {
|
|
|
17
17
|
tenancyLevel: string;
|
|
18
18
|
values?: Record<string, string>;
|
|
19
19
|
isAllClient?: boolean;
|
|
20
|
+
globalFilters?: MetricCardProps['globalFilters'];
|
|
20
21
|
};
|
|
21
|
-
export declare const replaceVariable: ({ query, rlsConditions, tenancyLevel, clientId, values, isAllClient, }: ReplaceVariable) => string;
|
|
22
|
+
export declare const replaceVariable: ({ query, rlsConditions, tenancyLevel, clientId, values, isAllClient, globalFilters, }: ReplaceVariable) => string;
|
|
22
23
|
export declare const nameSpace: (name: string, dbName: string) => string;
|
|
23
24
|
export declare const nameSpaceSpecification: (parentAlias: string, columnName: string, dbName: string) => string;
|
|
24
25
|
export declare const cteQuery: (queryStr: string, groupedConditions: Record<string, RlsCondition[]>, dbName: string) => string;
|
package/dist/types/app.d.ts
CHANGED
|
@@ -382,6 +382,39 @@ export type FilterType = {
|
|
|
382
382
|
tableName: string;
|
|
383
383
|
columns: Schema['columnsWithDataType'];
|
|
384
384
|
};
|
|
385
|
+
export type GlobalFilterColumn = {
|
|
386
|
+
filterType?: string;
|
|
387
|
+
selectedTable?: string;
|
|
388
|
+
variableStrings?: string[];
|
|
389
|
+
as: any;
|
|
390
|
+
dataType: string;
|
|
391
|
+
name: string;
|
|
392
|
+
isDefault?: boolean;
|
|
393
|
+
label?: string;
|
|
394
|
+
isShowHorizontal?: boolean;
|
|
395
|
+
defaultValue?: GlobalFiltersDefaultValue;
|
|
396
|
+
isClientScoped?: boolean;
|
|
397
|
+
clientColumn?: string;
|
|
398
|
+
clientColumnType?: string;
|
|
399
|
+
isManualOptions?: boolean;
|
|
400
|
+
manualOptions?: string[];
|
|
401
|
+
dependOn?: FloatingDropDownOption[];
|
|
402
|
+
selectedCustomColumn?: {
|
|
403
|
+
query: string;
|
|
404
|
+
columnName: string;
|
|
405
|
+
};
|
|
406
|
+
options?: FloatingDropDownOption[];
|
|
407
|
+
isVariableFilter?: boolean;
|
|
408
|
+
applyOnTables?: {
|
|
409
|
+
tableName: string;
|
|
410
|
+
columnName: string;
|
|
411
|
+
dataType: string;
|
|
412
|
+
}[];
|
|
413
|
+
};
|
|
414
|
+
export type GlobalFilterType = {
|
|
415
|
+
tableName: string;
|
|
416
|
+
columns: GlobalFilterColumn[];
|
|
417
|
+
};
|
|
385
418
|
export type JoinField = {
|
|
386
419
|
a: string;
|
|
387
420
|
b: string;
|