@tenorlab/react-dashboard 1.6.5 → 1.6.7
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/core.d.ts +591 -0
- package/dist/core.es.js +526 -0
- package/dist/react-dashboard.d.ts +719 -0
- package/dist/react-dashboard.es.js +3261 -0
- package/dist/styles.css +1 -0
- package/package.json +2 -2
|
@@ -0,0 +1,719 @@
|
|
|
1
|
+
import { CSSProperties } from 'react';
|
|
2
|
+
import { default as default_2 } from 'react';
|
|
3
|
+
import { ForwardRefExoticComponent } from 'react';
|
|
4
|
+
import { JSX } from 'react';
|
|
5
|
+
import { JSX as JSX_2 } from 'react/jsx-runtime';
|
|
6
|
+
import { ReactNode } from 'react';
|
|
7
|
+
import { RefAttributes } from 'react';
|
|
8
|
+
import { StoreApi } from 'zustand';
|
|
9
|
+
import { UseBoundStore } from 'zustand';
|
|
10
|
+
|
|
11
|
+
export declare const AddIcon: typeof PlusCircleIcon;
|
|
12
|
+
|
|
13
|
+
export declare function Button(props: IButtonProps): JSX_2.Element;
|
|
14
|
+
|
|
15
|
+
export declare function ChevronDownIcon({ className, style }: TIconProps): JSX_2.Element;
|
|
16
|
+
|
|
17
|
+
export declare function CircleQuestionMark({ className, style }: TIconProps): JSX_2.Element;
|
|
18
|
+
|
|
19
|
+
export declare function CrosshairIcon({ className, style }: TIconProps): JSX_2.Element;
|
|
20
|
+
|
|
21
|
+
export declare const DashboardGrid: ForwardRefExoticComponent<IDashboardGridProps & RefAttributes<HTMLDivElement>>;
|
|
22
|
+
|
|
23
|
+
export declare const DashboardWidgetBase: (props: IDashboardWidgetProps & {
|
|
24
|
+
ref?: React.ForwardedRef<HTMLDivElement>;
|
|
25
|
+
}) => React.ReactElement | null;
|
|
26
|
+
|
|
27
|
+
export declare function DeleteIcon({ className, style }: TIconProps): JSX_2.Element;
|
|
28
|
+
|
|
29
|
+
export declare const DraggablePanel: ForwardRefExoticComponent<DraggablePanelProps & RefAttributes<HTMLDivElement>>;
|
|
30
|
+
|
|
31
|
+
declare type DraggablePanelProps = {
|
|
32
|
+
testId?: string;
|
|
33
|
+
className: string;
|
|
34
|
+
style?: CSSProperties;
|
|
35
|
+
zIndex?: number;
|
|
36
|
+
onDraggingChange?: (isDragging: boolean) => void;
|
|
37
|
+
children: React.ReactNode;
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
export declare const Dropdown: default_2.FC<TProps>;
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Component to safely load and render dynamic widgets.
|
|
44
|
+
* This ensures the widget component (and its hooks) is called consistently.
|
|
45
|
+
* @param {object} props
|
|
46
|
+
* @param {string} props.widgetKey
|
|
47
|
+
* @param {(key: string) => Promise<void>} props.onRemoveClick
|
|
48
|
+
*/
|
|
49
|
+
export declare function DynamicWidgetLoader({ index, maxIndex, widgetKey, parentWidgetKey, targetContainerKey, childWidgetsConfig, savedProps, widgetCatalog, isEditing, extraProps, onRemoveClick, onMoveClick, selectContainer, savedPropsChanged, }: TDynamicWidgetLoaderProps): JSX_2.Element;
|
|
50
|
+
|
|
51
|
+
export declare function EditIcon({ className, style }: TIconProps): JSX_2.Element;
|
|
52
|
+
|
|
53
|
+
export declare function GridIcon({ className, style }: TIconProps): JSX_2.Element;
|
|
54
|
+
|
|
55
|
+
export declare function HandGrabIcon({ className, style }: TIconProps): JSX_2.Element;
|
|
56
|
+
|
|
57
|
+
export declare function HandIcon({ className, style }: TIconProps): JSX_2.Element;
|
|
58
|
+
|
|
59
|
+
export declare interface IButtonProps {
|
|
60
|
+
disabled?: boolean;
|
|
61
|
+
className?: string;
|
|
62
|
+
tooltip?: ITooltipProps;
|
|
63
|
+
isIconButton?: boolean;
|
|
64
|
+
buttonType?: TButtonType;
|
|
65
|
+
category?: string;
|
|
66
|
+
font?: string;
|
|
67
|
+
border?: number;
|
|
68
|
+
borderHover?: number;
|
|
69
|
+
borderColor?: string;
|
|
70
|
+
px?: number;
|
|
71
|
+
py?: number;
|
|
72
|
+
justifyCss?: TButtonJustifyCss;
|
|
73
|
+
shadow?: string;
|
|
74
|
+
shadowHover?: string;
|
|
75
|
+
addCss?: string;
|
|
76
|
+
onClick: (ev?: any) => any;
|
|
77
|
+
children: React.ReactNode;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export declare interface IButtonProps {
|
|
81
|
+
disabled?: boolean;
|
|
82
|
+
className?: string;
|
|
83
|
+
tooltip?: ITooltipProps;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* @name IChildWidgetConfigEntry
|
|
88
|
+
* @description Interface for a child widget configuration entry
|
|
89
|
+
* @remarks Used in IDashboardConfig
|
|
90
|
+
* @see IDashboardConfig
|
|
91
|
+
*/
|
|
92
|
+
export declare interface IChildWidgetConfigEntry {
|
|
93
|
+
parentWidgetKey: TDashboardWidgetKey;
|
|
94
|
+
widgetKey: TDashboardWidgetKey;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* @name IDashboardConfig
|
|
99
|
+
* @description Interface for the dashboard configuration
|
|
100
|
+
* @remarks Used to store the dashboard state
|
|
101
|
+
* @see IChildWidgetConfigEntry
|
|
102
|
+
* @see IDashboardSettingEntry
|
|
103
|
+
*/
|
|
104
|
+
export declare interface IDashboardConfig {
|
|
105
|
+
userID: number | string;
|
|
106
|
+
clientAppKey: string;
|
|
107
|
+
dashboardId: string;
|
|
108
|
+
dashboardName: string;
|
|
109
|
+
zoomScale: number;
|
|
110
|
+
responsiveGrid: boolean;
|
|
111
|
+
widgets: TDashboardWidgetKey[];
|
|
112
|
+
childWidgetsConfig: IChildWidgetConfigEntry[];
|
|
113
|
+
savedProps?: IWidgetSavedProps[];
|
|
114
|
+
cssSettings: IDashboardSettingEntry[];
|
|
115
|
+
_version?: number;
|
|
116
|
+
_stateDescription?: string;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* @name IDashboardGridProps
|
|
121
|
+
* @description Dashboard grid properties interface specific to React framework.
|
|
122
|
+
* This interface extends the base dashboard grid properties interface with optional children.
|
|
123
|
+
*/
|
|
124
|
+
export declare interface IDashboardGridProps extends IDashboardGridPropsBase {
|
|
125
|
+
children?: ReactNode;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* @name IDashboardGridPropsBase
|
|
130
|
+
* @description Base interface for dashboard grid props passed to widgets.
|
|
131
|
+
* @remarks
|
|
132
|
+
* - `zoomScale` represents a uniform zoom applied to the dashboard UI. Default
|
|
133
|
+
* behavior in the runtime clamps this value to a minimum of `0.7` and default
|
|
134
|
+
* is `1` when not explicitly set.
|
|
135
|
+
* - `responsiveGrid` toggles responsive layout behaviors vs fixed grid sizing.
|
|
136
|
+
*/
|
|
137
|
+
export declare interface IDashboardGridPropsBase {
|
|
138
|
+
isEditing: boolean;
|
|
139
|
+
zoomScale: number;
|
|
140
|
+
responsiveGrid: boolean;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
/**
|
|
144
|
+
* @name IDashboardSettingEntry
|
|
145
|
+
* @description Interface for a dashboard setting entry
|
|
146
|
+
* @see cssSettingsCatalog in dashboard-settings.ts
|
|
147
|
+
*/
|
|
148
|
+
export declare interface IDashboardSettingEntry {
|
|
149
|
+
key: string;
|
|
150
|
+
name: string;
|
|
151
|
+
description: string;
|
|
152
|
+
cssProperty: string;
|
|
153
|
+
step: number;
|
|
154
|
+
defaultUnit: string;
|
|
155
|
+
minValue: number;
|
|
156
|
+
defaultValue: string;
|
|
157
|
+
value: string;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
/**
|
|
161
|
+
* @name IDashboardStorageService
|
|
162
|
+
* @description Interface for the dashboard storage service
|
|
163
|
+
* @remarks Used to define the storage service methods
|
|
164
|
+
* @see TGetSavedDashboards
|
|
165
|
+
* @see TSaveDashboards
|
|
166
|
+
* @see IDashboardConfig
|
|
167
|
+
*/
|
|
168
|
+
export declare interface IDashboardStorageService {
|
|
169
|
+
getSavedDashboards: TGetSavedDashboards;
|
|
170
|
+
saveDashboards: TSaveDashboards;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
/**
|
|
174
|
+
* @name IDashboardWidget
|
|
175
|
+
* @description A type representing a React dashboard widget element.
|
|
176
|
+
* This type is defined as a JSX.Element.
|
|
177
|
+
*/
|
|
178
|
+
export declare interface IDashboardWidget extends JSX.Element {
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
/**
|
|
182
|
+
* @name IDashboardWidgetProps
|
|
183
|
+
* @description Dashboard widget properties interface specific to React framework.
|
|
184
|
+
* This interface extends the base dashboard widget properties interface with additional React-specific properties.
|
|
185
|
+
* @template TExtraProps - Additional properties specific to the widget.
|
|
186
|
+
*/
|
|
187
|
+
export declare interface IDashboardWidgetProps<TExtraProps = any> extends IDashboardWidgetPropsBase<TExtraProps> {
|
|
188
|
+
children?: ReactNode;
|
|
189
|
+
titleNode?: ReactNode;
|
|
190
|
+
titleRightNode?: ReactNode;
|
|
191
|
+
onRemoveClick?: (widgetKey: TDashboardWidgetKey, parentWidgetKey?: TDashboardWidgetKey) => void;
|
|
192
|
+
onMoveClick?: (direction: -1 | 1, widgetKey: TDashboardWidgetKey, parentWidgetKey?: TDashboardWidgetKey) => void;
|
|
193
|
+
selectContainer?: (containerKey?: TDashboardWidgetKey) => void;
|
|
194
|
+
savedPropsChanged?: (value: IWidgetSavedProps) => any;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
/**
|
|
198
|
+
* @name IDashboardWidgetPropsBase
|
|
199
|
+
* @description Props provided to every widget instance rendered by the dashboard.
|
|
200
|
+
* @template TExtraProps - Additional, widget-specific props supplied by the
|
|
201
|
+
* dashboard or integrator via the dynamic loader.
|
|
202
|
+
* @remarks
|
|
203
|
+
* - `index` and `maxIndex` indicate the widget's position and the current
|
|
204
|
+
* maximum index used for ordering (zero-based indexing is typical).
|
|
205
|
+
* - `widgetKey` is the stable `TDashboardWidgetKey` identifying the widget
|
|
206
|
+
* type; `parentWidgetKey` is set for nested/child widgets.
|
|
207
|
+
* - Boolean flags like `hideTitle`, `noShadow`, `noBorder`, `noPadding` are
|
|
208
|
+
* layout/presentation hints; default behavior should be documented by the
|
|
209
|
+
* concrete widget implementation.
|
|
210
|
+
* - `direction` applies to container widgets only.
|
|
211
|
+
* - `extraProps` is merged into the widget props by the `DynamicWidgetLoader`.
|
|
212
|
+
*/
|
|
213
|
+
export declare interface IDashboardWidgetPropsBase<TExtraProps = any> {
|
|
214
|
+
index: number;
|
|
215
|
+
maxIndex: number;
|
|
216
|
+
widgetKey: TDashboardWidgetKey;
|
|
217
|
+
parentWidgetKey?: TDashboardWidgetKey;
|
|
218
|
+
isEditing: boolean;
|
|
219
|
+
highlight?: boolean;
|
|
220
|
+
testId?: string;
|
|
221
|
+
title?: string;
|
|
222
|
+
size?: TWidgetSize;
|
|
223
|
+
borderCssClasses?: string;
|
|
224
|
+
backgroundCssClasses?: string;
|
|
225
|
+
addCssClasses?: string;
|
|
226
|
+
overrideCssClasses?: string;
|
|
227
|
+
tags?: string[];
|
|
228
|
+
hideTitle?: boolean;
|
|
229
|
+
noShadow?: boolean;
|
|
230
|
+
noBorder?: boolean;
|
|
231
|
+
noPadding?: boolean;
|
|
232
|
+
noCollapse?: boolean;
|
|
233
|
+
direction?: TWidgetDirection;
|
|
234
|
+
widgetSavedProps?: IWidgetSavedProps;
|
|
235
|
+
meta?: TWidgetMetaInfoBase;
|
|
236
|
+
extraProps?: TExtraProps;
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
/**
|
|
240
|
+
* @name IDynamicWidgetCatalogEntry
|
|
241
|
+
* @description Dynamic widget catalog entry interface specific to React framework.
|
|
242
|
+
* This interface extends the base dynamic widget catalog entry interface with React-specific element and component types.
|
|
243
|
+
* @template TFrameworkElementType - The React element type.
|
|
244
|
+
* @template TFrameworkComponentType - The React component type.
|
|
245
|
+
*/
|
|
246
|
+
export declare interface IDynamicWidgetCatalogEntry extends IDynamicWidgetCatalogEntryBase<TFrameworkElementType, TFrameworkComponentType> {
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
/**
|
|
250
|
+
* @name IDynamicWidgetCatalogEntryBase
|
|
251
|
+
* @description Catalog entry describing how to create or load a widget.
|
|
252
|
+
* @template TFrameworkElementType - Framework-specific element type (icon, element)
|
|
253
|
+
* @template TFrameworkComponentType - Framework-specific component type
|
|
254
|
+
* @remarks
|
|
255
|
+
* - `key` must be unique and stable across versions because it is stored in
|
|
256
|
+
* saved dashboard configurations.
|
|
257
|
+
* - `title` is the display name for catalogs and selection UIs.
|
|
258
|
+
* - `isContainer` indicates a widget that can host children.
|
|
259
|
+
* - `isRemote` marks entries that are expected to be loaded remotely (CDN,
|
|
260
|
+
* external script) and may require extra loading/initialization steps.
|
|
261
|
+
* - `meta` contains presentation metadata (see `TWidgetMetaInfoBase`).
|
|
262
|
+
* - `component` is a direct component reference (preferred for static/core widgets).
|
|
263
|
+
* - `loader` is an async factory used for dynamic/plugin widgets. When both
|
|
264
|
+
* `component` and `loader` are provided, loaders are typically used for
|
|
265
|
+
* dynamic initialization; concrete loaders/components precedence should be
|
|
266
|
+
* defined by the integrator.
|
|
267
|
+
*/
|
|
268
|
+
export declare interface IDynamicWidgetCatalogEntryBase<TFrameworkElementType = any, TFrameworkComponentType = any> {
|
|
269
|
+
key: TDashboardWidgetKey;
|
|
270
|
+
title: string;
|
|
271
|
+
isContainer?: boolean;
|
|
272
|
+
isRemote?: boolean;
|
|
273
|
+
meta?: TWidgetMetaInfoBase<TFrameworkElementType>;
|
|
274
|
+
component?: TFrameworkComponentType;
|
|
275
|
+
loader?: TWidgetFactoryBase<TFrameworkComponentType>;
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
/**
|
|
279
|
+
* Compares two version strings (e.g., "19.2.0" and "19.2.3")
|
|
280
|
+
* Returns true if the widget version is compatible with the host.
|
|
281
|
+
* Logic: Host must be >= Widget version for major/minor.
|
|
282
|
+
*/
|
|
283
|
+
export declare const _isVersionCompatible: (hostVer: string, widgetVer: string) => boolean;
|
|
284
|
+
|
|
285
|
+
export declare interface ITextFieldProps {
|
|
286
|
+
label: string;
|
|
287
|
+
size?: TSize;
|
|
288
|
+
value: string;
|
|
289
|
+
className?: string;
|
|
290
|
+
placeholder?: string;
|
|
291
|
+
onChange: (event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
292
|
+
onKeyDown?: (event: React.KeyboardEvent<HTMLInputElement>) => void;
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
export declare interface ITooltipProps {
|
|
296
|
+
placement: string;
|
|
297
|
+
title: string;
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
export declare interface ITooltipProps {
|
|
301
|
+
placement: string;
|
|
302
|
+
title: string;
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
declare interface IWidgetSavedProps {
|
|
306
|
+
parentWidgetKey?: TDashboardWidgetKey;
|
|
307
|
+
widgetKey: TDashboardWidgetKey;
|
|
308
|
+
isCollapsed?: boolean;
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
export declare const ListItem: ForwardRefExoticComponent<TStackProps & {
|
|
312
|
+
innerClass?: string;
|
|
313
|
+
} & RefAttributes<HTMLDivElement>>;
|
|
314
|
+
|
|
315
|
+
export declare const ListItemLeftChild: ForwardRefExoticComponent<TListItemChildProps & RefAttributes<HTMLDivElement>>;
|
|
316
|
+
|
|
317
|
+
export declare const ListItemMiddleChild: ForwardRefExoticComponent<TListItemChildProps & RefAttributes<HTMLDivElement>>;
|
|
318
|
+
|
|
319
|
+
export declare const ListItemRightChild: ForwardRefExoticComponent<TListItemChildProps & RefAttributes<HTMLDivElement>>;
|
|
320
|
+
|
|
321
|
+
export declare function MinusCircleIcon({ className, style }: TIconProps): JSX_2.Element;
|
|
322
|
+
|
|
323
|
+
export declare function MonitorIcon({ className, style }: TIconProps): JSX_2.Element;
|
|
324
|
+
|
|
325
|
+
export declare function MonitorSmartphoneIcon({ className, style }: TIconProps): JSX_2.Element;
|
|
326
|
+
|
|
327
|
+
export declare function MoveLeftIcon({ className, style }: TIconProps): JSX_2.Element;
|
|
328
|
+
|
|
329
|
+
export declare function MoveRightIcon({ className, style }: TIconProps): JSX_2.Element;
|
|
330
|
+
|
|
331
|
+
export declare function PlusCircleIcon({ className, style }: TIconProps): JSX_2.Element;
|
|
332
|
+
|
|
333
|
+
export declare function RedoIcon({ className, style }: TIconProps): JSX_2.Element;
|
|
334
|
+
|
|
335
|
+
export declare function RenameIcon({ className, style }: TIconProps): JSX_2.Element;
|
|
336
|
+
|
|
337
|
+
export declare function SettingsIcon({ className, style }: TIconProps): JSX_2.Element;
|
|
338
|
+
|
|
339
|
+
export declare const showToast: (options: any) => void;
|
|
340
|
+
|
|
341
|
+
export declare function Stack(props: TStackProps): JSX_2.Element;
|
|
342
|
+
|
|
343
|
+
export declare function SvgBaseWrapper({ children, className, style, }: {
|
|
344
|
+
children: React.ReactNode;
|
|
345
|
+
className?: string;
|
|
346
|
+
style?: React.CSSProperties;
|
|
347
|
+
}): JSX_2.Element;
|
|
348
|
+
|
|
349
|
+
export declare function TabletSmartphoneIcon({ className, style }: TIconProps): JSX_2.Element;
|
|
350
|
+
|
|
351
|
+
/**
|
|
352
|
+
* @name TAddWidgetResponse
|
|
353
|
+
* @description Type for the response of the addWidget mutation
|
|
354
|
+
* @property {boolean} success - Indicates if the widget was added successfully
|
|
355
|
+
* @property {string} [message] - Optional message providing additional information
|
|
356
|
+
* @property {IDashboardConfig} updatedDashboardConfig - The updated dashboard configuration after adding the widget
|
|
357
|
+
* @property {IDashboardConfig[]} allUpdatedDashboardConfigs - All updated dashboard configurations
|
|
358
|
+
*/
|
|
359
|
+
declare type TAddWidgetResponse = {
|
|
360
|
+
success: boolean;
|
|
361
|
+
message?: string;
|
|
362
|
+
updatedDashboardConfig: IDashboardConfig;
|
|
363
|
+
allUpdatedDashboardConfigs: IDashboardConfig[];
|
|
364
|
+
};
|
|
365
|
+
|
|
366
|
+
export declare function TargetIcon({ className, style }: TIconProps): JSX_2.Element;
|
|
367
|
+
|
|
368
|
+
export declare type TButtonJustifyCss = 'justify-start' | 'justify-center' | 'justify-end';
|
|
369
|
+
|
|
370
|
+
export declare type TButtonType = 'normal' | 'ghost';
|
|
371
|
+
|
|
372
|
+
declare type TDashboardSlice = {
|
|
373
|
+
isLoading: boolean;
|
|
374
|
+
isEditing: boolean;
|
|
375
|
+
allDashboardConfigs: IDashboardConfig[];
|
|
376
|
+
currentDashboardConfig: IDashboardConfig;
|
|
377
|
+
targetContainerKey?: TDashboardWidgetKey | undefined;
|
|
378
|
+
getNextContainerKey: (containerWidgetKey: TDashboardWidgetKey) => TDashboardWidgetKey;
|
|
379
|
+
getCurrentDashboardConfig: () => IDashboardConfig;
|
|
380
|
+
getCurrentDashboardId: () => string;
|
|
381
|
+
getIsResponsive: () => boolean;
|
|
382
|
+
getTargetContainerKey: () => TDashboardWidgetKey | undefined;
|
|
383
|
+
setIsLoading: (value: boolean) => boolean;
|
|
384
|
+
setIsEditing: (value: boolean) => boolean;
|
|
385
|
+
setTargetContainerKey: (value: TDashboardWidgetKey | undefined) => TDashboardWidgetKey | undefined;
|
|
386
|
+
setAllDashboardConfigs: (value: IDashboardConfig[]) => IDashboardConfig[];
|
|
387
|
+
setCurrentDashboardConfig: (value: IDashboardConfig) => IDashboardConfig[];
|
|
388
|
+
addDashboardConfig: (value: IDashboardConfig) => IDashboardConfig[];
|
|
389
|
+
deleteDashboardConfigById: (value: string) => IDashboardConfig[];
|
|
390
|
+
selectDashboardById: (dashboardId: string) => IDashboardConfig | undefined;
|
|
391
|
+
addWidget: (params: {
|
|
392
|
+
widgetKey: TDashboardWidgetKey;
|
|
393
|
+
parentWidgetKey?: TDashboardWidgetKey;
|
|
394
|
+
noDuplicatedWidgets?: boolean;
|
|
395
|
+
}) => TAddWidgetResponse;
|
|
396
|
+
removeWidget: (widgetKey: TDashboardWidgetKey, parentWidgetKey?: TDashboardWidgetKey) => TRemoveWidgetResponse;
|
|
397
|
+
moveWidget: (direction: -1 | 1, widgetKey: TDashboardWidgetKey, parentWidgetKey?: TDashboardWidgetKey) => TRemoveWidgetResponse;
|
|
398
|
+
};
|
|
399
|
+
|
|
400
|
+
export declare type TDashboardUndoService = ReturnType<typeof useDashboardUndoService>;
|
|
401
|
+
|
|
402
|
+
/**
|
|
403
|
+
* @name TDashboardUndoStatus
|
|
404
|
+
* @description Type for the dashboard undo/redo status
|
|
405
|
+
* @remarks Used in dashboard undo/redo functionality
|
|
406
|
+
*/
|
|
407
|
+
export declare type TDashboardUndoStatus = {
|
|
408
|
+
isUndoDisabled: boolean;
|
|
409
|
+
isRedoDisabled: boolean;
|
|
410
|
+
_currentIndex?: number;
|
|
411
|
+
_historyLength?: number;
|
|
412
|
+
};
|
|
413
|
+
|
|
414
|
+
/**
|
|
415
|
+
* @name TDashboardWidgetCatalog
|
|
416
|
+
* @description Dashboard widget catalog type specific to React framework.
|
|
417
|
+
* This type extends the base dashboard widget catalog type with React-specific element and component types.
|
|
418
|
+
* @template TFrameworkElementType - The React element type.
|
|
419
|
+
* @template TFrameworkComponentType - The React component type.
|
|
420
|
+
*/
|
|
421
|
+
export declare type TDashboardWidgetCatalog = TDashboardWidgetCatalogBase<TFrameworkElementType, TFrameworkComponentType>;
|
|
422
|
+
|
|
423
|
+
/**
|
|
424
|
+
* @name TDashboardWidgetCatalogBase
|
|
425
|
+
* @description Map of available widgets used by the dashboard at runtime.
|
|
426
|
+
* @template TFrameworkElementType - Framework-specific element type
|
|
427
|
+
* @template TFrameworkComponentType - Framework-specific component type
|
|
428
|
+
* @remarks Keys are `TDashboardWidgetKey` and values are catalog entries. The
|
|
429
|
+
* map is typically treated as a read-only registry; replace the map to update
|
|
430
|
+
* the available widget set rather than mutating entries in-place.
|
|
431
|
+
*/
|
|
432
|
+
export declare type TDashboardWidgetCatalogBase<TFrameworkElementType = any, TFrameworkComponentType = any> = Map<TDashboardWidgetKey, IDynamicWidgetCatalogEntryBase<TFrameworkElementType, TFrameworkComponentType>>;
|
|
433
|
+
|
|
434
|
+
/**
|
|
435
|
+
* @name TDashboardWidgetKey
|
|
436
|
+
* @description Type for the unique key identifying a dashboard widget.
|
|
437
|
+
* @remarks
|
|
438
|
+
* This is a simple alias for `string` to allow flexibility in widget keys.
|
|
439
|
+
* Recommended formats: stable short strings (e.g. `myApp.ChartWidget`),
|
|
440
|
+
* namespaced identifiers or UUIDs. Consumers should avoid empty strings.
|
|
441
|
+
*/
|
|
442
|
+
export declare type TDashboardWidgetKey = string;
|
|
443
|
+
|
|
444
|
+
declare type TDynamicWidgetLoaderProps<TExtraProps = any> = {
|
|
445
|
+
index: number;
|
|
446
|
+
maxIndex: number;
|
|
447
|
+
widgetKey: TDashboardWidgetKey;
|
|
448
|
+
parentWidgetKey?: TDashboardWidgetKey;
|
|
449
|
+
targetContainerKey?: TDashboardWidgetKey;
|
|
450
|
+
childWidgetsConfig?: IChildWidgetConfigEntry[];
|
|
451
|
+
savedProps?: IWidgetSavedProps[];
|
|
452
|
+
widgetCatalog: TDashboardWidgetCatalog;
|
|
453
|
+
isEditing: boolean;
|
|
454
|
+
extraProps?: TExtraProps;
|
|
455
|
+
onRemoveClick?: (widgetKey: TDashboardWidgetKey, parentWidgetKey?: TDashboardWidgetKey) => void;
|
|
456
|
+
onMoveClick?: (direction: -1 | 1, widgetKey: TDashboardWidgetKey, parentWidgetKey?: TDashboardWidgetKey) => void;
|
|
457
|
+
selectContainer?: (containerKey: TDashboardWidgetKey) => void;
|
|
458
|
+
savedPropsChanged: (value: IWidgetSavedProps) => any;
|
|
459
|
+
};
|
|
460
|
+
|
|
461
|
+
/**
|
|
462
|
+
* A reusable, styled TextField component built with Tailwind CSS.
|
|
463
|
+
*/
|
|
464
|
+
export declare const TextField: default_2.FC<ITextFieldProps>;
|
|
465
|
+
|
|
466
|
+
/**
|
|
467
|
+
* @name TFrameworkComponentType
|
|
468
|
+
* @description A type representing a React component type.
|
|
469
|
+
*/
|
|
470
|
+
declare type TFrameworkComponentType = React.ComponentType<any>;
|
|
471
|
+
|
|
472
|
+
/**
|
|
473
|
+
* @name TFrameworkElementType
|
|
474
|
+
* @description A type representing a React element type.
|
|
475
|
+
*/
|
|
476
|
+
declare type TFrameworkElementType = React.ElementType;
|
|
477
|
+
|
|
478
|
+
/**
|
|
479
|
+
* @name TGetSavedDashboards
|
|
480
|
+
* @description Function type to get saved dashboards for a user
|
|
481
|
+
* @remarks Used in IDashboardStorageService
|
|
482
|
+
* @see IDashboardConfig
|
|
483
|
+
* @see TDashboardWidgetCatalogBase
|
|
484
|
+
* @return Promise<IDashboardConfig[]>
|
|
485
|
+
*/
|
|
486
|
+
declare type TGetSavedDashboards = (userID: number | string, clientAppKey: string, widgetCatalog: TDashboardWidgetCatalogBase, defaultDashboardConfig: IDashboardConfig) => Promise<IDashboardConfig[]>;
|
|
487
|
+
|
|
488
|
+
declare type TIconProps = {
|
|
489
|
+
className?: string;
|
|
490
|
+
style?: React.CSSProperties;
|
|
491
|
+
};
|
|
492
|
+
|
|
493
|
+
export declare function TimerResetIcon({ className, style }: TIconProps): JSX_2.Element;
|
|
494
|
+
|
|
495
|
+
declare type TListItemChildProps = {
|
|
496
|
+
testId?: string;
|
|
497
|
+
className?: string;
|
|
498
|
+
children?: ReactNode;
|
|
499
|
+
};
|
|
500
|
+
|
|
501
|
+
/**
|
|
502
|
+
* @name TManifestEntry
|
|
503
|
+
* @description Entry describing a remote widget manifest or resource.
|
|
504
|
+
* @remarks
|
|
505
|
+
* - `url` should point to the resource or manifest (absolute URLs recommended).
|
|
506
|
+
* - `meta` contains widget metadata (see `TWidgetMetaInfoBase`) describing the
|
|
507
|
+
* remotely loaded widget.
|
|
508
|
+
*/
|
|
509
|
+
export declare type TManifestEntry = {
|
|
510
|
+
url: string;
|
|
511
|
+
meta: TWidgetMetaInfoBase;
|
|
512
|
+
};
|
|
513
|
+
|
|
514
|
+
declare interface TProps {
|
|
515
|
+
testid?: string;
|
|
516
|
+
label?: string;
|
|
517
|
+
hideLabel?: boolean;
|
|
518
|
+
showChevron?: boolean;
|
|
519
|
+
hide?: boolean;
|
|
520
|
+
enabled: boolean;
|
|
521
|
+
isMenuOpen: boolean;
|
|
522
|
+
toggleOpen: (open: boolean) => void;
|
|
523
|
+
icon?: ReactNode;
|
|
524
|
+
children?: ReactNode;
|
|
525
|
+
}
|
|
526
|
+
|
|
527
|
+
declare type TProps_2 = {
|
|
528
|
+
children: React.ReactNode;
|
|
529
|
+
addCssClasses?: string;
|
|
530
|
+
};
|
|
531
|
+
|
|
532
|
+
declare type TRemoveWidgetResponse = TAddWidgetResponse;
|
|
533
|
+
|
|
534
|
+
/**
|
|
535
|
+
* @name TSaveDashboards
|
|
536
|
+
* @description Function type to save dashboards for a user
|
|
537
|
+
* @remarks Used in IDashboardStorageService
|
|
538
|
+
* @see IDashboardConfig
|
|
539
|
+
* @see TDashboardWidgetCatalogBase
|
|
540
|
+
* @return Promise<boolean>
|
|
541
|
+
*/
|
|
542
|
+
declare type TSaveDashboards = (userID: number | string, clientAppKey: string, dashboardConfigs: IDashboardConfig[], widgetCatalog: TDashboardWidgetCatalogBase) => Promise<boolean>;
|
|
543
|
+
|
|
544
|
+
declare type TSize = 'small' | 'medium';
|
|
545
|
+
|
|
546
|
+
export declare type TStackProps = {
|
|
547
|
+
testId?: string;
|
|
548
|
+
classNames?: string;
|
|
549
|
+
direction?: 'row' | 'column';
|
|
550
|
+
style?: CSSProperties;
|
|
551
|
+
children: React.ReactNode;
|
|
552
|
+
};
|
|
553
|
+
|
|
554
|
+
/**
|
|
555
|
+
* @name TUndoHistoryEntry
|
|
556
|
+
* @description Type for an undo history entry
|
|
557
|
+
* @remarks Used in dashboard undo/redo functionality
|
|
558
|
+
* @see IDashboardConfig
|
|
559
|
+
*/
|
|
560
|
+
export declare type TUndoHistoryEntry = {
|
|
561
|
+
undoIndex: number;
|
|
562
|
+
config: IDashboardConfig;
|
|
563
|
+
};
|
|
564
|
+
|
|
565
|
+
/**
|
|
566
|
+
* @name TWidgetCategory
|
|
567
|
+
* @description Type for widget categories used for grouping and UI filters.
|
|
568
|
+
* @remarks
|
|
569
|
+
* Typical usage: categorizing widgets in a palette, grouping by behavior
|
|
570
|
+
* (for instance `Container` widgets may host child widgets).
|
|
571
|
+
*/
|
|
572
|
+
export declare type TWidgetCategory = 'Widget' | 'Chart' | 'Container';
|
|
573
|
+
|
|
574
|
+
/**
|
|
575
|
+
* @name TWidgetDirection
|
|
576
|
+
* @description Direction for layout flow inside container widgets.
|
|
577
|
+
* @remarks Only meaningful for container-type widgets that arrange children in
|
|
578
|
+
* either `row` or `column` flow.
|
|
579
|
+
*/
|
|
580
|
+
export declare type TWidgetDirection = 'row' | 'column';
|
|
581
|
+
|
|
582
|
+
export declare type TWidgetErrorExtraProps = {
|
|
583
|
+
versionMismatch: boolean;
|
|
584
|
+
requiredVer: string;
|
|
585
|
+
hostVer: string;
|
|
586
|
+
errorMessage: string;
|
|
587
|
+
externalDependencies: string[];
|
|
588
|
+
};
|
|
589
|
+
|
|
590
|
+
/**
|
|
591
|
+
* @name TWidgetFactory
|
|
592
|
+
* @description A type representing a widget factory function specific to React framework.
|
|
593
|
+
* This type extends the base widget factory type with React-specific component type.
|
|
594
|
+
* @template TFrameworkComponentType - The React component type.
|
|
595
|
+
*/
|
|
596
|
+
export declare type TWidgetFactory = TWidgetFactoryBase<TFrameworkComponentType>;
|
|
597
|
+
|
|
598
|
+
/**
|
|
599
|
+
* @name TWidgetFactoryBase
|
|
600
|
+
* @description Async factory used to lazily load a framework component for a widget.
|
|
601
|
+
* @template TFrameworkComponent - Framework-specific component type (e.g., React component)
|
|
602
|
+
* @returns Promise resolving to an object with a `default` export containing the component.
|
|
603
|
+
* @remarks Implementations should throw on unrecoverable load errors so callers
|
|
604
|
+
* can handle fallbacks; returning a stub is also acceptable when documented.
|
|
605
|
+
*/
|
|
606
|
+
export declare type TWidgetFactoryBase<TFrameworkComponent = any> = () => Promise<{
|
|
607
|
+
default: TFrameworkComponent;
|
|
608
|
+
}>;
|
|
609
|
+
|
|
610
|
+
/**
|
|
611
|
+
* @name TWidgetMetaInfo
|
|
612
|
+
* @description Widget meta information type specific to React framework.
|
|
613
|
+
* This type extends the base widget meta information type with React-specific element type.
|
|
614
|
+
*/
|
|
615
|
+
export declare type TWidgetMetaInfo = TWidgetMetaInfoBase<TFrameworkElementType | undefined>;
|
|
616
|
+
|
|
617
|
+
/**
|
|
618
|
+
* @name TWidgetMetaInfoBase
|
|
619
|
+
* @description Base metadata for a widget used by catalogs and tooling.
|
|
620
|
+
* @template TFrameworkElementType - Framework-specific element type (e.g. React element, Vue component)
|
|
621
|
+
* @remarks
|
|
622
|
+
* Fields:
|
|
623
|
+
* - `name` (required): Human readable widget name.
|
|
624
|
+
* - `description` (required): Short description shown in tooltips or catalog lists.
|
|
625
|
+
* - `categories` (required): One or more `TWidgetCategory` values used for grouping.
|
|
626
|
+
* - `noDuplicatedWidgets` (optional): When true, dashboard UI should prevent
|
|
627
|
+
* adding multiple instances of this widget.
|
|
628
|
+
* - `icon` (optional): Framework-specific icon element or component. May be
|
|
629
|
+
* `undefined` when not provided.
|
|
630
|
+
* - `externalDependencies` (required): Array of package identifiers or CDN
|
|
631
|
+
* references (e.g. `react@19.2.3`, `https://cdn.example.com/widget.js`). Use
|
|
632
|
+
* semantic versions or absolute URLs as appropriate.
|
|
633
|
+
*
|
|
634
|
+
* Example:
|
|
635
|
+
* {
|
|
636
|
+
* name: 'Simple Chart',
|
|
637
|
+
* description: 'Displays a time series',
|
|
638
|
+
* categories: ['Chart'],
|
|
639
|
+
* noDuplicatedWidgets: false,
|
|
640
|
+
* icon: undefined,
|
|
641
|
+
* externalDependencies: ['d3@7.0.0']
|
|
642
|
+
* }
|
|
643
|
+
*/
|
|
644
|
+
export declare type TWidgetMetaInfoBase<TFrameworkElementType = any> = {
|
|
645
|
+
name: string;
|
|
646
|
+
description: string;
|
|
647
|
+
categories: TWidgetCategory[];
|
|
648
|
+
noDuplicatedWidgets?: boolean;
|
|
649
|
+
icon?: TFrameworkElementType | string | undefined;
|
|
650
|
+
externalDependencies: string[];
|
|
651
|
+
tags?: string[];
|
|
652
|
+
noCollapse?: boolean;
|
|
653
|
+
};
|
|
654
|
+
|
|
655
|
+
export declare type TWidgetsCatalogFlyoutProps = {
|
|
656
|
+
targetContainerKey?: TDashboardWidgetKey;
|
|
657
|
+
widgetsCatalog: TDashboardWidgetCatalog;
|
|
658
|
+
currentDashboardConfig: IDashboardConfig;
|
|
659
|
+
undoStatus: TDashboardUndoStatus;
|
|
660
|
+
zIndex?: number;
|
|
661
|
+
addWidget: (widgetKey: TDashboardWidgetKey, parentWidgetKey?: TDashboardWidgetKey) => any;
|
|
662
|
+
addContainer: (widgetKey: TDashboardWidgetKey) => any;
|
|
663
|
+
onSettingItemsUpdated: (items: IDashboardSettingEntry[]) => any;
|
|
664
|
+
onResetToDefaultDashboardClick: () => any;
|
|
665
|
+
onUndoOrRedo: (operation: 'Undo' | 'Redo') => any;
|
|
666
|
+
onDoneClick: () => any;
|
|
667
|
+
};
|
|
668
|
+
|
|
669
|
+
/**
|
|
670
|
+
* @name TWidgetSize
|
|
671
|
+
* @description Size hint for widgets that can affect layout or styling.
|
|
672
|
+
* @remarks 'default' represents the standard size; 'large' and 'xlarge' are
|
|
673
|
+
* larger variants where the dashboard may allocate more grid cells.
|
|
674
|
+
*/
|
|
675
|
+
export declare type TWidgetSize = 'default' | 'large' | 'xlarge';
|
|
676
|
+
|
|
677
|
+
export declare function UndoIcon({ className, style }: TIconProps): JSX_2.Element;
|
|
678
|
+
|
|
679
|
+
export declare const useDashboardStore: UseBoundStore<Omit<StoreApi<TDashboardSlice>, "subscribe"> & {
|
|
680
|
+
subscribe: {
|
|
681
|
+
(listener: (selectedState: TDashboardSlice, previousSelectedState: TDashboardSlice) => void): () => void;
|
|
682
|
+
<U>(selector: (state: TDashboardSlice) => U, listener: (selectedState: U, previousSelectedState: U) => void, options?: {
|
|
683
|
+
equalityFn?: ((a: U, b: U) => boolean) | undefined;
|
|
684
|
+
fireImmediately?: boolean;
|
|
685
|
+
} | undefined): () => void;
|
|
686
|
+
};
|
|
687
|
+
}>;
|
|
688
|
+
|
|
689
|
+
export declare const useDashboardUndoService: () => {
|
|
690
|
+
initializeHistoryForDashboard: (initialConfig: IDashboardConfig) => void;
|
|
691
|
+
resetAllHistory: () => void;
|
|
692
|
+
addUndoEntry: (newConfig: IDashboardConfig) => void;
|
|
693
|
+
removeUndoHistoryForDashboard: (dashboardId: string) => void;
|
|
694
|
+
undo: (currentDashboardId: string) => void;
|
|
695
|
+
redo: (currentDashboardId: string) => void;
|
|
696
|
+
getUndoStatus: (currentDashboardId: string) => TDashboardUndoStatus;
|
|
697
|
+
undoHistory: Record<string, TUndoHistoryEntry[]>;
|
|
698
|
+
historyIndex: Record<string, number>;
|
|
699
|
+
};
|
|
700
|
+
|
|
701
|
+
export declare function WidgetContainerColumn(props: IDashboardWidgetProps): IDashboardWidget;
|
|
702
|
+
|
|
703
|
+
export declare function WidgetContainerLarge(props: IDashboardWidgetProps): IDashboardWidget;
|
|
704
|
+
|
|
705
|
+
export declare function WidgetContainerRow(props: IDashboardWidgetProps): IDashboardWidget;
|
|
706
|
+
|
|
707
|
+
export declare function WidgetsCatalogFlyout(props: TWidgetsCatalogFlyoutProps): JSX_2.Element;
|
|
708
|
+
|
|
709
|
+
export declare function WrapperColumnContent({ children, addCssClasses }: TProps_2): JSX_2.Element;
|
|
710
|
+
|
|
711
|
+
export declare function WrapperColumnContentListItem({ children, addCssClasses }: TProps_2): JSX_2.Element;
|
|
712
|
+
|
|
713
|
+
export declare function XCircleIcon({ className, style }: TIconProps): JSX_2.Element;
|
|
714
|
+
|
|
715
|
+
export declare function ZoomInIcon({ className, style }: TIconProps): JSX_2.Element;
|
|
716
|
+
|
|
717
|
+
export declare function ZoomOutIcon({ className, style }: TIconProps): JSX_2.Element;
|
|
718
|
+
|
|
719
|
+
export { }
|