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