@databrainhq/plugin 0.9.21 → 0.9.22
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/README.md +26 -26
- package/dist/components/Alert/index.d.ts +1 -1
- package/dist/components/Chart/SingleValueChart.d.ts +16 -0
- package/dist/components/Chart/index.d.ts +21 -0
- package/dist/components/ChartModal/ChartConfig.d.ts +6 -16
- package/dist/components/ChartModal/ChartModalOptions.d.ts +7 -5
- package/dist/components/ChartPopup/components/UnderlyingData/index.d.ts +1 -1
- package/dist/components/ChartPopup/index.d.ts +1 -1
- package/dist/components/ChartSettingsPopup/components/ChartConfigure/index.d.ts +8 -0
- package/dist/components/ChartSettingsPopup/components/ChartSettings/index.d.ts +9 -0
- package/dist/components/ChartSettingsPopup/index.d.ts +9 -0
- package/dist/components/Charts/BarChart.d.ts +1 -1
- package/dist/components/Charts/LineChart.d.ts +1 -1
- package/dist/components/DataType/index.d.ts +1 -1
- package/dist/components/DateRangePicker/index.d.ts +1 -1
- package/dist/components/Error/index.d.ts +1 -1
- package/dist/components/ExternalMetricForm/index.d.ts +1 -1
- package/dist/components/FilterDropDown/index.d.ts +2 -2
- package/dist/components/FilterField/index.d.ts +2 -2
- package/dist/components/FloatingDropDown/index.d.ts +2 -2
- package/dist/components/FullScreenChart/index.d.ts +3 -4
- package/dist/components/GlobalFilters/AddFilter.d.ts +2 -2
- package/dist/components/GlobalFilters/AppliedFilter.d.ts +1 -1
- package/dist/components/GlobalFilters/NumberFilterField.d.ts +1 -1
- package/dist/components/GlobalFilters/index.d.ts +2 -2
- package/dist/components/Icons/index.d.ts +1 -1
- package/dist/components/InfoTooltip/index.d.ts +1 -1
- package/dist/components/MetricChart/ChartImageDownloadButton.d.ts +4 -4
- package/dist/components/MetricChart/CsvDownloadButton.d.ts +1 -1
- package/dist/components/MetricChart/MetricChart.d.ts +1 -1
- package/dist/components/MetricChart/index.d.ts +1 -0
- package/dist/components/MetricCreation/components/MetricOutput/MetricOutput.d.ts +1 -1
- package/dist/components/MetricCreation/components/MetricOutput/components/ChartTab/index.d.ts +6 -50
- package/dist/components/MetricCreation/components/MetricOutput/components/TableTab/index.d.ts +1 -1
- package/dist/components/MetricCreation/components/MetricOutput/components/index.d.ts +0 -1
- package/dist/components/MetricFilterDropDown/index.d.ts +1 -1
- package/dist/components/MetricList/MetricList.d.ts +3 -4
- package/dist/components/MetricList/components/{DownloadRawCsvModal.d.ts → DownloadRawCsvModal/index.d.ts} +1 -1
- package/dist/components/MetricList/components/FullScreenView/DownloadButton.d.ts +9 -0
- package/dist/components/MetricList/components/FullScreenView/index.d.ts +18 -0
- package/dist/components/MetricList/components/{LayoutAlert.d.ts → LayoutAlert/index.d.ts} +1 -1
- package/dist/components/MetricList/components/{MetricCard.d.ts → MetricCards/MetricCard.d.ts} +5 -6
- package/dist/components/MetricList/components/MetricCards/NoDataLoading.d.ts +7 -0
- package/dist/components/MetricList/components/{SingleValueCard.d.ts → MetricCards/SingleValueCard.d.ts} +1 -1
- package/dist/components/MetricList/components/{TableViewModal.d.ts → TableViewModal/index.d.ts} +1 -1
- package/dist/components/MetricList/components/index.d.ts +8 -0
- package/dist/components/MetricList/index.d.ts +1 -6
- package/dist/components/MetricTable/index.d.ts +1 -1
- package/dist/components/Modal/ModalFooter.d.ts +1 -1
- package/dist/components/PopoverMenu/index.d.ts +1 -1
- package/dist/components/Portal/index.d.ts +2 -0
- package/dist/components/ScheduleEmail/ScheduleEmailForm/index.d.ts +1 -1
- package/dist/components/Select/index.d.ts +5 -5
- package/dist/components/Tab/index.d.ts +1 -1
- package/dist/components/Table/DebouncedInput.d.ts +1 -1
- package/dist/components/Table/index.d.ts +4 -2
- package/dist/components/TagInputField/index.d.ts +1 -1
- package/dist/components/TimeGrainField/index.d.ts +1 -1
- package/dist/components/ToggleButton/SwitchInput.d.ts +1 -1
- package/dist/components/ToggleButton/ToggleInput.d.ts +1 -1
- package/dist/components/ToggleButton/index.d.ts +1 -1
- package/dist/components/index.d.ts +2 -0
- package/dist/consts/metricOptions.d.ts +4 -0
- package/dist/containers/Dashboard/Dashboard.d.ts +1 -1
- package/dist/containers/Dashboard/DashboardProvider.d.ts +1 -1
- package/dist/helpers/getTimeFilterValue.d.ts +1 -1
- package/dist/helpers/timeseries.d.ts +6 -6
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/useClientDashboardLayout.d.ts +1 -1
- package/dist/hooks/useExternalMetric.d.ts +3 -20
- package/dist/hooks/useGenerateEmbeddedMetric.d.ts +1 -1
- package/dist/hooks/useMetricCard.d.ts +37 -0
- package/dist/hooks/useOutsideAlerter.d.ts +1 -1
- package/dist/hooks/useScheduleEmail.d.ts +1 -1
- package/dist/index.es.js +86985 -128219
- package/dist/index.umd.js +298 -242
- package/dist/style.css +1 -1
- package/dist/types/app.d.ts +119 -61
- package/dist/types/metricCreate.d.ts +13 -87
- package/dist/utils/generated/graphql.d.ts +437 -437
- package/dist/utils/getChartAttributes.d.ts +5 -8
- package/dist/utils/getChartImage.d.ts +3 -0
- package/dist/utils/getChartOptions.d.ts +7 -0
- package/package.json +110 -98
- package/dist/components/MetricCreation/components/MetricOutput/components/ChartTab/components/ChartConfigure/index.d.ts +0 -26
- package/dist/components/MetricCreation/components/MetricOutput/components/ChartTab/components/ChartSettings/index.d.ts +0 -38
- package/dist/components/MetricCreation/components/MetricOutput/components/ChartTab/components/index.d.ts +0 -2
- package/dist/typings.d.ts +0 -17
- package/dist/utils/handleSaveChartImage.d.ts +0 -3
- /package/dist/components/MetricList/components/{ArchiveMetricModal.d.ts → ArchiveMetricModal/index.d.ts} +0 -0
package/README.md
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
# @databrainhq/plugin
|
|
2
|
-
|
|
3
|
-
> Databrain app ui plugin.
|
|
4
|
-
|
|
5
|
-
[](https://www.npmjs.com/package/@databrainhq/plugin) [](https://standardjs.com)
|
|
6
|
-
|
|
7
|
-
## Install
|
|
8
|
-
|
|
9
|
-
```bash
|
|
10
|
-
npm install @databrainhq/plugin
|
|
11
|
-
```
|
|
12
|
-
|
|
13
|
-
## Usage
|
|
14
|
-
|
|
15
|
-
```tsx
|
|
16
|
-
import { Dashboard } from '@databrainhq/plugin';
|
|
17
|
-
import '@databrainhq/plugin/dist/style.css';
|
|
18
|
-
|
|
19
|
-
const Example = () => {
|
|
20
|
-
return <Dashboard token={/* Your Guest Token */} />;
|
|
21
|
-
};
|
|
22
|
-
```
|
|
23
|
-
|
|
24
|
-
## License
|
|
25
|
-
|
|
26
|
-
MIT © [databrainhq](https://github.com/databrainhq)
|
|
1
|
+
# @databrainhq/plugin
|
|
2
|
+
|
|
3
|
+
> Databrain app ui plugin.
|
|
4
|
+
|
|
5
|
+
[](https://www.npmjs.com/package/@databrainhq/plugin) [](https://standardjs.com)
|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install @databrainhq/plugin
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Usage
|
|
14
|
+
|
|
15
|
+
```tsx
|
|
16
|
+
import { Dashboard } from '@databrainhq/plugin';
|
|
17
|
+
import '@databrainhq/plugin/dist/style.css';
|
|
18
|
+
|
|
19
|
+
const Example = () => {
|
|
20
|
+
return <Dashboard token={/* Your Guest Token */} />;
|
|
21
|
+
};
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## License
|
|
25
|
+
|
|
26
|
+
MIT © [databrainhq](https://github.com/databrainhq)
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ClickActionsConfig } from '@/types';
|
|
3
|
+
export type SingleValueChartProps = {
|
|
4
|
+
settings?: {
|
|
5
|
+
fontSize?: number;
|
|
6
|
+
subHeaderFontSize?: number;
|
|
7
|
+
subHeaderShow?: boolean;
|
|
8
|
+
displayText?: string;
|
|
9
|
+
};
|
|
10
|
+
value: string | number;
|
|
11
|
+
hideBorder?: boolean;
|
|
12
|
+
chartClickConfig?: ClickActionsConfig['chart'];
|
|
13
|
+
className?: string;
|
|
14
|
+
};
|
|
15
|
+
declare const _default: React.MemoExoticComponent<({ value, settings, chartClickConfig, hideBorder, className, }: SingleValueChartProps) => JSX.Element>;
|
|
16
|
+
export default _default;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ChartSettingsType } from '@/types';
|
|
3
|
+
export type ChartProps = {
|
|
4
|
+
chartOptions: ChartSettingsType;
|
|
5
|
+
data: Record<string, any>[];
|
|
6
|
+
events?: Record<string, Function>;
|
|
7
|
+
config?: Record<string, any>;
|
|
8
|
+
className?: string;
|
|
9
|
+
colors?: string[];
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* @name Chart - The metric visualization component.
|
|
13
|
+
* @prop chartOptions - the chart properties saved in the database.
|
|
14
|
+
* @prop data - the array of objects/records returned by the querying.
|
|
15
|
+
* @prop events (optional) - the click, change, etc. events to be added to the chart.
|
|
16
|
+
* @prop config (optional) - any additional chart specific props to be passed to the respective charts e.g. table, single value.
|
|
17
|
+
* @prop className (optional) - the usual className prop to provide styles.
|
|
18
|
+
* @prop colors (optional) - the admin provided chart color palettes.
|
|
19
|
+
* @returns JSX - chart visaulization content.
|
|
20
|
+
*/
|
|
21
|
+
export declare const Chart: React.MemoExoticComponent<({ chartOptions, data, events, colors, config, className }: ChartProps) => JSX.Element>;
|
|
@@ -1,19 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
yAxisList?: string[];
|
|
8
|
-
xAxis: string | undefined;
|
|
9
|
-
setMeasure: React.Dispatch<React.SetStateAction<string | undefined>>;
|
|
10
|
-
setStep: React.Dispatch<React.SetStateAction<string | undefined>>;
|
|
11
|
-
step: string | undefined;
|
|
12
|
-
measure: string | undefined;
|
|
13
|
-
setSankeyValues: React.Dispatch<React.SetStateAction<string[] | undefined>>;
|
|
14
|
-
singleValue: string | undefined;
|
|
15
|
-
setSingleValue: React.Dispatch<React.SetStateAction<string | undefined>>;
|
|
16
|
-
setSettingsShow: React.Dispatch<React.SetStateAction<boolean>>;
|
|
2
|
+
import { ChartSettingsType } from '@/types';
|
|
3
|
+
type Props = {
|
|
4
|
+
data?: Record<string, any>[];
|
|
5
|
+
chartSettings: ChartSettingsType;
|
|
6
|
+
setChartSettings: React.Dispatch<React.SetStateAction<ChartSettingsType>>;
|
|
17
7
|
};
|
|
18
|
-
export declare const ChartConfig: ({ data,
|
|
8
|
+
export declare const ChartConfig: ({ data, chartSettings, setChartSettings, }: Props) => JSX.Element;
|
|
19
9
|
export {};
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { CHART_TYPES } from '@/consts';
|
|
3
|
+
type ChartType = keyof typeof CHART_TYPES;
|
|
4
|
+
type Props = {
|
|
5
|
+
onChartChange: (chartType: ChartType) => void;
|
|
6
|
+
chartType: ChartType;
|
|
5
7
|
isEnableTimeSeries: boolean;
|
|
6
8
|
};
|
|
7
|
-
export declare const ChartModalOptions: ({ chartType,
|
|
9
|
+
export declare const ChartModalOptions: ({ chartType, onChartChange, isEnableTimeSeries, }: Props) => JSX.Element;
|
|
8
10
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { ClickActionsConfig, GetUnderlyingData } from '@/types';
|
|
3
|
-
export
|
|
3
|
+
export type ChartPopupProps = React.PropsWithChildren & {
|
|
4
4
|
getUnderlyingData: GetUnderlyingData;
|
|
5
5
|
value: any;
|
|
6
6
|
columnName: string;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ChartSettingsType } from '@/types/app';
|
|
3
|
+
type Props = {
|
|
4
|
+
chartSettings: ChartSettingsType;
|
|
5
|
+
setChartSettings: React.Dispatch<React.SetStateAction<ChartSettingsType>>;
|
|
6
|
+
};
|
|
7
|
+
export declare const ChartConfigure: ({ chartSettings, setChartSettings }: Props) => JSX.Element;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ChartSettingsType } from '@/types/app';
|
|
3
|
+
type Props = {
|
|
4
|
+
data: any[] | undefined;
|
|
5
|
+
chartSettings: ChartSettingsType;
|
|
6
|
+
setChartSettings: React.Dispatch<React.SetStateAction<ChartSettingsType>>;
|
|
7
|
+
};
|
|
8
|
+
export declare const ChartSettings: ({ data, chartSettings, setChartSettings, }: Props) => JSX.Element;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ChartSettingsType } from '@/types';
|
|
3
|
+
import { PopoverMenuProps } from '@/components/PopoverMenu';
|
|
4
|
+
export type ChartSettingsPopupProps = Pick<PopoverMenuProps, 'buttonClass' | 'menuClass' | 'menuContainerClass' | 'position'> & {
|
|
5
|
+
data?: Record<string, any>[];
|
|
6
|
+
settings: ChartSettingsType;
|
|
7
|
+
setSettings: React.Dispatch<React.SetStateAction<ChartSettingsType>>;
|
|
8
|
+
};
|
|
9
|
+
export declare const ChartSettingsPopup: ({ data, settings, setSettings, buttonClass, menuClass, menuContainerClass, position, }: ChartSettingsPopupProps) => JSX.Element;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { FieldValues } from 'react-hook-form';
|
|
3
3
|
import { DashboardType } from '@/types/app';
|
|
4
|
-
|
|
4
|
+
type ExternalMetricProps = {
|
|
5
5
|
onSubmit: (values: FieldValues) => void;
|
|
6
6
|
defaultValues?: FieldValues;
|
|
7
7
|
onCancel: () => void;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { RlsFilterObjectType } from '@/types/app';
|
|
3
3
|
import { FloatingDropDownProps, MultiFloatingDropDownProps } from '@/components/FloatingDropDown';
|
|
4
|
-
export
|
|
4
|
+
export type FilterDropDownProps = Omit<FloatingDropDownProps, 'options' | 'isDisabled'> & {
|
|
5
5
|
companyId: string;
|
|
6
6
|
filter: Pick<RlsFilterObjectType, 'columnName' | 'tableName' | 'defaultValue' | 'value'>;
|
|
7
7
|
autoSelected?: boolean;
|
|
@@ -9,5 +9,5 @@ export declare type FilterDropDownProps = Omit<FloatingDropDownProps, 'options'
|
|
|
9
9
|
integrationName: string;
|
|
10
10
|
};
|
|
11
11
|
export declare const FilterDropDown: ({ companyId, filter, onChange, selectedOption, autoSelected, integrationId, integrationName, ...rest }: FilterDropDownProps) => JSX.Element;
|
|
12
|
-
export
|
|
12
|
+
export type MultiFilterDropDownProps = Pick<FilterDropDownProps, 'autoSelected' | 'companyId' | 'filter' | 'label' | 'integrationId' | 'integrationName'> & Omit<MultiFloatingDropDownProps, 'options' | 'isDisabled'>;
|
|
13
13
|
export declare const MultiFilterDropdown: React.FC<MultiFilterDropDownProps>;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
export
|
|
2
|
+
export type FilterFieldType = {
|
|
3
3
|
column: string;
|
|
4
4
|
operator: string;
|
|
5
5
|
value?: string | string[] | number | number[] | boolean | boolean[] | null;
|
|
6
6
|
as?: string;
|
|
7
7
|
defaultValues?: any;
|
|
8
8
|
};
|
|
9
|
-
export
|
|
9
|
+
export type FilterFieldProps = {
|
|
10
10
|
tableName: string;
|
|
11
11
|
filter: {
|
|
12
12
|
name: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { FloatingDropDownOption } from '@/types';
|
|
3
|
-
export
|
|
3
|
+
export type FloatingDropDownProps = {
|
|
4
4
|
onChange: (option: FloatingDropDownOption) => void;
|
|
5
5
|
selectedOption: FloatingDropDownOption;
|
|
6
6
|
options: FloatingDropDownOption[];
|
|
@@ -18,7 +18,7 @@ export declare type FloatingDropDownProps = {
|
|
|
18
18
|
dropdownAbove?: boolean;
|
|
19
19
|
};
|
|
20
20
|
export declare const FloatingDropDown: ({ label, labelVariant, selectedOption, onChange, className, buttonClass, options, isDisabled, children, icon, isSearchEnabled, closeControl, dropdownAbove, }: FloatingDropDownProps) => JSX.Element;
|
|
21
|
-
export
|
|
21
|
+
export type MultiFloatingDropDownProps = Omit<FloatingDropDownProps, 'selectedOption' | 'onChange'> & {
|
|
22
22
|
selectedOptions: FloatingDropDownOption[];
|
|
23
23
|
onChange: (options: FloatingDropDownOption[]) => void;
|
|
24
24
|
};
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import {
|
|
3
|
-
|
|
2
|
+
import { ChartProps } from '@/components/Chart';
|
|
3
|
+
type Props = ChartProps & {
|
|
4
4
|
isShow: boolean;
|
|
5
5
|
onCancel: () => void;
|
|
6
|
-
chart?: MetricChartProps;
|
|
7
6
|
};
|
|
8
|
-
export declare const FullScreenChart: ({ isShow, onCancel,
|
|
7
|
+
export declare const FullScreenChart: ({ isShow, onCancel, ...rest }: Props) => JSX.Element;
|
|
9
8
|
export {};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
|
|
2
|
+
type Filter = {
|
|
3
3
|
as: any;
|
|
4
4
|
dataType: string;
|
|
5
5
|
name: string;
|
|
6
6
|
isDefault?: boolean | undefined;
|
|
7
7
|
label?: string;
|
|
8
8
|
};
|
|
9
|
-
|
|
9
|
+
type Props = {
|
|
10
10
|
columnList: Filter[];
|
|
11
11
|
setFilterList: React.Dispatch<React.SetStateAction<Filter[]>>;
|
|
12
12
|
filterList: Filter[];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { FilterFieldType } from '@/components/FilterField';
|
|
3
|
-
|
|
3
|
+
type AppliedFilterProps = {
|
|
4
4
|
appliedFilter: FilterFieldType[];
|
|
5
5
|
setAppliedFilters: React.Dispatch<React.SetStateAction<FilterFieldType[]>>;
|
|
6
6
|
onChangeFilters: (updatedFilters: FilterFieldType[]) => void;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { MetricCardProps } from '@/components/MetricList/components
|
|
2
|
+
import { MetricCardProps } from '@/components/MetricList/components';
|
|
3
3
|
import { FilterType } from '@/types/app';
|
|
4
|
-
|
|
4
|
+
type GlobalFiltersProps = {
|
|
5
5
|
filters: FilterType[];
|
|
6
6
|
companyId: string;
|
|
7
7
|
onApply: (filters: MetricCardProps['globalFilters']) => void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
|
|
2
|
+
type IconsProps = {
|
|
3
3
|
name: 'data-exploration-icon' | 'dashboard-icon' | 'external-dashboard-icon' | 'sql-query-icon' | 'table-tab-icon' | 'visualization-icon' | 'arrow-back-icon' | 'logout-icon' | 'more-icon' | 'save-icon' | 'copy-icon' | 'dataset-icon' | 'filter-icon' | 'settings-icon' | 'info-icon' | 'schema-icon' | 'fullscreen-icon' | 'table-icon' | 'time-taken-icon' | 'setup-icon' | 'data-model-icon' | 'integration-icon' | 'external-dashboard-icon' | 'csv-icon' | 'iframe-icon' | 'dashboard-icon' | 'plus-icon' | 'checked-icon' | 'clone-icon' | 'close-icon' | 'double-arrow-left-icon' | 'double-arrow-right-icon' | 'metric-store-icon' | 'reset-icon' | 'play-icon' | 'tick-icon' | 'text-icon' | 'time-icon' | 'unknown-icon' | 'array-icon' | 'date-icon' | 'boolean-icon' | 'id-icon' | 'number-icon' | 'object-icon' | 'delete-icon';
|
|
4
4
|
className?: string;
|
|
5
5
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { PropsWithChildren } from 'react';
|
|
2
|
-
|
|
2
|
+
type TooltipProps = PropsWithChildren & {
|
|
3
3
|
content: JSX.Element;
|
|
4
4
|
className?: string;
|
|
5
5
|
position?: 'left' | 'right' | 'top' | 'bottom' | 'left-bottom-end' | 'right-bottom-end' | 'left-top-end' | 'right-top-end' | 'bottom-left' | 'bottom-right' | 'top-left' | 'top-right' | 'left-bottom' | 'left-top' | 'right-bottom' | 'right-top' | 'center';
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import EChartsReact from 'echarts-for-react';
|
|
3
|
-
|
|
3
|
+
type DownloadButtonProps = {
|
|
4
4
|
className?: string;
|
|
5
5
|
iconClass?: string;
|
|
6
6
|
text?: string;
|
|
7
7
|
chartRef: React.RefObject<EChartsReact>;
|
|
8
|
-
|
|
8
|
+
fileName?: string;
|
|
9
9
|
};
|
|
10
|
-
declare const ChartImageDownloadButton: ({ className, iconClass, text, chartRef,
|
|
11
|
-
export
|
|
10
|
+
export declare const ChartImageDownloadButton: ({ className, iconClass, fileName, text, chartRef, }: DownloadButtonProps) => JSX.Element;
|
|
11
|
+
export {};
|
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import EChartsReact from 'echarts-for-react';
|
|
3
3
|
import { AxisSettings, LabelSettings, LegendSettings, BackgroundSettings, CustomSettings, TableSettings } from '@/types/app';
|
|
4
4
|
import { ClickActionsConfig, TimeSeriesSettingsType } from '@/types';
|
|
5
|
-
export
|
|
5
|
+
export type MetricChartProps = {
|
|
6
6
|
data: {
|
|
7
7
|
labels: string[] | undefined;
|
|
8
8
|
datasets: {
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { MetricOutputProps } from '@/types/metricCreate';
|
|
3
|
-
export declare const MetricOutput: ({ data, error, isLoading,
|
|
3
|
+
export declare const MetricOutput: ({ data, error, isLoading, previewTableDataList, moreTabs, chartColors, chartSettings, setChartSettings, isUpdateMetric, }: MetricOutputProps) => JSX.Element;
|
package/dist/components/MetricCreation/components/MetricOutput/components/ChartTab/index.d.ts
CHANGED
|
@@ -1,59 +1,15 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
data: any[] | undefined;
|
|
6
|
-
labels: string[] | undefined;
|
|
7
|
-
funnelData: ('' | {
|
|
8
|
-
value: any;
|
|
9
|
-
name: any;
|
|
10
|
-
} | undefined)[] | undefined;
|
|
11
|
-
chartType: string;
|
|
12
|
-
datasets: {
|
|
13
|
-
label: string;
|
|
14
|
-
data: any[] | undefined;
|
|
15
|
-
borderColor: string;
|
|
16
|
-
}[] | undefined;
|
|
17
|
-
setChartType: React.Dispatch<React.SetStateAction<string>>;
|
|
18
|
-
setXAxis: React.Dispatch<React.SetStateAction<string | undefined>>;
|
|
19
|
-
setYAxisList: React.Dispatch<React.SetStateAction<string[] | undefined>>;
|
|
20
|
-
yAxisList?: string[];
|
|
21
|
-
xAxis: string | undefined;
|
|
22
|
-
setMeasure: React.Dispatch<React.SetStateAction<string | undefined>>;
|
|
23
|
-
setStep: React.Dispatch<React.SetStateAction<string | undefined>>;
|
|
24
|
-
step: string | undefined;
|
|
25
|
-
measure: string | undefined;
|
|
26
|
-
setSankeyValues: React.Dispatch<React.SetStateAction<string[] | undefined>>;
|
|
27
|
-
sankeyData: (any[] | undefined)[] | undefined;
|
|
28
|
-
singleValue: string | undefined;
|
|
29
|
-
setSingleValue: React.Dispatch<React.SetStateAction<string | undefined>>;
|
|
30
|
-
singleValueData: ('' | {
|
|
31
|
-
value: any;
|
|
32
|
-
label: string;
|
|
33
|
-
} | undefined)[] | undefined;
|
|
34
|
-
setMargins: React.Dispatch<React.SetStateAction<Record<string, number>>>;
|
|
35
|
-
margins: Record<string, number>;
|
|
36
|
-
legendSettings: LegendSettings;
|
|
37
|
-
setLegendSettings: React.Dispatch<React.SetStateAction<LegendSettings>>;
|
|
38
|
-
labelSettings: LabelSettings;
|
|
39
|
-
setLabelSettings: React.Dispatch<React.SetStateAction<LabelSettings>>;
|
|
40
|
-
axisSettings: AxisSettings;
|
|
41
|
-
setAxisSettings: React.Dispatch<React.SetStateAction<AxisSettings>>;
|
|
42
|
-
customSettings: CustomSettings;
|
|
43
|
-
setCustomSettings: React.Dispatch<React.SetStateAction<CustomSettings>>;
|
|
2
|
+
import { ClickActionsConfig, ChartSettingsType } from '@/types';
|
|
3
|
+
type Props = {
|
|
4
|
+
data?: Record<string, any>[];
|
|
44
5
|
isLoading: boolean;
|
|
45
|
-
backGroundColor: BackgroundSettings;
|
|
46
|
-
setBackGroundColor: React.Dispatch<React.SetStateAction<BackgroundSettings>>;
|
|
47
6
|
headerChild?: JSX.Element;
|
|
48
7
|
chartPopupChild?: JSX.Element;
|
|
49
|
-
tableSettings: TableSettings;
|
|
50
|
-
setTableSettings: React.Dispatch<React.SetStateAction<TableSettings>>;
|
|
51
|
-
tableName?: string;
|
|
52
8
|
chartColors?: string[];
|
|
9
|
+
chartSettings: ChartSettingsType;
|
|
10
|
+
setChartSettings: React.Dispatch<React.SetStateAction<ChartSettingsType>>;
|
|
53
11
|
handleChartRightClick?: (params: any) => void;
|
|
54
12
|
chartClickConfig?: ClickActionsConfig['chart'];
|
|
55
|
-
timeSeriesSettings: TimeSeriesSettingsType;
|
|
56
|
-
setTimeSeriesSettings: React.Dispatch<React.SetStateAction<TimeSeriesSettingsType>>;
|
|
57
13
|
};
|
|
58
|
-
export declare const ChartTab: ({
|
|
14
|
+
export declare const ChartTab: ({ data, isLoading, headerChild, chartSettings, setChartSettings, chartColors, handleChartRightClick, chartClickConfig, chartPopupChild, }: Props) => JSX.Element;
|
|
59
15
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { FloatingDropDownOption, RlsCondition } from '@/types';
|
|
3
|
-
|
|
3
|
+
type Props = {
|
|
4
4
|
rlsConditions?: RlsCondition[] | undefined;
|
|
5
5
|
onChangeFilterValue?: (name: string, value: string, customValue?: Record<string, Date>, stringValues?: FloatingDropDownOption[]) => void;
|
|
6
6
|
companyId: string;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { MetricCardProps } from './components
|
|
2
|
+
import { MetricCardProps } from './components';
|
|
3
3
|
import { ClientType } from '@/types/app';
|
|
4
4
|
import { ThemeType } from '@/utils/theme';
|
|
5
5
|
import { EmbeddedDashboardMetricsQuery } from '@/utils/generated/graphql';
|
|
6
6
|
export declare const GridLayout: React.ComponentClass<import("react-grid-layout").ResponsiveProps & import("react-grid-layout").WidthProviderProps, any>;
|
|
7
|
-
export
|
|
7
|
+
export type ExternalMetricListProps = {
|
|
8
8
|
chartColors?: string[];
|
|
9
9
|
globalFilters?: MetricCardProps['globalFilters'];
|
|
10
10
|
client: ClientType['value'];
|
|
11
11
|
companyId: string;
|
|
12
|
-
isAllowedToDeleteMetrics?: boolean;
|
|
13
12
|
isAllowedToUpdateMetrics?: boolean;
|
|
13
|
+
isAllowedToDeleteMetrics?: boolean;
|
|
14
14
|
isAllowedToChangeLayout?: boolean;
|
|
15
15
|
isLiveMode: boolean;
|
|
16
16
|
isMetricListLoading?: boolean;
|
|
@@ -21,6 +21,5 @@ export declare type ExternalMetricListProps = {
|
|
|
21
21
|
companyTenancyType: string;
|
|
22
22
|
externalDashboardId: string;
|
|
23
23
|
externalDashboardPk: string;
|
|
24
|
-
workspaceId: string;
|
|
25
24
|
};
|
|
26
25
|
export declare const ExternalMetricList: React.FC<ExternalMetricListProps>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import EChartsReact from 'echarts-for-react';
|
|
3
|
+
export type DownloadButtonProps = {
|
|
4
|
+
data: Record<string, any>[];
|
|
5
|
+
chartRef?: React.RefObject<EChartsReact>;
|
|
6
|
+
metricName: string;
|
|
7
|
+
onRawCsvData: () => void;
|
|
8
|
+
};
|
|
9
|
+
export declare const DownloadButton: ({ data, chartRef, metricName, onRawCsvData, }: DownloadButtonProps) => JSX.Element;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { ExternalMetrics } from '@/utils/generated/graphql';
|
|
3
|
+
export type FullScreenViewProps = {
|
|
4
|
+
metric: ExternalMetrics;
|
|
5
|
+
colors?: string[];
|
|
6
|
+
rlsFilters?: {
|
|
7
|
+
param: any;
|
|
8
|
+
filterValues: Record<string, string>;
|
|
9
|
+
};
|
|
10
|
+
onMinimize: () => void;
|
|
11
|
+
clientId: string;
|
|
12
|
+
tenancyLevel: string;
|
|
13
|
+
externalDashboardId: string;
|
|
14
|
+
userProvidedDashboardId: string;
|
|
15
|
+
companyId: string;
|
|
16
|
+
isAllowedToUpdateMetrics?: boolean;
|
|
17
|
+
};
|
|
18
|
+
export declare const FullScreenView: ({ metric, colors, rlsFilters, onMinimize, clientId, tenancyLevel, companyId, externalDashboardId, userProvidedDashboardId, isAllowedToUpdateMetrics, }: FullScreenViewProps) => JSX.Element;
|
package/dist/components/MetricList/components/{MetricCard.d.ts → MetricCards/MetricCard.d.ts}
RENAMED
|
@@ -1,23 +1,22 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { ExternalMetrics } from '@/utils/generated/graphql';
|
|
3
3
|
import { ClientType } from '@/types/app';
|
|
4
|
-
import { MetricChartProps } from '@/components/MetricChart';
|
|
5
4
|
import { FilterFieldType } from '@/components/FilterField';
|
|
6
|
-
export
|
|
5
|
+
export type MetricCardProps = {
|
|
7
6
|
globalFilters?: {
|
|
8
7
|
tableName: string;
|
|
9
8
|
filters: FilterFieldType[];
|
|
10
9
|
};
|
|
11
10
|
metricItem: any;
|
|
12
11
|
client: ClientType['value'];
|
|
13
|
-
onMaximize: (
|
|
12
|
+
onMaximize: (metric: ExternalMetrics, rlsFilters?: {
|
|
13
|
+
param: any;
|
|
14
|
+
filterValues: Record<string, string>;
|
|
15
|
+
}) => void;
|
|
14
16
|
colors?: string[];
|
|
15
17
|
param?: any;
|
|
16
18
|
companyTenancyType: string;
|
|
17
19
|
renderHeaderName?: (name: string) => JSX.Element;
|
|
18
20
|
onArchive?: (metricId: string) => void;
|
|
19
|
-
onEdit?: (metric: ExternalMetrics, metricData?: Record<string, any>[]) => void;
|
|
20
|
-
onTableView?: (metric: ExternalMetrics, metricData?: Record<string, any>[]) => void;
|
|
21
|
-
onDownloadRawCsv?: (metric: ExternalMetrics, filterValues: Record<string, any>) => void;
|
|
22
21
|
};
|
|
23
22
|
export declare const MetricCard: React.FC<MetricCardProps>;
|