deepspotscreen-sdk 0.1.0 → 0.1.1
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-BxkQV_ro.cjs → DeepspotSDK-CNO9Q25m.cjs} +1 -1
- package/dist/{DeepspotSDK-SyTH97IQ.js → DeepspotSDK-DNF2EXlq.js} +1 -1
- package/dist/deepspot-sdk.esm.js +1 -1
- package/dist/deepspot-sdk.js +1 -1
- package/dist/react/index.cjs +1 -1
- package/dist/react/index.mjs +2 -2
- package/dist/vue/index.cjs +1 -1
- package/dist/vue/index.mjs +1 -1
- package/package.json +1 -1
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
<div class="ds-chart-title">${e.title||""}</div>
|
|
4
4
|
<div class="ds-chart-body" id="ds-chart-body-${e.id}"></div>
|
|
5
5
|
</div>
|
|
6
|
-
`;const a=this.container.querySelector(`#ds-chart-body-${e.id}`);if(a)try{this.chart&&this.chart.destroy();const{default:o}=await de();this.chart=new o(a,i),this.chart.render()}catch(o){console.error("[Deepspot SDK] ChartRenderer error:",o),a.innerHTML='<div class="ds-chart-empty">Chart render error</div>'}}async update(e,t,s){if(!this.chart||!t||t.length===0){await this.render(e,t,s);return}const{series:r,categories:i}=this.extractSeriesAndCategories(e,t);try{this.chart.updateOptions({series:r,xaxis:{categories:i},theme:{mode:s}})}catch(a){this.render(e,t,s)}}destroy(){var e;try{(e=this.chart)==null||e.destroy()}catch(t){}this.chart=null}buildOptions(e,t,s,r){const i=e.type;return i==="pie"||i==="donut"?this.buildPieOptions(e,t,s,r):i==="bar"||i==="line"||i==="area"?this.buildCartesianOptions(e,t,s,r):null}buildCartesianOptions(e,t,s,r){var n;const{series:i,categories:a,xAxisLabel:o,yAxisLabel:l}=this.extractSeriesAndCategories(e,t),d=e.properties||{},f=d.colors?Object.values(d.colors):["#6366f1","#8b5cf6","#ec4899","#f59e0b","#10b981","#3b82f6"],h=s==="dark";return{chart:{type:e.type==="area"?"area":e.type==="line"?"line":"bar",toolbar:{show:!1},background:"transparent",animations:{enabled:!0,speed:400},fontFamily:"inherit",height:r!=null?r:"100%"},theme:{mode:s},series:i,xaxis:{categories:a,title:{text:o},labels:{rotate:a.length>8?-45:0,style:{colors:h?"#94a3b8":"#6b7280",fontSize:"11px"}},axisBorder:{color:h?"#334155":"#e5e7eb"},axisTicks:{color:h?"#334155":"#e5e7eb"}},yaxis:{title:{text:l},labels:{style:{colors:h?"#94a3b8":"#6b7280",fontSize:"11px"}}},colors:f,legend:{show:i.length>1||((n=d.showLegend)!=null?n:!1),position:"bottom",labels:{colors:h?"#94a3b8":"#6b7280"}},grid:{borderColor:h?"#1e293b":"#f3f4f6",strokeDashArray:4,padding:{bottom:a.length>8?60:10}},tooltip:{theme:s},stroke:{curve:"smooth",width:e.type==="bar"?0:2},fill:e.type==="area"?{type:"gradient",gradient:{shadeIntensity:.5,opacityFrom:.4,opacityTo:0}}:{},dataLabels:{enabled:!1},plotOptions:{bar:{borderRadius:4,distributed:i.length===1}}}}buildPieOptions(e,t,s,r){const i=e.properties||{},a=t.length>0?Object.keys(t[0]):[],o=a[0]||"label",l=a[1]||"value",d=t.map(p=>{var b;return String((b=p[o])!=null?b:"")}),f=t.map(p=>Number(p[l])||0),h=s==="dark",n=i.colors?Object.values(i.colors):["#6366f1","#8b5cf6","#ec4899","#f59e0b","#10b981","#3b82f6"];return{chart:{type:e.type,toolbar:{show:!1},background:"transparent",fontFamily:"inherit",height:r!=null?r:"100%"},theme:{mode:s},series:f,labels:d,colors:n,legend:{position:"bottom",labels:{colors:h?"#94a3b8":"#6b7280"}},tooltip:{theme:s},dataLabels:{enabled:d.length<=8},plotOptions:{pie:{donut:{size:e.type==="donut"?"65%":"0%"}}}}}extractSeriesAndCategories(e,t){const s=e.properties||{},r=t.length>0?Object.keys(t[0]):[],i=s.xAxis||r[0]||"x";let a=[];if(s.selectedYAxisColumn)try{const n=typeof s.selectedYAxisColumn=="string"?JSON.parse(s.selectedYAxisColumn):s.selectedYAxisColumn;Array.isArray(n)&&(a=n.map(p=>typeof p=="string"?{column:p}:p))}catch(n){}if(!a.length&&s.yAxis){const n=s.yAxis;a=(Array.isArray(n)?n:[n]).map(b=>({column:String(b)}))}!a.length&&r.length>1&&(a=r.slice(1).map(n=>({column:n})));const o=t.map(n=>{var p;return String((p=n[i])!=null?p:"")}),l=t.length>0?Object.keys(t[0]):[],d=a.map(n=>{const p=l.includes(n.column)?n.column:null,b=p?null:l.find(u=>u.includes(n.column)||n.column.includes(u)),x=!p&&!b?l.find(u=>{var y;return u!==i&&!isNaN(Number((y=t[0])==null?void 0:y[u]))}):null,c=p||b||x||n.column;return{name:n.label||n.column.replace(/_/g," "),data:t.map(u=>{const y=u[c];return y!=null?Number(y):null})}}),f=s.xAxisLabel||i.replace(/_/g," "),h=s.yAxisLabel||(
|
|
6
|
+
`;const a=this.container.querySelector(`#ds-chart-body-${e.id}`);if(a)try{this.chart&&this.chart.destroy();const{default:o}=await de();this.chart=new o(a,i),this.chart.render()}catch(o){console.error("[Deepspot SDK] ChartRenderer error:",o),a.innerHTML='<div class="ds-chart-empty">Chart render error</div>'}}async update(e,t,s){if(!this.chart||!t||t.length===0){await this.render(e,t,s);return}const{series:r,categories:i}=this.extractSeriesAndCategories(e,t);try{this.chart.updateOptions({series:r,xaxis:{categories:i},theme:{mode:s}})}catch(a){this.render(e,t,s)}}destroy(){var e;try{(e=this.chart)==null||e.destroy()}catch(t){}this.chart=null}buildOptions(e,t,s,r){const i=e.type;return i==="pie"||i==="donut"?this.buildPieOptions(e,t,s,r):i==="bar"||i==="line"||i==="area"?this.buildCartesianOptions(e,t,s,r):null}buildCartesianOptions(e,t,s,r){var n;const{series:i,categories:a,xAxisLabel:o,yAxisLabel:l}=this.extractSeriesAndCategories(e,t),d=e.properties||{},f=d.colors?Object.values(d.colors):["#6366f1","#8b5cf6","#ec4899","#f59e0b","#10b981","#3b82f6"],h=s==="dark";return{chart:{type:e.type==="area"?"area":e.type==="line"?"line":"bar",toolbar:{show:!1},background:"transparent",animations:{enabled:!0,speed:400},fontFamily:"inherit",height:r!=null?r:"100%"},theme:{mode:s},series:i,xaxis:{categories:a,title:{text:o},labels:{rotate:a.length>8?-45:0,style:{colors:h?"#94a3b8":"#6b7280",fontSize:"11px"}},axisBorder:{color:h?"#334155":"#e5e7eb"},axisTicks:{color:h?"#334155":"#e5e7eb"}},yaxis:{title:{text:l},labels:{style:{colors:h?"#94a3b8":"#6b7280",fontSize:"11px"}}},colors:f,legend:{show:i.length>1||((n=d.showLegend)!=null?n:!1),position:"bottom",labels:{colors:h?"#94a3b8":"#6b7280"}},grid:{borderColor:h?"#1e293b":"#f3f4f6",strokeDashArray:4,padding:{bottom:a.length>8?60:10}},tooltip:{theme:s},stroke:{curve:"smooth",width:e.type==="bar"?0:2},fill:e.type==="area"?{type:"gradient",gradient:{shadeIntensity:.5,opacityFrom:.4,opacityTo:0}}:{},dataLabels:{enabled:!1},plotOptions:{bar:{borderRadius:4,distributed:i.length===1}}}}buildPieOptions(e,t,s,r){const i=e.properties||{},a=t.length>0?Object.keys(t[0]):[],o=a[0]||"label",l=a[1]||"value",d=t.map(p=>{var b;return String((b=p[o])!=null?b:"")}),f=t.map(p=>Number(p[l])||0),h=s==="dark",n=i.colors?Object.values(i.colors):["#6366f1","#8b5cf6","#ec4899","#f59e0b","#10b981","#3b82f6"];return{chart:{type:e.type,toolbar:{show:!1},background:"transparent",fontFamily:"inherit",height:r!=null?r:"100%"},theme:{mode:s},series:f,labels:d,colors:n,legend:{position:"bottom",labels:{colors:h?"#94a3b8":"#6b7280"}},tooltip:{theme:s},dataLabels:{enabled:d.length<=8},plotOptions:{pie:{donut:{size:e.type==="donut"?"65%":"0%"}}}}}extractSeriesAndCategories(e,t){const s=e.properties||{},r=t.length>0?Object.keys(t[0]):[],i=s.xAxis||r[0]||"x";let a=[];if(s.selectedYAxisColumn)try{const n=typeof s.selectedYAxisColumn=="string"?JSON.parse(s.selectedYAxisColumn):s.selectedYAxisColumn;Array.isArray(n)&&(a=n.map(p=>typeof p=="string"?{column:p}:p))}catch(n){}if(!a.length&&s.yAxis){const n=s.yAxis;a=(Array.isArray(n)?n:[n]).map(b=>({column:String(b)}))}!a.length&&r.length>1&&(a=r.slice(1).map(n=>({column:n})));const o=t.map(n=>{var p;return String((p=n[i])!=null?p:"")}),l=t.length>0?Object.keys(t[0]):[],d=a.map(n=>{const p=l.includes(n.column)?n.column:null,b=p?null:l.find(u=>u.includes(n.column)||n.column.includes(u)),x=!p&&!b?l.find(u=>{var y;return u!==i&&!isNaN(Number((y=t[0])==null?void 0:y[u]))}):null,c=p||b||x||n.column;return{name:n.label||n.column.replace(/_/g," "),data:t.map(u=>{const y=u[c];return y!=null?Number(y):null})}}),f=s.xAxisLabel||i.replace(/_/g," "),h=s.yAxisLabel||(a.length===1?a[0].column:"Values");return{series:d,categories:o,xAxisLabel:f,yAxisLabel:h}}renderEmpty(e){this.container.innerHTML=`
|
|
7
7
|
<div class="ds-chart-card">
|
|
8
8
|
${e?`<div class="ds-chart-title">${e}</div>`:""}
|
|
9
9
|
<div class="ds-chart-empty">No data available</div>
|
|
@@ -432,7 +432,7 @@ class se {
|
|
|
432
432
|
return y != null ? Number(y) : null;
|
|
433
433
|
})
|
|
434
434
|
};
|
|
435
|
-
}), f = s.xAxisLabel || i.replace(/_/g, " "), h = s.yAxisLabel || (
|
|
435
|
+
}), f = s.xAxisLabel || i.replace(/_/g, " "), h = s.yAxisLabel || (a.length === 1 ? a[0].column : "Values");
|
|
436
436
|
return { series: d, categories: o, xAxisLabel: f, yAxisLabel: h };
|
|
437
437
|
}
|
|
438
438
|
renderEmpty(e) {
|
package/dist/deepspot-sdk.esm.js
CHANGED
|
@@ -432,7 +432,7 @@ class ne {
|
|
|
432
432
|
return g != null ? Number(g) : null;
|
|
433
433
|
})
|
|
434
434
|
};
|
|
435
|
-
}), h = s.xAxisLabel || r.replace(/_/g, " "), b = s.yAxisLabel || (
|
|
435
|
+
}), h = s.xAxisLabel || r.replace(/_/g, " "), b = s.yAxisLabel || (a.length === 1 ? a[0].column : "Values");
|
|
436
436
|
return { series: d, categories: o, xAxisLabel: h, yAxisLabel: b };
|
|
437
437
|
}
|
|
438
438
|
renderEmpty(e) {
|
package/dist/deepspot-sdk.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
<div class="ds-chart-title">${e.title||""}</div>
|
|
4
4
|
<div class="ds-chart-body" id="ds-chart-body-${e.id}"></div>
|
|
5
5
|
</div>
|
|
6
|
-
`;const u=this.container.querySelector(`#ds-chart-body-${e.id}`);if(u)try{this.chart&&this.chart.destroy();const{default:d}=await qw();this.chart=new d(u,l),this.chart.render()}catch(d){console.error("[Deepspot SDK] ChartRenderer error:",d),u.innerHTML='<div class="ds-chart-empty">Chart render error</div>'}}async update(e,i,a){if(!this.chart||!i||i.length===0){await this.render(e,i,a);return}const{series:A,categories:l}=this.extractSeriesAndCategories(e,i);try{this.chart.updateOptions({series:A,xaxis:{categories:l},theme:{mode:a}})}catch(u){this.render(e,i,a)}}destroy(){var e;try{(e=this.chart)==null||e.destroy()}catch(i){}this.chart=null}buildOptions(e,i,a,A){const l=e.type;return l==="pie"||l==="donut"?this.buildPieOptions(e,i,a,A):l==="bar"||l==="line"||l==="area"?this.buildCartesianOptions(e,i,a,A):null}buildCartesianOptions(e,i,a,A){var U;const{series:l,categories:u,xAxisLabel:d,yAxisLabel:g}=this.extractSeriesAndCategories(e,i),x=e.properties||{},B=x.colors?Object.values(x.colors):["#6366f1","#8b5cf6","#ec4899","#f59e0b","#10b981","#3b82f6"],E=a==="dark";return{chart:{type:e.type==="area"?"area":e.type==="line"?"line":"bar",toolbar:{show:!1},background:"transparent",animations:{enabled:!0,speed:400},fontFamily:"inherit",height:A!=null?A:"100%"},theme:{mode:a},series:l,xaxis:{categories:u,title:{text:d},labels:{rotate:u.length>8?-45:0,style:{colors:E?"#94a3b8":"#6b7280",fontSize:"11px"}},axisBorder:{color:E?"#334155":"#e5e7eb"},axisTicks:{color:E?"#334155":"#e5e7eb"}},yaxis:{title:{text:g},labels:{style:{colors:E?"#94a3b8":"#6b7280",fontSize:"11px"}}},colors:B,legend:{show:l.length>1||((U=x.showLegend)!=null?U:!1),position:"bottom",labels:{colors:E?"#94a3b8":"#6b7280"}},grid:{borderColor:E?"#1e293b":"#f3f4f6",strokeDashArray:4,padding:{bottom:u.length>8?60:10}},tooltip:{theme:a},stroke:{curve:"smooth",width:e.type==="bar"?0:2},fill:e.type==="area"?{type:"gradient",gradient:{shadeIntensity:.5,opacityFrom:.4,opacityTo:0}}:{},dataLabels:{enabled:!1},plotOptions:{bar:{borderRadius:4,distributed:l.length===1}}}}buildPieOptions(e,i,a,A){const l=e.properties||{},u=i.length>0?Object.keys(i[0]):[],d=u[0]||"label",g=u[1]||"value",x=i.map(F=>{var P;return String((P=F[d])!=null?P:"")}),B=i.map(F=>Number(F[g])||0),E=a==="dark",U=l.colors?Object.values(l.colors):["#6366f1","#8b5cf6","#ec4899","#f59e0b","#10b981","#3b82f6"];return{chart:{type:e.type,toolbar:{show:!1},background:"transparent",fontFamily:"inherit",height:A!=null?A:"100%"},theme:{mode:a},series:B,labels:x,colors:U,legend:{position:"bottom",labels:{colors:E?"#94a3b8":"#6b7280"}},tooltip:{theme:a},dataLabels:{enabled:x.length<=8},plotOptions:{pie:{donut:{size:e.type==="donut"?"65%":"0%"}}}}}extractSeriesAndCategories(e,i){const a=e.properties||{},A=i.length>0?Object.keys(i[0]):[],l=a.xAxis||A[0]||"x";let u=[];if(a.selectedYAxisColumn)try{const U=typeof a.selectedYAxisColumn=="string"?JSON.parse(a.selectedYAxisColumn):a.selectedYAxisColumn;Array.isArray(U)&&(u=U.map(F=>typeof F=="string"?{column:F}:F))}catch(U){}if(!u.length&&a.yAxis){const U=a.yAxis;u=(Array.isArray(U)?U:[U]).map(P=>({column:String(P)}))}!u.length&&A.length>1&&(u=A.slice(1).map(U=>({column:U})));const d=i.map(U=>{var F;return String((F=U[l])!=null?F:"")}),g=i.length>0?Object.keys(i[0]):[],x=u.map(U=>{const F=g.includes(U.column)?U.column:null,P=F?null:g.find(R=>R.includes(U.column)||U.column.includes(R)),M=!F&&!P?g.find(R=>{var V;return R!==l&&!isNaN(Number((V=i[0])==null?void 0:V[R]))}):null,G=F||P||M||U.column;return{name:U.label||U.column.replace(/_/g," "),data:i.map(R=>{const V=R[G];return V!=null?Number(V):null})}}),B=a.xAxisLabel||l.replace(/_/g," "),E=a.yAxisLabel||(
|
|
6
|
+
`;const u=this.container.querySelector(`#ds-chart-body-${e.id}`);if(u)try{this.chart&&this.chart.destroy();const{default:d}=await qw();this.chart=new d(u,l),this.chart.render()}catch(d){console.error("[Deepspot SDK] ChartRenderer error:",d),u.innerHTML='<div class="ds-chart-empty">Chart render error</div>'}}async update(e,i,a){if(!this.chart||!i||i.length===0){await this.render(e,i,a);return}const{series:A,categories:l}=this.extractSeriesAndCategories(e,i);try{this.chart.updateOptions({series:A,xaxis:{categories:l},theme:{mode:a}})}catch(u){this.render(e,i,a)}}destroy(){var e;try{(e=this.chart)==null||e.destroy()}catch(i){}this.chart=null}buildOptions(e,i,a,A){const l=e.type;return l==="pie"||l==="donut"?this.buildPieOptions(e,i,a,A):l==="bar"||l==="line"||l==="area"?this.buildCartesianOptions(e,i,a,A):null}buildCartesianOptions(e,i,a,A){var U;const{series:l,categories:u,xAxisLabel:d,yAxisLabel:g}=this.extractSeriesAndCategories(e,i),x=e.properties||{},B=x.colors?Object.values(x.colors):["#6366f1","#8b5cf6","#ec4899","#f59e0b","#10b981","#3b82f6"],E=a==="dark";return{chart:{type:e.type==="area"?"area":e.type==="line"?"line":"bar",toolbar:{show:!1},background:"transparent",animations:{enabled:!0,speed:400},fontFamily:"inherit",height:A!=null?A:"100%"},theme:{mode:a},series:l,xaxis:{categories:u,title:{text:d},labels:{rotate:u.length>8?-45:0,style:{colors:E?"#94a3b8":"#6b7280",fontSize:"11px"}},axisBorder:{color:E?"#334155":"#e5e7eb"},axisTicks:{color:E?"#334155":"#e5e7eb"}},yaxis:{title:{text:g},labels:{style:{colors:E?"#94a3b8":"#6b7280",fontSize:"11px"}}},colors:B,legend:{show:l.length>1||((U=x.showLegend)!=null?U:!1),position:"bottom",labels:{colors:E?"#94a3b8":"#6b7280"}},grid:{borderColor:E?"#1e293b":"#f3f4f6",strokeDashArray:4,padding:{bottom:u.length>8?60:10}},tooltip:{theme:a},stroke:{curve:"smooth",width:e.type==="bar"?0:2},fill:e.type==="area"?{type:"gradient",gradient:{shadeIntensity:.5,opacityFrom:.4,opacityTo:0}}:{},dataLabels:{enabled:!1},plotOptions:{bar:{borderRadius:4,distributed:l.length===1}}}}buildPieOptions(e,i,a,A){const l=e.properties||{},u=i.length>0?Object.keys(i[0]):[],d=u[0]||"label",g=u[1]||"value",x=i.map(F=>{var P;return String((P=F[d])!=null?P:"")}),B=i.map(F=>Number(F[g])||0),E=a==="dark",U=l.colors?Object.values(l.colors):["#6366f1","#8b5cf6","#ec4899","#f59e0b","#10b981","#3b82f6"];return{chart:{type:e.type,toolbar:{show:!1},background:"transparent",fontFamily:"inherit",height:A!=null?A:"100%"},theme:{mode:a},series:B,labels:x,colors:U,legend:{position:"bottom",labels:{colors:E?"#94a3b8":"#6b7280"}},tooltip:{theme:a},dataLabels:{enabled:x.length<=8},plotOptions:{pie:{donut:{size:e.type==="donut"?"65%":"0%"}}}}}extractSeriesAndCategories(e,i){const a=e.properties||{},A=i.length>0?Object.keys(i[0]):[],l=a.xAxis||A[0]||"x";let u=[];if(a.selectedYAxisColumn)try{const U=typeof a.selectedYAxisColumn=="string"?JSON.parse(a.selectedYAxisColumn):a.selectedYAxisColumn;Array.isArray(U)&&(u=U.map(F=>typeof F=="string"?{column:F}:F))}catch(U){}if(!u.length&&a.yAxis){const U=a.yAxis;u=(Array.isArray(U)?U:[U]).map(P=>({column:String(P)}))}!u.length&&A.length>1&&(u=A.slice(1).map(U=>({column:U})));const d=i.map(U=>{var F;return String((F=U[l])!=null?F:"")}),g=i.length>0?Object.keys(i[0]):[],x=u.map(U=>{const F=g.includes(U.column)?U.column:null,P=F?null:g.find(R=>R.includes(U.column)||U.column.includes(R)),M=!F&&!P?g.find(R=>{var V;return R!==l&&!isNaN(Number((V=i[0])==null?void 0:V[R]))}):null,G=F||P||M||U.column;return{name:U.label||U.column.replace(/_/g," "),data:i.map(R=>{const V=R[G];return V!=null?Number(V):null})}}),B=a.xAxisLabel||l.replace(/_/g," "),E=a.yAxisLabel||(u.length===1?u[0].column:"Values");return{series:x,categories:d,xAxisLabel:B,yAxisLabel:E}}renderEmpty(e){this.container.innerHTML=`
|
|
7
7
|
<div class="ds-chart-card">
|
|
8
8
|
${e?`<div class="ds-chart-title">${e}</div>`:""}
|
|
9
9
|
<div class="ds-chart-empty">No data available</div>
|
package/dist/react/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react");function E({apiKey:f,baseUrl:l,dashboardId:p,userId:d,tenantId:m,embedLevel:y,theme:v,height:x,pageId:z,tabId:j,filters:i,hideFilters:q,hideExport:L,onReady:b,onFilterChange:n,onTabSwitch:g,onError:o,className:S,style:D,loadingNode:u}){const t=e.useRef(null),R=e.useRef(void 0),[s,r]=e.useState(!0),[c,k]=e.useState("");return e.useEffect(()=>{if(!t.current)return;let P=!1;async function $(){var w;if(t.current)try{r(!0),k("");const{DeepspotSDK:a}=await Promise.resolve().then(()=>require("../DeepspotSDK-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react");function E({apiKey:f,baseUrl:l,dashboardId:p,userId:d,tenantId:m,embedLevel:y,theme:v,height:x,pageId:z,tabId:j,filters:i,hideFilters:q,hideExport:L,onReady:b,onFilterChange:n,onTabSwitch:g,onError:o,className:S,style:D,loadingNode:u}){const t=e.useRef(null),R=e.useRef(void 0),[s,r]=e.useState(!0),[c,k]=e.useState("");return e.useEffect(()=>{if(!t.current)return;let P=!1;async function $(){var w;if(t.current)try{r(!0),k("");const{DeepspotSDK:a}=await Promise.resolve().then(()=>require("../DeepspotSDK-CNO9Q25m.cjs"));if(P||!t.current)return;const C=await new a({apiKey:f,baseUrl:l}).embedDashboard({dashboardId:p,container:t.current,userId:d,tenantId:m,embedLevel:y,theme:v,height:x,pageId:z,tabId:j,filters:i,hideFilters:q,hideExport:L,onReady:b,onFilterChange:n,onTabSwitch:g,onError:o});if(P){C.destroy();return}R.current=C,r(!1)}catch(a){if(P)return;const B=(w=a==null?void 0:a.message)!=null?w:String(a);k(B),r(!1),o==null||o(B)}}return $(),()=>{var w;P=!0,(w=R.current)==null||w.destroy(),R.current=void 0}},[f,l,p,d,m,y,v,x,z,j,q,L]),e.createElement("div",{style:{position:"relative",width:"100%"}},s&&!c?u!=null?u:e.createElement("div",{style:{position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"center",background:"rgba(255,255,255,0.6)",zIndex:1,fontSize:"14px",color:"#666"}},"Loading dashboard…"):null,c?e.createElement("div",{style:{padding:"12px 16px",background:"#fef2f2",border:"1px solid #fca5a5",borderRadius:"6px",color:"#b91c1c",fontSize:"13px",marginBottom:"8px"}},`Deepspot error: ${c}`):null,e.createElement("div",{ref:t,className:S,style:D}))}function M({apiKey:f,baseUrl:l,dashboardId:p,componentId:d,userId:m,tenantId:y,theme:v,height:x,filters:z,onReady:j,onError:i,className:q,style:L,loadingNode:b}){const n=e.useRef(null),g=e.useRef(void 0),[o,S]=e.useState(!0),[D,u]=e.useState("");return e.useEffect(()=>{if(!n.current)return;let t=!1;async function R(){var s;if(n.current)try{S(!0),u("");const{DeepspotSDK:r}=await Promise.resolve().then(()=>require("../DeepspotSDK-CNO9Q25m.cjs"));if(t||!n.current)return;const k=await new r({apiKey:f,baseUrl:l}).embedReport({dashboardId:p,componentId:d,container:n.current,userId:m,tenantId:y,theme:v,height:x,filters:z,onReady:j,onError:i});if(t){k.destroy();return}g.current=k,S(!1)}catch(r){if(t)return;const c=(s=r==null?void 0:r.message)!=null?s:String(r);u(c),S(!1),i==null||i(c)}}return R(),()=>{var s;t=!0,(s=g.current)==null||s.destroy(),g.current=void 0}},[f,l,p,d,m,y,v,x]),e.createElement("div",{style:{position:"relative",width:"100%"}},o&&!D?b!=null?b:e.createElement("div",{style:{position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"center",background:"rgba(255,255,255,0.6)",zIndex:1,fontSize:"14px",color:"#666"}},"Loading…"):null,D?e.createElement("div",{style:{padding:"12px 16px",background:"#fef2f2",border:"1px solid #fca5a5",borderRadius:"6px",color:"#b91c1c",fontSize:"13px",marginBottom:"8px"}},`Deepspot error: ${D}`):null,e.createElement("div",{ref:n,className:q,style:L}))}exports.DeepspotDashboard=E;exports.DeepspotReport=M;
|
package/dist/react/index.mjs
CHANGED
|
@@ -30,7 +30,7 @@ function M({
|
|
|
30
30
|
if (t.current)
|
|
31
31
|
try {
|
|
32
32
|
e(!0), k("");
|
|
33
|
-
const { DeepspotSDK: a } = await import("../DeepspotSDK-
|
|
33
|
+
const { DeepspotSDK: a } = await import("../DeepspotSDK-DNF2EXlq.js");
|
|
34
34
|
if (C || !t.current) return;
|
|
35
35
|
const G = await new a({ apiKey: f, baseUrl: p }).embedDashboard({
|
|
36
36
|
dashboardId: l,
|
|
@@ -123,7 +123,7 @@ function O({
|
|
|
123
123
|
if (r.current)
|
|
124
124
|
try {
|
|
125
125
|
D(!0), u("");
|
|
126
|
-
const { DeepspotSDK: e } = await import("../DeepspotSDK-
|
|
126
|
+
const { DeepspotSDK: e } = await import("../DeepspotSDK-DNF2EXlq.js");
|
|
127
127
|
if (t || !r.current) return;
|
|
128
128
|
const k = await new e({ apiKey: f, baseUrl: p }).embedReport({
|
|
129
129
|
dashboardId: l,
|
package/dist/vue/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("vue"),u=require("../DeepspotSDK-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("vue"),u=require("../DeepspotSDK-CNO9Q25m.cjs"),y=d.defineComponent({name:"DeepspotDashboard",props:{apiKey:{type:String,required:!0},baseUrl:{type:String,required:!0},dashboardId:{type:String,required:!0},userId:{type:String,default:void 0},tenantId:{type:String,default:void 0},embedLevel:{type:String,default:"dashboard"},theme:{type:String,default:"light"},height:{type:String,default:"600px"},pageId:{type:String,default:void 0},tabId:{type:String,default:void 0},hideFilters:{type:Boolean,default:!1},hideExport:{type:Boolean,default:!1},filters:{type:Object,default:()=>({})}},emits:["ready","filter-change","tab-switch","error"],setup(e,{emit:r}){const i=d.ref();let t;async function o(){var l;if(i.value){t==null||t.destroy(),t=void 0;try{t=await new u.DeepspotSDK({apiKey:e.apiKey,baseUrl:e.baseUrl}).embedDashboard({dashboardId:e.dashboardId,container:i.value,userId:e.userId,tenantId:e.tenantId,embedLevel:e.embedLevel,theme:e.theme,height:e.height,pageId:e.pageId,tabId:e.tabId,hideFilters:e.hideFilters,hideExport:e.hideExport,filters:e.filters,onReady:()=>r("ready"),onFilterChange:n=>r("filter-change",n),onTabSwitch:(n,h)=>r("tab-switch",n,h),onError:n=>r("error",n)})}catch(a){r("error",(l=a==null?void 0:a.message)!=null?l:String(a))}}}return d.onMounted(()=>{o()}),d.onUnmounted(()=>{t==null||t.destroy()}),d.watch(()=>[e.dashboardId,e.userId,e.tenantId,e.apiKey,e.baseUrl,e.embedLevel,e.theme,e.height,e.pageId,e.tabId,e.hideFilters,e.hideExport],()=>{o()}),()=>d.h("div",{ref:i,style:{display:"block"}})}}),g=d.defineComponent({name:"DeepspotReport",props:{apiKey:{type:String,required:!0},baseUrl:{type:String,required:!0},dashboardId:{type:String,required:!0},componentId:{type:String,required:!0},userId:{type:String,default:void 0},tenantId:{type:String,default:void 0},theme:{type:String,default:"light"},height:{type:String,default:"400px"},filters:{type:Object,default:()=>({})}},emits:["ready","error"],setup(e,{emit:r}){const i=d.ref();let t;async function o(){var l;if(i.value){t==null||t.destroy(),t=void 0;try{t=await new u.DeepspotSDK({apiKey:e.apiKey,baseUrl:e.baseUrl}).embedReport({dashboardId:e.dashboardId,componentId:e.componentId,container:i.value,userId:e.userId,tenantId:e.tenantId,theme:e.theme,height:e.height,filters:e.filters,onReady:()=>r("ready"),onError:n=>r("error",n)})}catch(a){r("error",(l=a==null?void 0:a.message)!=null?l:String(a))}}}return d.onMounted(()=>{o()}),d.onUnmounted(()=>{t==null||t.destroy()}),d.watch(()=>[e.dashboardId,e.componentId,e.userId,e.apiKey,e.baseUrl,e.theme,e.height],()=>{o()}),()=>d.h("div",{ref:i,style:{display:"block"}})}});exports.DeepspotDashboard=y;exports.DeepspotReport=g;
|
package/dist/vue/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent as h, ref as o, onMounted as u, onUnmounted as y, watch as g, h as b } from "vue";
|
|
2
|
-
import { DeepspotSDK as f } from "../DeepspotSDK-
|
|
2
|
+
import { DeepspotSDK as f } from "../DeepspotSDK-DNF2EXlq.js";
|
|
3
3
|
const m = h({
|
|
4
4
|
name: "DeepspotDashboard",
|
|
5
5
|
props: {
|