@tenorlab/react-dashboard 1.3.8 → 1.4.1
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/react-dashboard.d.ts +2 -147
- package/package.json +3 -2
|
@@ -10,75 +10,18 @@ import { UseBoundStore } from 'zustand';
|
|
|
10
10
|
|
|
11
11
|
export declare function AddIcon({ className }: TIconProps): JSX_2.Element;
|
|
12
12
|
|
|
13
|
-
export declare const blankDashboardConfig: IDashboardConfig;
|
|
14
|
-
|
|
15
13
|
export declare function Button(props: IButtonProps): JSX_2.Element;
|
|
16
14
|
|
|
17
15
|
export declare function CircleQuestionMark({ className }: TIconProps): JSX_2.Element;
|
|
18
16
|
|
|
19
|
-
/**
|
|
20
|
-
* @name createDynamicEntry
|
|
21
|
-
* Helper function to create dynamic entries
|
|
22
|
-
* This helps keep the catalog registration clean
|
|
23
|
-
*/
|
|
24
|
-
export declare const createDynamicEntry: (key: string, loader: TWidgetFactoryBase, metaData: TWidgetMetaInfoBase) => [string, IDynamicWidgetCatalogEntryBase];
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* @name createStaticEntry
|
|
28
|
-
* Helper function to create static entries
|
|
29
|
-
* This helps keep the catalog registration clean
|
|
30
|
-
*/
|
|
31
|
-
export declare const createStaticEntry: <TFrameworkComponentType = any>(key: string, component: TFrameworkComponentType, metaData?: TWidgetMetaInfoBase) => [string, IDynamicWidgetCatalogEntryBase];
|
|
32
|
-
|
|
33
17
|
export declare function CrosshairIcon({ className }: TIconProps): JSX_2.Element;
|
|
34
18
|
|
|
35
|
-
export declare const cssSettingsCatalog: IDashboardSettingEntry[];
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
* @name cssVarsUtils
|
|
39
|
-
* @description Provides helpers method like getCssVariableValue, setCssVariableValue etc
|
|
40
|
-
*/
|
|
41
|
-
export declare const cssVarsUtils: {
|
|
42
|
-
/**
|
|
43
|
-
* @name getCssVariableValue
|
|
44
|
-
* @description Return the value of a CSS custom property from the current HTML document
|
|
45
|
-
* @param cssPropertyName
|
|
46
|
-
* @returns
|
|
47
|
-
*/
|
|
48
|
-
getCssVariableValue: (cssPropertyName: string) => string | null;
|
|
49
|
-
/**
|
|
50
|
-
* @name setCssVariableValue
|
|
51
|
-
* @description Sets the value of a CSS custom property on the current HTML document
|
|
52
|
-
* @param cssPropertyName
|
|
53
|
-
* @param value
|
|
54
|
-
*/
|
|
55
|
-
setCssVariableValue: (cssPropertyName: string, value: string) => void;
|
|
56
|
-
/**
|
|
57
|
-
* @name restoreCssVarsFromSettings
|
|
58
|
-
* @description
|
|
59
|
-
* Sets the values of many CSS custom properties on the current HTML document
|
|
60
|
-
* from the list of dashboard settings provided
|
|
61
|
-
* @param settings, an array of IDashboardSettingEntry
|
|
62
|
-
*/
|
|
63
|
-
restoreCssVarsFromSettings: (settings: IDashboardSettingEntry[]) => void;
|
|
64
|
-
};
|
|
65
|
-
|
|
66
19
|
export declare const DashboardGrid: ForwardRefExoticComponent<IDashboardGridProps & RefAttributes<HTMLDivElement>>;
|
|
67
20
|
|
|
68
|
-
export declare const DashboardMaxZoomScale: 1;
|
|
69
|
-
|
|
70
|
-
export declare const DashboardMinZoomScale: 0.7;
|
|
71
|
-
|
|
72
|
-
export declare const dashboardSettingsUtils: {
|
|
73
|
-
incrementOrDecrementValue: (item: IDashboardSettingEntry, direction: -1 | 1) => IDashboardSettingEntry;
|
|
74
|
-
};
|
|
75
|
-
|
|
76
21
|
export declare const DashboardWidgetBase: (props: IDashboardWidgetProps & {
|
|
77
22
|
ref?: React.ForwardedRef<HTMLDivElement>;
|
|
78
23
|
}) => React.ReactElement | null;
|
|
79
24
|
|
|
80
|
-
export declare const DashboardZoomStep: 0.05;
|
|
81
|
-
|
|
82
25
|
export declare function DeleteIcon({ className }: TIconProps): JSX_2.Element;
|
|
83
26
|
|
|
84
27
|
export declare const DraggablePanel: ForwardRefExoticComponent<DraggablePanelProps & RefAttributes<HTMLDivElement>>;
|
|
@@ -102,45 +45,6 @@ export declare function DynamicWidgetLoader({ index, maxIndex, widgetKey, parent
|
|
|
102
45
|
|
|
103
46
|
export declare function EditIcon({ className }: TIconProps): JSX_2.Element;
|
|
104
47
|
|
|
105
|
-
/**
|
|
106
|
-
* @name ensureContainersSequence
|
|
107
|
-
* @description
|
|
108
|
-
* Ensures that the container widgets are numbered sequentially in the dashboardConfig, but the original order is preserved.
|
|
109
|
-
*/
|
|
110
|
-
export declare const ensureContainersSequence: (dashboardConfig: IDashboardConfig) => IDashboardConfig;
|
|
111
|
-
|
|
112
|
-
export declare const ensureZoomScaleIsWithinRange: (value: number) => number;
|
|
113
|
-
|
|
114
|
-
export declare const getDefaultWidgetMetaFromKey: TGetDefaultWidgetMetaFromKey;
|
|
115
|
-
|
|
116
|
-
/**
|
|
117
|
-
* @name getDefaultWidgetMetaFromMap
|
|
118
|
-
* @description Helper to get widget meta info from the catalog by key.
|
|
119
|
-
*/
|
|
120
|
-
export declare const getDefaultWidgetMetaFromMap: <TFrameworkElementType = any>(widgetKey: TDashboardWidgetKey, defaultWidgetMetaMap: Record<TDashboardWidgetKey, TWidgetMetaInfoBase<TFrameworkElementType>>, options?: {
|
|
121
|
-
title?: string;
|
|
122
|
-
description?: string;
|
|
123
|
-
}) => TWidgetMetaInfoBase<TFrameworkElementType>;
|
|
124
|
-
|
|
125
|
-
/**
|
|
126
|
-
* @name getDistinctCssClasses
|
|
127
|
-
* @description Ensures a distinct list off css classes, avoiding duplicates
|
|
128
|
-
* @param defaultClasses
|
|
129
|
-
* @param additionalClasses
|
|
130
|
-
* @returns the distinct list as a string
|
|
131
|
-
*/
|
|
132
|
-
export declare const getDistinctCssClasses: (defaultClasses: string, ...additionalClasses: string[]) => string;
|
|
133
|
-
|
|
134
|
-
export declare const getMetaInfoFromFile: (widgetMetaModules: Record<string, Record<string, TWidgetMetaInfoBase>>, baseSrcPath: string, folder: string, key: string) => TWidgetMetaInfoBase | undefined;
|
|
135
|
-
|
|
136
|
-
export declare const getNewZoomScaleWithinRange: (currentZoomScale: number, direction: -1 | 1) => number;
|
|
137
|
-
|
|
138
|
-
/**
|
|
139
|
-
* @name getWidgetMetaFromCatalog
|
|
140
|
-
* @description Helper to get widget meta info from the catalog by key.
|
|
141
|
-
*/
|
|
142
|
-
export declare const getWidgetMetaFromCatalog: <TFrameworkElementType = any, TFrameworkComponentType = any>(widgetKey: TDashboardWidgetKey, widgetsCatalog: TDashboardWidgetCatalogBase<TFrameworkElementType, TFrameworkComponentType>) => TWidgetMetaInfoBase<TFrameworkElementType>;
|
|
143
|
-
|
|
144
48
|
export declare function GridIcon({ className }: TIconProps): JSX_2.Element;
|
|
145
49
|
|
|
146
50
|
export declare function HandGrabIcon({ className }: TIconProps): JSX_2.Element;
|
|
@@ -307,14 +211,6 @@ export declare const ListItemMiddleChild: ForwardRefExoticComponent<TListItemChi
|
|
|
307
211
|
|
|
308
212
|
export declare const ListItemRightChild: ForwardRefExoticComponent<TListItemChildProps & RefAttributes<HTMLDivElement>>;
|
|
309
213
|
|
|
310
|
-
/**
|
|
311
|
-
* @name localWidgetDiscovery
|
|
312
|
-
* @description Scans local directories for widgets.
|
|
313
|
-
* If lazy is true, it registers loaders. If false, it registers static components.
|
|
314
|
-
*/
|
|
315
|
-
export declare const localWidgetDiscovery: (baseSrcPath: string, // e.g., "/src/async-widgets" or "/src/bundled-widgets"
|
|
316
|
-
widgetModules: Record<string, any>, widgetMetaModules: Record<string, any>, lazy?: boolean) => [string, IDynamicWidgetCatalogEntryBase][];
|
|
317
|
-
|
|
318
214
|
export declare function MonitorIcon({ className }: TIconProps): JSX_2.Element;
|
|
319
215
|
|
|
320
216
|
export declare function MonitorSmartphoneIcon({ className }: TIconProps): JSX_2.Element;
|
|
@@ -323,40 +219,8 @@ export declare function MoveLeftIcon({ className }: TIconProps): JSX_2.Element;
|
|
|
323
219
|
|
|
324
220
|
export declare function MoveRightIcon({ className }: TIconProps): JSX_2.Element;
|
|
325
221
|
|
|
326
|
-
export declare const parseContainerTitle: (containerWidgetKey: TDashboardWidgetKey) => string;
|
|
327
|
-
|
|
328
|
-
/**
|
|
329
|
-
* Enhanced helper to derive key and title from widget file paths.
|
|
330
|
-
* Handles:
|
|
331
|
-
* - widget-revenue-trends1 -> WidgetRevenueTrends1
|
|
332
|
-
* - widget-with-extraprops -> WidgetWithExtraprops
|
|
333
|
-
* - widget-revenue-trends-async -> WidgetRevenueTrendsAsync
|
|
334
|
-
*/
|
|
335
|
-
export declare const parseKeyAndTitleFromFilePath: (path: string) => {
|
|
336
|
-
key: TDashboardWidgetKey;
|
|
337
|
-
title: string;
|
|
338
|
-
folder: string;
|
|
339
|
-
} | null;
|
|
340
|
-
|
|
341
222
|
export declare function RedoIcon({ className }: TIconProps): JSX_2.Element;
|
|
342
223
|
|
|
343
|
-
export declare const remoteWidgetDiscovery: (manifestUrl: string) => Promise<{
|
|
344
|
-
entries: [string, IDynamicWidgetCatalogEntryBase][];
|
|
345
|
-
message: string;
|
|
346
|
-
details: string;
|
|
347
|
-
}>;
|
|
348
|
-
|
|
349
|
-
export declare const removeEmptyContainers: (dashboardConfig: IDashboardConfig) => IDashboardConfig;
|
|
350
|
-
|
|
351
|
-
/**
|
|
352
|
-
* @name resolveColorFromClass
|
|
353
|
-
* @description Resolves the current computed color using your existing CSS classes
|
|
354
|
-
* @param classNames, i.e. 'bg-primary'
|
|
355
|
-
* @param property to resolve, i.e. 'backgroundColor'
|
|
356
|
-
* @returns
|
|
357
|
-
*/
|
|
358
|
-
export declare const resolveColorFromClass: (classNames: string | string[], property?: "color" | "backgroundColor") => string;
|
|
359
|
-
|
|
360
224
|
export declare function SettingsIcon({ className }: TIconProps): JSX_2.Element;
|
|
361
225
|
|
|
362
226
|
export declare const showToast: (options: any) => void;
|
|
@@ -446,14 +310,7 @@ declare type TFrameworkComponentType = React.ComponentType<any>;
|
|
|
446
310
|
|
|
447
311
|
declare type TFrameworkElementType = React.ElementType;
|
|
448
312
|
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
export declare type TGetDefaultWidgetMetaFromKeyOptions = {
|
|
452
|
-
title?: string;
|
|
453
|
-
description?: string;
|
|
454
|
-
};
|
|
455
|
-
|
|
456
|
-
export declare type TGetSavedDashboards = (userID: number | string, clientAppKey: string, widgetCatalog: TDashboardWidgetCatalogBase, defaultDashboardConfig: IDashboardConfig) => Promise<IDashboardConfig[]>;
|
|
313
|
+
declare type TGetSavedDashboards = (userID: number | string, clientAppKey: string, widgetCatalog: TDashboardWidgetCatalogBase, defaultDashboardConfig: IDashboardConfig) => Promise<IDashboardConfig[]>;
|
|
457
314
|
|
|
458
315
|
declare type TIconProps = {
|
|
459
316
|
className?: string;
|
|
@@ -479,7 +336,7 @@ declare type TProps = {
|
|
|
479
336
|
|
|
480
337
|
declare type TRemoveWidgetResponse = TAddWidgetResponse;
|
|
481
338
|
|
|
482
|
-
|
|
339
|
+
declare type TSaveDashboards = (userID: number | string, clientAppKey: string, dashboardConfigs: IDashboardConfig[], widgetCatalog: TDashboardWidgetCatalogBase) => Promise<boolean>;
|
|
483
340
|
|
|
484
341
|
declare type TSize = 'small' | 'medium';
|
|
485
342
|
|
|
@@ -542,8 +399,6 @@ export declare type TWidgetSize = 'default' | 'large' | 'xlarge';
|
|
|
542
399
|
|
|
543
400
|
export declare function UndoIcon({ className }: TIconProps): JSX_2.Element;
|
|
544
401
|
|
|
545
|
-
export declare const useDashboardStorageService: () => IDashboardStorageService;
|
|
546
|
-
|
|
547
402
|
export declare const useDashboardStore: UseBoundStore<StoreApi<TDashboardSlice>>;
|
|
548
403
|
|
|
549
404
|
export declare const useDashboardUndoService: () => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tenorlab/react-dashboard",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.1",
|
|
4
4
|
"description": "Foundation components for creating user-configurable dashboards in React",
|
|
5
5
|
"author": "Damiano Fusco",
|
|
6
6
|
"type": "module",
|
|
@@ -50,7 +50,8 @@
|
|
|
50
50
|
"module": "./dist/react-dashboard.es.js",
|
|
51
51
|
"peerDependencies": {
|
|
52
52
|
"react": "^18.0.0 || ^19.0.0",
|
|
53
|
-
"react-dom": "^18.0.0 || ^19.0.0"
|
|
53
|
+
"react-dom": "^18.0.0 || ^19.0.0",
|
|
54
|
+
"zustand": "^5.0.0 || ^5.0.9"
|
|
54
55
|
},
|
|
55
56
|
"devDependencies": {
|
|
56
57
|
"@tenorlab/dashboard-core": "^1.0.1",
|