@databrainhq/plugin 0.13.0-beta.7 → 0.13.0-beta.9

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.
@@ -1,14 +1,9 @@
1
1
  import React from 'react';
2
2
  import { FieldValues } from 'react-hook-form';
3
- import { DashboardType, FloatingDropDownOption } from '@/types/app';
4
3
  type ExternalMetricProps = {
5
4
  onSubmit: (values: FieldValues) => void;
6
5
  defaultValues?: FieldValues;
7
6
  onCancel: () => void;
8
- isEmbedded?: boolean;
9
- dashboardIds: DashboardType['id'][];
10
- onDashboardChange: (selected: DashboardType['id'][]) => void;
11
- options: FloatingDropDownOption[];
12
7
  error?: string;
13
8
  isCreatingMetric?: boolean;
14
9
  };
@@ -14,6 +14,7 @@ export type FilterColumn = {
14
14
  clientColumnType?: string;
15
15
  isManualOptions?: boolean;
16
16
  manualOptions?: string[];
17
+ dependOn?: FloatingDropDownOption[];
17
18
  };
18
19
  type FiltersProps = {
19
20
  filterList: FilterColumn[];
@@ -1,13 +1,13 @@
1
1
  import React from 'react';
2
2
  import { FloatingDropDownOption, RlsCondition } from '@/types';
3
- import { MetricCardProps } from '@/components/MetricList';
4
3
  type Props = {
5
4
  rlsConditions?: RlsCondition;
6
5
  onChangeFilterValue?: (name: string, value: string, customValue?: Record<string, Date>, stringValues?: FloatingDropDownOption[]) => void;
7
6
  workspaceId: string;
8
7
  clientId?: string;
9
8
  className?: string;
10
- globalFilters?: MetricCardProps['globalFilters'];
9
+ rlsConditionList: RlsCondition[];
11
10
  };
12
- export declare const MetricFilterDropDown: ({ rlsConditions, onChangeFilterValue, workspaceId, clientId, className, globalFilters, }: Props) => React.JSX.Element;
13
- export default MetricFilterDropDown;
11
+ export declare const MetricFilterDropDown: ({ rlsConditions, onChangeFilterValue, workspaceId, clientId, className, rlsConditionList, }: Props) => React.JSX.Element;
12
+ declare const _default: React.MemoExoticComponent<({ rlsConditions, onChangeFilterValue, workspaceId, clientId, className, rlsConditionList, }: Props) => React.JSX.Element>;
13
+ export default _default;
@@ -31,5 +31,6 @@ export type MetricCardProps = {
31
31
  enableDownloadCsv?: boolean;
32
32
  enableMultiMetricFilters?: boolean;
33
33
  disableActions?: boolean;
34
+ metricFilterPosition?: 'outside' | 'inside';
34
35
  };
35
- export declare const MetricCard: ({ globalFilters, metricItem, onMaximize, client, colors, param, companyTenancyType, renderHeaderName, isDisableCardClick, onArchive, chartRendererType, isDisableMorePopup, appFilters, isInternalApp, setCrossDashboardFilters, crossDashboardFilters, metricFilterOptions, onDownloadRawCsv, enableDownloadCsv, enableMultiMetricFilters, disableActions, }: MetricCardProps) => React.JSX.Element;
36
+ export declare const MetricCard: ({ globalFilters, metricItem, onMaximize, client, colors, param, companyTenancyType, renderHeaderName, isDisableCardClick, onArchive, chartRendererType, isDisableMorePopup, appFilters, isInternalApp, setCrossDashboardFilters, crossDashboardFilters, metricFilterOptions, onDownloadRawCsv, enableDownloadCsv, enableMultiMetricFilters, disableActions, metricFilterPosition, }: MetricCardProps) => React.JSX.Element;
@@ -2,13 +2,15 @@ import React from 'react';
2
2
  type TabsContextType = [
3
3
  activeTab: string | number,
4
4
  setActiveTab: React.Dispatch<React.SetStateAction<string | number>>,
5
- variant: 'primary' | 'popoverTabs'
5
+ variant: 'primary' | 'popoverTabs',
6
+ setTab?: React.Dispatch<React.SetStateAction<string | number>>
6
7
  ];
7
8
  export declare const TabsContext: React.Context<[] | TabsContextType>;
8
9
  type TabsProps = {
9
10
  children: React.ReactNode;
10
11
  variant?: 'primary' | 'popoverTabs';
11
12
  defaultActiveTab?: string | number;
13
+ setTab?: React.Dispatch<React.SetStateAction<string | number>>;
12
14
  width?: string;
13
15
  };
14
16
  type TabProps = {
@@ -25,6 +27,7 @@ export declare const Tabs: {
25
27
  width?: string | undefined;
26
28
  background?: string | undefined;
27
29
  className?: string | undefined;
30
+ headerButton?: React.ReactNode;
28
31
  }>;
29
32
  Tab: React.FC<TabProps>;
30
33
  Panel: React.FC<{
@@ -86,3 +86,4 @@ export declare const NUMBER_FORMAT: {
86
86
  label: string;
87
87
  value: string;
88
88
  }[];
89
+ export declare const ICONS_LIST: readonly ["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"];
@@ -13,5 +13,6 @@ export interface EmbeddedMetricProps {
13
13
  enableEmailCsv?: boolean;
14
14
  enableMultiMetricFilters?: boolean;
15
15
  metricFilterOptions?: MetricFilterOptionsType;
16
+ metricFilterPosition?: 'outside' | 'inside';
16
17
  }
17
- export declare const EmbeddedMetric: React.MemoExoticComponent<({ token, chartColors, metricId, chartRendererType, variant, onMinimize, isHideChartSettings, isHideTablePreview, enableDownloadCsv, enableEmailCsv, metricFilterOptions, enableMultiMetricFilters, }: EmbeddedMetricProps) => React.JSX.Element>;
18
+ export declare const EmbeddedMetric: React.MemoExoticComponent<({ token, chartColors, metricId, chartRendererType, variant, onMinimize, isHideChartSettings, isHideTablePreview, enableDownloadCsv, enableEmailCsv, metricFilterOptions, enableMultiMetricFilters, metricFilterPosition, }: EmbeddedMetricProps) => React.JSX.Element>;
@@ -31,6 +31,7 @@ export interface MetricProps extends HTMLAttributes<HTMLElement> {
31
31
  style?: React.CSSProperties;
32
32
  metricFilterOptions?: MetricFilterOptionsType;
33
33
  enableMultiMetricFilters?: boolean;
34
+ metricFilterPosition?: 'outside' | 'inside';
34
35
  }
35
36
  /**
36
37
  * @name Metric - A react component to display a single metric card.
@@ -1,6 +1,6 @@
1
1
  import type { ReactNode } from 'react';
2
2
  import { ColumnSizingState } from '@tanstack/react-table';
3
- import { CHART_TYPES } from '@/consts';
3
+ import { CHART_TYPES, ICONS_LIST } from '@/consts';
4
4
  export type ChildrenProps = {
5
5
  children: ReactNode;
6
6
  };
@@ -144,7 +144,7 @@ export type CustomSettings = {
144
144
  coloredBars?: boolean;
145
145
  };
146
146
  export type Colors = 'primary' | 'primary-dark' | 'secondary' | 'secondary-dark' | 'alert' | 'alert-dark' | 'alert-light' | 'success' | 'success-dark' | 'success-light' | 'warning' | 'warning-dark' | 'info' | 'info-light' | 'white' | 'gray' | 'gray-dark' | 'light' | 'dark' | 'infoAlert';
147
- export type IconType = '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';
147
+ export type IconType = (typeof ICONS_LIST)[number];
148
148
  export type LogoType = 'redshift' | 'postgres' | 'mysql' | 'mongodb' | 'bigquery' | 'snowflake' | 'microsoft' | 'google' | 'elasticsearch' | 'redis' | 'databrick' | 'clickhouse';
149
149
  export type IconSizes = 'xxs' | 'xs' | 'sm' | 'md' | 'lg' | 'xl';
150
150
  export type IconConfig = {
@@ -293,6 +293,7 @@ export type Schema = {
293
293
  clientColumnType?: string;
294
294
  isManualOptions?: boolean;
295
295
  manualOptions?: string[];
296
+ dependOn?: FloatingDropDownOption[];
296
297
  }[];
297
298
  };
298
299
  export type RlsFilterObjectType = {
@@ -410,6 +411,7 @@ export type RlsCondition = {
410
411
  comparisonOperator: FloatingDropDownOption;
411
412
  }[];
412
413
  comparisonOperator?: FloatingDropDownOption;
414
+ dependOn?: FloatingDropDownOption;
413
415
  };
414
416
  export type MetricData = {
415
417
  id: string;
@@ -451,7 +453,7 @@ export type MetricFilterOptionsType = Record<string, {
451
453
  options: string[] | number[] | DateTypeOptionType[];
452
454
  defaultOption?: string | number;
453
455
  }>;
454
- export type FilterClausesType = (column: string) => {
456
+ export type FilterClausesType = (dependOn: FloatingDropDownOption[]) => {
455
457
  as: string;
456
458
  columnName: string;
457
459
  value: string | string[];