@dashboard-designer/ui 0.2.3 → 0.2.5

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/dist/index.d.ts CHANGED
@@ -1,10 +1,8 @@
1
- import * as React from 'react';
2
- import React__default, { ReactNode } from 'react';
3
- import { Dashboard, VariableValue, Widget, DashboardVariable, AuthConfig, User, EmbedTokenRequest, EmbedTokenResponse, ConnectionConfig, ExecuteQueryRequest, QueryResult, ProcedureParameter, DashboardAclEntry, DashboardPermission, DashboardVersionMeta, DashboardVersion, FilterDef, WidgetType } from '@dashboard-designer/core';
4
- export { AuthConfig, ConnectionConfig, DASHBOARD_FILE_FORMAT, DASHBOARD_FILE_VERSION, Dashboard, DashboardVariable, FilterDef, VariableValue, Widget, buildDashboardExportFile, cloneDashboardForImport, parseDashboardImport } from '@dashboard-designer/core';
1
+ import { Dashboard, VariableValue, Widget, DashboardVariable, DashboardPrintHeader, AuthConfig, User, EmbedTokenRequest, EmbedTokenResponse, ConnectionConfig, ExecuteQueryRequest, QueryResult, ProcedureParameter, DashboardAclEntry, DashboardPermission, DashboardVersionMeta, DashboardVersion, FilterDef, WidgetType } from '@dashboard-designer/core';
2
+ export { AuthConfig, ConnectionConfig, DASHBOARD_FILE_FORMAT, DASHBOARD_FILE_VERSION, Dashboard, DashboardPrintHeader, DashboardPrintSettings, DashboardVariable, FilterDef, VariableValue, Widget, buildDashboardExportFile, cloneDashboardForImport, parseDashboardImport } from '@dashboard-designer/core';
3
+ import React, { ReactNode } from 'react';
5
4
  import * as i18next from 'i18next';
6
5
  export { default as i18n } from 'i18next';
7
- import * as lucide_react from 'lucide-react';
8
6
  import { LucideIcon } from 'lucide-react';
9
7
 
10
8
  interface DashboardToolbarContext {
@@ -45,7 +43,7 @@ interface ChartDataRowActionContext {
45
43
  interface ChartDataRowAction {
46
44
  id: string;
47
45
  label: string;
48
- icon: React__default.ReactNode;
46
+ icon: React.ReactNode;
49
47
  onClick: (context: ChartDataRowActionContext) => void | Promise<void>;
50
48
  isVisible?: (context: ChartDataRowActionContext) => boolean;
51
49
  }
@@ -64,6 +62,7 @@ interface DashboardVariableProps {
64
62
 
65
63
  interface DashboardDesignerProps extends DashboardVariableProps, ChartDataActionProps, DashboardToolbarProps {
66
64
  dashboard?: Dashboard;
65
+ printHeader?: DashboardPrintHeader;
67
66
  apiBaseUrl: string;
68
67
  auth: AuthConfig;
69
68
  locale?: string;
@@ -73,16 +72,17 @@ interface DashboardDesignerProps extends DashboardVariableProps, ChartDataAction
73
72
  /** When set, shows Edit / Done in the dashboard toolbar. */
74
73
  onToggleEdit?: () => void;
75
74
  }
76
- declare function DashboardDesigner({ dashboard: initial, apiBaseUrl, auth, locale, onChange, onSave, readOnly, onToggleEdit, predefinedVariables, variableValues, variablesReady, resolveVariables, chartDataRowActions, toolbarButtons, hideToolbar, toolbarVisibility, }: DashboardDesignerProps): React__default.JSX.Element;
75
+ declare function DashboardDesigner({ dashboard: initial, printHeader, apiBaseUrl, auth, locale, onChange, onSave, readOnly, onToggleEdit, predefinedVariables, variableValues, variablesReady, resolveVariables, chartDataRowActions, toolbarButtons, hideToolbar, toolbarVisibility, }: DashboardDesignerProps): React.JSX.Element;
77
76
 
78
77
  interface DashboardViewerProps extends DashboardVariableProps, ChartDataActionProps, DashboardToolbarProps {
79
78
  dashboard: Dashboard;
79
+ printHeader?: DashboardPrintHeader;
80
80
  apiBaseUrl: string;
81
81
  auth: AuthConfig;
82
82
  locale?: string;
83
83
  }
84
84
  /** Read-only dashboard renderer for embeds / published views. */
85
- declare function DashboardViewer({ dashboard, apiBaseUrl, auth, locale, ...variables }: DashboardViewerProps): React__default.JSX.Element;
85
+ declare function DashboardViewer({ dashboard, apiBaseUrl, auth, locale, ...variables }: DashboardViewerProps): React.JSX.Element;
86
86
 
87
87
  declare class DashboardApiClient {
88
88
  apiBaseUrl: string;
@@ -100,6 +100,13 @@ declare class DashboardApiClient {
100
100
  createEmbedToken(body: EmbedTokenRequest): Promise<EmbedTokenResponse>;
101
101
  listConnections(): Promise<{
102
102
  connections: ConnectionConfig[];
103
+ connectionVariables?: Record<string, string>;
104
+ }>;
105
+ listConnectionSources(): Promise<{
106
+ connections: ConnectionConfig[];
107
+ }>;
108
+ createConnectionVariable(name: string, connectionId: string): Promise<{
109
+ ok: boolean;
103
110
  }>;
104
111
  saveConnection(connection: ConnectionConfig): Promise<{
105
112
  connection: ConnectionConfig;
@@ -217,7 +224,7 @@ interface ChartRendererProps {
217
224
  listboxSelection?: Array<string | number>;
218
225
  onListboxSelectionChange?: (values: Array<string | number>) => void;
219
226
  }
220
- declare function ChartRenderer({ widget, data, locale, currency, loading, onDrillDown, onDataClick, listboxSelection, onListboxSelectionChange, chartColors, }: ChartRendererProps): React__default.JSX.Element;
227
+ declare function ChartRenderer({ widget, data, locale, currency, loading, onDrillDown, onDataClick, listboxSelection, onListboxSelectionChange, chartColors, }: ChartRendererProps): React.JSX.Element;
221
228
 
222
229
  interface FilterBarProps {
223
230
  clearable?: boolean;
@@ -237,7 +244,7 @@ interface FilterBarProps {
237
244
  /** Applied to newly added filters (where = row-level, having = aggregated). */
238
245
  defaultClause?: 'where' | 'having';
239
246
  }
240
- declare function FilterBar({ filters, suggestionRows, clearable, onChange, title, hint, editable, fieldOptions, fieldPlaceholder, fieldEmptyLabel, fieldDisabled, hideHeader, defaultClause, }: FilterBarProps): React__default.JSX.Element;
247
+ declare function FilterBar({ filters, suggestionRows, clearable, onChange, title, hint, editable, fieldOptions, fieldPlaceholder, fieldEmptyLabel, fieldDisabled, hideHeader, defaultClause, }: FilterBarProps): React.JSX.Element;
241
248
 
242
249
  declare function ensureI18n(locale?: string): i18next.i18n;
243
250
 
@@ -251,7 +258,7 @@ interface SearchableSelectProps {
251
258
  disabled?: boolean;
252
259
  emptyLabel?: string;
253
260
  }
254
- declare function SearchableSelect({ id, options, value, onChange, placeholder, multiple, disabled, emptyLabel, }: SearchableSelectProps): React__default.JSX.Element;
261
+ declare function SearchableSelect({ id, options, value, onChange, placeholder, multiple, disabled, emptyLabel, }: SearchableSelectProps): React.JSX.Element;
255
262
 
256
263
  interface FieldHelpProps {
257
264
  /** Help text shown in the tooltip. */
@@ -260,25 +267,25 @@ interface FieldHelpProps {
260
267
  label?: string;
261
268
  }
262
269
  /** Compact help icon with a portal tooltip that stays fully on-screen. */
263
- declare function FieldHelp({ text, label }: FieldHelpProps): React__default.JSX.Element | null;
270
+ declare function FieldHelp({ text, label }: FieldHelpProps): React.JSX.Element | null;
264
271
  interface FieldLabelProps {
265
272
  htmlFor?: string;
266
- children: React__default.ReactNode;
273
+ children: React.ReactNode;
267
274
  /** Help / usage description for this field. */
268
275
  help?: string;
269
276
  className?: string;
270
277
  }
271
278
  /** Field label with an optional inline help icon. */
272
- declare function FieldLabel({ htmlFor, children, help, className }: FieldLabelProps): React__default.JSX.Element;
279
+ declare function FieldLabel({ htmlFor, children, help, className }: FieldLabelProps): React.JSX.Element;
273
280
 
274
281
  declare const ICON_SIZE = 16;
275
282
  declare const chartTypeIcon: Record<WidgetType, LucideIcon>;
276
283
  declare const navIcon: {
277
- readonly dashboards: React.ForwardRefExoticComponent<Omit<lucide_react.LucideProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
278
- readonly designer: React.ForwardRefExoticComponent<Omit<lucide_react.LucideProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
279
- readonly viewer: React.ForwardRefExoticComponent<Omit<lucide_react.LucideProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
280
- readonly connections: React.ForwardRefExoticComponent<Omit<lucide_react.LucideProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
281
- readonly users: React.ForwardRefExoticComponent<Omit<lucide_react.LucideProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
284
+ readonly dashboards: LucideIcon;
285
+ readonly designer: LucideIcon;
286
+ readonly viewer: LucideIcon;
287
+ readonly connections: LucideIcon;
288
+ readonly users: LucideIcon;
282
289
  };
283
290
 
284
291
  /** Download the dashboard definition as a JSON file. */