@industry-theme/principal-view-panels 0.12.87 → 0.12.89

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.
@@ -9,9 +9,9 @@ export interface DashboardPanelProps extends PanelComponentProps {
9
9
  */
10
10
  selectedDashboard?: DiscoveredCanvas | null;
11
11
  /**
12
- * Optional data provider for fetching metric values.
13
- * If not provided, the dashboard will render without data.
14
- * Use MockDataProvider from @principal-ai/principal-view-react for testing.
12
+ * Data provider for fetching metric values.
13
+ * If not provided, metrics will display with zero/empty values.
14
+ * For testing with sample data, pass MockDataProvider from @principal-ai/principal-view-react.
15
15
  */
16
16
  dataProvider?: DataProvider;
17
17
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"DashboardPanel.d.ts","sourceRoot":"","sources":["../../src/panels/DashboardPanel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmD,MAAM,OAAO,CAAC;AACxE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAC;AAI/E,OAAO,KAAK,EAEV,YAAY,EAGZ,gBAAgB,EAChB,YAAY,EACb,MAAM,mCAAmC,CAAC;AAG3C,MAAM,WAAW,mBAAoB,SAAQ,mBAAmB;IAC9D;;;;OAIG;IACH,iBAAiB,CAAC,EAAE,gBAAgB,GAAG,IAAI,CAAC;IAE5C;;;;OAIG;IACH,YAAY,CAAC,EAAE,YAAY,CAAC;IAE5B;;;OAGG;IACH,aAAa,CAAC,EAAE,CAAC,MAAM,EAAE,YAAY,KAAK,IAAI,CAAC;IAE/C;;OAEG;IACH,aAAa,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;CAC5C;AAED;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,CAyMxD,CAAC"}
1
+ {"version":3,"file":"DashboardPanel.d.ts","sourceRoot":"","sources":["../../src/panels/DashboardPanel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4D,MAAM,OAAO,CAAC;AACjF,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAC;AAI/E,OAAO,KAAK,EAEV,YAAY,EAGZ,gBAAgB,EAChB,YAAY,EAEb,MAAM,mCAAmC,CAAC;AAsB3C,MAAM,WAAW,mBAAoB,SAAQ,mBAAmB;IAC9D;;;;OAIG;IACH,iBAAiB,CAAC,EAAE,gBAAgB,GAAG,IAAI,CAAC;IAE5C;;;;OAIG;IACH,YAAY,CAAC,EAAE,YAAY,CAAC;IAE5B;;;OAGG;IACH,aAAa,CAAC,EAAE,CAAC,MAAM,EAAE,YAAY,KAAK,IAAI,CAAC;IAE/C;;OAEG;IACH,aAAa,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;CAC5C;AAED;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,CA+MxD,CAAC"}
@@ -206072,6 +206072,17 @@ const TraceDetailsPanel = ({
206072
206072
  }
206073
206073
  );
206074
206074
  };
206075
+ class EmptyDataProvider {
206076
+ getAll() {
206077
+ return {};
206078
+ }
206079
+ get(_metricId) {
206080
+ return {
206081
+ current: 0,
206082
+ series: []
206083
+ };
206084
+ }
206085
+ }
206075
206086
  const DashboardPanel = ({
206076
206087
  context: _context,
206077
206088
  actions,
@@ -206232,6 +206243,10 @@ const DashboardPanel = ({
206232
206243
  }
206233
206244
  );
206234
206245
  }
206246
+ const effectiveDataProvider = useMemo(
206247
+ () => dataProvider ?? new EmptyDataProvider(),
206248
+ [dataProvider]
206249
+ );
206235
206250
  return /* @__PURE__ */ jsx(
206236
206251
  "div",
206237
206252
  {
@@ -206247,7 +206262,7 @@ const DashboardPanel = ({
206247
206262
  DashboardRenderer,
206248
206263
  {
206249
206264
  dashboard,
206250
- dataProvider,
206265
+ dataProvider: effectiveDataProvider,
206251
206266
  timeRange,
206252
206267
  onTimeRangeChange: setTimeRange,
206253
206268
  refreshInterval,