@quillsql/react 2.10.1 → 2.10.2

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,16 +1,46 @@
1
1
  /// <reference types="react" />
2
- declare const Chart: ({ chartId, config, colors, containerStyle, query, SelectComponent, DatePickerComponent, dateRangeFilterDisabled, isAnimationActive, hideXAxis, hideYAxis, hideCartesionGrid, }: {
2
+ interface BaseChartProps {
3
+ colors: string[];
4
+ containerStyle?: React.CSSProperties;
5
+ dashboard: any;
6
+ dispatch: any;
7
+ client: any;
8
+ dateFilter?: any;
9
+ theme: any;
10
+ isDateFilter?: boolean;
11
+ isAnimationActive?: boolean;
12
+ hideXAxis?: boolean;
13
+ hideYAxis?: boolean;
14
+ hideCartesionGrid?: boolean;
15
+ }
16
+ interface WithChartId extends BaseChartProps {
3
17
  chartId: string;
4
- config?: any;
5
- colors?: string[] | undefined;
6
- containerStyle?: import("react").CSSProperties | undefined;
7
- DatePickerComponent?: JSX.Element | undefined;
8
- query?: string | undefined;
9
- isAnimationActive: boolean;
10
- hideXAxis: boolean;
11
- hideYAxis: boolean;
12
- hideCartesionGrid: boolean;
13
- dateRangeFilterDisabled: boolean;
14
- }) => import("react/jsx-runtime").JSX.Element;
18
+ }
19
+ export type FieldFormat = 'whole_number' | 'one_decimal_place' | 'two_decimal_places' | 'dollar_amount' | 'dollar_cents' | 'MMM_yyyy' | 'MMM_dd_yyyy' | 'MMM_dd-MMM_dd' | 'MMM_dd_hh:mm_ap_pm' | 'hh_ap_pm' | 'percent' | 'string';
20
+ interface YAxisField {
21
+ label: string;
22
+ field: string;
23
+ chartType: string;
24
+ format: FieldFormat;
25
+ }
26
+ export interface DashboardItem {
27
+ name: string;
28
+ chartType: string;
29
+ xAxisField: string;
30
+ xAxisLabel: string;
31
+ xAxisFormat: FieldFormat;
32
+ yAxisFields: YAxisField[];
33
+ rows: any[];
34
+ columns: any[];
35
+ buckets: any[];
36
+ pivot: any;
37
+ bucketedRows: any[];
38
+ filtersApplied: any;
39
+ }
40
+ interface WithConfig extends BaseChartProps {
41
+ config: DashboardItem;
42
+ }
43
+ type ChartProps = WithChartId | WithConfig;
44
+ declare const Chart: ({ chartId, config, colors, containerStyle, query, SelectComponent, dateRangeFilterDisabled, isAnimationActive, hideXAxis, hideYAxis, hideCartesionGrid, }: ChartProps) => import("react/jsx-runtime").JSX.Element;
15
45
  export default Chart;
16
46
  //# sourceMappingURL=Chart.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Chart.d.ts","sourceRoot":"","sources":["../../src/Chart.tsx"],"names":[],"mappings":";AA0HA,QAAA,MAAM,KAAK;aAcA,MAAM;aACN,GAAG;;;;;uBAKO,OAAO;eACf,OAAO;eACP,OAAO;uBACC,OAAO;6BACD,OAAO;6CAqCjC,CAAC;AA2hBF,eAAe,KAAK,CAAC"}
1
+ {"version":3,"file":"Chart.d.ts","sourceRoot":"","sources":["../../src/Chart.tsx"],"names":[],"mappings":";AAyBA,UAAU,cAAc;IACtB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,cAAc,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IACrC,SAAS,EAAE,GAAG,CAAC;IACf,QAAQ,EAAE,GAAG,CAAC;IACd,MAAM,EAAE,GAAG,CAAC;IACZ,UAAU,CAAC,EAAE,GAAG,CAAC;IACjB,KAAK,EAAE,GAAG,CAAC;IACX,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC7B;AAED,UAAU,WAAY,SAAQ,cAAc;IAC1C,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,MAAM,WAAW,GACnB,cAAc,GACd,mBAAmB,GACnB,oBAAoB,GACpB,eAAe,GACf,cAAc,GACd,UAAU,GACV,aAAa,GACb,eAAe,GACf,oBAAoB,GACpB,UAAU,GACV,SAAS,GACT,QAAQ,CAAC;AAEb,UAAU,UAAU;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,WAAW,CAAC;CACrB;AAED,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,WAAW,CAAC;IACzB,WAAW,EAAE,UAAU,EAAE,CAAC;IAC1B,IAAI,EAAE,GAAG,EAAE,CAAC;IACZ,OAAO,EAAE,GAAG,EAAE,CAAC;IACf,OAAO,EAAE,GAAG,EAAE,CAAC;IACf,KAAK,EAAE,GAAG,CAAC;IACX,YAAY,EAAE,GAAG,EAAE,CAAC;IACpB,cAAc,EAAE,GAAG,CAAC;CACrB;AAED,UAAU,UAAW,SAAQ,cAAc;IACzC,MAAM,EAAE,aAAa,CAAC;CACvB;AAED,KAAK,UAAU,GAAG,WAAW,GAAG,UAAU,CAAC;AAgF3C,QAAA,MAAM,KAAK,8JAYR,UAAU,4CAkCZ,CAAC;AA2hBF,eAAe,KAAK,CAAC"}
package/dist/cjs/Chart.js CHANGED
@@ -78,7 +78,7 @@ function hashCode(s) {
78
78
  return a & a;
79
79
  }, 0);
80
80
  }
81
- const Chart = ({ chartId, config, colors, containerStyle, query, SelectComponent, DatePickerComponent, dateRangeFilterDisabled = false, isAnimationActive = true, hideXAxis = false, hideYAxis = false, hideCartesionGrid = false, }) => {
81
+ const Chart = ({ chartId, config, colors, containerStyle, query, SelectComponent, dateRangeFilterDisabled = false, isAnimationActive = true, hideXAxis = false, hideYAxis = false, hideCartesionGrid = false, }) => {
82
82
  const { dispatch, dashboard } = (0, react_1.useContext)(Context_1.DashboardContext);
83
83
  const { dashboardFilters } = (0, react_1.useContext)(Context_1.DashboardFiltersContext);
84
84
  // eslint-disable-next-line no-unused-vars
@@ -91,7 +91,7 @@ const Chart = ({ chartId, config, colors, containerStyle, query, SelectComponent
91
91
  ? theme.chartColors
92
92
  : ['#4E80EE', '#E14F62', '#55B5A6', '#E9A23B', '#6466E9', '#55B685'];
93
93
  }, [colors]);
94
- return ((0, jsx_runtime_1.jsx)(ChartUpdater, { config: config, dispatch: dispatch, dashboard: dashboard, chartId: chartId, containerStyle: containerStyle, colors: chartColors, client: client, theme: theme, dashboardFilters: dashboardFilters, query: query, SelectComponent: SelectComponent, DatePickerComponent: DatePickerComponent, isAnimationActive: isAnimationActive, hideXAxis: hideXAxis, hideYAxis: hideYAxis, hideCartesionGrid: hideCartesionGrid, dateRangeFilterDisabled: dateRangeFilterDisabled }));
94
+ return ((0, jsx_runtime_1.jsx)(ChartUpdater, { config: config, dispatch: dispatch, dashboard: dashboard, chartId: chartId, containerStyle: containerStyle, colors: chartColors, client: client, theme: theme, dashboardFilters: dashboardFilters, query: query, isAnimationActive: isAnimationActive, hideXAxis: hideXAxis, hideYAxis: hideYAxis, hideCartesionGrid: hideCartesionGrid, dateRangeFilterDisabled: dateRangeFilterDisabled }));
95
95
  };
96
96
  const ChartUpdater = ({ colors, chartId, config, containerStyle, dashboard, dispatch, client, theme, dashboardFilters, isAnimationActive, hideXAxis, hideYAxis, hideCartesionGrid, dateRangeFilterDisabled, }) => {
97
97
  const [loading, setLoading] = (0, react_1.useState)(false);
@@ -1,16 +1,46 @@
1
1
  /// <reference types="react" />
2
- declare const Chart: ({ chartId, config, colors, containerStyle, query, SelectComponent, DatePickerComponent, dateRangeFilterDisabled, isAnimationActive, hideXAxis, hideYAxis, hideCartesionGrid, }: {
2
+ interface BaseChartProps {
3
+ colors: string[];
4
+ containerStyle?: React.CSSProperties;
5
+ dashboard: any;
6
+ dispatch: any;
7
+ client: any;
8
+ dateFilter?: any;
9
+ theme: any;
10
+ isDateFilter?: boolean;
11
+ isAnimationActive?: boolean;
12
+ hideXAxis?: boolean;
13
+ hideYAxis?: boolean;
14
+ hideCartesionGrid?: boolean;
15
+ }
16
+ interface WithChartId extends BaseChartProps {
3
17
  chartId: string;
4
- config?: any;
5
- colors?: string[] | undefined;
6
- containerStyle?: import("react").CSSProperties | undefined;
7
- DatePickerComponent?: JSX.Element | undefined;
8
- query?: string | undefined;
9
- isAnimationActive: boolean;
10
- hideXAxis: boolean;
11
- hideYAxis: boolean;
12
- hideCartesionGrid: boolean;
13
- dateRangeFilterDisabled: boolean;
14
- }) => import("react/jsx-runtime").JSX.Element;
18
+ }
19
+ export type FieldFormat = 'whole_number' | 'one_decimal_place' | 'two_decimal_places' | 'dollar_amount' | 'dollar_cents' | 'MMM_yyyy' | 'MMM_dd_yyyy' | 'MMM_dd-MMM_dd' | 'MMM_dd_hh:mm_ap_pm' | 'hh_ap_pm' | 'percent' | 'string';
20
+ interface YAxisField {
21
+ label: string;
22
+ field: string;
23
+ chartType: string;
24
+ format: FieldFormat;
25
+ }
26
+ export interface DashboardItem {
27
+ name: string;
28
+ chartType: string;
29
+ xAxisField: string;
30
+ xAxisLabel: string;
31
+ xAxisFormat: FieldFormat;
32
+ yAxisFields: YAxisField[];
33
+ rows: any[];
34
+ columns: any[];
35
+ buckets: any[];
36
+ pivot: any;
37
+ bucketedRows: any[];
38
+ filtersApplied: any;
39
+ }
40
+ interface WithConfig extends BaseChartProps {
41
+ config: DashboardItem;
42
+ }
43
+ type ChartProps = WithChartId | WithConfig;
44
+ declare const Chart: ({ chartId, config, colors, containerStyle, query, SelectComponent, dateRangeFilterDisabled, isAnimationActive, hideXAxis, hideYAxis, hideCartesionGrid, }: ChartProps) => import("react/jsx-runtime").JSX.Element;
15
45
  export default Chart;
16
46
  //# sourceMappingURL=Chart.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Chart.d.ts","sourceRoot":"","sources":["../../src/Chart.tsx"],"names":[],"mappings":";AA0HA,QAAA,MAAM,KAAK;aAcA,MAAM;aAC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AC1B,IAAI,EAAE,GAAG,EAAE,CAAC;IACZ,OAAO,EAAE,GAAG,EAAE,CAAC;IACf,OAAO,EAAE,GAAG,EAAE,CAAC;IACf,KAAK,EAAE,GAAG,CAAC;IACX,YAAY,EAAE,GAAG,EAAE,CAAC;IACpB,cAAc,EAAE,GAAG,CAAC;CACrB;AAED,UAAU,UAAW,SAAQ,cAAc;IACzC,MAAM,EAAE,aAAa,CAAC;CACvB;AAED,KAAK,UAAU,GAAG,WAAW,GAAG,UAAU,CAAC;AAgF3C,QAAA,MAAM,KAAK,8JAYR,UAAU,4CAkCZ,CAAC;AA2hBF,eAAe,KAAK,CAAC"}
package/dist/esm/Chart.js CHANGED
@@ -73,7 +73,7 @@ function hashCode(s) {
73
73
  return a & a;
74
74
  }, 0);
75
75
  }
76
- const Chart = ({ chartId, config, colors, containerStyle, query, SelectComponent, DatePickerComponent, dateRangeFilterDisabled = false, isAnimationActive = true, hideXAxis = false, hideYAxis = false, hideCartesionGrid = false, }) => {
76
+ const Chart = ({ chartId, config, colors, containerStyle, query, SelectComponent, dateRangeFilterDisabled = false, isAnimationActive = true, hideXAxis = false, hideYAxis = false, hideCartesionGrid = false, }) => {
77
77
  const { dispatch, dashboard } = useContext(DashboardContext);
78
78
  const { dashboardFilters } = useContext(DashboardFiltersContext);
79
79
  // eslint-disable-next-line no-unused-vars
@@ -86,7 +86,7 @@ const Chart = ({ chartId, config, colors, containerStyle, query, SelectComponent
86
86
  ? theme.chartColors
87
87
  : ['#4E80EE', '#E14F62', '#55B5A6', '#E9A23B', '#6466E9', '#55B685'];
88
88
  }, [colors]);
89
- return (_jsx(ChartUpdater, { config: config, dispatch: dispatch, dashboard: dashboard, chartId: chartId, containerStyle: containerStyle, colors: chartColors, client: client, theme: theme, dashboardFilters: dashboardFilters, query: query, SelectComponent: SelectComponent, DatePickerComponent: DatePickerComponent, isAnimationActive: isAnimationActive, hideXAxis: hideXAxis, hideYAxis: hideYAxis, hideCartesionGrid: hideCartesionGrid, dateRangeFilterDisabled: dateRangeFilterDisabled }));
89
+ return (_jsx(ChartUpdater, { config: config, dispatch: dispatch, dashboard: dashboard, chartId: chartId, containerStyle: containerStyle, colors: chartColors, client: client, theme: theme, dashboardFilters: dashboardFilters, query: query, isAnimationActive: isAnimationActive, hideXAxis: hideXAxis, hideYAxis: hideYAxis, hideCartesionGrid: hideCartesionGrid, dateRangeFilterDisabled: dateRangeFilterDisabled }));
90
90
  };
91
91
  const ChartUpdater = ({ colors, chartId, config, containerStyle, dashboard, dispatch, client, theme, dashboardFilters, isAnimationActive, hideXAxis, hideYAxis, hideCartesionGrid, dateRangeFilterDisabled, }) => {
92
92
  const [loading, setLoading] = useState(false);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quillsql/react",
3
- "version": "2.10.1",
3
+ "version": "2.10.2",
4
4
  "exports": {
5
5
  ".": {
6
6
  "import": "./dist/esm/index.js",