@vizzly/dashboard 0.12.7 → 0.12.8

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.
Files changed (40) hide show
  1. package/dist/dashboard/src/contexts/GlobalProvider/useGlobalProvider.d.ts +12 -6
  2. package/dist/dashboard/src/types.d.ts +2 -0
  3. package/dist/index.js +1 -1
  4. package/dist/services/src/index.d.ts +18 -1
  5. package/dist/services/src/schemaValidations/index.d.ts +2 -0
  6. package/dist/services/src/schemaValidations/query.d.ts +3 -0
  7. package/dist/shared-logic/src/Component/sharedSchemas.d.ts +11 -3
  8. package/dist/shared-logic/src/Component/types.d.ts +3 -1
  9. package/dist/shared-logic/src/ComponentInterface/types/namespaces.types.d.ts +2 -2
  10. package/dist/shared-logic/src/CustomComponent/CustomComponent.d.ts +5 -0
  11. package/dist/shared-logic/src/CustomComponent/attributesSchema.d.ts +3 -0
  12. package/dist/shared-logic/src/CustomComponent/constants.d.ts +3 -0
  13. package/dist/shared-logic/src/CustomComponent/index.d.ts +3 -2
  14. package/dist/shared-logic/src/CustomComponent/types.d.ts +27 -0
  15. package/dist/shared-logic/src/Query/types.d.ts +3 -0
  16. package/dist/shared-logic/src/QueryEngineConfig/types.d.ts +1 -1
  17. package/dist/shared-logic/src/api/queryEngine/getRunQueriesCallback.d.ts +29 -0
  18. package/dist/shared-ui/src/base/Modal.d.ts +1 -0
  19. package/dist/shared-ui/src/base/MultiSelect.d.ts +2 -0
  20. package/dist/shared-ui/src/base/Select/Wrapper.d.ts +2 -0
  21. package/dist/shared-ui/src/base/Select.d.ts +2 -0
  22. package/dist/shared-ui/src/base/classNames.d.ts +1 -0
  23. package/dist/shared-ui/src/base/useFuzzySearch.d.ts +2 -1
  24. package/dist/shared-ui/src/components/AdditionalFilter/asyncLoadFilterOptions.d.ts +2 -1
  25. package/dist/shared-ui/src/components/ChartHelper.d.ts +1 -1
  26. package/dist/shared-ui/src/components/CustomComponent/CustomComponent.d.ts +4 -5
  27. package/dist/shared-ui/src/components/CustomComponent/StaticCustomComponent.d.ts +5 -0
  28. package/dist/shared-ui/src/components/CustomComponent/buildInitialSelectableComponent.d.ts +5 -0
  29. package/dist/shared-ui/src/components/DragAndDrop/DndWrapper.d.ts +10 -2
  30. package/dist/shared-ui/src/components/ViewHeader/ViewHeader.d.ts +1 -1
  31. package/dist/shared-ui/src/contexts/DashboardBehaviour/context.d.ts +1 -0
  32. package/dist/shared-ui/src/contexts/DashboardBehaviour/types.d.ts +6 -1
  33. package/dist/shared-ui/src/library/DataPanel/CustomFieldInput/PercentageModal/buildGroupedFilterValue.d.ts +2 -1
  34. package/dist/shared-ui/src/library/Editor/useEditor.d.ts +4 -1
  35. package/dist/shared-ui/src/library/Library/types.d.ts +0 -1
  36. package/dist/shared-ui/src/types.d.ts +4 -12
  37. package/package.json +3 -3
  38. package/dist/dashboard/src/getRunQueriesCallback.d.ts +0 -6
  39. package/dist/shared-ui/src/components/DragAndDrop/DndWrapper.test.d.ts +0 -1
  40. package/dist/shared-ui/src/components/DragAndDrop/TestComponent.d.ts +0 -3
@@ -1,5 +1,5 @@
1
1
  import { QueryEngineConfig, QueryEngineEndpoint } from '../../shared-logic/src/QueryEngineConfig/types';
2
- import { identityCallback, loadDataSetsCallback, loadQueryEngineConfigCallback, programmaticDashboardCallback } from '../../shared-logic/src/Callbacks/types';
2
+ import { identityCallback, loadDataCallback, loadDataSetsCallback, loadQueryEngineConfigCallback, programmaticDashboardCallback } from '../../shared-logic/src/Callbacks/types';
3
3
  import { IdentityConfig } from '../../shared-logic/src/IdentityConfig/types';
4
4
  import { DashboardStorageStrategy } from '../../shared-logic/src/DashboardAPI/types';
5
5
  import { DataSet } from '../../shared-logic/src/DataSet/types';
@@ -11,6 +11,10 @@ import { Row, Cell, Dashboard, Header, Library, Editor } from './Services';
11
11
  import * as Views from './Services/View';
12
12
  import { ViewConfiguration } from '../../shared-logic/src/ViewConfiguration/types';
13
13
  import { EventBus, EventBusParams } from './eventbus.types';
14
+ import { QueryAttributes } from '../../shared-logic/src/QueryAttributes/types';
15
+ import { CustomDriver } from '../../results-driver/src/types';
16
+ import { Result } from '../../shared-logic/src/Result/types';
17
+ import { DateTimeFilterOptions } from '../../shared-logic/src/DateTime/types';
14
18
  export type { ViewConfiguration } from '../../shared-logic/src/ViewConfiguration/types';
15
19
  export { VizzlyInstanceNotLoaded } from './errors/VizzlyInstanceNotLoaded';
16
20
  export declare type Options = {
@@ -31,6 +35,7 @@ export declare type VizzlyServicesProperties = {
31
35
  };
32
36
  declare class VizzlyServices {
33
37
  private queryEngineConfig;
38
+ static queryEngine: QueryEngineEndpoint | loadQueryEngineConfigCallback | undefined;
34
39
  private dataSets;
35
40
  private identityConfig;
36
41
  private vizzlyAPIClient;
@@ -70,6 +75,14 @@ declare class VizzlyServices {
70
75
  */
71
76
  getViewConfiguration(): ViewConfiguration;
72
77
  getIdentityConfig(): IdentityConfig;
78
+ query(queries: Query[], params?: {
79
+ abortController?: AbortController;
80
+ instanceId?: string;
81
+ runQueries?: CustomDriver['runQueries'];
82
+ data?: loadDataCallback;
83
+ queryEngineEndpoint?: QueryEngineEndpoint;
84
+ dateFilterOptions?: DateTimeFilterOptions;
85
+ }): Promise<QueryResponse>;
73
86
  static upcastDashboard(dashboard: DashboardFromAPI, dataSets: DataSet[], queryEngineConfig: QueryEngineConfig): Array<DashboardLogic.Dashboard>;
74
87
  static filterDashboards(dashboards: DashboardLogic.Dashboard[], options: FilterDashboardOptions): DashboardLogic.Dashboard[];
75
88
  static validateDashboard(dashboard: unknown): void;
@@ -139,5 +152,9 @@ export declare type CreateDashboardParams = {
139
152
  parentDashboardId: string;
140
153
  abortSignal?: AbortSignal;
141
154
  };
155
+ export declare type Query = QueryAttributes;
156
+ export declare type QueryResponse = {
157
+ results: (Result | null)[] | (any[][] | null)[] | null;
158
+ };
142
159
  export declare type Vizzly = VizzlyServices;
143
160
  export declare const Vizzly: typeof VizzlyServices;
@@ -0,0 +1,2 @@
1
+ export * from './query';
2
+ export * from './dashboard';
@@ -0,0 +1,3 @@
1
+ import { Query } from 'src';
2
+ import { QueryEngineConfig } from '../../../shared-logic/src/QueryEngineConfig/types';
3
+ export declare const validateQuery: (params: Query[], queryEngineConfig: QueryEngineConfig) => void;
@@ -19,15 +19,17 @@ export declare const baseAttributesSchema: (attributeSchemaOptions: ComponentInt
19
19
  protectedByOrganisation: Joi.BooleanSchema<boolean>;
20
20
  };
21
21
  export declare const approxAxisLabelCountSchema: Joi.AnySchema<any>;
22
- export declare const timeDimensionQuerySchema: (queryEngineConfig: QueryEngineConfig, attributeSchemaOptions: ComponentInterfaceConfig['attributesSchemaOptions']) => {
22
+ export declare const querySchema: (queryEngineConfig: QueryEngineConfig, attributeSchemaOptions: ComponentInterfaceConfig['attributesSchemaOptions']) => {
23
23
  measure: Joi.ArraySchema<any[]>;
24
24
  dimension: Joi.ArraySchema<any[]>;
25
- drilldown: Joi.AlternativesSchema<string | any[]>;
26
25
  order: Joi.ArraySchema<any[]>;
27
- timeDimension: Joi.AlternativesSchema<any>;
28
26
  limit: Joi.NumberSchema<number>;
29
27
  offset: Joi.NumberSchema<number>;
30
28
  filter: Joi.ArraySchema<any[]>;
29
+ };
30
+ export declare const timeDimensionQuerySchema: (queryEngineConfig: QueryEngineConfig, attributeSchemaOptions: ComponentInterfaceConfig['attributesSchemaOptions']) => {
31
+ timeDimension: Joi.AlternativesSchema<any>;
32
+ drilldown: Joi.AlternativesSchema<string | any[]>;
31
33
  xAxisPrefix: Joi.StringSchema<string>;
32
34
  yAxisPrefix: Joi.StringSchema<string>;
33
35
  xAxisPostfix: Joi.StringSchema<string>;
@@ -36,6 +38,12 @@ export declare const timeDimensionQuerySchema: (queryEngineConfig: QueryEngineCo
36
38
  xAxisFormat: Joi.AlternativesSchema<any>;
37
39
  approxYAxisLabelCount: Joi.AnySchema<any>;
38
40
  approxXAxisLabelCount: Joi.AnySchema<any>;
41
+ measure: Joi.ArraySchema<any[]>;
42
+ dimension: Joi.ArraySchema<any[]>;
43
+ order: Joi.ArraySchema<any[]>;
44
+ limit: Joi.NumberSchema<number>;
45
+ offset: Joi.NumberSchema<number>;
46
+ filter: Joi.ArraySchema<any[]>;
39
47
  };
40
48
  export declare const lineCurveSchema: Joi.StringSchema<string>;
41
49
  export declare const protectedFieldsMeasure: (queryEngineConfig: QueryEngineConfig) => Joi.ArraySchema<any[]>;
@@ -11,6 +11,7 @@ export declare type getNumberFormatter = (formatterId: string | undefined | null
11
11
  export declare type FormatType = string | null;
12
12
  export declare type ApproxAxisLabelCount = 'auto' | number;
13
13
  export declare type ComponentType = 'barChart' | 'horizontalBarChart' | 'areaChart' | 'lineChart' | 'scatterChart' | 'pieChart' | 'singleStat' | 'dataTable' | 'basicTable' | 'comboChart' | 'mercatorMap' | 'custom' | 'progress';
14
+ export declare const componentTypes: string[];
14
15
  export declare namespace Component {
15
16
  export type LineCurve = 'natural' | 'straight' | 'step' | 'stepBefore' | 'stepAfter';
16
17
  export type RawComponent = Omit<Component, 'queries' | 'results' | 'span'> & {
@@ -69,7 +70,8 @@ export declare namespace Component {
69
70
  };
70
71
  export type CustomComponentAttributes = BaseAttributes & {
71
72
  type: 'custom';
72
- id: string;
73
+ viewId: string;
74
+ customComponentId: string;
73
75
  };
74
76
  export type AxisTitles = {
75
77
  x?: string;
@@ -37,8 +37,8 @@ export interface DataPanelNamespaces {
37
37
  field_x_axis?: Section<'fieldCollector'>;
38
38
  field_country?: Section<'fieldCollector'>;
39
39
  sort?: Section<'sort'>;
40
- filter: Section<'filter'>;
41
- custom_metrics: Section<'customMetrics'>;
40
+ filter?: Section<'filter'>;
41
+ custom_metrics?: Section<'customMetrics'>;
42
42
  limit?: Section<'limit'>;
43
43
  pagination?: Section<'pagination'>;
44
44
  combo_chart_dimension?: Section<'comboChartDimension'>;
@@ -0,0 +1,5 @@
1
+ import { CustomComponent, SelectableCustomComponent, StaticCustomComponent } from './types';
2
+ export declare const isStatic: (component: CustomComponent) => component is StaticCustomComponent;
3
+ export declare const isSelectable: (component: CustomComponent) => component is SelectableCustomComponent;
4
+ export declare const getSelectableComponents: (components: CustomComponent[]) => SelectableCustomComponent[];
5
+ export declare const findSelectableById: (components: CustomComponent[], id: string) => SelectableCustomComponent | undefined;
@@ -0,0 +1,3 @@
1
+ import Joi from '@vizzly/joi';
2
+ import { ComponentInterfaceConfig } from '../ComponentInterface/types';
3
+ export declare const attributesSchema: (config: ComponentInterfaceConfig) => Joi.ObjectSchema<any>;
@@ -0,0 +1,3 @@
1
+ import { ViewConstants } from '../ComponentInterface/types/namespaces.types';
2
+ declare const CONSTANTS: ViewConstants;
3
+ export default CONSTANTS;
@@ -1,4 +1,5 @@
1
1
  import { Component } from '../Component/types';
2
- import { ComponentInterface } from '../ComponentInterface/types';
3
- declare const CustomChart: ComponentInterface<Component.CustomComponentAttributes, Component.CustomComponentAttributes>;
2
+ import { LoadComponentInterface } from '../ComponentInterface/types';
3
+ import { DumpedCustomComponentAttributes } from './types';
4
+ declare const CustomChart: LoadComponentInterface<Component.CustomComponentAttributes, DumpedCustomComponentAttributes>;
4
5
  export default CustomChart;
@@ -0,0 +1,27 @@
1
+ /// <reference types="react" />
2
+ import { Component } from '../Component/types';
3
+ export declare type CustomComponent = StaticCustomComponent | SelectableCustomComponent;
4
+ export declare type BaseCustomComponent = {
5
+ id: string;
6
+ };
7
+ export declare type StaticCustomComponent = BaseCustomComponent & {
8
+ rowIndex: number;
9
+ cellIndex: number;
10
+ Component: () => JSX.Element | string;
11
+ options?: {
12
+ disableAddCell?: boolean;
13
+ raw?: boolean;
14
+ };
15
+ attributes?: {
16
+ displayTitle?: string;
17
+ displaySubject?: string;
18
+ };
19
+ };
20
+ export declare type SelectableCustomComponent = BaseCustomComponent & {
21
+ title: string;
22
+ Icon: () => JSX.Element;
23
+ Component: ({ attributes }: {
24
+ attributes: Component.CustomComponentAttributes;
25
+ }) => JSX.Element | string;
26
+ };
27
+ export declare type DumpedCustomComponentAttributes = Component.CustomComponentAttributes;
@@ -61,6 +61,9 @@ export declare namespace QueryNameSpace {
61
61
  value: string;
62
62
  } | {
63
63
  type: 'null';
64
+ } | {
65
+ type: 'boolean';
66
+ value: boolean | null;
64
67
  };
65
68
  type ComplexType<SupportedFunction = string, ComparisonOperator = string, MathsOp = string> = {
66
69
  type: 'field';
@@ -2,7 +2,7 @@ import { SupportedAggregates } from '../Aggregate';
2
2
  import { SupportedTimeTruncFunctions } from '../TimeDimension/types';
3
3
  import { SupportedOperators } from '../QueryAttributes/types';
4
4
  import { SupportedTransformationFunctions } from '../Functions/types';
5
- export declare type SupportedFeature = 'subquery' | 'simpleMaths' | 'aggregateMaths' | 'switchField' | 'configManagerUi' | 'roundedNumbers' | 'sqlDefinedDataSet' | 'encryptedDashboards' | 'sqlViews' | 'dateMaths' | 'conditional';
5
+ export declare type SupportedFeature = 'subquery' | 'simpleMaths' | 'aggregateMaths' | 'switchField' | 'configManagerUi' | 'roundedNumbers' | 'sqlDefinedDataSet' | 'encryptedDashboards' | 'sqlViews' | 'dateMaths';
6
6
  export declare type QueryEngineConfig = {
7
7
  origin?: 'in-browser' | 'query-engine' | 'custom';
8
8
  supportedFeatures: SupportedFeature[];
@@ -0,0 +1,29 @@
1
+ import { AdditionalFilter, FilterConfig, TimeRangeOptions } from '../../../../shared-logic/src/AdditionalFilter/types';
2
+ import { loadDataCallback } from '../../../../shared-logic/src/Callbacks/types';
3
+ import { QueryEngineConfig as QueryEngineConfigType } from '../../../../shared-logic/src/QueryEngineConfig/types';
4
+ import { Component } from '../../../../shared-logic/src/Component/types';
5
+ import { QueryAttributes } from '../../../../shared-logic/src/QueryAttributes/types';
6
+ import { PreparedQuery } from '../../../../shared-logic/src/Query/types';
7
+ import { Result } from '../../../../shared-logic/src/Result/types';
8
+ import { DataSet } from '../../../../shared-logic/src/DataSet/types';
9
+ import { IdentityConfig as IdentityConfigType } from '../../../../shared-logic/src/IdentityConfig/types';
10
+ declare type CallbackError = null;
11
+ export declare type runQueriesCallback = (queries: Component.Attributes | AdditionalFilter | QueryAttributes[] | [PreparedQuery], params: {
12
+ dataSets: DataSet[];
13
+ abortSignal?: AbortSignal;
14
+ dataAccessToken?: string;
15
+ filterConfig?: FilterConfig;
16
+ }) => Promise<(Result | null)[] | Array<Result['content'] | null> | CallbackError>;
17
+ declare const getRunQueriesCallback: (identityConfig: IdentityConfigType, queryEngineConfig: QueryEngineConfigType, timeRangeOptions: TimeRangeOptions, runQueries?: ((queries: import("../../../../shared-logic/src/Query/types").Query<string, string, string>[], params: {
18
+ dataSets: DataSet<DataSet.Field>[];
19
+ abortSignal?: AbortSignal | undefined;
20
+ dataAccessToken?: string | undefined;
21
+ filterConfig?: FilterConfig | undefined;
22
+ }) => Promise<(Result | any[][] | null)[] | null>) | undefined, data?: loadDataCallback | undefined, queryEngineEndpoint?: string | {
23
+ endpoint: string;
24
+ dynamicConfig?: Object | undefined;
25
+ customHeaders?: (() => {
26
+ [headerKey: string]: string;
27
+ }) | undefined;
28
+ } | undefined) => runQueriesCallback;
29
+ export default getRunQueriesCallback;
@@ -26,6 +26,7 @@ export declare const ModalBody: React.FunctionComponent<{
26
26
  children?: React.ReactNode;
27
27
  vizzlyPrefix: string;
28
28
  'data-component'?: string;
29
+ disableDnD?: boolean;
29
30
  }>;
30
31
  export declare const ModalOverlay: React.FunctionComponent<{
31
32
  dark?: boolean;
@@ -1,6 +1,7 @@
1
1
  import { FunctionComponent } from 'react';
2
2
  import { TextOverride } from '../../../shared-logic/src/Translations/types';
3
3
  import { FreeTextOptions } from './Dropdown/Dropdown.types';
4
+ import { ValueAlias } from '../contexts/DashboardBehaviour/types';
4
5
  export declare type MultiSelectOptions = {
5
6
  hide?: boolean;
6
7
  value: any;
@@ -24,6 +25,7 @@ export declare const MultiSelect: FunctionComponent<{
24
25
  dropdownForFilter?: boolean;
25
26
  onFreeTextSelected?: (() => void) | undefined;
26
27
  freeTextOptions?: FreeTextOptions;
28
+ valueAlias?: ValueAlias;
27
29
  }>;
28
30
  export declare function getSelectedIndices<T extends {
29
31
  value: string;
@@ -3,6 +3,7 @@ import { CustomThemeClassNamespaces } from '../classNames';
3
3
  import { VizzlyComponents } from '../../types';
4
4
  import { SelectOption } from '../Select/Select.types';
5
5
  import { TextOverride } from '../../../../shared-logic/src/Translations/types';
6
+ import { ValueAlias } from '../../contexts/DashboardBehaviour/types';
6
7
  declare type Props = VizzlyComponents.ComponentOverrides.Props.Select & {
7
8
  testId?: string;
8
9
  'data-component'?: string;
@@ -19,6 +20,7 @@ declare type Props = VizzlyComponents.ComponentOverrides.Props.Select & {
19
20
  dropdownForFilter?: boolean;
20
21
  onFreeTextSelected?: () => void;
21
22
  onClick?: (() => void) | undefined;
23
+ valueAlias?: ValueAlias;
22
24
  };
23
25
  export declare const PROPS_AS_CLASSNAMES: CustomThemeClassNamespaces[];
24
26
  declare const _default: (props: Props) => JSX.Element;
@@ -3,6 +3,7 @@ import { SelectOption } from './Select/Select.types';
3
3
  import { LabelTooltip } from './Label/Label';
4
4
  import { AsyncSelectOptions } from './Select/types';
5
5
  import { TextOverride } from '../../../shared-logic/src/Translations/types';
6
+ import { ValueAlias } from '../contexts/DashboardBehaviour/types';
6
7
  declare type Props = {
7
8
  options: SelectOption[] | AsyncSelectOptions;
8
9
  selected?: any;
@@ -35,6 +36,7 @@ declare type Props = {
35
36
  fixedWidth?: number;
36
37
  dropdownForFilter?: boolean;
37
38
  hasFreeText?: boolean;
39
+ valueAlias?: ValueAlias;
38
40
  onClick?: () => void;
39
41
  };
40
42
  export declare const Select: (props: Props) => JSX.Element;
@@ -46,6 +46,7 @@ declare type CustomThemeClassNamespaceDescriptionMap = {
46
46
  populated: string;
47
47
  error: string;
48
48
  accordion: string;
49
+ 'custom-component': string;
49
50
  };
50
51
  export declare const namespaceDescriptions: CustomThemeClassNamespaceDescriptionMap;
51
52
  export declare type CustomThemeClassNamespaces = keyof CustomThemeClassNamespaceDescriptionMap;
@@ -1,3 +1,4 @@
1
+ import { ValueAlias } from '../contexts/DashboardBehaviour/types';
1
2
  declare type Provided<T> = {
2
3
  values: Array<{
3
4
  item: T;
@@ -6,5 +7,5 @@ declare type Provided<T> = {
6
7
  searchString: string;
7
8
  setSearch: (searchValue: string) => void;
8
9
  };
9
- declare const _default: <T>(arr: T[], includeKeys: (keyof T)[]) => Provided<T>;
10
+ declare const _default: <T extends Record<string, any>>(arr: T[], includeKeys: (keyof T)[], valueAlias?: ValueAlias | undefined) => Provided<T>;
10
11
  export default _default;
@@ -1,6 +1,7 @@
1
1
  import { VizzlyComponents } from '../../types';
2
2
  import { AdditionalFilter } from '../../../../shared-logic/src/AdditionalFilter/types';
3
+ import { ValueAlias } from '../../contexts/DashboardBehaviour/types';
3
4
  export declare const asyncLoadFilterOptions: <T extends {
4
5
  label: string | number | Function;
5
6
  value: string | number;
6
- }>(filter: AdditionalFilter, runQueriesCallback: VizzlyComponents.runQueriesCallbackInternal) => (abortSignal: AbortSignal) => Promise<T[]>;
7
+ }>(filter: AdditionalFilter, runQueriesCallback: VizzlyComponents.runQueriesCallbackInternal, valueAlias?: ValueAlias | undefined) => (abortSignal: AbortSignal) => Promise<T[]>;
@@ -22,7 +22,7 @@ declare type Datum = {
22
22
  };
23
23
  export declare const getExplanationsOfConditionFormattingRulesThatApplyToSeries: (dimensions: QueryAttributesType.Dimension[], conditionalFormattingRules: ActualComponent.ConditionalFormatting.Rule[], seriesKey: string, supportedAggregates: DashboardBehaviour['queryEngineConfig']['supportedAggregates'], dataSet: DataSetType) => Array<ConditionalFormattingOption>;
24
24
  export declare const applyConditionFormattingRules: (dimensions: QueryAttributesType.Dimension[], conditionalFormattingRules: ConditionalFormattingBoundary[], datum: Datum | undefined, key: string, dataSet: DataSetType) => ActualComponent.ConditionalFormatting.DisplayRule | undefined;
25
- export declare const formatXAxisLabel: (timeDimension: QueryAttributesType.TimeDimension | null, supportedTimeTruncFunctions: QueryEngineConfig['supportedTimeTruncFunctions'], axisLabelConfig: AxisLabelConfig) => (value: any) => string;
25
+ export declare const formatXAxisLabel: (timeDimension: QueryAttributesType.TimeDimension | null, supportedTimeTruncFunctions: QueryEngineConfig['supportedTimeTruncFunctions'], axisLabelConfig: AxisLabelConfig, valueAlias?: DashboardBehaviour['valueAlias']) => (value: any) => string;
26
26
  export declare const formatYAxisLabel: (textOverride: TextOverride, axisLabelConfig?: AxisLabelConfig | undefined) => (value: any) => string;
27
27
  export declare const formatSeriesName: (result: ResultType | null | undefined, textOverride: TextOverride, type: ComponentType, id: string, labelFormat: LabelFormat) => (key: string) => string | undefined;
28
28
  export declare const convertValueToFormat: (value: any, numberFormatOptions?: {
@@ -1,7 +1,6 @@
1
- /// <reference types="react" />
1
+ import { FunctionComponent } from 'react';
2
2
  import { Component } from '../../../../shared-logic/src/Component/types';
3
- declare type Props = {
3
+ export declare const CustomComponent: FunctionComponent<{
4
4
  component: Component<Component.CustomComponentAttributes>;
5
- };
6
- export declare const CustomComponent: (props: Props) => JSX.Element;
7
- export {};
5
+ }>;
6
+ export declare const customComponentClassName: string | undefined;
@@ -0,0 +1,5 @@
1
+ import { FunctionComponent } from 'react';
2
+ import { StaticCustomComponent as StaticCustomComponentType } from '../../../../shared-logic/src/CustomComponent/types';
3
+ export declare const StaticCustomComponent: FunctionComponent<{
4
+ customComponent: StaticCustomComponentType;
5
+ }>;
@@ -0,0 +1,5 @@
1
+ import { DataSet as DataSetType } from '../../../../shared-logic/src/DataSet/types';
2
+ import { DashboardBehaviour } from '../../contexts/DashboardBehaviour/types';
3
+ import { QueryEngineConfig } from '../../../../shared-logic/src/QueryEngineConfig/types';
4
+ import { SelectableCustomComponent } from '../../../../shared-logic/src/CustomComponent/types';
5
+ export declare const buildInitialSelectableCustomComponent: (queryEngineConfig: QueryEngineConfig, dataSet: DataSetType, component: SelectableCustomComponent, onEditorUpdate: DashboardBehaviour['onEditorUpdate']) => import("../../../../shared-logic/src/Component/types").Component<import("../../../../shared-logic/src/Component/types").Component.CustomComponentAttributes>;
@@ -1,4 +1,12 @@
1
- import { FunctionComponent } from 'react';
2
- export declare const DndWrapper: FunctionComponent<{
1
+ import React, { FunctionComponent } from 'react';
2
+ import { DragDropManager } from 'dnd-core';
3
+ import { HTML5BackendImpl } from '@vizzly/dnd-backend';
4
+ import { HTML5BackendContext, HTML5BackendOptions } from '@vizzly/dnd-backend';
5
+ export declare const HTML5Backend: (manager: DragDropManager, context: HTML5BackendContext, options: HTML5BackendOptions | undefined) => HTML5BackendImpl;
6
+ export declare const DndProvider: FunctionComponent<{
7
+ children: React.ReactNode;
8
+ id: string;
9
+ }>;
10
+ export declare const DndModal: FunctionComponent<{
3
11
  children: React.ReactNode;
4
12
  }>;
@@ -17,7 +17,7 @@ export declare type ViewHeaderProps = {
17
17
  library: boolean;
18
18
  setLocalFilters: (localFilters: AdditionalFilter[]) => void;
19
19
  setParameterUpdate?: (payload: UpdatedMetrics) => void;
20
- dataSet: DataSet;
20
+ dataSet?: DataSet;
21
21
  parameters?: Component.Parameters;
22
22
  componentType: ComponentType;
23
23
  measure?: QueryAttributes.Measure[];
@@ -23,6 +23,7 @@ export interface DashboardBehaviourProps {
23
23
  filterLibrary?: FilterLibrary;
24
24
  pdfSettings?: DashboardBehaviourType['pdfSettings'];
25
25
  id?: string;
26
+ valueAlias?: DashboardBehaviourType['valueAlias'];
26
27
  }
27
28
  declare type ProvidedValues = DashboardBehaviourType & {
28
29
  setOverrideDeveloperInfo: (developerInfo: DashboardBehaviourType['overrideDeveloperInfo']) => void;
@@ -13,6 +13,7 @@ import { VizzlyTranslations } from '../../../../shared-logic/src/Translations/tr
13
13
  import { PDFSettings } from '../../../../shared-logic/src/PDFGenerator/types';
14
14
  import { programmaticDashboardCallback } from '../../../../shared-logic/src/Callbacks/types';
15
15
  import React from 'react';
16
+ import { CustomComponent } from '../../../../shared-logic/src/CustomComponent/types';
16
17
  declare type OverrideDeveloperInfo = {
17
18
  overrideKey: string;
18
19
  componentProps: any;
@@ -27,6 +28,9 @@ export declare type NumberFormatter = {
27
28
  formatter: (number: number | undefined | null, noValueReplacement?: string) => string;
28
29
  description: string;
29
30
  };
31
+ export declare type ValueAlias = {
32
+ [id: string]: string | number;
33
+ };
30
34
  export declare type DeveloperTools = {
31
35
  theme?: boolean;
32
36
  componentOverride?: boolean;
@@ -51,7 +55,7 @@ export declare type DashboardBehaviour = {
51
55
  featureToggles: FeatureToggles;
52
56
  developerTools: boolean | DeveloperTools;
53
57
  componentOverrides: Partial<VizzlyComponents.ComponentOverrides>;
54
- customComponents: VizzlyComponents.ComponentOverrides.CustomComponent[];
58
+ customComponents: CustomComponent[];
55
59
  onlyViewTypes: (dataSet: DataSet) => ComponentType[];
56
60
  reportScheduleOptions: Array<{
57
61
  cron: string;
@@ -60,6 +64,7 @@ export declare type DashboardBehaviour = {
60
64
  numberFormatOptions: {
61
65
  [id: string]: NumberFormatter;
62
66
  };
67
+ valueAlias?: ValueAlias;
63
68
  dateTimeFormatOptions: {
64
69
  [id: string]: DateTimeFormatter;
65
70
  };
@@ -1,3 +1,4 @@
1
1
  import { DataSet } from '../../../../../../shared-logic/src/DataSet/types';
2
2
  import { QueryAttributes } from '../../../../../../shared-logic/src/QueryAttributes/types';
3
- export declare function buildGroupedFilterValue(dataSet: DataSet, filterGroup: QueryAttributes.Filter[][]): string;
3
+ import { ValueAlias } from '../../../../contexts/DashboardBehaviour/types';
4
+ export declare function buildGroupedFilterValue(dataSet: DataSet, filterGroup: QueryAttributes.Filter[][], valueAlias?: ValueAlias): string;
@@ -9,6 +9,7 @@ import { DashboardBehaviour, TextOverride } from '../../contexts/DashboardBehavi
9
9
  import { Dashboard } from '../../../../shared-logic/src/Dashboard/types';
10
10
  import { Result } from '../../../../shared-logic/src/Result/types';
11
11
  import { StudioAction, StudioState } from '../../contexts/DashboardContext/types';
12
+ import { SelectableCustomComponent } from '../../../../shared-logic/src/CustomComponent/types';
12
13
  export declare type EditorHookValues = {
13
14
  queryEngineConfig: QueryEngineConfig;
14
15
  selectedComponent: ComponentType['attributes']['type'];
@@ -20,7 +21,9 @@ export declare type EditorHookValues = {
20
21
  setDataSets: (dataSets: DataSetType[]) => void;
21
22
  dataSet: DataSetType;
22
23
  viewOptions: DashboardBehaviour['onlyViewTypes'];
23
- onSelectViewType: (viewType: ComponentType['attributes']['type']) => void;
24
+ onSelectViewType: (viewType: ComponentType['attributes']['type'], params?: {
25
+ customComponent?: SelectableCustomComponent;
26
+ }) => void;
24
27
  numberFormatOptions: DashboardBehaviour['numberFormatOptions'];
25
28
  setAttributes: (attributes: ComponentType.Attributes) => void;
26
29
  setLocalFilters: (localFilters: Component['localFilters']) => void;
@@ -10,5 +10,4 @@ export declare type ViewsInLibraryProps = {
10
10
  selectedIndex: number;
11
11
  onEdit: (index: number) => void;
12
12
  onDelete: (index: number) => void;
13
- onlyDataSetIds: string[];
14
13
  };
@@ -14,6 +14,8 @@ import { AdditionalFilter, FilterConfig } from '../../shared-logic/src/Additiona
14
14
  import { QueryAttributes } from '../../shared-logic/src/QueryAttributes/types';
15
15
  import { GlobalFilterViewProps } from './components/GlobalFilters/types';
16
16
  import { api } from '../../shared-logic/src/api';
17
+ import { CustomComponent as CustomComponentType } from '../../shared-logic/src/CustomComponent/types';
18
+ import { runQueriesCallback as runQueriesCallbackImported } from '../../shared-logic/src/api/queryEngine/getRunQueriesCallback';
17
19
  declare global {
18
20
  var disableViewCheck: boolean;
19
21
  var disableResizing: boolean;
@@ -40,12 +42,7 @@ export declare namespace VizzlyComponents {
40
42
  };
41
43
  export type PivotConfig = PivotConfigImported;
42
44
  export namespace ComponentOverrides {
43
- type CustomComponent = {
44
- id: string;
45
- title: string;
46
- Icon: () => JSX.Element;
47
- Component: () => JSX.Element;
48
- };
45
+ type CustomComponent = CustomComponentType;
49
46
  namespace Props {
50
47
  type PickDataSet = {
51
48
  previewDataSetId: string;
@@ -333,12 +330,7 @@ export declare namespace VizzlyComponents {
333
330
  type CallbackError = null;
334
331
  export type loadQueryEngineConfigCallback = loadQueryEngineConfigCallbackImported;
335
332
  export type loadDataSetsCallback = loadDataSetsCallbackImported;
336
- export type runQueriesCallback = (queries: Component.Attributes | AdditionalFilter | QueryAttributes[] | [PreparedQuery], params: {
337
- dataSets: DataSet[];
338
- abortSignal?: AbortSignal;
339
- dataAccessToken?: string;
340
- filterConfig?: FilterConfig;
341
- }) => Promise<(Result | null)[] | Array<Result['content'] | null> | CallbackError>;
333
+ export type runQueriesCallback = runQueriesCallbackImported;
342
334
  export type runQueriesCallbackInternal = (queries: Component.Attributes | AdditionalFilter | Array<QueryAttributes> | [PreparedQuery], abortSignal?: AbortSignal, filterConfig?: FilterConfig) => Promise<Result[] | CallbackError>;
343
335
  export type identityCallback = identityCallbackImported;
344
336
  export type loadDataCallback = loadDataCallbackImported;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@vizzly/dashboard",
3
3
  "author": "james@vizzly.co",
4
- "version": "0.12.7",
4
+ "version": "0.12.8",
5
5
  "source": "src/index.tsx",
6
6
  "types": "./dist/dashboard/src/index.d.ts",
7
7
  "main": "dist/index.js",
@@ -50,14 +50,14 @@
50
50
  "lodash-es": "^4.17.21",
51
51
  "react-dates-17": "22.0.8",
52
52
  "react-dnd": "^15.1",
53
- "react-dnd-html5-backend": "^15.0.1",
53
+ "@vizzly/dnd-backend": "0.0.3-alpha.1",
54
54
  "react-popper": "^2.3.0",
55
55
  "react-visibility-sensor": "^5.1.1",
56
56
  "topojson-client": "^3.1.0",
57
57
  "twin.macro": "^3.0.0-rc.3",
58
58
  "uuid": "^9.0.0",
59
59
  "@vizzly/semantic-layer-public": "^0.0.76",
60
- "@vizzly/sqlbuilder-public": "0.0.77"
60
+ "@vizzly/sqlbuilder-public": "0.0.79"
61
61
  },
62
62
  "devDependencies": {
63
63
  "@babel/core": "^7.19.3",
@@ -1,6 +0,0 @@
1
- import { TimeRangeOptions } from '../../shared-logic/src/AdditionalFilter/types';
2
- import { SessionSuccessProvidedValues } from './contexts/SessionContext/useSessionContext';
3
- import { DashboardProps } from './types';
4
- import { StudioProps } from '../../shared-ui/src/components/Studio/StudioContexts';
5
- declare const getRunQueriesCallback: (props: DashboardProps, session: SessionSuccessProvidedValues, timeRangeOptions: TimeRangeOptions) => StudioProps['runQueriesCallback'];
6
- export default getRunQueriesCallback;
@@ -1 +0,0 @@
1
- import '@testing-library/jest-dom/extend-expect';
@@ -1,3 +0,0 @@
1
- import { FunctionComponent } from 'react';
2
- declare const TestComponent: FunctionComponent;
3
- export default TestComponent;