@tenorlab/react-dashboard 1.4.1 → 1.4.2

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 CHANGED
@@ -14,6 +14,12 @@ export declare const createDynamicEntry: (key: string, loader: TWidgetFactoryBas
14
14
  */
15
15
  export declare const createStaticEntry: <TFrameworkComponentType = any>(key: string, component: TFrameworkComponentType, metaData?: TWidgetMetaInfoBase) => [string, IDynamicWidgetCatalogEntryBase];
16
16
 
17
+ /**
18
+ * @name cssSettingsCatalog
19
+ * @description Catalog of available dashboard settings (array of IDashboardSettingEntry)
20
+ * @see IDashboardSettingEntry
21
+ * @remarks step should never be less than 0.1 as we do some rounding in other places ...
22
+ */
17
23
  export declare const cssSettingsCatalog: IDashboardSettingEntry[];
18
24
 
19
25
  /**
@@ -49,7 +55,18 @@ export declare const DashboardMaxZoomScale: 1;
49
55
 
50
56
  export declare const DashboardMinZoomScale: 0.7;
51
57
 
58
+ /**
59
+ * @name dashboardSettingsUtils
60
+ * @description Contains utils for the dashboard custom settings
61
+ */
52
62
  export declare const dashboardSettingsUtils: {
63
+ /**
64
+ * @name incrementOrDecrementValue
65
+ * @description Increments or decrement a value based on the direction parameter
66
+ * @param item: an instance of IDashboardSettingEntry
67
+ * @param direction: -1 (for decrement) or 1 (for increment)
68
+ * @returns the update item
69
+ */
53
70
  incrementOrDecrementValue: (item: IDashboardSettingEntry, direction: -1 | 1) => IDashboardSettingEntry;
54
71
  };
55
72
 
@@ -272,6 +289,13 @@ export declare type TWidgetMetaInfoBase<TFrameworkElementType = any> = {
272
289
 
273
290
  export declare type TWidgetSize = 'default' | 'large' | 'xlarge';
274
291
 
292
+ /**
293
+ * @name useDashboardStorageService
294
+ * @description
295
+ * This implementation of IDashboardStorageService uses localStorage to store custom dashboard configurations.
296
+ * Developers can implement their own version of the dashboard storage service to store the data in a database or other way if needed.
297
+ * @returns An instance of IDashboardStorageService
298
+ */
275
299
  export declare const useDashboardStorageService: () => IDashboardStorageService;
276
300
 
277
301
  export { }
package/dist/core.es.js CHANGED
@@ -77,6 +77,13 @@ const w = [
77
77
  value: "1.0rem"
78
78
  }
79
79
  ], S = ["rem", "pc", "cm", "in", "em", "vh", "vw", "%"], b = (e, t) => S.includes(e) ? t : 1, E = {
80
+ /**
81
+ * @name incrementOrDecrementValue
82
+ * @description Increments or decrement a value based on the direction parameter
83
+ * @param item: an instance of IDashboardSettingEntry
84
+ * @param direction: -1 (for decrement) or 1 (for increment)
85
+ * @returns the update item
86
+ */
80
87
  incrementOrDecrementValue: (e, t) => {
81
88
  const i = e.value.match(/([\d.]+)/), a = i ? parseFloat(i[1]) : 0, s = e.value.match(/([^\d.]+)/), n = s ? s[1] : e.defaultUnit, r = b(n, e.step) * t, c = `${Math.max(a + r, e.minValue).toFixed(1)}${n}`;
82
89
  return {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tenorlab/react-dashboard",
3
- "version": "1.4.1",
3
+ "version": "1.4.2",
4
4
  "description": "Foundation components for creating user-configurable dashboards in React",
5
5
  "author": "Damiano Fusco",
6
6
  "type": "module",
@@ -54,7 +54,7 @@
54
54
  "zustand": "^5.0.0 || ^5.0.9"
55
55
  },
56
56
  "devDependencies": {
57
- "@tenorlab/dashboard-core": "^1.0.1",
57
+ "@tenorlab/dashboard-core": "^1.4.1",
58
58
  "@types/node": "^24.10.1",
59
59
  "@types/react": "19.2.3",
60
60
  "@types/react-dom": "19.2.3",