deepspotscreen-sdk 0.0.1 → 0.0.3
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/{DeepspotSDK-CyX06_c2.js → DeepspotSDK-BEdSECUH.js} +667 -316
- package/dist/DeepspotSDK-D2MQ877M.cjs +780 -0
- package/dist/core/ApiClient.d.ts +11 -0
- package/dist/deepspot-sdk.esm.js +546 -194
- package/dist/deepspot-sdk.js +308 -74
- package/dist/react/index.cjs +1 -1
- package/dist/react/index.mjs +2 -2
- package/dist/renderer/DashboardRenderer.d.ts +12 -0
- package/dist/renderer/TableRenderer.d.ts +25 -1
- package/dist/vue/index.cjs +1 -1
- package/dist/vue/index.mjs +1 -1
- package/package.json +1 -1
- package/dist/DeepspotSDK-g7o9tAip.cjs +0 -546
package/dist/deepspot-sdk.esm.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
class
|
|
1
|
+
class P {
|
|
2
2
|
constructor(e, t) {
|
|
3
3
|
this.tokenCache = /* @__PURE__ */ new Map(), this.baseUrl = e.replace(/\/$/, ""), this.apiKey = t;
|
|
4
4
|
}
|
|
5
5
|
// ── Embed Token ─────────────────────────────────────────────────────────────
|
|
6
6
|
async getEmbedToken(e) {
|
|
7
|
-
var i, a,
|
|
7
|
+
var i, a, o, d;
|
|
8
8
|
const t = [
|
|
9
9
|
e.dashboardId,
|
|
10
10
|
e.embedType,
|
|
11
11
|
(i = e.embedLevel) != null ? i : "",
|
|
12
12
|
(a = e.componentId) != null ? a : "",
|
|
13
|
-
(
|
|
13
|
+
(o = e.userId) != null ? o : ""
|
|
14
14
|
].join(":"), s = this.tokenCache.get(t);
|
|
15
15
|
if (s && s.expiresAt > Date.now() + 6e4) return s.token;
|
|
16
16
|
const r = await this.post(
|
|
@@ -18,7 +18,7 @@ class S {
|
|
|
18
18
|
{
|
|
19
19
|
dashboardId: e.dashboardId,
|
|
20
20
|
embedType: e.embedType,
|
|
21
|
-
embedLevel: (
|
|
21
|
+
embedLevel: (d = e.embedLevel) != null ? d : "dashboard",
|
|
22
22
|
componentId: e.componentId,
|
|
23
23
|
userId: e.userId,
|
|
24
24
|
tenantId: e.tenantId,
|
|
@@ -38,8 +38,8 @@ class S {
|
|
|
38
38
|
embedType: "dashboard",
|
|
39
39
|
embedLevel: (i = s.embedLevel) != null ? i : "dashboard"
|
|
40
40
|
});
|
|
41
|
-
return s.pageId && r.set("pageId", s.pageId), s.tabId && r.set("tabId", s.tabId), s.filters && Object.entries(s.filters).forEach(([a,
|
|
42
|
-
|
|
41
|
+
return s.pageId && r.set("pageId", s.pageId), s.tabId && r.set("tabId", s.tabId), s.filters && Object.entries(s.filters).forEach(([a, o]) => {
|
|
42
|
+
o != null && o !== "" && r.set(`filter[${a}]`, Array.isArray(o) ? o.join(",") : String(o));
|
|
43
43
|
}), this.get(
|
|
44
44
|
`/dashboard-builder/embed/${e}/render?${r}`,
|
|
45
45
|
{ "x-embed-token": t }
|
|
@@ -52,8 +52,8 @@ class S {
|
|
|
52
52
|
embedLevel: "report",
|
|
53
53
|
componentId: t
|
|
54
54
|
});
|
|
55
|
-
return r.filters && Object.entries(r.filters).forEach(([a,
|
|
56
|
-
|
|
55
|
+
return r.filters && Object.entries(r.filters).forEach(([a, o]) => {
|
|
56
|
+
o != null && o !== "" && i.set(`filter[${a}]`, Array.isArray(o) ? o.join(",") : String(o));
|
|
57
57
|
}), this.get(
|
|
58
58
|
`/dashboard-builder/embed/${e}/render?${i}`,
|
|
59
59
|
{ "x-embed-token": s }
|
|
@@ -75,6 +75,18 @@ class S {
|
|
|
75
75
|
Authorization: `Bearer ${t}`
|
|
76
76
|
});
|
|
77
77
|
}
|
|
78
|
+
// ── Paginated Table Data ────────────────────────────────────────────────────
|
|
79
|
+
/**
|
|
80
|
+
* Fetches one page of data for an embedded data-table component.
|
|
81
|
+
* Called by TableRenderer whenever the user navigates to a different page.
|
|
82
|
+
* Mirrors: GET /dashboard-builder/embed/:dashboardId/table/:componentId/data
|
|
83
|
+
*/
|
|
84
|
+
async getTablePage(e, t, s, r, i) {
|
|
85
|
+
return this.get(
|
|
86
|
+
`/dashboard-builder/embed/${e}/table/${t}/data?page=${s}&pageSize=${r}`,
|
|
87
|
+
{ "x-embed-token": i }
|
|
88
|
+
);
|
|
89
|
+
}
|
|
78
90
|
// ── Filter Options ──────────────────────────────────────────────────────────
|
|
79
91
|
/**
|
|
80
92
|
* Fetches distinct option values for a dropdown / multi-select filter.
|
|
@@ -194,8 +206,8 @@ class w {
|
|
|
194
206
|
});
|
|
195
207
|
}
|
|
196
208
|
}
|
|
197
|
-
const
|
|
198
|
-
class
|
|
209
|
+
const N = 24, S = 10, I = 12;
|
|
210
|
+
class A {
|
|
199
211
|
/**
|
|
200
212
|
* @param containerWidth Actual pixel width of the grid container.
|
|
201
213
|
* @param minY Minimum y value across all components (normalises
|
|
@@ -206,23 +218,23 @@ class E {
|
|
|
206
218
|
}
|
|
207
219
|
/** Pixel width of one column unit */
|
|
208
220
|
get colWidth() {
|
|
209
|
-
return this.containerWidth /
|
|
221
|
+
return this.containerWidth / N;
|
|
210
222
|
}
|
|
211
223
|
/** Convert grid position {x,y,w,h} → CSS absolute pixel values */
|
|
212
224
|
toPx(e) {
|
|
213
|
-
const t = this.colWidth, s =
|
|
225
|
+
const t = this.colWidth, s = I / 2;
|
|
214
226
|
return {
|
|
215
227
|
left: e.x * t + s,
|
|
216
|
-
top: (e.y - this.minY) *
|
|
217
|
-
width: e.w * t -
|
|
218
|
-
height: e.h *
|
|
228
|
+
top: (e.y - this.minY) * S + s,
|
|
229
|
+
width: e.w * t - I,
|
|
230
|
+
height: e.h * S - I
|
|
219
231
|
};
|
|
220
232
|
}
|
|
221
233
|
/** Total pixel height required to fit all positioned components */
|
|
222
234
|
static totalHeight(e) {
|
|
223
235
|
if (!e.length) return 400;
|
|
224
236
|
const t = Math.min(...e.map((r) => r.y));
|
|
225
|
-
return (Math.max(...e.map((r) => r.y + r.h)) - t) *
|
|
237
|
+
return (Math.max(...e.map((r) => r.y + r.h)) - t) * S + 40;
|
|
226
238
|
}
|
|
227
239
|
/** Apply absolute positioning styles directly to a DOM element */
|
|
228
240
|
applyStyles(e, t) {
|
|
@@ -231,8 +243,8 @@ class E {
|
|
|
231
243
|
}
|
|
232
244
|
}
|
|
233
245
|
let R = null;
|
|
234
|
-
function
|
|
235
|
-
return R || (R = import("./apexcharts.common-k3hLWpB8.js").then((
|
|
246
|
+
function K() {
|
|
247
|
+
return R || (R = import("./apexcharts.common-k3hLWpB8.js").then((m) => m.a)), R;
|
|
236
248
|
}
|
|
237
249
|
class O {
|
|
238
250
|
constructor(e) {
|
|
@@ -258,10 +270,10 @@ class O {
|
|
|
258
270
|
if (a)
|
|
259
271
|
try {
|
|
260
272
|
this.chart && this.chart.destroy();
|
|
261
|
-
const { default:
|
|
262
|
-
this.chart = new
|
|
263
|
-
} catch (
|
|
264
|
-
console.error("[Deepspot SDK] ChartRenderer error:",
|
|
273
|
+
const { default: o } = await K();
|
|
274
|
+
this.chart = new o(a, i), this.chart.render();
|
|
275
|
+
} catch (o) {
|
|
276
|
+
console.error("[Deepspot SDK] ChartRenderer error:", o), a.innerHTML = '<div class="ds-chart-empty">Chart render error</div>';
|
|
265
277
|
}
|
|
266
278
|
}
|
|
267
279
|
async update(e, t, s) {
|
|
@@ -295,7 +307,7 @@ class O {
|
|
|
295
307
|
}
|
|
296
308
|
buildCartesianOptions(e, t, s, r) {
|
|
297
309
|
var l;
|
|
298
|
-
const { series: i, categories: a, xAxisLabel:
|
|
310
|
+
const { series: i, categories: a, xAxisLabel: o, yAxisLabel: d } = this.extractSeriesAndCategories(e, t), n = e.properties || {}, b = n.colors ? Object.values(n.colors) : ["#6366f1", "#8b5cf6", "#ec4899", "#f59e0b", "#10b981", "#3b82f6"], c = s === "dark";
|
|
299
311
|
return {
|
|
300
312
|
chart: {
|
|
301
313
|
type: e.type === "area" ? "area" : e.type === "line" ? "line" : "bar",
|
|
@@ -311,26 +323,26 @@ class O {
|
|
|
311
323
|
series: i,
|
|
312
324
|
xaxis: {
|
|
313
325
|
categories: a,
|
|
314
|
-
title: { text:
|
|
326
|
+
title: { text: o },
|
|
315
327
|
labels: {
|
|
316
328
|
rotate: a.length > 8 ? -45 : 0,
|
|
317
|
-
style: { colors:
|
|
329
|
+
style: { colors: c ? "#94a3b8" : "#6b7280", fontSize: "11px" }
|
|
318
330
|
},
|
|
319
|
-
axisBorder: { color:
|
|
320
|
-
axisTicks: { color:
|
|
331
|
+
axisBorder: { color: c ? "#334155" : "#e5e7eb" },
|
|
332
|
+
axisTicks: { color: c ? "#334155" : "#e5e7eb" }
|
|
321
333
|
},
|
|
322
334
|
yaxis: {
|
|
323
|
-
title: { text:
|
|
324
|
-
labels: { style: { colors:
|
|
335
|
+
title: { text: d },
|
|
336
|
+
labels: { style: { colors: c ? "#94a3b8" : "#6b7280", fontSize: "11px" } }
|
|
325
337
|
},
|
|
326
338
|
colors: b,
|
|
327
339
|
legend: {
|
|
328
340
|
show: i.length > 1 || ((l = n.showLegend) != null ? l : !1),
|
|
329
341
|
position: "bottom",
|
|
330
|
-
labels: { colors:
|
|
342
|
+
labels: { colors: c ? "#94a3b8" : "#6b7280" }
|
|
331
343
|
},
|
|
332
344
|
grid: {
|
|
333
|
-
borderColor:
|
|
345
|
+
borderColor: c ? "#1e293b" : "#f3f4f6",
|
|
334
346
|
strokeDashArray: 4,
|
|
335
347
|
padding: {
|
|
336
348
|
bottom: a.length > 8 ? 60 : 10
|
|
@@ -352,10 +364,10 @@ class O {
|
|
|
352
364
|
};
|
|
353
365
|
}
|
|
354
366
|
buildPieOptions(e, t, s, r) {
|
|
355
|
-
const i = e.properties || {}, a = t.length > 0 ? Object.keys(t[0]) : [],
|
|
367
|
+
const i = e.properties || {}, a = t.length > 0 ? Object.keys(t[0]) : [], o = a[0] || "label", d = a[1] || "value", n = t.map((h) => {
|
|
356
368
|
var p;
|
|
357
|
-
return String((p =
|
|
358
|
-
}), b = t.map((
|
|
369
|
+
return String((p = h[o]) != null ? p : "");
|
|
370
|
+
}), b = t.map((h) => Number(h[d]) || 0), c = s === "dark", l = i.colors ? Object.values(i.colors) : ["#6366f1", "#8b5cf6", "#ec4899", "#f59e0b", "#10b981", "#3b82f6"];
|
|
359
371
|
return {
|
|
360
372
|
chart: {
|
|
361
373
|
type: e.type,
|
|
@@ -370,7 +382,7 @@ class O {
|
|
|
370
382
|
colors: l,
|
|
371
383
|
legend: {
|
|
372
384
|
position: "bottom",
|
|
373
|
-
labels: { colors:
|
|
385
|
+
labels: { colors: c ? "#94a3b8" : "#6b7280" }
|
|
374
386
|
},
|
|
375
387
|
tooltip: { theme: s },
|
|
376
388
|
dataLabels: { enabled: n.length <= 8 },
|
|
@@ -388,7 +400,7 @@ class O {
|
|
|
388
400
|
try {
|
|
389
401
|
const l = typeof s.selectedYAxisColumn == "string" ? JSON.parse(s.selectedYAxisColumn) : s.selectedYAxisColumn;
|
|
390
402
|
Array.isArray(l) && (a = l.map(
|
|
391
|
-
(
|
|
403
|
+
(h) => typeof h == "string" ? { column: h } : h
|
|
392
404
|
));
|
|
393
405
|
} catch (l) {
|
|
394
406
|
}
|
|
@@ -397,23 +409,23 @@ class O {
|
|
|
397
409
|
a = (Array.isArray(l) ? l : [l]).map((p) => ({ column: String(p) }));
|
|
398
410
|
}
|
|
399
411
|
!a.length && r.length > 1 && (a = r.slice(1).map((l) => ({ column: l })));
|
|
400
|
-
const
|
|
401
|
-
var
|
|
402
|
-
return String((
|
|
403
|
-
}),
|
|
404
|
-
const
|
|
412
|
+
const o = t.map((l) => {
|
|
413
|
+
var h;
|
|
414
|
+
return String((h = l[i]) != null ? h : "");
|
|
415
|
+
}), d = t.length > 0 ? Object.keys(t[0]) : [], n = a.map((l) => {
|
|
416
|
+
const h = d.includes(l.column) ? l.column : null, p = h ? null : d.find((u) => u.includes(l.column) || l.column.includes(u)), f = !h && !p ? d.find((u) => {
|
|
405
417
|
var y;
|
|
406
|
-
return
|
|
407
|
-
}) : null,
|
|
418
|
+
return u !== i && !isNaN(Number((y = t[0]) == null ? void 0 : y[u]));
|
|
419
|
+
}) : null, g = h || p || f || l.column;
|
|
408
420
|
return {
|
|
409
421
|
name: l.label || l.column.replace(/_/g, " "),
|
|
410
|
-
data: t.map((
|
|
411
|
-
const y =
|
|
422
|
+
data: t.map((u) => {
|
|
423
|
+
const y = u[g];
|
|
412
424
|
return y != null ? Number(y) : null;
|
|
413
425
|
})
|
|
414
426
|
};
|
|
415
|
-
}), b = s.xAxisLabel || i.replace(/_/g, " "),
|
|
416
|
-
return { series: n, categories:
|
|
427
|
+
}), b = s.xAxisLabel || i.replace(/_/g, " "), c = s.yAxisLabel || (n.length === 1 ? n[0].name : "Values");
|
|
428
|
+
return { series: n, categories: o, xAxisLabel: b, yAxisLabel: c };
|
|
417
429
|
}
|
|
418
430
|
renderEmpty(e) {
|
|
419
431
|
this.container.innerHTML = `
|
|
@@ -424,34 +436,126 @@ class O {
|
|
|
424
436
|
`;
|
|
425
437
|
}
|
|
426
438
|
}
|
|
427
|
-
class
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
439
|
+
class z {
|
|
440
|
+
constructor() {
|
|
441
|
+
this.columns = [], this.allData = [], this.currentRows = [], this.totalRows = 0, this.currentPage = 1, this.currentPageSize = 10, this.searchTerm = "", this.isLoading = !1;
|
|
442
|
+
}
|
|
443
|
+
// ── Public API ─────────────────────────────────────────────────────────────
|
|
444
|
+
render(e, t, s, r) {
|
|
445
|
+
var b;
|
|
446
|
+
this.container = e, this.component = t, this.fetchPage = r, this.searchTerm = "", this.currentPage = 1, this.currentPageSize = 10;
|
|
447
|
+
const i = s && !Array.isArray(s) && "rows" in s;
|
|
448
|
+
if (i) {
|
|
449
|
+
const c = s;
|
|
450
|
+
this.currentRows = c.rows, this.allData = [], this.totalRows = c.total, this.currentPage = c.page, this.currentPageSize = c.pageSize;
|
|
451
|
+
} else
|
|
452
|
+
this.allData = s || [], this.currentRows = [], this.totalRows = this.allData.length, this.currentPage = 1;
|
|
453
|
+
if (i && s.rows.length === 0 && s.total === 0 || !i && this.allData.length === 0) {
|
|
431
454
|
e.innerHTML = `
|
|
432
455
|
<div class="ds-table-card">
|
|
433
|
-
<div class="ds-table-
|
|
456
|
+
<div class="ds-table-header-row">
|
|
457
|
+
<span class="ds-table-dot"></span>
|
|
458
|
+
<div class="ds-table-title">${this.escape(t.title || "")}</div>
|
|
459
|
+
</div>
|
|
434
460
|
<div class="ds-chart-empty">No data available</div>
|
|
435
461
|
</div>
|
|
436
462
|
`;
|
|
437
463
|
return;
|
|
438
464
|
}
|
|
439
|
-
const
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
465
|
+
const a = i ? s.rows[0] : this.allData[0], o = a ? Object.keys(a) : [], d = ((b = t.properties) == null ? void 0 : b.columns) || [], n = d.length ? d.filter((c) => o.includes(c)) : [];
|
|
466
|
+
this.columns = n.length ? n : o, this.paint();
|
|
467
|
+
}
|
|
468
|
+
// ── Rendering ──────────────────────────────────────────────────────────────
|
|
469
|
+
paint() {
|
|
470
|
+
const { rows: e, startNum: t } = this.getPageRows(), s = Math.max(1, Math.ceil(this.totalRows / this.currentPageSize)), r = (this.currentPage - 1) * this.currentPageSize + 1, i = this.fetchPage ? Math.min(r - 1 + (this.isLoading ? this.currentPageSize : e.length), this.totalRows) : Math.min(this.currentPage * this.currentPageSize, this.totalRows), a = this.columns.map((l) => `<th>${this.escape(this.formatHeader(l))}</th>`).join(""), o = e.length === 0 ? `<tr><td colspan="${this.columns.length + 1}" style="text-align:center;padding:20px;color:#9ca3af">No results found</td></tr>` : e.map((l, h) => {
|
|
471
|
+
const p = this.columns.map((f) => {
|
|
472
|
+
const g = l[f];
|
|
473
|
+
return `<td title="${this.escape(String(g != null ? g : ""))}">${this.escape(this.formatValue(g))}</td>`;
|
|
474
|
+
}).join("");
|
|
475
|
+
return `<tr><td class="ds-table-sno">${t + h}</td>${p}</tr>`;
|
|
476
|
+
}).join(""), d = this.currentPageSize, n = [10, 25, 50, 100].map((l) => `<option value="${l}"${l === d ? " selected" : ""}>${l}</option>`).join(""), b = this.currentPage <= 1, c = this.currentPage >= s;
|
|
477
|
+
this.container.innerHTML = `
|
|
444
478
|
<div class="ds-table-card">
|
|
445
|
-
<div class="ds-table-
|
|
479
|
+
<div class="ds-table-header-row">
|
|
480
|
+
<div class="ds-table-title-wrap">
|
|
481
|
+
<span class="ds-table-dot"></span>
|
|
482
|
+
<span class="ds-table-title">${this.escape(this.component.title || "")}</span>
|
|
483
|
+
</div>
|
|
484
|
+
</div>
|
|
446
485
|
<div class="ds-table-scroll">
|
|
447
486
|
<table class="ds-table">
|
|
448
|
-
<thead><tr>${
|
|
487
|
+
<thead><tr><th class="ds-table-sno-th">S.No</th>${a}</tr></thead>
|
|
449
488
|
<tbody>${o}</tbody>
|
|
450
489
|
</table>
|
|
451
490
|
</div>
|
|
491
|
+
<div class="ds-table-footer">
|
|
492
|
+
<div class="ds-table-info">
|
|
493
|
+
<span>${r.toLocaleString()}–${i.toLocaleString()} of ${this.totalRows.toLocaleString()}</span>
|
|
494
|
+
<span class="ds-table-rows-label">Rows:</span>
|
|
495
|
+
<select class="ds-table-page-size">${n}</select>
|
|
496
|
+
</div>
|
|
497
|
+
<div class="ds-table-pagination">
|
|
498
|
+
<button class="ds-table-pg-btn" data-action="first" ${b ? "disabled" : ""}>«</button>
|
|
499
|
+
<button class="ds-table-pg-btn" data-action="prev" ${b ? "disabled" : ""}>Previous</button>
|
|
500
|
+
<span class="ds-table-pg-info">Page ${this.currentPage} of ${s}</span>
|
|
501
|
+
<button class="ds-table-pg-btn" data-action="next" ${c ? "disabled" : ""}>Next</button>
|
|
502
|
+
<button class="ds-table-pg-btn" data-action="last" ${c ? "disabled" : ""}>»</button>
|
|
503
|
+
</div>
|
|
504
|
+
</div>
|
|
505
|
+
${this.isLoading ? '<div class="ds-table-loading-overlay"><div class="ds-embed-spinner"></div></div>' : ""}
|
|
452
506
|
</div>
|
|
453
|
-
|
|
507
|
+
`, this.attachEvents();
|
|
508
|
+
}
|
|
509
|
+
attachEvents() {
|
|
510
|
+
const e = this.container.querySelector(".ds-table-search");
|
|
511
|
+
e == null || e.addEventListener("input", () => {
|
|
512
|
+
this.searchTerm = e.value, this.currentPage = 1, this.fetchPage || (this.totalRows = this.filteredRows().length, this.paint());
|
|
513
|
+
});
|
|
514
|
+
const t = this.container.querySelector(".ds-table-page-size");
|
|
515
|
+
t == null || t.addEventListener("change", () => {
|
|
516
|
+
this.currentPageSize = parseInt(t.value, 10), this.currentPage = 1, this.fetchPage ? this.loadPage(1) : (this.totalRows = this.filteredRows().length, this.paint());
|
|
517
|
+
}), this.container.querySelectorAll("[data-action]").forEach((s) => {
|
|
518
|
+
s.addEventListener("click", () => {
|
|
519
|
+
if (s.disabled) return;
|
|
520
|
+
const r = Math.max(1, Math.ceil(this.totalRows / this.currentPageSize)), i = s.dataset.action;
|
|
521
|
+
let a = this.currentPage;
|
|
522
|
+
i === "first" ? a = 1 : i === "prev" ? a = Math.max(1, this.currentPage - 1) : i === "next" ? a = Math.min(r, this.currentPage + 1) : i === "last" && (a = r), (a !== this.currentPage || i === "first" || i === "last") && (this.currentPage = a, this.fetchPage ? this.loadPage(a) : this.paint());
|
|
523
|
+
});
|
|
524
|
+
});
|
|
525
|
+
}
|
|
526
|
+
// ── Server-side page load ──────────────────────────────────────────────────
|
|
527
|
+
async loadPage(e) {
|
|
528
|
+
if (this.fetchPage) {
|
|
529
|
+
this.isLoading = !0, this.currentPage = e, this.paint();
|
|
530
|
+
try {
|
|
531
|
+
const t = await this.fetchPage(e, this.currentPageSize);
|
|
532
|
+
this.currentRows = t.rows || [], this.totalRows = Number(t.total) || this.currentRows.length, this.currentPage = Number(t.page) || e;
|
|
533
|
+
} catch (t) {
|
|
534
|
+
console.error("[Deepspot SDK] TableRenderer: page fetch failed", t);
|
|
535
|
+
} finally {
|
|
536
|
+
this.isLoading = !1, this.paint();
|
|
537
|
+
}
|
|
538
|
+
}
|
|
539
|
+
}
|
|
540
|
+
// ── Data helpers ───────────────────────────────────────────────────────────
|
|
541
|
+
getPageRows() {
|
|
542
|
+
const e = (this.currentPage - 1) * this.currentPageSize + 1;
|
|
543
|
+
if (this.fetchPage)
|
|
544
|
+
return { rows: this.currentRows, startNum: e };
|
|
545
|
+
const t = this.filteredRows(), s = (this.currentPage - 1) * this.currentPageSize;
|
|
546
|
+
return { rows: t.slice(s, s + this.currentPageSize), startNum: e };
|
|
547
|
+
}
|
|
548
|
+
filteredRows() {
|
|
549
|
+
if (!this.searchTerm) return this.allData;
|
|
550
|
+
const e = this.searchTerm.toLowerCase();
|
|
551
|
+
return this.allData.filter(
|
|
552
|
+
(t) => this.columns.some((s) => {
|
|
553
|
+
var r;
|
|
554
|
+
return String((r = t[s]) != null ? r : "").toLowerCase().includes(e);
|
|
555
|
+
})
|
|
556
|
+
);
|
|
454
557
|
}
|
|
558
|
+
// ── Formatters ─────────────────────────────────────────────────────────────
|
|
455
559
|
formatHeader(e) {
|
|
456
560
|
return e.replace(/_/g, " ").replace(/\b\w/g, (t) => t.toUpperCase());
|
|
457
561
|
}
|
|
@@ -462,26 +566,26 @@ class j {
|
|
|
462
566
|
return e.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """);
|
|
463
567
|
}
|
|
464
568
|
}
|
|
465
|
-
class
|
|
569
|
+
class j {
|
|
466
570
|
render(e, t, s) {
|
|
467
571
|
const r = t.properties || {};
|
|
468
572
|
let i = null;
|
|
469
573
|
if (s && s.length > 0) {
|
|
470
|
-
const
|
|
471
|
-
if (
|
|
472
|
-
i =
|
|
574
|
+
const h = s[0], p = r.metric || Object.keys(h)[0], f = h[p];
|
|
575
|
+
if (f !== void 0)
|
|
576
|
+
i = f;
|
|
473
577
|
else {
|
|
474
|
-
const
|
|
475
|
-
(
|
|
578
|
+
const g = Object.keys(h).find(
|
|
579
|
+
(u) => u.includes(p) || p.includes(u)
|
|
476
580
|
);
|
|
477
|
-
i =
|
|
581
|
+
i = h[g != null ? g : Object.keys(h)[0]];
|
|
478
582
|
}
|
|
479
583
|
}
|
|
480
|
-
const a = this.formatValue(i, r),
|
|
584
|
+
const a = this.formatValue(i, r), o = r.backgroundColor || "", d = r.textColor || "", n = t.title || "", b = o ? `background:${o};border-color:${o};` : "", c = d ? `color:${d};` : "", l = d ? `color:${d};opacity:0.7;` : "";
|
|
481
585
|
e.innerHTML = `
|
|
482
586
|
<div class="ds-card"${b ? ` style="${b}"` : ""}>
|
|
483
587
|
<div class="ds-card-label"${l ? ` style="${l}"` : ""}>${n}</div>
|
|
484
|
-
<div class="ds-card-value"${
|
|
588
|
+
<div class="ds-card-value"${c ? ` style="${c}"` : ""}>${a}</div>
|
|
485
589
|
</div>
|
|
486
590
|
`;
|
|
487
591
|
}
|
|
@@ -494,7 +598,7 @@ class M {
|
|
|
494
598
|
return Math.abs(s) >= 1e6 ? a = (s / 1e6).toFixed(1) + "M" : Math.abs(s) >= 1e3 ? a = (s / 1e3).toFixed(1) + "K" : a = s % 1 === 0 ? s.toLocaleString() : s.toFixed(2), `${r}${a}${i}`;
|
|
495
599
|
}
|
|
496
600
|
}
|
|
497
|
-
class
|
|
601
|
+
class q {
|
|
498
602
|
constructor(e, t) {
|
|
499
603
|
this.currentValues = {}, this.container = e, this.onFilterChange = t;
|
|
500
604
|
}
|
|
@@ -536,9 +640,9 @@ class z {
|
|
|
536
640
|
${r}
|
|
537
641
|
<select class="ds-filter-select" id="${s}" data-filter-id="${e.filterId}">
|
|
538
642
|
<option value="">All</option>
|
|
539
|
-
${(e.options || []).map((
|
|
540
|
-
<option value="${this.escAttr(
|
|
541
|
-
${this.escText(
|
|
643
|
+
${(e.options || []).map((o) => `
|
|
644
|
+
<option value="${this.escAttr(o)}" ${t === o ? "selected" : ""}>
|
|
645
|
+
${this.escText(o)}
|
|
542
646
|
</option>
|
|
543
647
|
`).join("")}
|
|
544
648
|
</select>
|
|
@@ -548,8 +652,8 @@ class z {
|
|
|
548
652
|
<div class="ds-filter-item">
|
|
549
653
|
${r}
|
|
550
654
|
<select class="ds-filter-select" id="${s}" data-filter-id="${e.filterId}" multiple size="1">
|
|
551
|
-
${(e.options || []).map((
|
|
552
|
-
<option value="${this.escAttr(
|
|
655
|
+
${(e.options || []).map((o) => `
|
|
656
|
+
<option value="${this.escAttr(o)}">${this.escText(o)}</option>
|
|
553
657
|
`).join("")}
|
|
554
658
|
</select>
|
|
555
659
|
</div>`;
|
|
@@ -592,20 +696,20 @@ class z {
|
|
|
592
696
|
attachListeners(e) {
|
|
593
697
|
const t = {};
|
|
594
698
|
this.container.querySelectorAll("[data-filter-id]").forEach((s) => {
|
|
595
|
-
const r = s.dataset.filterId, i = s.dataset.datePart, a = e.find((
|
|
596
|
-
let
|
|
699
|
+
const r = s.dataset.filterId, i = s.dataset.datePart, a = e.find((d) => d.filterId === r), o = () => {
|
|
700
|
+
let d;
|
|
597
701
|
if ((a == null ? void 0 : a.type) === "date-range" && i)
|
|
598
|
-
t[r] = t[r] || {}, t[r][i] = s.value,
|
|
702
|
+
t[r] = t[r] || {}, t[r][i] = s.value, d = { ...t[r] };
|
|
599
703
|
else if ((a == null ? void 0 : a.type) === "multi-select") {
|
|
600
704
|
const n = s;
|
|
601
|
-
|
|
705
|
+
d = Array.from(n.selectedOptions).map((b) => b.value).filter(Boolean);
|
|
602
706
|
} else
|
|
603
|
-
|
|
604
|
-
this.currentValues[r] =
|
|
707
|
+
d = s.value;
|
|
708
|
+
this.currentValues[r] = d, this.onFilterChange(r, d);
|
|
605
709
|
};
|
|
606
710
|
s.addEventListener(
|
|
607
711
|
(a == null ? void 0 : a.type) === "text-input" ? "input" : "change",
|
|
608
|
-
|
|
712
|
+
o
|
|
609
713
|
);
|
|
610
714
|
});
|
|
611
715
|
}
|
|
@@ -616,9 +720,9 @@ class z {
|
|
|
616
720
|
return e.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">");
|
|
617
721
|
}
|
|
618
722
|
}
|
|
619
|
-
class
|
|
723
|
+
class M {
|
|
620
724
|
constructor(e, t) {
|
|
621
|
-
this.activePageId = "", this.activeTabId = "", this.activeFilters = {}, this.chartRenderers = /* @__PURE__ */ new Map(), this.tableRenderer = new
|
|
725
|
+
this.activePageId = "", this.activeTabId = "", this.activeFilters = {}, this.chartRenderers = /* @__PURE__ */ new Map(), this.tableRenderer = new z(), this.cardRenderer = new j(), this.isLoadingTab = !1, this.root = e, this.opts = t, this.activeFilters = { ...t.initialFilters };
|
|
622
726
|
}
|
|
623
727
|
// ── Initial full render ───────────────────────────────────────────────────
|
|
624
728
|
render(e) {
|
|
@@ -640,14 +744,47 @@ class N {
|
|
|
640
744
|
this.chartRenderers.forEach((e) => e.destroy()), this.chartRenderers.clear(), this.root.innerHTML = "";
|
|
641
745
|
}
|
|
642
746
|
exportPDF() {
|
|
643
|
-
|
|
644
|
-
e
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
747
|
+
var l, h;
|
|
748
|
+
const e = this.root.querySelector("#ds-grid");
|
|
749
|
+
if (!e) return;
|
|
750
|
+
const t = this.root.style.height, s = this.root.style.overflow;
|
|
751
|
+
this.root.style.height = "auto", this.root.style.overflow = "visible";
|
|
752
|
+
const r = this.root.querySelector("#ds-canvas"), i = (l = r == null ? void 0 : r.style.height) != null ? l : "", a = (h = r == null ? void 0 : r.style.overflow) != null ? h : "";
|
|
753
|
+
r && (r.style.height = "auto", r.style.overflow = "visible");
|
|
754
|
+
const o = Array.from(e.querySelectorAll(".ds-table-scroll")), d = o.map((p) => ({
|
|
755
|
+
el: p,
|
|
756
|
+
overflow: p.style.overflow,
|
|
757
|
+
maxHeight: p.style.maxHeight,
|
|
758
|
+
height: p.style.height
|
|
759
|
+
}));
|
|
760
|
+
o.forEach((p) => {
|
|
761
|
+
p.style.overflow = "visible", p.style.maxHeight = "none", p.style.height = "auto";
|
|
762
|
+
});
|
|
763
|
+
const n = e.offsetWidth, b = parseInt(e.style.height, 10) || e.offsetHeight, c = e.getBoundingClientRect().top + window.scrollY;
|
|
764
|
+
import("./html2canvas.esm-CzwMv54K.js").then(
|
|
765
|
+
({ default: p }) => p(e, {
|
|
766
|
+
scale: 2,
|
|
767
|
+
useCORS: !0,
|
|
768
|
+
allowTaint: !0,
|
|
769
|
+
logging: !1,
|
|
770
|
+
width: n,
|
|
771
|
+
height: b,
|
|
772
|
+
windowWidth: n,
|
|
773
|
+
windowHeight: b,
|
|
774
|
+
scrollX: 0,
|
|
775
|
+
scrollY: -c
|
|
776
|
+
}).then((f) => {
|
|
777
|
+
this.root.style.height = t, this.root.style.overflow = s, r && (r.style.height = i, r.style.overflow = a), d.forEach(({ el: g, overflow: u, maxHeight: y, height: v }) => {
|
|
778
|
+
g.style.overflow = u, g.style.maxHeight = y, g.style.height = v;
|
|
779
|
+
}), import("./jspdf.es.min-d9hlG26J.js").then((g) => g.j).then(({ jsPDF: g }) => {
|
|
780
|
+
const u = f.width / 2, y = f.height / 2, v = new g({
|
|
781
|
+
orientation: u >= y ? "landscape" : "portrait",
|
|
782
|
+
unit: "px",
|
|
783
|
+
format: [u, y]
|
|
784
|
+
});
|
|
785
|
+
v.addImage(f.toDataURL("image/png"), "PNG", 0, 0, u, y), v.save(`${this.renderData.dashboard.name || "dashboard"}.pdf`);
|
|
786
|
+
});
|
|
787
|
+
})
|
|
651
788
|
);
|
|
652
789
|
}
|
|
653
790
|
exportCSV() {
|
|
@@ -655,9 +792,9 @@ class N {
|
|
|
655
792
|
const t = this.renderData.data[e.id];
|
|
656
793
|
if (!(t != null && t.length) || !["table", "bar", "line", "area"].includes(e.type)) return;
|
|
657
794
|
const s = Object.keys(t[0]), r = [s.join(","), ...t.map(
|
|
658
|
-
(a) => s.map((
|
|
659
|
-
var
|
|
660
|
-
return JSON.stringify((
|
|
795
|
+
(a) => s.map((o) => {
|
|
796
|
+
var d;
|
|
797
|
+
return JSON.stringify((d = a[o]) != null ? d : "");
|
|
661
798
|
}).join(",")
|
|
662
799
|
)].join(`
|
|
663
800
|
`);
|
|
@@ -688,10 +825,10 @@ class N {
|
|
|
688
825
|
</div>
|
|
689
826
|
`, this.root.style.position = "relative", this.opts.hideExport || this.buildExportToolbar();
|
|
690
827
|
const i = this.root.querySelector("#ds-filter-container");
|
|
691
|
-
this.filterRenderer = new
|
|
692
|
-
var b,
|
|
693
|
-
const
|
|
694
|
-
this.activeFilters[n] =
|
|
828
|
+
this.filterRenderer = new q(i, (a, o) => {
|
|
829
|
+
var b, c;
|
|
830
|
+
const d = this.renderData.filters.find((l) => l.filterId === a), n = (d == null ? void 0 : d.applyToField) || a;
|
|
831
|
+
this.activeFilters[n] = o, (c = (b = this.opts).onFilterChange) == null || c.call(b, this.activeFilters), this.opts.onTabSwitch(this.activePageId, this.activeTabId);
|
|
695
832
|
});
|
|
696
833
|
}
|
|
697
834
|
buildExportToolbar() {
|
|
@@ -699,7 +836,7 @@ class N {
|
|
|
699
836
|
const e = this.root.querySelector("#ds-toolbar");
|
|
700
837
|
e && (e.innerHTML = `
|
|
701
838
|
<button class="ds-toolbar-btn" id="ds-btn-pdf">⬇ PDF</button>
|
|
702
|
-
<button class="ds-toolbar-btn" id="ds-btn-csv">⬇ CSV</button>
|
|
839
|
+
<button class="ds-toolbar-btn" id="ds-btn-csv" style="display:none">⬇ CSV</button>
|
|
703
840
|
`, (t = e.querySelector("#ds-btn-pdf")) == null || t.addEventListener("click", () => this.exportPDF()), (s = e.querySelector("#ds-btn-csv")) == null || s.addEventListener("click", () => this.exportCSV()));
|
|
704
841
|
}
|
|
705
842
|
// ── Navigation ────────────────────────────────────────────────────────────
|
|
@@ -781,19 +918,19 @@ class N {
|
|
|
781
918
|
e.style.height = "200px", e.innerHTML = '<div class="ds-chart-empty" style="padding-top:80px;">No components on this tab.</div>';
|
|
782
919
|
return;
|
|
783
920
|
}
|
|
784
|
-
const s = e.clientWidth || this.root.clientWidth || 800, r = t.map((n) => n.position), i = r.length ? Math.min(...r.map((n) => n.y)) : 0, a = new
|
|
785
|
-
e.style.height = `${
|
|
786
|
-
const
|
|
921
|
+
const s = e.clientWidth || this.root.clientWidth || 800, r = t.map((n) => n.position), i = r.length ? Math.min(...r.map((n) => n.y)) : 0, a = new A(s, i);
|
|
922
|
+
e.style.height = `${A.totalHeight(r)}px`, e.innerHTML = "";
|
|
923
|
+
const o = 36, d = [];
|
|
787
924
|
t.forEach((n) => {
|
|
788
925
|
const b = document.createElement("div");
|
|
789
926
|
b.className = "ds-component-wrapper", b.dataset.componentId = n.id, a.applyStyles(b, n.position), e.appendChild(b);
|
|
790
|
-
const
|
|
791
|
-
|
|
792
|
-
}), Promise.all(
|
|
927
|
+
const c = a.toPx(n.position), l = Math.max(50, c.height - o);
|
|
928
|
+
d.push(this.renderComponent(b, n, l));
|
|
929
|
+
}), Promise.all(d).catch(() => {
|
|
793
930
|
});
|
|
794
931
|
}
|
|
795
932
|
async renderComponent(e, t, s) {
|
|
796
|
-
var a,
|
|
933
|
+
var a, o;
|
|
797
934
|
const r = this.renderData.data[t.id] || [], i = this.opts.theme;
|
|
798
935
|
switch (t.type) {
|
|
799
936
|
case "bar":
|
|
@@ -801,19 +938,21 @@ class N {
|
|
|
801
938
|
case "pie":
|
|
802
939
|
case "donut":
|
|
803
940
|
case "area": {
|
|
804
|
-
const
|
|
805
|
-
await
|
|
941
|
+
const d = new O(e);
|
|
942
|
+
await d.render(t, r, i, s), this.chartRenderers.set(t.id, d);
|
|
806
943
|
break;
|
|
807
944
|
}
|
|
808
|
-
case "table":
|
|
809
|
-
this.
|
|
945
|
+
case "table": {
|
|
946
|
+
const d = this.opts.onFetchTablePage ? (n, b) => this.opts.onFetchTablePage(t.id, n, b) : void 0;
|
|
947
|
+
this.tableRenderer.render(e, t, r, d);
|
|
810
948
|
break;
|
|
949
|
+
}
|
|
811
950
|
case "number-card":
|
|
812
951
|
this.cardRenderer.render(e, t, r);
|
|
813
952
|
break;
|
|
814
953
|
case "text": {
|
|
815
|
-
const
|
|
816
|
-
e.innerHTML = `<div style="${
|
|
954
|
+
const d = Object.entries(((a = t.properties) == null ? void 0 : a.style) || {}).map(([n, b]) => `${n}:${b}`).join(";");
|
|
955
|
+
e.innerHTML = `<div style="${d};padding:8px;">${((o = t.properties) == null ? void 0 : o.content) || ""}</div>`;
|
|
817
956
|
break;
|
|
818
957
|
}
|
|
819
958
|
}
|
|
@@ -835,7 +974,7 @@ class N {
|
|
|
835
974
|
}
|
|
836
975
|
class H {
|
|
837
976
|
constructor(e, t) {
|
|
838
|
-
this.chartRenderer = null, this.tableRenderer = new
|
|
977
|
+
this.chartRenderer = null, this.tableRenderer = new z(), this.cardRenderer = new j(), this.root = e, this.theme = t;
|
|
839
978
|
}
|
|
840
979
|
render(e, t) {
|
|
841
980
|
const s = e.components[0];
|
|
@@ -894,12 +1033,12 @@ class H {
|
|
|
894
1033
|
}
|
|
895
1034
|
}
|
|
896
1035
|
}
|
|
897
|
-
let
|
|
898
|
-
function
|
|
899
|
-
if (!(
|
|
900
|
-
|
|
1036
|
+
let E = !1;
|
|
1037
|
+
function L() {
|
|
1038
|
+
if (!(E || typeof document == "undefined")) {
|
|
1039
|
+
E = !0;
|
|
901
1040
|
try {
|
|
902
|
-
const
|
|
1041
|
+
const m = `/* ─────────────────────────────────────────────────────────────────────────────
|
|
903
1042
|
Deepspot SDK — Base Embed Styles
|
|
904
1043
|
Injected once into the host page's <head> by the SDK.
|
|
905
1044
|
All selectors are scoped under .ds-embed-* to avoid leaking into host styles.
|
|
@@ -1182,6 +1321,7 @@ function F() {
|
|
|
1182
1321
|
overflow: hidden;
|
|
1183
1322
|
display: flex;
|
|
1184
1323
|
flex-direction: column;
|
|
1324
|
+
position: relative;
|
|
1185
1325
|
}
|
|
1186
1326
|
|
|
1187
1327
|
.ds-theme-dark .ds-table-card {
|
|
@@ -1189,21 +1329,100 @@ function F() {
|
|
|
1189
1329
|
border-color: #334155;
|
|
1190
1330
|
}
|
|
1191
1331
|
|
|
1332
|
+
/* ── Table header: dot + title on left, search on right ──────────────────────*/
|
|
1333
|
+
.ds-table-header-row {
|
|
1334
|
+
display: flex;
|
|
1335
|
+
align-items: center;
|
|
1336
|
+
justify-content: space-between;
|
|
1337
|
+
padding: 10px 14px 8px;
|
|
1338
|
+
flex-shrink: 0;
|
|
1339
|
+
gap: 8px;
|
|
1340
|
+
border-bottom: 1px solid #f3f4f6;
|
|
1341
|
+
}
|
|
1342
|
+
|
|
1343
|
+
.ds-theme-dark .ds-table-header-row {
|
|
1344
|
+
border-bottom-color: #334155;
|
|
1345
|
+
}
|
|
1346
|
+
|
|
1347
|
+
.ds-table-title-wrap {
|
|
1348
|
+
display: flex;
|
|
1349
|
+
align-items: center;
|
|
1350
|
+
gap: 6px;
|
|
1351
|
+
min-width: 0;
|
|
1352
|
+
}
|
|
1353
|
+
|
|
1354
|
+
.ds-table-dot {
|
|
1355
|
+
width: 8px;
|
|
1356
|
+
height: 8px;
|
|
1357
|
+
border-radius: 50%;
|
|
1358
|
+
background: #6366f1;
|
|
1359
|
+
flex-shrink: 0;
|
|
1360
|
+
}
|
|
1361
|
+
|
|
1192
1362
|
.ds-table-title {
|
|
1193
|
-
padding: 10px 14px 4px;
|
|
1194
1363
|
font-size: 13px;
|
|
1195
1364
|
font-weight: 600;
|
|
1196
1365
|
color: #374151;
|
|
1197
|
-
|
|
1366
|
+
white-space: nowrap;
|
|
1367
|
+
overflow: hidden;
|
|
1368
|
+
text-overflow: ellipsis;
|
|
1198
1369
|
}
|
|
1199
1370
|
|
|
1200
1371
|
.ds-theme-dark .ds-table-title {
|
|
1201
1372
|
color: #e2e8f0;
|
|
1202
1373
|
}
|
|
1203
1374
|
|
|
1375
|
+
/* ── Search ──────────────────────────────────────────────────────────────────*/
|
|
1376
|
+
.ds-table-search-wrap {
|
|
1377
|
+
position: relative;
|
|
1378
|
+
flex-shrink: 0;
|
|
1379
|
+
}
|
|
1380
|
+
|
|
1381
|
+
.ds-table-search-icon {
|
|
1382
|
+
position: absolute;
|
|
1383
|
+
left: 8px;
|
|
1384
|
+
top: 50%;
|
|
1385
|
+
transform: translateY(-50%);
|
|
1386
|
+
width: 14px;
|
|
1387
|
+
height: 14px;
|
|
1388
|
+
color: #9ca3af;
|
|
1389
|
+
pointer-events: none;
|
|
1390
|
+
}
|
|
1391
|
+
|
|
1392
|
+
.ds-table-search {
|
|
1393
|
+
height: 30px;
|
|
1394
|
+
padding: 0 10px 0 28px;
|
|
1395
|
+
border: 1px solid #e5e7eb;
|
|
1396
|
+
border-radius: 6px;
|
|
1397
|
+
font-size: 12px;
|
|
1398
|
+
background: #f9fafb;
|
|
1399
|
+
color: #374151;
|
|
1400
|
+
width: 180px;
|
|
1401
|
+
outline: none;
|
|
1402
|
+
transition: border-color 0.15s, box-shadow 0.15s;
|
|
1403
|
+
}
|
|
1404
|
+
|
|
1405
|
+
.ds-table-search:focus {
|
|
1406
|
+
border-color: #6366f1;
|
|
1407
|
+
box-shadow: 0 0 0 2px rgba(99,102,241,0.15);
|
|
1408
|
+
background: #fff;
|
|
1409
|
+
}
|
|
1410
|
+
|
|
1411
|
+
.ds-theme-dark .ds-table-search {
|
|
1412
|
+
background: #0f172a;
|
|
1413
|
+
border-color: #334155;
|
|
1414
|
+
color: #e2e8f0;
|
|
1415
|
+
}
|
|
1416
|
+
|
|
1417
|
+
.ds-theme-dark .ds-table-search:focus {
|
|
1418
|
+
background: #1e293b;
|
|
1419
|
+
}
|
|
1420
|
+
|
|
1421
|
+
/* ── Scroll area ─────────────────────────────────────────────────────────────*/
|
|
1204
1422
|
.ds-table-scroll {
|
|
1205
1423
|
flex: 1;
|
|
1206
1424
|
overflow: auto;
|
|
1425
|
+
min-height: 0;
|
|
1207
1426
|
}
|
|
1208
1427
|
|
|
1209
1428
|
.ds-table {
|
|
@@ -1212,6 +1431,21 @@ function F() {
|
|
|
1212
1431
|
font-size: 12px;
|
|
1213
1432
|
}
|
|
1214
1433
|
|
|
1434
|
+
.ds-table-sno-th {
|
|
1435
|
+
width: 48px;
|
|
1436
|
+
text-align: center !important;
|
|
1437
|
+
}
|
|
1438
|
+
|
|
1439
|
+
.ds-table-sno {
|
|
1440
|
+
text-align: center;
|
|
1441
|
+
color: #9ca3af;
|
|
1442
|
+
font-size: 11px;
|
|
1443
|
+
}
|
|
1444
|
+
|
|
1445
|
+
.ds-theme-dark .ds-table-sno {
|
|
1446
|
+
color: #64748b;
|
|
1447
|
+
}
|
|
1448
|
+
|
|
1215
1449
|
.ds-table th {
|
|
1216
1450
|
position: sticky;
|
|
1217
1451
|
top: 0;
|
|
@@ -1253,7 +1487,123 @@ function F() {
|
|
|
1253
1487
|
}
|
|
1254
1488
|
|
|
1255
1489
|
.ds-theme-dark .ds-table tr:hover td {
|
|
1490
|
+
background: #0f172a;
|
|
1491
|
+
}
|
|
1492
|
+
|
|
1493
|
+
/* ── Footer: info + pagination ───────────────────────────────────────────────*/
|
|
1494
|
+
.ds-table-footer {
|
|
1495
|
+
display: flex;
|
|
1496
|
+
align-items: center;
|
|
1497
|
+
justify-content: space-between;
|
|
1498
|
+
padding: 8px 14px;
|
|
1499
|
+
border-top: 1px solid #f3f4f6;
|
|
1500
|
+
flex-shrink: 0;
|
|
1501
|
+
gap: 8px;
|
|
1502
|
+
flex-wrap: wrap;
|
|
1503
|
+
}
|
|
1504
|
+
|
|
1505
|
+
.ds-theme-dark .ds-table-footer {
|
|
1506
|
+
border-top-color: #334155;
|
|
1507
|
+
}
|
|
1508
|
+
|
|
1509
|
+
.ds-table-info {
|
|
1510
|
+
display: flex;
|
|
1511
|
+
align-items: center;
|
|
1512
|
+
gap: 8px;
|
|
1513
|
+
font-size: 12px;
|
|
1514
|
+
color: #6b7280;
|
|
1515
|
+
}
|
|
1516
|
+
|
|
1517
|
+
.ds-theme-dark .ds-table-info {
|
|
1518
|
+
color: #94a3b8;
|
|
1519
|
+
}
|
|
1520
|
+
|
|
1521
|
+
.ds-table-rows-label {
|
|
1522
|
+
margin-left: 4px;
|
|
1523
|
+
}
|
|
1524
|
+
|
|
1525
|
+
.ds-table-page-size {
|
|
1526
|
+
height: 28px;
|
|
1527
|
+
padding: 0 6px;
|
|
1528
|
+
border: 1px solid #e5e7eb;
|
|
1529
|
+
border-radius: 5px;
|
|
1530
|
+
font-size: 12px;
|
|
1531
|
+
background: #fff;
|
|
1532
|
+
color: #374151;
|
|
1533
|
+
cursor: pointer;
|
|
1534
|
+
outline: none;
|
|
1535
|
+
}
|
|
1536
|
+
|
|
1537
|
+
.ds-theme-dark .ds-table-page-size {
|
|
1538
|
+
background: #0f172a;
|
|
1539
|
+
border-color: #334155;
|
|
1540
|
+
color: #e2e8f0;
|
|
1541
|
+
}
|
|
1542
|
+
|
|
1543
|
+
.ds-table-pagination {
|
|
1544
|
+
display: flex;
|
|
1545
|
+
align-items: center;
|
|
1546
|
+
gap: 6px;
|
|
1547
|
+
}
|
|
1548
|
+
|
|
1549
|
+
.ds-table-pg-btn {
|
|
1550
|
+
height: 28px;
|
|
1551
|
+
padding: 0 10px;
|
|
1552
|
+
border: 1px solid #e5e7eb;
|
|
1553
|
+
border-radius: 5px;
|
|
1554
|
+
font-size: 12px;
|
|
1555
|
+
font-weight: 500;
|
|
1556
|
+
background: #fff;
|
|
1557
|
+
color: #374151;
|
|
1558
|
+
cursor: pointer;
|
|
1559
|
+
transition: background 0.12s, border-color 0.12s;
|
|
1560
|
+
white-space: nowrap;
|
|
1561
|
+
}
|
|
1562
|
+
|
|
1563
|
+
.ds-table-pg-btn:hover:not(:disabled) {
|
|
1564
|
+
background: #f3f4f6;
|
|
1565
|
+
border-color: #d1d5db;
|
|
1566
|
+
}
|
|
1567
|
+
|
|
1568
|
+
.ds-table-pg-btn:disabled {
|
|
1569
|
+
opacity: 0.4;
|
|
1570
|
+
cursor: not-allowed;
|
|
1571
|
+
}
|
|
1572
|
+
|
|
1573
|
+
.ds-theme-dark .ds-table-pg-btn {
|
|
1256
1574
|
background: #1e293b;
|
|
1575
|
+
border-color: #334155;
|
|
1576
|
+
color: #e2e8f0;
|
|
1577
|
+
}
|
|
1578
|
+
|
|
1579
|
+
.ds-theme-dark .ds-table-pg-btn:hover:not(:disabled) {
|
|
1580
|
+
background: #0f172a;
|
|
1581
|
+
}
|
|
1582
|
+
|
|
1583
|
+
.ds-table-pg-info {
|
|
1584
|
+
font-size: 12px;
|
|
1585
|
+
color: #6b7280;
|
|
1586
|
+
white-space: nowrap;
|
|
1587
|
+
}
|
|
1588
|
+
|
|
1589
|
+
.ds-theme-dark .ds-table-pg-info {
|
|
1590
|
+
color: #94a3b8;
|
|
1591
|
+
}
|
|
1592
|
+
|
|
1593
|
+
/* ── Loading overlay while fetching a page ───────────────────────────────────*/
|
|
1594
|
+
.ds-table-loading-overlay {
|
|
1595
|
+
position: absolute;
|
|
1596
|
+
inset: 0;
|
|
1597
|
+
background: rgba(255,255,255,0.6);
|
|
1598
|
+
display: flex;
|
|
1599
|
+
align-items: center;
|
|
1600
|
+
justify-content: center;
|
|
1601
|
+
border-radius: 10px;
|
|
1602
|
+
z-index: 10;
|
|
1603
|
+
}
|
|
1604
|
+
|
|
1605
|
+
.ds-theme-dark .ds-table-loading-overlay {
|
|
1606
|
+
background: rgba(30,41,59,0.7);
|
|
1257
1607
|
}
|
|
1258
1608
|
|
|
1259
1609
|
/* ── KPI Number Card ───────────────────────────────────────────────────────── */
|
|
@@ -1335,34 +1685,34 @@ function F() {
|
|
|
1335
1685
|
background: #0f172a;
|
|
1336
1686
|
}
|
|
1337
1687
|
`, e = document.createElement("style");
|
|
1338
|
-
e.id = "deepspot-sdk-styles", e.textContent =
|
|
1339
|
-
} catch (
|
|
1688
|
+
e.id = "deepspot-sdk-styles", e.textContent = m, document.head.appendChild(e);
|
|
1689
|
+
} catch (m) {
|
|
1340
1690
|
}
|
|
1341
1691
|
}
|
|
1342
1692
|
}
|
|
1343
|
-
function
|
|
1344
|
-
if (typeof
|
|
1345
|
-
const e = document.querySelector(
|
|
1346
|
-
if (!e) throw new Error(`Deepspot SDK: container "${
|
|
1693
|
+
function D(m) {
|
|
1694
|
+
if (typeof m == "string") {
|
|
1695
|
+
const e = document.querySelector(m);
|
|
1696
|
+
if (!e) throw new Error(`Deepspot SDK: container "${m}" not found in DOM`);
|
|
1347
1697
|
return e;
|
|
1348
1698
|
}
|
|
1349
|
-
return
|
|
1699
|
+
return m;
|
|
1350
1700
|
}
|
|
1351
1701
|
class U {
|
|
1352
1702
|
constructor(e) {
|
|
1353
1703
|
if (!e.apiKey) throw new Error("Deepspot SDK: apiKey is required");
|
|
1354
1704
|
if (!e.baseUrl) throw new Error("Deepspot SDK: baseUrl is required");
|
|
1355
|
-
this.apiClient = new
|
|
1705
|
+
this.apiClient = new P(e.baseUrl, e.apiKey), L();
|
|
1356
1706
|
}
|
|
1357
1707
|
// ── Embed full dashboard ────────────────────────────────────────────────────
|
|
1358
1708
|
async embedDashboard(e) {
|
|
1359
|
-
var a,
|
|
1360
|
-
const t =
|
|
1709
|
+
var a, o, d, n, b;
|
|
1710
|
+
const t = D(e.container), s = (a = e.embedLevel) != null ? a : "dashboard", r = (o = e.theme) != null ? o : "light";
|
|
1361
1711
|
t.style.height = e.height || "600px", t.style.display = "block";
|
|
1362
1712
|
const i = this.createRoot(t, r);
|
|
1363
1713
|
this.showLoading(i);
|
|
1364
1714
|
try {
|
|
1365
|
-
const
|
|
1715
|
+
const c = await this.apiClient.getEmbedToken({
|
|
1366
1716
|
dashboardId: e.dashboardId,
|
|
1367
1717
|
embedType: "dashboard",
|
|
1368
1718
|
embedLevel: s,
|
|
@@ -1370,7 +1720,7 @@ class U {
|
|
|
1370
1720
|
tenantId: e.tenantId
|
|
1371
1721
|
}), l = await this.apiClient.getDashboardRender(
|
|
1372
1722
|
e.dashboardId,
|
|
1373
|
-
|
|
1723
|
+
c,
|
|
1374
1724
|
{
|
|
1375
1725
|
embedLevel: s,
|
|
1376
1726
|
pageId: e.pageId,
|
|
@@ -1378,39 +1728,40 @@ class U {
|
|
|
1378
1728
|
filters: e.filters || {}
|
|
1379
1729
|
}
|
|
1380
1730
|
);
|
|
1381
|
-
let
|
|
1382
|
-
const p = new
|
|
1731
|
+
let h;
|
|
1732
|
+
const p = new M(i, {
|
|
1383
1733
|
embedLevel: s,
|
|
1384
1734
|
theme: r,
|
|
1385
|
-
hideFilters: (
|
|
1735
|
+
hideFilters: (d = e.hideFilters) != null ? d : !1,
|
|
1386
1736
|
hideExport: (n = e.hideExport) != null ? n : !1,
|
|
1387
1737
|
initialFilters: e.filters || {},
|
|
1388
1738
|
onFilterChange: e.onFilterChange,
|
|
1389
1739
|
onReady: e.onReady,
|
|
1390
|
-
onFetchFilterOptions: (
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1740
|
+
onFetchFilterOptions: (f) => this.apiClient.getFilterOptions(e.dashboardId, f, c),
|
|
1741
|
+
onFetchTablePage: (f, g, u) => this.apiClient.getTablePage(e.dashboardId, f, g, u, c),
|
|
1742
|
+
onTabSwitch: async (f, g) => {
|
|
1743
|
+
var u, y, v;
|
|
1744
|
+
(u = e.onTabSwitch) == null || u.call(e, f, g);
|
|
1394
1745
|
try {
|
|
1395
|
-
const
|
|
1746
|
+
const x = await this.apiClient.getDashboardRender(
|
|
1396
1747
|
e.dashboardId,
|
|
1397
|
-
|
|
1748
|
+
c,
|
|
1398
1749
|
{
|
|
1399
1750
|
embedLevel: s,
|
|
1400
|
-
pageId:
|
|
1401
|
-
tabId:
|
|
1402
|
-
filters: (
|
|
1751
|
+
pageId: f,
|
|
1752
|
+
tabId: g,
|
|
1753
|
+
filters: (v = (y = h == null ? void 0 : h.getActiveFilters()) != null ? y : e.filters) != null ? v : {}
|
|
1403
1754
|
}
|
|
1404
1755
|
);
|
|
1405
|
-
p.update(
|
|
1406
|
-
} catch (
|
|
1407
|
-
console.error("Deepspot SDK: tab fetch failed",
|
|
1756
|
+
p.update(x);
|
|
1757
|
+
} catch (x) {
|
|
1758
|
+
console.error("Deepspot SDK: tab fetch failed", x);
|
|
1408
1759
|
}
|
|
1409
1760
|
}
|
|
1410
1761
|
});
|
|
1411
|
-
return p.render(l),
|
|
1762
|
+
return p.render(l), h = new w({
|
|
1412
1763
|
dashboardId: e.dashboardId,
|
|
1413
|
-
token:
|
|
1764
|
+
token: c,
|
|
1414
1765
|
embedType: "dashboard",
|
|
1415
1766
|
embedLevel: s,
|
|
1416
1767
|
activePageId: l.activePage,
|
|
@@ -1419,15 +1770,15 @@ class U {
|
|
|
1419
1770
|
apiClient: this.apiClient,
|
|
1420
1771
|
renderer: p,
|
|
1421
1772
|
onFilterChange: e.onFilterChange
|
|
1422
|
-
}),
|
|
1423
|
-
} catch (
|
|
1424
|
-
throw this.showError(i, (
|
|
1773
|
+
}), h;
|
|
1774
|
+
} catch (c) {
|
|
1775
|
+
throw this.showError(i, (c == null ? void 0 : c.message) || "Failed to load dashboard"), (b = e.onError) == null || b.call(e, (c == null ? void 0 : c.message) || "Failed to load dashboard"), c;
|
|
1425
1776
|
}
|
|
1426
1777
|
}
|
|
1427
1778
|
// ── Embed single report (component) ────────────────────────────────────────
|
|
1428
1779
|
async embedReport(e) {
|
|
1429
1780
|
var r;
|
|
1430
|
-
const t =
|
|
1781
|
+
const t = D(e.container);
|
|
1431
1782
|
t.style.height = e.height || "400px", t.style.display = "block";
|
|
1432
1783
|
const s = this.createRoot(t, e.theme || "light");
|
|
1433
1784
|
this.showLoading(s);
|
|
@@ -1443,15 +1794,15 @@ class U {
|
|
|
1443
1794
|
e.componentId,
|
|
1444
1795
|
i,
|
|
1445
1796
|
{ filters: e.filters || {} }
|
|
1446
|
-
),
|
|
1447
|
-
return
|
|
1797
|
+
), o = new H(s, e.theme || "light");
|
|
1798
|
+
return o.render(a, e.onReady), new w({
|
|
1448
1799
|
dashboardId: e.dashboardId,
|
|
1449
1800
|
componentId: e.componentId,
|
|
1450
1801
|
token: i,
|
|
1451
1802
|
embedType: "report",
|
|
1452
1803
|
activeFilters: e.filters || {},
|
|
1453
1804
|
apiClient: this.apiClient,
|
|
1454
|
-
renderer:
|
|
1805
|
+
renderer: o
|
|
1455
1806
|
});
|
|
1456
1807
|
} catch (i) {
|
|
1457
1808
|
throw this.showError(s, (i == null ? void 0 : i.message) || "Failed to load report"), (r = e.onError) == null || r.call(e, (i == null ? void 0 : i.message) || "Failed to load report"), i;
|
|
@@ -1481,12 +1832,12 @@ class U {
|
|
|
1481
1832
|
`;
|
|
1482
1833
|
}
|
|
1483
1834
|
}
|
|
1484
|
-
const
|
|
1835
|
+
const C = class C extends HTMLElement {
|
|
1485
1836
|
constructor() {
|
|
1486
1837
|
super(...arguments), this.instance = null, this.connected = !1;
|
|
1487
1838
|
}
|
|
1488
1839
|
connectedCallback() {
|
|
1489
|
-
this.connected = !0,
|
|
1840
|
+
this.connected = !0, L(), this.style.display = "block", this.renderRoot = document.createElement("div"), this.renderRoot.className = "ds-embed-root", this.appendChild(this.renderRoot), this.mount();
|
|
1490
1841
|
}
|
|
1491
1842
|
disconnectedCallback() {
|
|
1492
1843
|
var e;
|
|
@@ -1497,59 +1848,60 @@ const L = class L extends HTMLElement {
|
|
|
1497
1848
|
t === s || !this.connected || ((r = this.instance) == null || r.destroy(), this.instance = null, this.mount());
|
|
1498
1849
|
}
|
|
1499
1850
|
async mount() {
|
|
1500
|
-
const e = this.getAttribute("dashboard-id"), t = this.getAttribute("api-key"), s = this.getAttribute("base-url") || "", r = this.getAttribute("user-id") || void 0, i = this.getAttribute("tenant-id") || void 0, a = this.getAttribute("embed-level") || "dashboard",
|
|
1851
|
+
const e = this.getAttribute("dashboard-id"), t = this.getAttribute("api-key"), s = this.getAttribute("base-url") || "", r = this.getAttribute("user-id") || void 0, i = this.getAttribute("tenant-id") || void 0, a = this.getAttribute("embed-level") || "dashboard", o = this.getAttribute("theme") || "light", d = this.getAttribute("height") || "600px", n = this.getAttribute("page-id") || void 0, b = this.getAttribute("tab-id") || void 0, c = this.getAttribute("hide-filters") === "true", l = this.getAttribute("hide-export") === "true";
|
|
1501
1852
|
if (!e || !t || !s) {
|
|
1502
1853
|
this.showError("Missing required attributes: dashboard-id, api-key, base-url");
|
|
1503
1854
|
return;
|
|
1504
1855
|
}
|
|
1505
|
-
this.renderRoot.style.height =
|
|
1856
|
+
this.renderRoot.style.height = d, this.renderRoot.className = `ds-embed-root ds-theme-${o}`, this.showLoading();
|
|
1506
1857
|
try {
|
|
1507
|
-
const
|
|
1858
|
+
const h = new P(s, t), p = await h.getEmbedToken({
|
|
1508
1859
|
dashboardId: e,
|
|
1509
1860
|
embedType: "dashboard",
|
|
1510
1861
|
embedLevel: a,
|
|
1511
1862
|
userId: r,
|
|
1512
1863
|
tenantId: i
|
|
1513
|
-
}),
|
|
1864
|
+
}), f = await h.getDashboardRender(e, p, {
|
|
1514
1865
|
embedLevel: a,
|
|
1515
1866
|
pageId: n,
|
|
1516
1867
|
tabId: b,
|
|
1517
1868
|
filters: {}
|
|
1518
|
-
}),
|
|
1869
|
+
}), g = new M(this.renderRoot, {
|
|
1519
1870
|
embedLevel: a,
|
|
1520
|
-
theme:
|
|
1521
|
-
hideFilters:
|
|
1871
|
+
theme: o,
|
|
1872
|
+
hideFilters: c,
|
|
1522
1873
|
hideExport: l,
|
|
1523
1874
|
initialFilters: {},
|
|
1524
|
-
onFetchFilterOptions: (
|
|
1525
|
-
|
|
1526
|
-
|
|
1875
|
+
onFetchFilterOptions: (u) => h.getFilterOptions(e, u, p),
|
|
1876
|
+
onFetchTablePage: (u, y, v) => h.getTablePage(e, u, y, v, p),
|
|
1877
|
+
onTabSwitch: async (u, y) => {
|
|
1878
|
+
var v, x;
|
|
1527
1879
|
try {
|
|
1528
|
-
const
|
|
1880
|
+
const $ = await h.getDashboardRender(e, p, {
|
|
1529
1881
|
embedLevel: a,
|
|
1530
|
-
pageId:
|
|
1882
|
+
pageId: u,
|
|
1531
1883
|
tabId: y,
|
|
1532
|
-
filters: (
|
|
1884
|
+
filters: (x = (v = this.instance) == null ? void 0 : v.getActiveFilters()) != null ? x : {}
|
|
1533
1885
|
});
|
|
1534
|
-
|
|
1535
|
-
} catch (
|
|
1536
|
-
console.error("Deepspot SDK: tab fetch failed",
|
|
1886
|
+
g.update($);
|
|
1887
|
+
} catch ($) {
|
|
1888
|
+
console.error("Deepspot SDK: tab fetch failed", $);
|
|
1537
1889
|
}
|
|
1538
1890
|
}
|
|
1539
1891
|
});
|
|
1540
|
-
|
|
1892
|
+
g.render(f), this.instance = new w({
|
|
1541
1893
|
dashboardId: e,
|
|
1542
1894
|
token: p,
|
|
1543
1895
|
embedLevel: a,
|
|
1544
1896
|
embedType: "dashboard",
|
|
1545
|
-
activePageId:
|
|
1546
|
-
activeTabId:
|
|
1897
|
+
activePageId: f.activePage,
|
|
1898
|
+
activeTabId: f.activeTab,
|
|
1547
1899
|
activeFilters: {},
|
|
1548
|
-
apiClient:
|
|
1549
|
-
renderer:
|
|
1900
|
+
apiClient: h,
|
|
1901
|
+
renderer: g
|
|
1550
1902
|
});
|
|
1551
|
-
} catch (
|
|
1552
|
-
this.showError((
|
|
1903
|
+
} catch (h) {
|
|
1904
|
+
this.showError((h == null ? void 0 : h.message) || "Failed to load dashboard");
|
|
1553
1905
|
}
|
|
1554
1906
|
}
|
|
1555
1907
|
showLoading() {
|
|
@@ -1593,7 +1945,7 @@ const L = class L extends HTMLElement {
|
|
|
1593
1945
|
(e = this.instance) == null || e.exportPDF();
|
|
1594
1946
|
}
|
|
1595
1947
|
};
|
|
1596
|
-
|
|
1948
|
+
C.observedAttributes = [
|
|
1597
1949
|
"dashboard-id",
|
|
1598
1950
|
"api-key",
|
|
1599
1951
|
"user-id",
|
|
@@ -1607,14 +1959,14 @@ L.observedAttributes = [
|
|
|
1607
1959
|
"hide-filters",
|
|
1608
1960
|
"hide-export"
|
|
1609
1961
|
];
|
|
1610
|
-
let T =
|
|
1962
|
+
let T = C;
|
|
1611
1963
|
customElements.get("deepspot-dashboard") || customElements.define("deepspot-dashboard", T);
|
|
1612
|
-
const
|
|
1964
|
+
const F = class F extends HTMLElement {
|
|
1613
1965
|
constructor() {
|
|
1614
1966
|
super(...arguments), this.instance = null, this.isConnected_ = !1;
|
|
1615
1967
|
}
|
|
1616
1968
|
connectedCallback() {
|
|
1617
|
-
this.isConnected_ = !0,
|
|
1969
|
+
this.isConnected_ = !0, L(), this.style.display = "block", this.renderRoot = document.createElement("div"), this.renderRoot.className = "ds-embed-root", this.appendChild(this.renderRoot), this.mount();
|
|
1618
1970
|
}
|
|
1619
1971
|
disconnectedCallback() {
|
|
1620
1972
|
var e;
|
|
@@ -1625,23 +1977,23 @@ const A = class A extends HTMLElement {
|
|
|
1625
1977
|
t !== s && this.isConnected_ && ((r = this.instance) == null || r.destroy(), this.instance = null, this.mount());
|
|
1626
1978
|
}
|
|
1627
1979
|
async mount() {
|
|
1628
|
-
const e = this.getAttribute("dashboard-id"), t = this.getAttribute("component-id"), s = this.getAttribute("api-key"), r = this.getAttribute("base-url") || "", i = this.getAttribute("user-id") || void 0, a = this.getAttribute("tenant-id") || void 0,
|
|
1980
|
+
const e = this.getAttribute("dashboard-id"), t = this.getAttribute("component-id"), s = this.getAttribute("api-key"), r = this.getAttribute("base-url") || "", i = this.getAttribute("user-id") || void 0, a = this.getAttribute("tenant-id") || void 0, o = this.getAttribute("theme") || "light", d = this.getAttribute("height") || "400px";
|
|
1629
1981
|
if (!e || !t || !s || !r) {
|
|
1630
1982
|
this.showError("Missing required attributes: dashboard-id, component-id, api-key, base-url");
|
|
1631
1983
|
return;
|
|
1632
1984
|
}
|
|
1633
|
-
this.renderRoot.style.height =
|
|
1985
|
+
this.renderRoot.style.height = d, this.renderRoot.className = `ds-embed-root ds-theme-${o}`, this.showLoading();
|
|
1634
1986
|
try {
|
|
1635
|
-
const n = new
|
|
1987
|
+
const n = new P(r, s), b = await n.getEmbedToken({
|
|
1636
1988
|
dashboardId: e,
|
|
1637
1989
|
embedType: "report",
|
|
1638
1990
|
componentId: t,
|
|
1639
1991
|
userId: i,
|
|
1640
1992
|
tenantId: a
|
|
1641
|
-
}),
|
|
1993
|
+
}), c = await n.getReportRender(e, t, b, {
|
|
1642
1994
|
filters: {}
|
|
1643
|
-
}), l = new H(this.renderRoot,
|
|
1644
|
-
l.render(
|
|
1995
|
+
}), l = new H(this.renderRoot, o);
|
|
1996
|
+
l.render(c, () => {
|
|
1645
1997
|
}), this.instance = new w({
|
|
1646
1998
|
dashboardId: e,
|
|
1647
1999
|
componentId: t,
|
|
@@ -1685,7 +2037,7 @@ const A = class A extends HTMLElement {
|
|
|
1685
2037
|
(e = this.instance) == null || e.refresh();
|
|
1686
2038
|
}
|
|
1687
2039
|
};
|
|
1688
|
-
|
|
2040
|
+
F.observedAttributes = [
|
|
1689
2041
|
"dashboard-id",
|
|
1690
2042
|
"component-id",
|
|
1691
2043
|
"api-key",
|
|
@@ -1695,7 +2047,7 @@ A.observedAttributes = [
|
|
|
1695
2047
|
"theme",
|
|
1696
2048
|
"height"
|
|
1697
2049
|
];
|
|
1698
|
-
let k =
|
|
2050
|
+
let k = F;
|
|
1699
2051
|
customElements.get("deepspot-report") || customElements.define("deepspot-report", k);
|
|
1700
2052
|
customElements.get("deepspot-dashboard") || customElements.define("deepspot-dashboard", T);
|
|
1701
2053
|
customElements.get("deepspot-report") || customElements.define("deepspot-report", k);
|