@sentio/ui-dashboard 0.2.0 → 0.2.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/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
2
1
  import { DurationLike, ButtonProps } from '@sentio/ui-core';
2
+ import * as react_jsx_runtime from 'react/jsx-runtime';
3
3
  import * as React from 'react';
4
4
  import React__default, { ReactNode, CSSProperties } from 'react';
5
5
  import { ComposeOption, SetOptionOpts, ECharts } from 'echarts/core';
@@ -20,6 +20,22 @@ type NoteFontSizeLike = 'MD' | 'SM' | 'LG' | 'XL' | 'XXL';
20
20
  type NoteAlignmentLike = 'LEFT' | 'CENTER' | 'RIGHT';
21
21
  /** Note panel vertical alignment. */
22
22
  type NoteVerticalAlignmentLike = 'TOP' | 'MIDDLE' | 'BOTTOM';
23
+ /** Series/value aggregation calculation. */
24
+ type CalculationLike = 'LAST' | 'FIRST' | 'MEAN' | 'TOTAL' | 'ALL' | 'MIN' | 'MAX';
25
+ /** Bar-gauge layout direction. */
26
+ type DirectionLike = 'HORIZONTAL' | 'VERTICAL';
27
+ /** Mark type for chart markers. */
28
+ type MarkerTypeLike = 'LINE' | 'AREA' | 'LINEX';
29
+ /** Sort key for axis/bar ordering. */
30
+ type SortByLike = 'ByName' | 'ByValue';
31
+ /** Value formatter family. */
32
+ type ValueFormatterLike = 'NumberFormatter' | 'DateFormatter' | 'StringFormatter';
33
+ /** Number value display style. */
34
+ type ValueStyleLike = 'Standard' | 'Compact' | 'Scientific' | 'Percent' | 'Currency' | 'None';
35
+ /** Pie vs donut. */
36
+ type PieTypeLike = 'Pie' | 'Donut';
37
+ /** Line style. */
38
+ type LineStyleLike = 'Solid' | 'Dotted';
23
39
 
24
40
  /** One panel's box in the grid. */
25
41
  interface LayoutItemLike {
@@ -108,6 +124,11 @@ interface DashboardLike {
108
124
  sharing?: unknown;
109
125
  }
110
126
 
127
+ /** Sort key + direction (x-axis, bar-gauge). */
128
+ interface SortLike {
129
+ sortBy?: SortByLike;
130
+ orderDesc?: boolean;
131
+ }
111
132
  /** Y-axis configuration. */
112
133
  interface YAxisConfigLike {
113
134
  min?: string;
@@ -117,9 +138,162 @@ interface YAxisConfigLike {
117
138
  column?: string;
118
139
  name?: string;
119
140
  }
120
- /** Minimal subset of a chart's config. Extended alongside chart components. */
141
+ /** X-axis configuration. */
142
+ interface XAxisConfigLike {
143
+ type?: string;
144
+ min?: string;
145
+ max?: string;
146
+ scale?: boolean;
147
+ name?: string;
148
+ column?: string;
149
+ sort?: SortLike;
150
+ format?: string;
151
+ }
152
+ /** Text/background color overrides for value + mapping rules. */
153
+ interface ColorThemeLike {
154
+ textColor?: string;
155
+ backgroundColor?: string;
156
+ themeType?: string;
157
+ }
158
+ /** A value→text/color mapping rule. */
159
+ interface MappingRuleLike {
160
+ comparison?: string;
161
+ value?: number | 'NaN' | 'Infinity' | '-Infinity';
162
+ text?: string;
163
+ colorTheme?: ColorThemeLike;
164
+ }
165
+ /** Number/string/date value formatting. */
166
+ interface ValueConfigLike {
167
+ valueFormatter?: ValueFormatterLike;
168
+ showValueLabel?: boolean;
169
+ maxSignificantDigits?: number;
170
+ dateFormat?: string;
171
+ mappingRules?: MappingRuleLike[];
172
+ style?: ValueStyleLike;
173
+ maxFractionDigits?: number;
174
+ precision?: number;
175
+ currencySymbol?: string;
176
+ tooltipTotal?: boolean;
177
+ prefix?: string;
178
+ suffix?: string;
179
+ }
180
+ /** Line chart style. */
181
+ interface LineConfigLike {
182
+ style?: LineStyleLike;
183
+ smooth?: boolean;
184
+ }
185
+ /** Pie/donut config. */
186
+ interface PieConfigLike {
187
+ pieType?: PieTypeLike;
188
+ showPercent?: boolean;
189
+ showValue?: boolean;
190
+ calculation?: CalculationLike;
191
+ absValue?: boolean;
192
+ }
193
+ /** Bar-gauge config. */
194
+ interface BarGaugeConfigLike {
195
+ direction?: DirectionLike;
196
+ calculation?: CalculationLike;
197
+ sort?: SortLike;
198
+ }
199
+ /** Query-value (single big number) config. */
200
+ interface QueryValueConfigLike {
201
+ colorTheme?: ColorThemeLike;
202
+ showBackgroundChart?: boolean;
203
+ calculation?: CalculationLike;
204
+ seriesCalculation?: CalculationLike;
205
+ }
206
+ /** Per-column label config (event/log tables). */
207
+ interface LabelConfigColumnLike {
208
+ name?: string;
209
+ showLabel?: boolean;
210
+ showValue?: boolean;
211
+ }
212
+ /** Series label config. */
213
+ interface LabelConfigLike {
214
+ columns?: LabelConfigColumnLike[];
215
+ alias?: string;
216
+ }
217
+ /** Scatter chart config. */
218
+ interface ScatterConfigLike {
219
+ symbolSize?: string;
220
+ color?: string;
221
+ minSize?: number;
222
+ maxSize?: number;
223
+ }
224
+ /** A mark line/area on a chart. */
225
+ interface MarkerLike {
226
+ type?: MarkerTypeLike;
227
+ value?: number | 'NaN' | 'Infinity' | '-Infinity';
228
+ color?: string;
229
+ label?: string;
230
+ valueX?: string;
231
+ }
232
+ /** Series count limit. */
233
+ interface DataConfigLike {
234
+ seriesLimit?: number;
235
+ }
236
+ /** Per-series override (currently just chart type). */
237
+ interface SeriesConfigSeriesLike {
238
+ type?: ChartTypeLike;
239
+ }
240
+ /** Per-series config keyed by series id. */
241
+ interface SeriesConfigLike {
242
+ series?: {
243
+ [key: string]: SeriesConfigSeriesLike;
244
+ };
245
+ }
246
+ /** Table column sort entry. */
247
+ interface ColumnSortLike {
248
+ column?: string;
249
+ orderDesc?: boolean;
250
+ }
251
+ /** Table chart config. */
252
+ interface TableConfigLike {
253
+ calculation?: CalculationLike;
254
+ showColumns?: {
255
+ [key: string]: boolean;
256
+ };
257
+ sortColumns?: ColumnSortLike[];
258
+ columnOrders?: string[];
259
+ columnWidths?: {
260
+ [key: string]: number;
261
+ };
262
+ showPlainData?: boolean;
263
+ calculations?: {
264
+ [key: string]: CalculationLike;
265
+ };
266
+ valueConfigs?: {
267
+ [key: string]: ValueConfigLike;
268
+ };
269
+ rowLimit?: number;
270
+ }
271
+ /** Compare-to-previous-period offset. */
272
+ interface CompareTimeLike {
273
+ ago?: DurationLike;
274
+ }
275
+ /** Per-chart time-range override. `timeRange` payload kept opaque. */
276
+ interface TimeRangeOverrideLike {
277
+ enabled?: boolean;
278
+ timeRange?: unknown;
279
+ compareTime?: CompareTimeLike;
280
+ }
281
+ /** A chart's full config — structural mirror of proto `ChartConfig`. */
121
282
  interface ChartConfigLike {
122
283
  yAxis?: YAxisConfigLike;
284
+ xAxis?: XAxisConfigLike;
285
+ lineConfig?: LineConfigLike;
286
+ valueConfig?: ValueConfigLike;
287
+ pieConfig?: PieConfigLike;
288
+ barGauge?: BarGaugeConfigLike;
289
+ queryValueConfig?: QueryValueConfigLike;
290
+ tableConfig?: TableConfigLike;
291
+ labelConfig?: LabelConfigLike;
292
+ scatterConfig?: ScatterConfigLike;
293
+ seriesConfig?: SeriesConfigLike;
294
+ dataConfig?: DataConfigLike;
295
+ timeRangeOverride?: TimeRangeOverrideLike;
296
+ markers?: MarkerLike[];
123
297
  }
124
298
  /** A note (text) panel's content and styling. */
125
299
  interface NoteLike {
@@ -209,12 +383,12 @@ interface MetricInfoLike {
209
383
  };
210
384
  }
211
385
 
212
- interface Props$d {
386
+ interface Props$h {
213
387
  metric?: MetricInfoLike;
214
388
  value: QueryLike;
215
389
  onChange: (value: QueryLike) => void;
216
390
  }
217
- declare function AggregateInput({ metric, value, onChange }: Props$d): react_jsx_runtime.JSX.Element;
391
+ declare function AggregateInput({ metric, value, onChange }: Props$h): react_jsx_runtime.JSX.Element;
218
392
 
219
393
  declare enum ArgumentType {
220
394
  String = 0,
@@ -249,28 +423,28 @@ declare const EventsFunctionMap: {
249
423
  [name: string]: FunctionDef;
250
424
  };
251
425
 
252
- interface Props$c {
426
+ interface Props$g {
253
427
  argument: ArgumentDef;
254
428
  value?: ArgumentLike;
255
429
  onChange?: (value: ArgumentLike) => void;
256
430
  className?: string;
257
431
  }
258
- declare function ArgumentInput({ className, argument, value, onChange }: Props$c): react_jsx_runtime.JSX.Element;
432
+ declare function ArgumentInput({ className, argument, value, onChange }: Props$g): react_jsx_runtime.JSX.Element;
259
433
 
260
- interface Props$b {
434
+ interface Props$f {
261
435
  value: QueryLike;
262
436
  onChange: (value: QueryLike) => void;
263
437
  }
264
- declare function FunctionInput({ value, onChange }: Props$b): react_jsx_runtime.JSX.Element;
438
+ declare function FunctionInput({ value, onChange }: Props$f): react_jsx_runtime.JSX.Element;
265
439
 
266
- interface Props$a {
440
+ interface Props$e {
267
441
  onClick: (func: FunctionDef) => void;
268
442
  functionCategories?: typeof FunctionsCategories;
269
443
  defaultFunc?: string;
270
444
  }
271
- declare function FunctionsPanel({ onClick, functionCategories, defaultFunc }: Props$a): react_jsx_runtime.JSX.Element;
445
+ declare function FunctionsPanel({ onClick, functionCategories, defaultFunc }: Props$e): react_jsx_runtime.JSX.Element;
272
446
 
273
- interface Props$9 {
447
+ interface Props$d {
274
448
  metric?: MetricInfoLike;
275
449
  value: QueryLike;
276
450
  onChange: (value: QueryLike) => void;
@@ -280,7 +454,7 @@ interface Props$9 {
280
454
  small?: boolean;
281
455
  useRegex?: boolean;
282
456
  }
283
- declare function LabelsInput({ value, metric, variables, onChange, small, useRegex }: Props$9): react_jsx_runtime.JSX.Element;
457
+ declare function LabelsInput({ value, metric, variables, onChange, small, useRegex }: Props$d): react_jsx_runtime.JSX.Element;
284
458
 
285
459
  declare const SystemLabels: {
286
460
  field: string;
@@ -343,7 +517,7 @@ type SeriesFinder = {
343
517
  };
344
518
  declare const ReactEChartsBase: React__default.ForwardRefExoticComponent<ReactEChartsProps & React__default.RefAttributes<EChartsHandle>>;
345
519
 
346
- interface Props$8 {
520
+ interface Props$c {
347
521
  legend: string[];
348
522
  legendSelected: Record<string, boolean>;
349
523
  returnedSeries?: number;
@@ -351,7 +525,7 @@ interface Props$8 {
351
525
  onRendered: (v: boolean) => void;
352
526
  chartHandle?: EChartsHandle;
353
527
  }
354
- declare const ChartLegend: ({ legend, legendSelected, returnedSeries, totalSeries, onRendered, chartHandle }: Props$8) => react_jsx_runtime.JSX.Element;
528
+ declare const ChartLegend: ({ legend, legendSelected, returnedSeries, totalSeries, onRendered, chartHandle }: Props$c) => react_jsx_runtime.JSX.Element;
355
529
 
356
530
  declare const RefreshContext: React.Context<{
357
531
  refresh?: () => void;
@@ -359,6 +533,36 @@ declare const RefreshContext: React.Context<{
359
533
  }>;
360
534
  declare const RefreshButton: (props: Partial<ButtonProps>) => react_jsx_runtime.JSX.Element | null;
361
535
 
536
+ interface Props$b {
537
+ config?: LineConfigLike;
538
+ defaultOpen?: boolean;
539
+ onChange: (config: LineConfigLike) => void;
540
+ }
541
+ declare const LineControls: ({ config, defaultOpen, onChange }: Props$b) => react_jsx_runtime.JSX.Element;
542
+
543
+ interface Props$a {
544
+ config?: LabelConfigLike;
545
+ setConfig: (value: LabelConfigLike) => void;
546
+ defaultOpen?: boolean;
547
+ }
548
+ declare const LabelControls: ({ config, setConfig, defaultOpen }: Props$a) => react_jsx_runtime.JSX.Element;
549
+
550
+ interface Props$9 {
551
+ config?: PieConfigLike;
552
+ defaultOpen?: boolean;
553
+ onChange: (config: PieConfigLike) => void;
554
+ }
555
+ declare const defaultConfig$1: PieConfigLike;
556
+ declare function PieChartControls({ config, defaultOpen, onChange }: Props$9): react_jsx_runtime.JSX.Element;
557
+
558
+ interface Props$8 {
559
+ config?: BarGaugeConfigLike;
560
+ defaultOpen?: boolean;
561
+ onChange: (config: BarGaugeConfigLike) => void;
562
+ }
563
+ declare const defaultConfig: BarGaugeConfigLike;
564
+ declare function BarGaugeControls({ config, defaultOpen, onChange }: Props$8): react_jsx_runtime.JSX.Element;
565
+
362
566
  declare const sentioColors: {
363
567
  light: {
364
568
  classic: string[];
@@ -1149,4 +1353,4 @@ interface Props {
1149
1353
  }
1150
1354
  declare const SvgIcon: ({ className }: Props) => react_jsx_runtime.JSX.Element;
1151
1355
 
1152
- export { AggregateInput, SvgIcon$6 as AreaIcon, type ArgumentDef, ArgumentInput, ArgumentType, SvgIcon$4 as BarGuageIcon, SvgIcon$5 as BarIcon, type ChartConfigLike, ChartLegend, type ChartLike, type ChartTypeLike, type DashboardExtraLike, type DashboardLike, type DashboardVisibilityLike, type DataSourceTypeLike, type EChartsHandle, type EChartsOption, EventsFunctionCategories, EventsFunctionMap, type FunctionDef, FunctionInput, FunctionMap, FunctionsCategories, FunctionsPanel, type GroupLike, type GroupStyleLike, LabelSearchProvider, LabelsInput, type LayoutItemLike, type LayoutsLike, SvgIcon$7 as LineIcon, type NoteAlignmentLike, type NoteFontSizeLike, type NoteLike, type NoteVerticalAlignmentLike, type OverlayGraphLike, type PanelLike, SvgIcon$3 as PieIcon, SvgIcon$2 as QueryValueIcon, ReactEChartsBase, type ReactEChartsProps, RefreshButton, RefreshContext, type ResponsiveLayoutsLike, SvgIcon$1 as ScatterIcon, SystemLabels, SvgIcon as TableIcon, type TemplateVariableLike, type TemplateViewLike, type YAxisConfigLike, isAggrOrRollupFunction, sentioColors, sentioTheme, sentioThemeDark, sortMetricByName, useLabelSearch, useLabelSearchContext };
1356
+ export { AggregateInput, SvgIcon$6 as AreaIcon, type ArgumentDef, ArgumentInput, ArgumentType, BarGaugeControls, SvgIcon$4 as BarGuageIcon, SvgIcon$5 as BarIcon, type ChartConfigLike, ChartLegend, type ChartLike, type ChartTypeLike, type DashboardExtraLike, type DashboardLike, type DashboardVisibilityLike, type DataSourceTypeLike, type EChartsHandle, type EChartsOption, EventsFunctionCategories, EventsFunctionMap, type FunctionDef, FunctionInput, FunctionMap, FunctionsCategories, FunctionsPanel, type GroupLike, type GroupStyleLike, LabelControls, LabelSearchProvider, LabelsInput, type LayoutItemLike, type LayoutsLike, LineControls, SvgIcon$7 as LineIcon, type NoteAlignmentLike, type NoteFontSizeLike, type NoteLike, type NoteVerticalAlignmentLike, type OverlayGraphLike, type PanelLike, PieChartControls, SvgIcon$3 as PieIcon, SvgIcon$2 as QueryValueIcon, ReactEChartsBase, type ReactEChartsProps, RefreshButton, RefreshContext, type ResponsiveLayoutsLike, SvgIcon$1 as ScatterIcon, SystemLabels, SvgIcon as TableIcon, type TemplateVariableLike, type TemplateViewLike, type YAxisConfigLike, defaultConfig as defaultBarGaugeConfig, defaultConfig$1 as defaultPieConfig, isAggrOrRollupFunction, sentioColors, sentioTheme, sentioThemeDark, sortMetricByName, useLabelSearch, useLabelSearchContext };