@redsift/dashboard 7.0.2 → 7.1.1-alpha.0
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/index.d.ts +25 -25
- package/index.js +764 -2345
- package/index.js.map +1 -1
- package/package.json +7 -7
package/index.d.ts
CHANGED
|
@@ -5,25 +5,25 @@ export { ColorTheme, PieChartLabelVariant, PieChartSize, PieChartTheme, PieChart
|
|
|
5
5
|
import React, { Ref, ReactElement, ComponentProps, Dispatch } from 'react';
|
|
6
6
|
import { GridFilterItem, DataGridProps as DataGridProps$1 } from '@redsift/table';
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
type SuccessDangerColorTheme = {
|
|
9
9
|
success: string;
|
|
10
10
|
warning: string;
|
|
11
11
|
danger: string;
|
|
12
12
|
neutral?: string;
|
|
13
13
|
};
|
|
14
|
-
|
|
14
|
+
type JSONValue = string | number | boolean | {
|
|
15
15
|
[x: string]: JSONValue;
|
|
16
16
|
} | Array<JSONValue> | undefined | null;
|
|
17
|
-
|
|
17
|
+
type JSONObject = {
|
|
18
18
|
[x: string]: JSONValue;
|
|
19
19
|
};
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
20
|
+
type JSONArray = Array<JSONObject>;
|
|
21
|
+
type TNdx = Crossfilter<any>;
|
|
22
|
+
type Group = Group$1<any, NaturallyOrderedValue, unknown>;
|
|
23
|
+
type GroupSelector = (group: Group) => Group;
|
|
24
|
+
type Dimension = Dimension$1<any, string | number | boolean | ComparableObject>;
|
|
25
|
+
type DimensionSelector = OrderedValueSelector<any, NaturallyOrderedValue | NaturallyOrderedValue[]>;
|
|
26
|
+
type ChartDimensions = {
|
|
27
27
|
width: number;
|
|
28
28
|
height: number;
|
|
29
29
|
marginTop?: number;
|
|
@@ -38,7 +38,7 @@ declare const groupReduceSum: (field: string) => (d: Dimension) => crossfilter2.
|
|
|
38
38
|
declare const SUM: (field: string) => (d: Dimension) => crossfilter2.Group<any, crossfilter2.NaturallyOrderedValue, unknown>;
|
|
39
39
|
|
|
40
40
|
/** Component Type. */
|
|
41
|
-
|
|
41
|
+
type Comp<P, T = HTMLElement> = {
|
|
42
42
|
(props: P & {
|
|
43
43
|
ref?: Ref<T>;
|
|
44
44
|
}): ReactElement | null;
|
|
@@ -52,7 +52,7 @@ declare type Comp<P, T = HTMLElement> = {
|
|
|
52
52
|
className?: string;
|
|
53
53
|
};
|
|
54
54
|
/** Get types of the values of a record. */
|
|
55
|
-
|
|
55
|
+
type ValueOf<T extends Record<any, any>> = T[keyof T];
|
|
56
56
|
|
|
57
57
|
/**
|
|
58
58
|
* Component props.
|
|
@@ -73,7 +73,7 @@ declare const ChartEmptyState: Comp<ChartEmptyStateProps, HTMLDivElement>;
|
|
|
73
73
|
/**
|
|
74
74
|
* Context props.
|
|
75
75
|
*/
|
|
76
|
-
|
|
76
|
+
type DashboardContextProps = {
|
|
77
77
|
ndx?: TNdx;
|
|
78
78
|
state: DashboardReducerState;
|
|
79
79
|
dispatch?: Dispatch<DashboardReducerAction>;
|
|
@@ -82,7 +82,7 @@ declare type DashboardContextProps = {
|
|
|
82
82
|
/**
|
|
83
83
|
* Reducer props.
|
|
84
84
|
*/
|
|
85
|
-
|
|
85
|
+
type DashboardReducerState = {
|
|
86
86
|
tableFilters: GridFilterItem[];
|
|
87
87
|
};
|
|
88
88
|
declare enum DashboardReducerActionType {
|
|
@@ -91,7 +91,7 @@ declare enum DashboardReducerActionType {
|
|
|
91
91
|
FilterTable = "filter-table",
|
|
92
92
|
FilterTableBatch = "filter-table-batch"
|
|
93
93
|
}
|
|
94
|
-
|
|
94
|
+
type DashboardReducerAction = {
|
|
95
95
|
type: DashboardReducerActionType;
|
|
96
96
|
filter?: GridFilterItem | GridFilterItem[];
|
|
97
97
|
};
|
|
@@ -127,7 +127,7 @@ declare const HorizontalBarChartSize: {
|
|
|
127
127
|
readonly medium: "medium";
|
|
128
128
|
readonly small: "small";
|
|
129
129
|
};
|
|
130
|
-
|
|
130
|
+
type HorizontalBarChartSize = ValueOf<typeof HorizontalBarChartSize>;
|
|
131
131
|
/**
|
|
132
132
|
* Component theme.
|
|
133
133
|
*/
|
|
@@ -140,7 +140,7 @@ declare const HorizontalBarChartTheme: {
|
|
|
140
140
|
readonly darker: "darker";
|
|
141
141
|
readonly monochrome: "monochrome";
|
|
142
142
|
};
|
|
143
|
-
|
|
143
|
+
type HorizontalBarChartTheme = ValueOf<typeof HorizontalBarChartTheme>;
|
|
144
144
|
interface LocaleText$2 {
|
|
145
145
|
emptyChartTitle?: string;
|
|
146
146
|
emptyChartSubtitle?: string;
|
|
@@ -151,12 +151,12 @@ interface LocaleText$2 {
|
|
|
151
151
|
* Component props.
|
|
152
152
|
*/
|
|
153
153
|
interface HorizontalBarChartProps extends ComponentProps<'div'> {
|
|
154
|
+
/** Whether the x axis labels are rotated or not. */
|
|
155
|
+
areXLabelsRotated?: boolean;
|
|
154
156
|
/** Number of categories to use, the rest being put into a new category called "Others". */
|
|
155
157
|
caping?: number;
|
|
156
158
|
/** Caption. */
|
|
157
159
|
caption?: string;
|
|
158
|
-
/** Whether the x axis labels are rotated or not. */
|
|
159
|
-
areXLabelsRotated?: boolean;
|
|
160
160
|
/** Dataset to use to generate the chart, if no context is provided. */
|
|
161
161
|
data?: JSONArray;
|
|
162
162
|
/** Which datagrid column the chart is filtering and using which operation. */
|
|
@@ -189,7 +189,7 @@ interface HorizontalBarChartProps extends ComponentProps<'div'> {
|
|
|
189
189
|
/** Title. */
|
|
190
190
|
title?: string;
|
|
191
191
|
}
|
|
192
|
-
|
|
192
|
+
type StyledHorizontalBarChartProps = Omit<HorizontalBarChartProps, 'columnToFilter' | 'data' | 'dimension' | 'group' | 'localeText'> & {};
|
|
193
193
|
|
|
194
194
|
declare const HorizontalBarChart: Comp<HorizontalBarChartProps, HTMLDivElement>;
|
|
195
195
|
|
|
@@ -247,7 +247,7 @@ interface PieChartProps extends ComponentProps<'div'> {
|
|
|
247
247
|
/** PieChart variant. */
|
|
248
248
|
variant?: PieChartVariant;
|
|
249
249
|
}
|
|
250
|
-
|
|
250
|
+
type StyledPieChartProps = Omit<PieChartProps, 'columnToFilter' | 'dimension' | 'group' | 'localeText'> & {
|
|
251
251
|
$showLabels: boolean;
|
|
252
252
|
$spaced: boolean;
|
|
253
253
|
};
|
|
@@ -262,7 +262,7 @@ declare const TimeSeriesBarChartSize: {
|
|
|
262
262
|
readonly medium: "medium";
|
|
263
263
|
readonly small: "small";
|
|
264
264
|
};
|
|
265
|
-
|
|
265
|
+
type TimeSeriesBarChartSize = ValueOf<typeof TimeSeriesBarChartSize>;
|
|
266
266
|
/**
|
|
267
267
|
* Component theme.
|
|
268
268
|
*/
|
|
@@ -275,8 +275,8 @@ declare const TimeSeriesBarChartTheme: {
|
|
|
275
275
|
readonly darker: "darker";
|
|
276
276
|
readonly monochrome: "monochrome";
|
|
277
277
|
};
|
|
278
|
-
|
|
279
|
-
|
|
278
|
+
type TimeSeriesBarChartTheme = ValueOf<typeof TimeSeriesBarChartTheme>;
|
|
279
|
+
type datetimeEnum = 'hour' | 'day' | 'week' | 'month' | 'year';
|
|
280
280
|
interface LocaleText {
|
|
281
281
|
emptyChartTitle?: string;
|
|
282
282
|
emptyChartSubtitle?: string;
|
|
@@ -322,7 +322,7 @@ interface TimeSeriesBarChartProps extends ComponentProps<'div'> {
|
|
|
322
322
|
/** Y Axis Label. */
|
|
323
323
|
yAxisLabel?: string;
|
|
324
324
|
}
|
|
325
|
-
|
|
325
|
+
type StyledTimeSeriesBarChartProps = Omit<TimeSeriesBarChartProps, 'dimension' | 'dateTimeFieldName'> & {};
|
|
326
326
|
|
|
327
327
|
declare const TimeSeriesBarChart: Comp<TimeSeriesBarChartProps, HTMLDivElement>;
|
|
328
328
|
|