@databrainhq/plugin 0.10.22 → 0.10.99

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 (31) hide show
  1. package/README.md +159 -8
  2. package/dist/components/Chart/SingleValueChart.d.ts +6 -1
  3. package/dist/components/ChartPopup/components/UnderlyingData/index.d.ts +3 -2
  4. package/dist/components/ChartPopup/index.d.ts +4 -3
  5. package/dist/components/DrillBreadCrumb/index.d.ts +2 -1
  6. package/dist/components/GlobalFilters/NumberFilterField.d.ts +4 -4
  7. package/dist/components/Icons/index.d.ts +1 -1
  8. package/dist/components/InternetFailure/index.d.ts +2 -0
  9. package/dist/components/MetricFilterDropDown/index.d.ts +1 -1
  10. package/dist/components/MetricList/components/FullScreenView/AddMetricFilter.d.ts +8 -0
  11. package/dist/components/Select/index.d.ts +2 -0
  12. package/dist/consts/app.d.ts +4 -0
  13. package/dist/containers/Dashboard/Dashboard.d.ts +14 -4
  14. package/dist/containers/Dashboard/EmbededDashboard.d.ts +0 -1
  15. package/dist/containers/Metric/EmbeddedMetric.d.ts +3 -1
  16. package/dist/containers/Metric/index.d.ts +20 -3
  17. package/dist/hooks/useDashboardContext.d.ts +2 -0
  18. package/dist/hooks/useEmbeddedDashboard.d.ts +1 -0
  19. package/dist/hooks/useMetricCard.d.ts +6 -3
  20. package/dist/hooks/useUnderlyingData.d.ts +4 -3
  21. package/dist/index.es.js +28343 -27576
  22. package/dist/index.umd.js +167 -163
  23. package/dist/style.css +1 -1
  24. package/dist/types/app.d.ts +9 -3
  25. package/dist/utils/checkIsOnline.d.ts +2 -0
  26. package/dist/utils/generated/graphql.d.ts +7 -6
  27. package/dist/webcomponents.d.ts +16 -0
  28. package/dist/webcomponents.es.js +93086 -0
  29. package/dist/webcomponents.umd.js +1861 -0
  30. package/package.json +29 -16
  31. package/src/index.ts +7 -0
@@ -68,6 +68,7 @@ export type CustomSettings = {
68
68
  comparisonTimeGrain?: string;
69
69
  comparisonTableName?: string;
70
70
  comparisonValueFontSize?: number;
71
+ comparisonSuffix?: string;
71
72
  subHeaderFontSize?: number;
72
73
  dateFormatter?: string;
73
74
  numberFormatter?: string;
@@ -75,6 +76,7 @@ export type CustomSettings = {
75
76
  showFullStacked?: boolean;
76
77
  showConversionRate?: boolean;
77
78
  labelFormat?: string;
79
+ isShowTrendLine?: boolean;
78
80
  };
79
81
  export type TableSettings = {
80
82
  contentAlignment?: string;
@@ -138,7 +140,10 @@ export type ChartSettingsType = {
138
140
  backGroundColor?: BackgroundSettings;
139
141
  timeSeriesSettings?: TimeSeriesSettingsType;
140
142
  isMultiDimension?: boolean;
143
+ isDynamicSeries?: boolean;
141
144
  seriesField?: string;
145
+ metricFilterPosition?: string;
146
+ seriesOptions?: string[];
142
147
  };
143
148
  export type SelectedColumns = {
144
149
  column: string;
@@ -250,11 +255,12 @@ export type MetricData = {
250
255
  createdBy: string;
251
256
  dateCreated: string;
252
257
  };
253
- export type GetUnderlyingData = ({ columnName, value, setData, setLoading, }: {
254
- columnName: string;
255
- value: any;
258
+ export type GetUnderlyingData = ({ columnName, value, setData, setLoading, isSingleValueChart, }: {
259
+ columnName: string | undefined;
260
+ value: any | undefined;
256
261
  setData: React.Dispatch<React.SetStateAction<any[]>>;
257
262
  setLoading: React.Dispatch<React.SetStateAction<boolean>>;
263
+ isSingleValueChart: boolean;
258
264
  }) => void;
259
265
  export type ConditionalFormattingParam = {
260
266
  value: any;
@@ -0,0 +1,2 @@
1
+ declare const checkIsOnline: () => Promise<boolean>;
2
+ export default checkIsOnline;
@@ -147,11 +147,11 @@ export type GenerateExternalMetricQueryOutput = {
147
147
  query: Scalars['String'];
148
148
  };
149
149
  export type GetUnderlyingDataInput = {
150
- columnName: Scalars['String'];
150
+ columnName?: InputMaybe<Scalars['String']>;
151
151
  companyId: Scalars['String'];
152
152
  metricId?: InputMaybe<Scalars['String']>;
153
153
  query: Scalars['String'];
154
- value: Scalars['json'];
154
+ value?: InputMaybe<Scalars['json']>;
155
155
  workspaceId: Scalars['String'];
156
156
  };
157
157
  export type GetUnderlyingDataOutput = {
@@ -3586,6 +3586,7 @@ export type GenerateDatasetMetricsMutation = {
3586
3586
  error?: any | null;
3587
3587
  query?: string | null;
3588
3588
  result?: any | null;
3589
+ timeTaken?: number | null;
3589
3590
  } | null;
3590
3591
  };
3591
3592
  export type GenerateEmbeddedMeticMutationVariables = Exact<{
@@ -3716,6 +3717,7 @@ export type GetExternalDashboardIdQuery = {
3716
3717
  externalDashboards: Array<{
3717
3718
  __typename?: 'externalDashboards';
3718
3719
  id: any;
3720
+ name: string;
3719
3721
  filters: any;
3720
3722
  layout: any;
3721
3723
  }>;
@@ -3973,7 +3975,6 @@ export type QueryExternalMetricQuery = {
3973
3975
  __typename?: 'ExternalMetricQueryOutput';
3974
3976
  data?: any | null;
3975
3977
  timeTaken?: number | null;
3976
- comparisonValue?: any | null;
3977
3978
  totalRecords?: number | null;
3978
3979
  } | null;
3979
3980
  };
@@ -4190,7 +4191,7 @@ export declare const useFetchColumnDataMutation: <TError = unknown, TContext = u
4190
4191
  integrationId?: InputMaybe<string> | undefined;
4191
4192
  integrationName?: InputMaybe<string> | undefined;
4192
4193
  }>, TContext>;
4193
- export declare const GenerateDatasetMetricsDocument = "\n mutation GenerateDatasetMetrics($userInputs: json = \"\", $integrationName: String = \"\", $integrationId: String = \"\") {\n generateDatasetMetrics(\n input: {userInputs: $userInputs, integrationName: $integrationName, integrationId: $integrationId}\n ) {\n error\n query\n result\n }\n}\n ";
4194
+ export declare const GenerateDatasetMetricsDocument = "\n mutation GenerateDatasetMetrics($userInputs: json = \"\", $integrationName: String = \"\", $integrationId: String = \"\") {\n generateDatasetMetrics(\n input: {userInputs: $userInputs, integrationName: $integrationName, integrationId: $integrationId}\n ) {\n error\n query\n result\n timeTaken\n }\n}\n ";
4194
4195
  export declare const useGenerateDatasetMetricsMutation: <TError = unknown, TContext = unknown>(options?: UseMutationOptions<GenerateDatasetMetricsMutation, TError, Exact<{
4195
4196
  userInputs?: InputMaybe<Scalars['json']>;
4196
4197
  integrationName?: InputMaybe<string> | undefined;
@@ -4228,7 +4229,7 @@ export declare const EmbeddedDashboardMetricsDocument = "\n query EmbeddedDas
4228
4229
  export declare const useEmbeddedDashboardMetricsQuery: <TData = EmbeddedDashboardMetricsQuery, TError = unknown>(variables?: EmbeddedDashboardMetricsQueryVariables, options?: UseQueryOptions<EmbeddedDashboardMetricsQuery, TError, TData, import("react-query").QueryKey> | undefined) => import("react-query").UseQueryResult<TData, TError>;
4229
4230
  export declare const GetExternalDashboardClientThemeDocument = "\n query GetExternalDashboardClientTheme($companyId: uuid!, $clientId: String!) {\n externalDashboardThemes(\n where: {companyId: {_eq: $companyId}, externalDashboardThemeClients: {clientId: {_eq: $clientId}}}\n limit: 1\n ) {\n colors\n createdAt\n id\n name\n }\n}\n ";
4230
4231
  export declare const useGetExternalDashboardClientThemeQuery: <TData = GetExternalDashboardClientThemeQuery, TError = unknown>(variables: GetExternalDashboardClientThemeQueryVariables, options?: UseQueryOptions<GetExternalDashboardClientThemeQuery, TError, TData, import("react-query").QueryKey> | undefined) => import("react-query").UseQueryResult<TData, TError>;
4231
- export declare const GetExternalDashboardIdDocument = "\n query GetExternalDashboardId($externalDashboardId: String = \"\") {\n externalDashboards(where: {externalDashboardId: {_eq: $externalDashboardId}}) {\n id\n filters\n layout\n }\n}\n ";
4232
+ export declare const GetExternalDashboardIdDocument = "\n query GetExternalDashboardId($externalDashboardId: String = \"\") {\n externalDashboards(where: {externalDashboardId: {_eq: $externalDashboardId}}) {\n id\n name\n filters\n layout\n }\n}\n ";
4232
4233
  export declare const useGetExternalDashboardIdQuery: <TData = GetExternalDashboardIdQuery, TError = unknown>(variables?: GetExternalDashboardIdQueryVariables, options?: UseQueryOptions<GetExternalDashboardIdQuery, TError, TData, import("react-query").QueryKey> | undefined) => import("react-query").UseQueryResult<TData, TError>;
4233
4234
  export declare const GetExternalDashboardLayoutDocument = "\n query GetExternalDashboardLayout($clientId: String!, $externalDashboardId: uuid!) {\n clientDashboardLayout_by_pk(\n clientId: $clientId\n externalDashboardId: $externalDashboardId\n ) {\n clientId\n externalDashboardId\n layout\n isLocked\n }\n}\n ";
4234
4235
  export declare const useGetExternalDashboardLayoutQuery: <TData = GetExternalDashboardLayoutQuery, TError = unknown>(variables: GetExternalDashboardLayoutQueryVariables, options?: UseQueryOptions<GetExternalDashboardLayoutQuery, TError, TData, import("react-query").QueryKey> | undefined) => import("react-query").UseQueryResult<TData, TError>;
@@ -4358,7 +4359,7 @@ export declare const usePreviewTableMutation: <TError = unknown, TContext = unkn
4358
4359
  integrationId?: InputMaybe<string> | undefined;
4359
4360
  integrationName?: InputMaybe<string> | undefined;
4360
4361
  }>, TContext>;
4361
- export declare const QueryExternalMetricDocument = "\n query QueryExternalMetric($id: String = \"\", $clientId: String = \"\", $globalFilters: json = \"\", $rlsConditions: json = [], $filterValues: json = \"\", $tenancyLevel: String = \"\", $drillFilters: json = [], $limit: Int, $offset: Int) {\n externalMetricQuery(\n input: {externalMetricId: $id, clientId: $clientId, globalFilters: $globalFilters, rlsConditions: $rlsConditions, filterValues: $filterValues, tenancyLevel: $tenancyLevel, drillFilters: $drillFilters, limit: $limit, offset: $offset}\n ) {\n data\n timeTaken\n comparisonValue\n totalRecords\n }\n}\n ";
4362
+ export declare const QueryExternalMetricDocument = "\n query QueryExternalMetric($id: String = \"\", $clientId: String = \"\", $globalFilters: json = \"\", $rlsConditions: json = [], $filterValues: json = \"\", $tenancyLevel: String = \"\", $drillFilters: json = [], $limit: Int, $offset: Int) {\n externalMetricQuery(\n input: {externalMetricId: $id, clientId: $clientId, globalFilters: $globalFilters, rlsConditions: $rlsConditions, filterValues: $filterValues, tenancyLevel: $tenancyLevel, drillFilters: $drillFilters, limit: $limit, offset: $offset}\n ) {\n data\n timeTaken\n totalRecords\n }\n}\n ";
4362
4363
  export declare const useQueryExternalMetricQuery: <TData = QueryExternalMetricQuery, TError = unknown>(variables?: QueryExternalMetricQueryVariables, options?: UseQueryOptions<QueryExternalMetricQuery, TError, TData, import("react-query").QueryKey> | undefined) => import("react-query").UseQueryResult<TData, TError>;
4363
4364
  export declare const RawCsvDocument = "\n mutation RawCsv($companyId: String = \"\", $recipientAddress: String = \"\", $sqlQuery: String = \"\", $metricName: String = \"\", $workspaceId: String = \"\") {\n sendRawCsv(\n input: {companyId: $companyId, recipientAddress: $recipientAddress, sqlQuery: $sqlQuery, metricName: $metricName, workspaceId: $workspaceId}\n ) {\n status\n error {\n message\n }\n }\n}\n ";
4364
4365
  export declare const useRawCsvMutation: <TError = unknown, TContext = unknown>(options?: UseMutationOptions<RawCsvMutation, TError, Exact<{
@@ -0,0 +1,16 @@
1
+ /// <reference types="react" />
2
+ import { DashboardProps } from './containers/Dashboard';
3
+ import { MetricProps } from './containers/Metric';
4
+ declare global {
5
+ namespace JSX {
6
+ interface CustomElements extends IntrinsicElements {
7
+ Tag: any;
8
+ 'dbn-dashboard': DashboardProps;
9
+ 'dbn-metric': MetricProps;
10
+ }
11
+ }
12
+ export interface DbnElements extends HTMLElement {
13
+ 'dbn-dashboard': DashboardProps;
14
+ 'dbn-metric': MetricProps;
15
+ }
16
+ }