@tenorlab/react-dashboard 1.5.1 → 1.5.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/README.md CHANGED
@@ -37,7 +37,7 @@ Import the base styles in your entry file (e.g., `main.tsx`):
37
37
  TypeScript
38
38
 
39
39
  ```
40
- import '@tenorlab/react-dashboard/dist/style.css'
40
+ import '@tenorlab/react-dashboard/styles.css'
41
41
  ```
42
42
 
43
43
  ------
@@ -169,18 +169,20 @@ export const getWidgetCatalog = async (user: any | null): Promise<TDashboardWidg
169
169
  catalogMapEntries.push(createStaticEntry('WidgetRecentPaymentInfo', WidgetRecentPaymentInfo))
170
170
  }
171
171
 
172
+ // add bundled widgets (non-lazy)
172
173
  catalogMapEntries.push(...localWidgetDiscovery(
173
174
  bundledWidgetsSrcPath,
174
175
  bundledWidgetModules,
175
176
  allMetaModules,
176
- false
177
+ false, // lazy: false
177
178
  ))
178
179
 
180
+ // add async-widgets (lazy)
179
181
  catalogMapEntries.push(...localWidgetDiscovery(
180
182
  asyncWidgetsSrcPath,
181
183
  asyncWidgetModules,
182
184
  allMetaModules,
183
- true
185
+ true, // lazy: true
184
186
  ))
185
187
 
186
188
  // Optional: Remote discovery of -pre-built widgets hosted on a CDN
package/dist/core.d.ts CHANGED
@@ -266,13 +266,14 @@ export declare const parseContainerTitle: (containerWidgetKey: TDashboardWidgetK
266
266
  /**
267
267
  * Enhanced helper to derive key and title from widget file paths.
268
268
  * Handles:
269
+ * - widget-total-orders -> WidgetTotalOrders
269
270
  * - widget-revenue-trends1 -> WidgetRevenueTrends1
270
271
  * - widget-with-extraprops -> WidgetWithExtraprops
271
272
  * - widget-revenue-trends-async -> WidgetRevenueTrendsAsync
272
273
  */
273
274
  export declare const parseKeyAndTitleFromFilePath: (path: string) => {
274
275
  key: TDashboardWidgetKey;
275
- title: string;
276
+ name: string;
276
277
  folder: string;
277
278
  } | null;
278
279
 
@@ -344,7 +345,7 @@ export declare type TGetDefaultWidgetMetaFromKey = (widgetKey: TDashboardWidgetK
344
345
  * and/or `description`.
345
346
  */
346
347
  export declare type TGetDefaultWidgetMetaFromKeyOptions = {
347
- title?: string;
348
+ name?: string;
348
349
  description?: string;
349
350
  };
350
351
 
package/dist/core.es.js CHANGED
@@ -156,9 +156,9 @@ const w = [
156
156
  }, U = (e) => {
157
157
  const t = `${e}`.split("_");
158
158
  return t.length > 1 ? t[1].replace(/(\D)(\d+)/, "$1 $2") : "Container";
159
- }, m = 0.7, p = 1, V = 0.05, D = (e) => {
159
+ }, u = 0.7, p = 1, V = 0.05, D = (e) => {
160
160
  let t = Number(e || 0);
161
- return t < m && (t = m), t > p && (t = p), t;
161
+ return t < u && (t = u), t > p && (t = p), t;
162
162
  }, j = (e, t) => {
163
163
  let a = Number(Number((V * t).toFixed(2)).toFixed(2)), i = Number((Number(e) + a).toFixed(2));
164
164
  return D(i);
@@ -193,7 +193,7 @@ const w = [
193
193
  parentWidgetKey: n || s
194
194
  };
195
195
  }), e;
196
- }, u = (e, t) => {
196
+ }, m = (e, t) => {
197
197
  const a = `${e}`.includes("Container"), i = a ? ["Container"] : ["Widget"], s = t?.name || e, n = t?.description || (a ? "Container" : "Unknown");
198
198
  return {
199
199
  name: s,
@@ -203,8 +203,8 @@ const w = [
203
203
  icon: void 0,
204
204
  externalDependencies: []
205
205
  };
206
- }, I = (e, t, a) => t[e] || u(e, a), M = (e, t) => t.get(e)?.meta || u(e), k = (e, t, a) => {
207
- const i = a || u(e);
206
+ }, I = (e, t, a) => t[e] || m(e, a), M = (e, t) => t.get(e)?.meta || m(e), k = (e, t, a) => {
207
+ const i = a || m(e);
208
208
  return [
209
209
  e,
210
210
  {
@@ -217,7 +217,7 @@ const w = [
217
217
  }
218
218
  ];
219
219
  }, h = (e, t, a, i) => {
220
- const s = i || u(e);
220
+ const s = i || m(e);
221
221
  return [
222
222
  e,
223
223
  {
@@ -235,7 +235,7 @@ const w = [
235
235
  const a = t[1], i = a.split("-"), s = `Widget${i.map((r) => r.charAt(0).toUpperCase() + r.slice(1)).join("")}`, n = i.map((r) => r.charAt(0).toUpperCase() + r.slice(1)).join(" ");
236
236
  return {
237
237
  key: s,
238
- title: n,
238
+ name: n,
239
239
  folder: a
240
240
  };
241
241
  }
@@ -282,9 +282,10 @@ const w = [
282
282
  for (const n in t) {
283
283
  const r = t[n], c = F(n);
284
284
  if (c && r) {
285
- const { key: o, title: d, folder: l } = c;
285
+ const { key: o, name: d, folder: l } = c;
286
286
  let g = $(a, e, l, o);
287
- if (g || (g = u(o, {
287
+ if (g || (g = m(o, {
288
+ name: d,
288
289
  description: `Local ${i ? "dynamic" : "static"} widget`
289
290
  })), i)
290
291
  s.push(
@@ -343,7 +344,7 @@ const w = [
343
344
  ].join(" ").trim();
344
345
  export {
345
346
  p as DashboardMaxZoomScale,
346
- m as DashboardMinZoomScale,
347
+ u as DashboardMinZoomScale,
347
348
  V as DashboardZoomStep,
348
349
  z as blankDashboardConfig,
349
350
  h as createDynamicEntry,
@@ -353,7 +354,7 @@ export {
353
354
  E as dashboardSettingsUtils,
354
355
  x as ensureContainersSequence,
355
356
  D as ensureZoomScaleIsWithinRange,
356
- u as getDefaultWidgetMetaFromKey,
357
+ m as getDefaultWidgetMetaFromKey,
357
358
  I as getDefaultWidgetMetaFromMap,
358
359
  Z as getDistinctCssClasses,
359
360
  $ as getMetaInfoFromFile,
@@ -2519,7 +2519,10 @@ function rn({
2519
2519
  `${a.widgetKey}_${f}`
2520
2520
  ))
2521
2521
  } : {};
2522
- return C ? /* @__PURE__ */ n(xt, { fallback: /* @__PURE__ */ n(nn, { title: `Loading ${h.title}` }), children: /* @__PURE__ */ n(b, { ...l, ...M }) }) : /* @__PURE__ */ n(b, { ...l, ...M });
2522
+ return C ? /* @__PURE__ */ $(xt, { fallback: /* @__PURE__ */ n(nn, { title: `Loading ${h.title}` }), children: [
2523
+ "]",
2524
+ /* @__PURE__ */ n(b, { ...l, ...M })
2525
+ ] }) : /* @__PURE__ */ n(b, { ...l, ...M });
2523
2526
  }
2524
2527
  const ye = "size-5";
2525
2528
  function Ie(e) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tenorlab/react-dashboard",
3
- "version": "1.5.1",
3
+ "version": "1.5.2",
4
4
  "description": "Foundation components for creating user-configurable dashboards in React",
5
5
  "author": "Damiano Fusco",
6
6
  "type": "module",