@tenorlab/react-dashboard 1.1.6 → 1.1.8

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,5 +1,5 @@
1
1
  import type { IChildWidgetConfigEntry, TDashboardWidgetCatalog, TDashboardWidgetKey } from './interfaces';
2
- type TDynamicWidgetLoaderProps = {
2
+ type TDynamicWidgetLoaderProps<TExtraProps = any> = {
3
3
  index: number;
4
4
  maxIndex: number;
5
5
  widgetKey: TDashboardWidgetKey;
@@ -8,10 +8,17 @@ type TDynamicWidgetLoaderProps = {
8
8
  childWidgetsConfig?: IChildWidgetConfigEntry[];
9
9
  widgetCatalog: TDashboardWidgetCatalog;
10
10
  isEditing: boolean;
11
+ extraProps?: TExtraProps;
11
12
  onRemoveClick?: (widgetKey: TDashboardWidgetKey, parentWidgetKey?: TDashboardWidgetKey) => void;
12
13
  onMoveClick?: (direction: -1 | 1, widgetKey: TDashboardWidgetKey, parentWidgetKey?: TDashboardWidgetKey) => void;
13
14
  selectContainer?: (containerKey: TDashboardWidgetKey) => void;
14
15
  };
16
+ /**
17
+ * Compares two version strings (e.g., "19.2.0" and "19.2.3")
18
+ * Returns true if the widget version is compatible with the host.
19
+ * Logic: Host must be >= Widget version for major/minor.
20
+ */
21
+ export declare const _isVersionCompatible: (hostVer: string, widgetVer: string) => boolean;
15
22
  /**
16
23
  * Component to safely load and render dynamic widgets.
17
24
  * This ensures the widget component (and its hooks) is called consistently.
@@ -19,5 +26,5 @@ type TDynamicWidgetLoaderProps = {
19
26
  * @param {string} props.widgetKey
20
27
  * @param {(key: string) => Promise<void>} props.onRemoveClick
21
28
  */
22
- export declare function DynamicWidgetLoader({ index, maxIndex, widgetKey, parentWidgetKey, targetContainerKey, childWidgetsConfig, widgetCatalog, isEditing, onRemoveClick, onMoveClick, selectContainer, }: TDynamicWidgetLoaderProps): import("react/jsx-runtime").JSX.Element;
29
+ export declare function DynamicWidgetLoader({ index, maxIndex, widgetKey, parentWidgetKey, targetContainerKey, childWidgetsConfig, widgetCatalog, isEditing, extraProps, onRemoveClick, onMoveClick, selectContainer, }: TDynamicWidgetLoaderProps): import("react/jsx-runtime").JSX.Element;
23
30
  export {};
@@ -15,7 +15,7 @@ export interface IDashboardGridPropsBase {
15
15
  }
16
16
  export type TWidgetSize = 'default' | 'large' | 'xlarge';
17
17
  export type TWidgetDirection = 'row' | 'column';
18
- export interface IDashboardWidgetPropsBase {
18
+ export interface IDashboardWidgetPropsBase<TExtraProps = any> {
19
19
  index: number;
20
20
  maxIndex: number;
21
21
  widgetKey: TDashboardWidgetKey;
@@ -32,6 +32,7 @@ export interface IDashboardWidgetPropsBase {
32
32
  noBorder?: boolean;
33
33
  noPadding?: boolean;
34
34
  direction?: TWidgetDirection;
35
+ extraProps?: TExtraProps;
35
36
  }
36
37
  /**
37
38
  * 1. Define the Async Loader type