@tenorlab/react-dashboard 1.5.1 → 1.5.21
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 +5 -3
- package/dist/core.d.ts +3 -2
- package/dist/core.es.js +12 -11
- package/package.json +1 -1
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/
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
},
|
|
159
|
+
}, u = 0.7, p = 1, V = 0.05, D = (e) => {
|
|
160
160
|
let t = Number(e || 0);
|
|
161
|
-
return 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
|
-
},
|
|
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] ||
|
|
207
|
-
const i = a ||
|
|
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 ||
|
|
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
|
-
|
|
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,
|
|
285
|
+
const { key: o, name: d, folder: l } = c;
|
|
286
286
|
let g = $(a, e, l, o);
|
|
287
|
-
if (g || (g =
|
|
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
|
-
|
|
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
|
-
|
|
357
|
+
m as getDefaultWidgetMetaFromKey,
|
|
357
358
|
I as getDefaultWidgetMetaFromMap,
|
|
358
359
|
Z as getDistinctCssClasses,
|
|
359
360
|
$ as getMetaInfoFromFile,
|