@dlh.io/bideux 0.1.0

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.
Files changed (90) hide show
  1. package/LICENSE +202 -0
  2. package/README.md +90 -0
  3. package/dist/all.d.ts +14 -0
  4. package/dist/all.js +15 -0
  5. package/dist/all.js.map +1 -0
  6. package/dist/chunk-62IQGXLW.js +11470 -0
  7. package/dist/chunk-62IQGXLW.js.map +1 -0
  8. package/dist/chunk-75CRTQK7.js +315 -0
  9. package/dist/chunk-75CRTQK7.js.map +1 -0
  10. package/dist/chunk-FVO6E22Z.js +225 -0
  11. package/dist/chunk-FVO6E22Z.js.map +1 -0
  12. package/dist/chunk-GRITOB4M.js +337 -0
  13. package/dist/chunk-GRITOB4M.js.map +1 -0
  14. package/dist/chunk-HPFHIZWO.js +40 -0
  15. package/dist/chunk-HPFHIZWO.js.map +1 -0
  16. package/dist/chunk-IMNUQGHE.js +2864 -0
  17. package/dist/chunk-IMNUQGHE.js.map +1 -0
  18. package/dist/chunk-LHD445PJ.js +571 -0
  19. package/dist/chunk-LHD445PJ.js.map +1 -0
  20. package/dist/chunk-LPLBBHOW.js +386 -0
  21. package/dist/chunk-LPLBBHOW.js.map +1 -0
  22. package/dist/chunk-NGM5R3LW.js +881 -0
  23. package/dist/chunk-NGM5R3LW.js.map +1 -0
  24. package/dist/chunk-OMPR32AR.js +1320 -0
  25. package/dist/chunk-OMPR32AR.js.map +1 -0
  26. package/dist/chunk-QDQ5VVTC.js +255 -0
  27. package/dist/chunk-QDQ5VVTC.js.map +1 -0
  28. package/dist/chunk-RRWZKNDZ.js +1004 -0
  29. package/dist/chunk-RRWZKNDZ.js.map +1 -0
  30. package/dist/chunk-SRWIBMEB.js +178 -0
  31. package/dist/chunk-SRWIBMEB.js.map +1 -0
  32. package/dist/element/chunk-AOKCBPMV.js +1646 -0
  33. package/dist/element/chunk-AOKCBPMV.js.map +1 -0
  34. package/dist/element/chunk-B67SYRQP.js +281 -0
  35. package/dist/element/chunk-B67SYRQP.js.map +1 -0
  36. package/dist/element/chunk-FNRVFA2C.js +55 -0
  37. package/dist/element/chunk-FNRVFA2C.js.map +1 -0
  38. package/dist/element/chunk-G3C722QP.js +4707 -0
  39. package/dist/element/chunk-G3C722QP.js.map +1 -0
  40. package/dist/element/chunk-H5IFOSQP.js +346 -0
  41. package/dist/element/chunk-H5IFOSQP.js.map +1 -0
  42. package/dist/element/chunk-LXR3CLCN.js +30 -0
  43. package/dist/element/chunk-LXR3CLCN.js.map +1 -0
  44. package/dist/element/chunk-TFV4CJR4.js +183 -0
  45. package/dist/element/chunk-TFV4CJR4.js.map +1 -0
  46. package/dist/element/chunk-TXSK3CIN.js +859 -0
  47. package/dist/element/chunk-TXSK3CIN.js.map +1 -0
  48. package/dist/element/chunk-WDTTBY3S.js +45 -0
  49. package/dist/element/chunk-WDTTBY3S.js.map +1 -0
  50. package/dist/element/chunk-ZI3RYCAR.js +233 -0
  51. package/dist/element/chunk-ZI3RYCAR.js.map +1 -0
  52. package/dist/element/element.d.ts +3044 -0
  53. package/dist/element/element.js +146554 -0
  54. package/dist/element/element.js.map +1 -0
  55. package/dist/element/revo-grid.entry-7FHEBN3O.js +4817 -0
  56. package/dist/element/revo-grid.entry-7FHEBN3O.js.map +1 -0
  57. package/dist/element/revogr-attribution_7.entry-LSOFVZRA.js +1328 -0
  58. package/dist/element/revogr-attribution_7.entry-LSOFVZRA.js.map +1 -0
  59. package/dist/element/revogr-clipboard_3.entry-V74UIBPJ.js +494 -0
  60. package/dist/element/revogr-clipboard_3.entry-V74UIBPJ.js.map +1 -0
  61. package/dist/element/revogr-data_4.entry-2UBOKTFN.js +1041 -0
  62. package/dist/element/revogr-data_4.entry-2UBOKTFN.js.map +1 -0
  63. package/dist/element/revogr-filter-panel.entry-B24PLQU4.js +552 -0
  64. package/dist/element/revogr-filter-panel.entry-B24PLQU4.js.map +1 -0
  65. package/dist/index.d.ts +1041 -0
  66. package/dist/index.js +10 -0
  67. package/dist/index.js.map +1 -0
  68. package/dist/react.d.ts +1915 -0
  69. package/dist/react.js +14 -0
  70. package/dist/react.js.map +1 -0
  71. package/dist/renderers/echarts.d.ts +44 -0
  72. package/dist/renderers/echarts.js +6 -0
  73. package/dist/renderers/echarts.js.map +1 -0
  74. package/dist/renderers/index.d.ts +48 -0
  75. package/dist/renderers/index.js +12 -0
  76. package/dist/renderers/index.js.map +1 -0
  77. package/dist/renderers/revogrid.d.ts +76 -0
  78. package/dist/renderers/revogrid.js +6 -0
  79. package/dist/renderers/revogrid.js.map +1 -0
  80. package/dist/renderers/tabulator.d.ts +37 -0
  81. package/dist/renderers/tabulator.js +6 -0
  82. package/dist/renderers/tabulator.js.map +1 -0
  83. package/dist/result-table-CPls-277.d.ts +1885 -0
  84. package/dist/schema/dashboard.schema.json +4374 -0
  85. package/dist/schema/semantic-model.schema.json +1200 -0
  86. package/dist/schema/widget.schema.json +1793 -0
  87. package/dist/styles.css +156 -0
  88. package/dist/theme.css +1789 -0
  89. package/dist/types-CHFSsU_X.d.ts +1007 -0
  90. package/package.json +119 -0
@@ -0,0 +1,1041 @@
1
+ import { x as DashboardGridConfig, c as Breakpoint, aa as ResponsiveLayouts, L as DashboardSpec, w as DashboardFilterPanelConfig, T as LayoutItem, q as BuilderRelationship, n as BuilderModelMetric, i as BuilderDataset, h as BuilderDataStore, I as DashboardPivotInfo, a8 as ReadPivotOpenLevels, a4 as PivotExpandEntry, ad as SemanticSummary, V as ModelMarker, U as LayoutKey } from './result-table-CPls-277.js';
2
+ export { A as AGGREGATIONS, a as ALL_COMPONENTS, b as Aggregation, B as BUILDER_COMPONENTS, d as BreakpointConfig, e as BuilderAppearance, f as BuilderCardinality, g as BuilderComponent, j as BuilderDimension, k as BuilderDimensionType, l as BuilderMappings, m as BuilderMetric, o as BuilderPivot, p as BuilderPivotMeasure, r as BuilderRollup, s as BuilderSeries, t as BuilderWidget, C as CHART_TYPES, u as ChartType, D as DELTA_FORMATS, v as DashboardConfig, y as DashboardModelAiGrounding, z as DashboardModelDataStoreDiagnostic, E as DashboardModelDatasetDiagnostic, F as DashboardModelDiagnostics, G as DashboardModelMetricDiagnostic, H as DashboardModelRelationshipDiagnostic, J as DashboardResponsiveConfig, K as DashboardSectionConfig, M as DashboardTab, N as DeltaFormat, O as FilterControl, P as FilterLayout, Q as FilterModel, R as FilterOption, S as LAYOUT_BREAKPOINT_WIDTHS, W as ModelMarkerSeverity, X as ModelOutline, Y as ModelParseError, Z as NUMBER_FORMATS, _ as NumberFormat, $ as PIVOT_AGGREGATIONS, a0 as PIVOT_DIRECTIONS, a1 as PIVOT_SUBTOTALS, a2 as PivotAggregation, a3 as PivotDirection, a5 as PivotOpenLevels, a6 as PivotSubtotals, a7 as RatioSide, a9 as ResizeHandle, ab as ResultTable, ac as SORT_ORDERS, ae as SortOrder, af as WidgetAnchor, ag as WidgetColumn, ah as WidgetFinding, ai as WidgetOutline, aj as WidgetRef, ak as aggregationExpression, al as blockingKeys, am as buildFilterModel, an as cellText, ao as countModelIssues, ap as dashboardTabs, aq as dataStoreFragment, ar as datasetFragment, as as defaultTabId, at as describeFilter, au as diagnosticsToMarkers, av as dimensionTypeFor, aw as filterOptions, ax as formatTableCsv, ay as humanizeColumn, az as indexModelYaml, aA as isBuilderComponent, aB as isDoubleScaledPercent, aC as isIsoDate, aD as isRelativeDateExpression, aE as labelColumns, aF as layoutKeyForWidth, aG as modelMetricFragment, aH as modelText, aI as numericColumns, aJ as parseAggregation, aK as parseModelDocument, aL as parseRatioExpression, aM as preservedKeys, aN as ratioExpression, aO as readDataStores, aP as readDatasets, aQ as readModelMetrics, aR as readModelOutline, aS as readRelationships, aT as readWidgetOutline, aU as relationshipFragment, aV as removeDataStore, aW as removeDataset, aX as removeModelMetric, aY as removeRelationship, aZ as resolveResponsive, a_ as resultColumns, a$ as resultRows, b0 as tabWidgetIds, b1 as upsertDataStore, b2 as upsertDataset, b3 as upsertModelMetric, b4 as upsertRelationship, b5 as widgetColumns, b6 as widgetFindings, b7 as widgetFragment, b8 as widgetIssues, b9 as writeComponent, ba as writeIdentity, bb as writePivotLayout, bc as writeWidget, bd as yamlSyntaxMarkers } from './result-table-CPls-277.js';
3
+ import { aw as WidgetSpec, C as ChartOption, av as WidgetResult, S as RendererContext, b as ChartRendererModel, D as DataRow, ae as TabularRendererModel, ad as TabularGridAdapter, B as BasicRendererModel, h as KpiRendererModel, M as MarkdownRendererModel, ag as TextRendererModel, aq as WidgetRenderResolution, O as PivotTablePayload, u as PivotGridColumnDefinition, H as PivotRowPayload, w as PivotGridRow, y as PivotMeasurePayload, v as PivotGridColumnGroup, r as PivotFieldPayload, x as PivotGridRowMeta, z as PivotRendererModel, R as ReadyPivotRendererModel, t as PivotGridColumn, k as PivotCellAction, l as PivotCellPresentation, a2 as PivotOpenLevels, Q as PivotViewState, J as PivotSortState, m as PivotColumnFilter, a1 as PivotDirection, T as RendererExtension, a3 as RendererRegistry, d as GridColumnModel, aa as TableRendererModel, af as TabulatorRendererModel, G as GridColumnFormatterModel, ac as TableSortState, a9 as TableExportModel, an as WidgetInteraction, ao as WidgetInteractionContext, al as WidgetDefaults, ax as WidgetTheme, ak as WidgetComponent, W as RendererFrame, a4 as RendererThemeTokens, N as NativeWidgetRenderInput, a as BrowserRenderer, as as WidgetRendererFactories, X as RendererHostCallbacks, at as WidgetRendererFactory } from './types-CHFSsU_X.js';
4
+ export { c as DrillStackItem, E as ExtensionRendererModel, F as FieldMapping, e as GridOptionsModel, I as ImageRendererModel, f as InteractionVariableMapping, g as InteractionVariableSource, K as KpiDeltaModel, i as KpiValueFormat, L as LabelBlock, j as MissingPivotRendererModel, P as PIVOT_META_PROP, n as PivotColumnNode, o as PivotControlsModel, p as PivotDetailColumn, q as PivotDetailResult, s as PivotFilterOp, A as PivotRowKind, aj as RendererExportRequest, U as RendererExtensionInput, V as RendererExtensionMount, Y as RendererLabel, Z as RendererLicensePort, _ as RendererLicenseRequest, $ as RendererPivotAggregation, a0 as RendererPivotDetailRequest, a5 as ResponsiveLayout, a6 as SortDirection, a7 as TableCellModel, a8 as TableColumnModel, ab as TableRowModel, ah as TextRendererStyle, ai as UnknownRendererModel, am as WidgetHeaderConfig, ap as WidgetLayout, ar as WidgetRenderState, au as WidgetRendererHandle, ay as buildDrillUrl, az as decodeDrillStack, aA as defaultRendererTheme, aB as encodeDrillStack, aC as findEventRow, aD as getClickInteraction, aE as isUrlInteraction, aF as resolveInteractionValue, aG as resolveInteractionValues, aH as resolveRendererTheme } from './types-CHFSsU_X.js';
5
+ import 'yaml';
6
+
7
+ /**
8
+ * Business context available to host authoring tools, including synonyms.
9
+ */
10
+ type AiContext = {
11
+ [k: string]: JsonValue;
12
+ } | string | null;
13
+ type JsonValue = unknown;
14
+ type CustomExtensions = {
15
+ [k: string]: JsonValue;
16
+ }[] | null;
17
+ /**
18
+ * Warehouse connections datasets may read from.
19
+ *
20
+ * @maxItems 3
21
+ */
22
+ type DataStores = [] | [DataStore] | [DataStore, DataStore] | [DataStore, DataStore, DataStore];
23
+ type AiContext1 = {
24
+ [k: string]: JsonValue;
25
+ } | string | null;
26
+ type CustomExtensions1 = {
27
+ [k: string]: JsonValue;
28
+ }[] | null;
29
+ /**
30
+ * Host data-store identifier holding credentials, database, and schema. Omit to use the host's default active store.
31
+ */
32
+ type DataModelId = string | null;
33
+ /**
34
+ * Store used by datasets that do not name one.
35
+ */
36
+ type Default = boolean;
37
+ type Description = string | null;
38
+ /**
39
+ * Id datasets use to point at this store, for example ops_dw.
40
+ */
41
+ type Id = string;
42
+ type Name = string | null;
43
+ /**
44
+ * Warehouse vendor, for example snowflake, databricks or postgres.
45
+ */
46
+ type Vendor = string | null;
47
+ type AiContext2 = {
48
+ [k: string]: JsonValue;
49
+ } | string | null;
50
+ type Enabled = boolean;
51
+ type TtlSeconds = number | null;
52
+ type TtlSeconds1 = number | null;
53
+ type CustomExtensions2 = {
54
+ [k: string]: JsonValue;
55
+ }[] | null;
56
+ /**
57
+ * Id of the data store in this model's data_stores list. Omit to use the model's default store.
58
+ */
59
+ type DataStoreId = string | null;
60
+ type DataStoreIds = string[] | null;
61
+ type DataModelId1 = string | null;
62
+ /**
63
+ * Id of the data store in this model's data_stores list. Omit to use the model's default store.
64
+ */
65
+ type DataStoreId1 = string | null;
66
+ type DataStoreIds1 = string[] | null;
67
+ type Description1 = string | null;
68
+ type AiContext3 = {
69
+ [k: string]: JsonValue;
70
+ } | string | null;
71
+ /**
72
+ * Warehouse column this dimension reads. Defaults to the id.
73
+ */
74
+ type Column = string | null;
75
+ type CustomExtensions3 = {
76
+ [k: string]: JsonValue;
77
+ }[] | null;
78
+ type Description2 = string | null;
79
+ /**
80
+ * SQL expression to use instead of a plain column.
81
+ */
82
+ type Expression = string | Expression1 | null;
83
+ type Default1 = string | null;
84
+ type Dialect = string;
85
+ type Expression2 = string;
86
+ type Dialects = ExpressionDialect[];
87
+ type Format = string | null;
88
+ type Group = string | null;
89
+ type Hidden = boolean | null;
90
+ /**
91
+ * Id widgets use to group or filter by, for example business_date.
92
+ */
93
+ type Id1 = string;
94
+ type IsTime = boolean | null;
95
+ type Label = string | null;
96
+ type Name1 = string | null;
97
+ type Type = "string" | "number" | "date" | "time" | "boolean";
98
+ /**
99
+ * Columns widgets can group or filter by.
100
+ */
101
+ type Dimensions = Dimension[];
102
+ /**
103
+ * Columns widgets can group or filter by.
104
+ */
105
+ type Dimensions1 = Dimension[];
106
+ /**
107
+ * Column carrying the location key. Without it a location-scoped user cannot query this dataset.
108
+ */
109
+ type FilterField = string | null;
110
+ type FilterParam = string;
111
+ /**
112
+ * Table or view the rows come from, for example {mart_schema}.RPT_DAILY_SALES_SUMMARY.
113
+ */
114
+ type From = string | null;
115
+ type GroupBy = string[] | null;
116
+ /**
117
+ * Id widgets use to ask for this dataset, for example daily_sales.
118
+ */
119
+ type Id2 = string;
120
+ type Kpi = string | null;
121
+ type Enabled1 = boolean;
122
+ type Grain = string[];
123
+ type Metrics = string[];
124
+ type Source = string | null;
125
+ type Join = "left" | "inner";
126
+ type JoinColumns = string[];
127
+ type MaxRows = number;
128
+ /**
129
+ * @maxItems 3
130
+ */
131
+ type Parts = [] | [MeshPart] | [MeshPart, MeshPart] | [MeshPart, MeshPart, MeshPart];
132
+ type Dataset1 = string;
133
+ type AiContext4 = {
134
+ [k: string]: JsonValue;
135
+ } | string | null;
136
+ type CustomExtensions4 = {
137
+ [k: string]: JsonValue;
138
+ }[] | null;
139
+ type Dependencies = string[] | null;
140
+ type Description3 = string | null;
141
+ /**
142
+ * SQL aggregate such as SUM(NET_SALES), or an expression over other metrics such as labor_cost / net_sales.
143
+ */
144
+ type Expression3 = string | Expression1;
145
+ type Filter = string | null;
146
+ type Format1 = string | null;
147
+ type Group1 = string | null;
148
+ type Hidden1 = boolean | null;
149
+ /**
150
+ * Id widgets use to ask for this metric, for example net_sales.
151
+ */
152
+ type Id3 = string;
153
+ type Label1 = string | null;
154
+ type Name2 = string | null;
155
+ /**
156
+ * sql sends the expression to the warehouse; formula computes it from other metrics after the query.
157
+ */
158
+ type Type1 = "sql" | "formula";
159
+ /**
160
+ * Aggregations valid on this dataset's source.
161
+ */
162
+ type Metrics1 = Metric[];
163
+ /**
164
+ * Label shown to users. Defaults to the id.
165
+ */
166
+ type Name3 = string | null;
167
+ type PrimaryKey = string[] | null;
168
+ /**
169
+ * SQL to run when source_type is query.
170
+ */
171
+ type Query = string | null;
172
+ type AiContext5 = {
173
+ [k: string]: JsonValue;
174
+ } | string | null;
175
+ type CustomExtensions5 = {
176
+ [k: string]: JsonValue;
177
+ }[] | null;
178
+ /**
179
+ * Id of the dataset on the left of the join.
180
+ */
181
+ type From1 = string;
182
+ /**
183
+ * Join columns on the from dataset.
184
+ */
185
+ type FromColumns = string[];
186
+ /**
187
+ * Name of the join, for example sales_to_labor.
188
+ */
189
+ type Name4 = string;
190
+ /**
191
+ * Cardinality. one_to_many and many_to_many can fan out and double-count.
192
+ */
193
+ type Relationship1 = ("one_to_one" | "many_to_one" | "one_to_many" | "many_to_many") | null;
194
+ /**
195
+ * Id of the dataset on the right of the join.
196
+ */
197
+ type To = string;
198
+ /**
199
+ * Join columns on the to dataset, positionally matched to from_columns.
200
+ */
201
+ type ToColumns = string[];
202
+ type Relationships = Relationship[];
203
+ /**
204
+ * Table or view the rows come from, for example {mart_schema}.RPT_DAILY_SALES_SUMMARY.
205
+ */
206
+ type From2 = string | null;
207
+ /**
208
+ * table or view reads source; query runs the query field; mesh combines datasets from different data stores.
209
+ */
210
+ type SourceType = ("table" | "view" | "query" | "mesh") | null;
211
+ type UniqueKeys = string[][] | null;
212
+ /**
213
+ * Reusable sources of rows widgets can ask for.
214
+ */
215
+ type Datasets = Dataset[];
216
+ type Description4 = string | null;
217
+ type Kind = "semantic_model";
218
+ /**
219
+ * Metrics usable across datasets, including formulas spanning a join.
220
+ */
221
+ type Metrics2 = Metric[];
222
+ /**
223
+ * Model name. Dashboards reference the tenant model as default.
224
+ */
225
+ type Name5 = string;
226
+ /**
227
+ * Joins between datasets, so one widget can mix their fields.
228
+ */
229
+ type Relationships1 = Relationship[];
230
+ /**
231
+ * Spec version of this document. Currently 1.0.
232
+ */
233
+ type Version = string;
234
+ /**
235
+ * An OSI semantic model block (data stores, datasets, relationships, metrics).
236
+ */
237
+ interface SemanticModel {
238
+ ai_context?: AiContext;
239
+ custom_extensions?: CustomExtensions;
240
+ data_stores?: DataStores;
241
+ datasets?: Datasets;
242
+ description?: Description4;
243
+ kind?: Kind;
244
+ metrics?: Metrics2;
245
+ name: Name5;
246
+ relationships?: Relationships1;
247
+ version?: Version;
248
+ [k: string]: unknown;
249
+ }
250
+ /**
251
+ * A data-store (warehouse) connection referenced by datasets.
252
+ */
253
+ interface DataStore {
254
+ ai_context?: AiContext1;
255
+ custom_extensions?: CustomExtensions1;
256
+ data_model_id?: DataModelId;
257
+ default?: Default;
258
+ description?: Description;
259
+ id: Id;
260
+ name?: Name;
261
+ vendor?: Vendor;
262
+ [k: string]: unknown;
263
+ }
264
+ /**
265
+ * A reusable semantic dataset: schema/table, dimensions, and metrics.
266
+ */
267
+ interface Dataset {
268
+ ai_context?: AiContext2;
269
+ cache?: DatasetCacheConfig | null;
270
+ custom_extensions?: CustomExtensions2;
271
+ dataStoreId?: DataStoreId;
272
+ dataStoreIds?: DataStoreIds;
273
+ data_model_id?: DataModelId1;
274
+ data_store_id?: DataStoreId1;
275
+ data_store_ids?: DataStoreIds1;
276
+ description?: Description1;
277
+ dimensions?: Dimensions;
278
+ fields?: Dimensions1;
279
+ filter_field?: FilterField;
280
+ filter_param?: FilterParam;
281
+ from?: From;
282
+ group_by?: GroupBy;
283
+ id: Id2;
284
+ kpi?: Kpi;
285
+ materialization?: DatasetMaterialization | null;
286
+ mesh?: MeshPlan | null;
287
+ metrics?: Metrics1;
288
+ name?: Name3;
289
+ params?: Params;
290
+ primary_key?: PrimaryKey;
291
+ query?: Query;
292
+ relationships?: Relationships;
293
+ source?: From2;
294
+ source_type?: SourceType;
295
+ unique_keys?: UniqueKeys;
296
+ [k: string]: unknown;
297
+ }
298
+ /**
299
+ * How long a dataset's warehouse results may be reused.
300
+ */
301
+ interface DatasetCacheConfig {
302
+ enabled?: Enabled;
303
+ ttlSeconds?: TtlSeconds;
304
+ ttl_seconds?: TtlSeconds1;
305
+ [k: string]: unknown;
306
+ }
307
+ /**
308
+ * A dimension (attribute) inside a Dataset.
309
+ */
310
+ interface Dimension {
311
+ ai_context?: AiContext3;
312
+ column?: Column;
313
+ custom_extensions?: CustomExtensions3;
314
+ description?: Description2;
315
+ expression?: Expression;
316
+ format?: Format;
317
+ group?: Group;
318
+ hidden?: Hidden;
319
+ id: Id1;
320
+ is_time?: IsTime;
321
+ label?: Label;
322
+ name?: Name1;
323
+ type?: Type;
324
+ [k: string]: unknown;
325
+ }
326
+ /**
327
+ * OSI-style multi-dialect expression block.
328
+ *
329
+ * ``dialects`` lists SQL or expression variants per warehouse. ``default`` is
330
+ * available for row-level formulas or fallback SQL.
331
+ */
332
+ interface Expression1 {
333
+ default?: Default1;
334
+ dialects?: Dialects;
335
+ [k: string]: unknown;
336
+ }
337
+ /**
338
+ * A single dialect expression for a field or metric.
339
+ */
340
+ interface ExpressionDialect {
341
+ dialect: Dialect;
342
+ expression: Expression2;
343
+ [k: string]: unknown;
344
+ }
345
+ /**
346
+ * A pre-aggregated rollup the engine may read instead of the base source.
347
+ *
348
+ * ``grain`` lists the dimensions the rollup is aggregated to and ``metrics``
349
+ * the measures it carries. A widget selection covered by both is answered from
350
+ * ``source``; anything wider falls back to the dataset's own source, so the
351
+ * rollup is an optimisation and never changes what a widget can ask for.
352
+ */
353
+ interface DatasetMaterialization {
354
+ enabled?: Enabled1;
355
+ grain?: Grain;
356
+ metrics?: Metrics;
357
+ source?: Source;
358
+ [k: string]: unknown;
359
+ }
360
+ /**
361
+ * How a mesh dataset stitches datasets from different data stores together.
362
+ */
363
+ interface MeshPlan {
364
+ join?: Join;
365
+ join_columns?: JoinColumns;
366
+ max_rows?: MaxRows;
367
+ parts?: Parts;
368
+ [k: string]: unknown;
369
+ }
370
+ /**
371
+ * One dataset taking part in a mesh dataset.
372
+ */
373
+ interface MeshPart {
374
+ dataset: Dataset1;
375
+ [k: string]: unknown;
376
+ }
377
+ /**
378
+ * A calculated field or metric inside a Dataset.
379
+ */
380
+ interface Metric {
381
+ ai_context?: AiContext4;
382
+ custom_extensions?: CustomExtensions4;
383
+ dependencies?: Dependencies;
384
+ description?: Description3;
385
+ expression: Expression3;
386
+ filter?: Filter;
387
+ format?: Format1;
388
+ group?: Group1;
389
+ hidden?: Hidden1;
390
+ id: Id3;
391
+ label?: Label1;
392
+ name?: Name2;
393
+ type?: Type1;
394
+ [k: string]: unknown;
395
+ }
396
+ interface Params {
397
+ [k: string]: JsonValue;
398
+ }
399
+ /**
400
+ * A relationship between two datasets (OSI-style join).
401
+ */
402
+ interface Relationship {
403
+ ai_context?: AiContext5;
404
+ custom_extensions?: CustomExtensions5;
405
+ from: From1;
406
+ from_columns?: FromColumns;
407
+ name: Name4;
408
+ relationship?: Relationship1;
409
+ to: To;
410
+ to_columns?: ToColumns;
411
+ [k: string]: unknown;
412
+ }
413
+
414
+ declare const documentVersion = "1.0";
415
+ declare const documentKinds: readonly ["dashboard", "semantic_model", "widget"];
416
+ type DocumentKind = (typeof documentKinds)[number];
417
+
418
+ /**
419
+ * Ready-to-edit YAML for a brand new dashboard.
420
+ *
421
+ * A new dashboard already has a place for its controls. Without a filter panel
422
+ * a filter added later becomes an ordinary tile somewhere on the grid, which is
423
+ * not where a reader looks for one. It also has one tab, because a widget has
424
+ * to be added to a tab and a dashboard with no tabs has nowhere to put it.
425
+ */
426
+ interface DashboardTemplateOptions {
427
+ /** The address the dashboard will be created under. Seeds the document id. */
428
+ slug: string;
429
+ /** What the dashboard is called. */
430
+ name: string;
431
+ /** What the dashboard is for, written into the manifest as given. */
432
+ description?: string;
433
+ }
434
+ /** The YAML of a blank dashboard, valid the moment it is read back. */
435
+ declare function dashboardTemplate(options: DashboardTemplateOptions): string;
436
+
437
+ interface ExpressionRow {
438
+ [key: string]: unknown;
439
+ }
440
+ interface ExpressionContext {
441
+ rows?: ExpressionRow[];
442
+ row?: ExpressionRow;
443
+ variables?: Record<string, unknown>;
444
+ }
445
+ declare function interpolateVariables(value: unknown, variables: Record<string, unknown>): unknown;
446
+ declare function evaluateExpression(expression: string, context: ExpressionContext): unknown;
447
+ declare function evaluateVariables(variables: Record<string, string> | undefined, rows: ExpressionRow[], existingVariables?: Record<string, unknown>): Record<string, unknown>;
448
+ declare function applyFilter(filter: string | undefined, rows: ExpressionRow[], variables: Record<string, unknown>): ExpressionRow[];
449
+ declare function resolveFilterDefault(defaultValue: unknown, extraVariables?: Record<string, unknown>): unknown;
450
+
451
+ /**
452
+ * Printing what a filter is currently set to, inside written content.
453
+ *
454
+ * A heading that says "Downtown, last 30 days" is how a reader knows what the
455
+ * numbers beside it are counting. The wording lives in the widget's content as
456
+ * `{{filter:some_filter_id}}`, and this fills it in from the dashboard's filter
457
+ * state, preferring the label the control showed over the raw key it sends.
458
+ */
459
+ /**
460
+ * One filter value as a reader should see it.
461
+ *
462
+ * An unset filter reads as *empty* rather than as nothing at all, because a
463
+ * heading that silently loses a word is harder to understand than one that says
464
+ * the filter is not narrowing anything.
465
+ */
466
+ declare function formatFilterValue(value: unknown, empty?: string): string;
467
+ /**
468
+ * Content with every filter token replaced by what that filter is set to.
469
+ *
470
+ * *labels* holds the wording the control itself displayed, which is what a
471
+ * reader recognises: a location filter sends a store key and shows a store name.
472
+ * A token naming a filter this dashboard does not have is left exactly as
473
+ * written, so the mistake is visible rather than silently blank.
474
+ */
475
+ declare function fillFilterTokens(content: string, filters: Record<string, unknown>, labels?: Record<string, string>): string;
476
+ /** Whether content prints any filter at all, which decides if it has to re-render. */
477
+ declare function mentionsFilter(content: string): boolean;
478
+
479
+ declare const MAX_LAYOUT_WIDTHS: Record<"mobile" | "tablet" | "desktop" | "wide", number>;
480
+ /**
481
+ * Default grid behavior for dashboards.
482
+ * Authors can override these values through dashboard.spec.config.grid.
483
+ */
484
+ declare const DEFAULT_GRID_CONFIG: DashboardGridConfig;
485
+ /**
486
+ * Resolve the compactType and preventCollision values for the current
487
+ * snap setting.
488
+ * - Snap on = vertical compaction + collision re-ordering, so a drag pushes the
489
+ * neighbours it lands on out of the way.
490
+ * - Snap off = no compaction + collision prevention. This gives free placement
491
+ * to any empty cell up to maxRows; dragging an item onto another reverts it.
492
+ *
493
+ * Collisions are prevented in free placement regardless of what the dashboard
494
+ * declares, because `preventCollision: false` without compaction is the one
495
+ * combination that lets a widget be dropped on top of another and stay there.
496
+ * A dashboard that genuinely wants stacking sets `allowOverlap`.
497
+ */
498
+ declare function resolveSnap(grid: DashboardGridConfig, snap: boolean): {
499
+ compactType: "vertical" | "horizontal" | null;
500
+ preventCollision: boolean;
501
+ };
502
+
503
+ declare const BREAKPOINT_MAP: Record<string, Breakpoint>;
504
+ /** Components that are controls the reader changes rather than tiles on the grid. */
505
+ declare const CONTROL_COMPONENTS: Set<string>;
506
+ declare function isControlComponent(component: string): boolean;
507
+ /**
508
+ * The filter panel configuration under either spelling the specification
509
+ * accepts. A document read straight from YAML keeps `filter_panel`; one read back
510
+ * from a Pydantic model carries `filterPanel`.
511
+ */
512
+ declare function filterPanelConfig(dashboard: DashboardSpec): DashboardFilterPanelConfig | undefined;
513
+ /**
514
+ * True when the dashboard shows this widget in its filter panel rather than as a
515
+ * tile, so it must not reserve a cell on the grid.
516
+ */
517
+ declare function isPanelledControl(widget: WidgetSpec, dashboard: DashboardSpec): boolean;
518
+ /**
519
+ * Drop the panelled controls from every breakpoint of a set of layouts.
520
+ *
521
+ * A control drawn in the filter panel that still holds a cell leaves a hole the
522
+ * tiles around it were placed away from, and free placement never closes it.
523
+ */
524
+ declare function stripPanelledControls(layouts: ResponsiveLayouts, widgets: Record<string, WidgetSpec>, dashboard: DashboardSpec): ResponsiveLayouts;
525
+ declare function layoutForBreakpoint(widget: WidgetSpec, bp: Breakpoint, colCount: number, maxRows?: number): LayoutItem;
526
+ /** True when two grid items share any cell. */
527
+ declare function itemsCollide(a: LayoutItem, b: LayoutItem): boolean;
528
+ /**
529
+ * The topmost, then leftmost, empty rectangle that fits a widget of this size.
530
+ *
531
+ * Scanning for a gap rather than always appending at the bottom is what makes a
532
+ * widget land somewhere usable: a dashboard with one tall chart on the left has
533
+ * room beside it, and dropping the next widget far below that looks broken.
534
+ */
535
+ declare function firstFreeSlot(existing: LayoutItem[], w: number, h: number, colCount: number): {
536
+ x: number;
537
+ y: number;
538
+ };
539
+ /**
540
+ * Push overlapping items down until nothing shares a cell.
541
+ *
542
+ * Positions are honoured where they can be: an item only moves when something
543
+ * already sits where it wants to be, and it moves down rather than sideways so
544
+ * columns the author chose survive. Rows are not capped here, because squashing
545
+ * an item back inside a row limit is what put two widgets on top of each other
546
+ * in the first place. Callers grow the grid instead.
547
+ */
548
+ declare function resolveCollisions(items: LayoutItem[]): LayoutItem[];
549
+ /** The rows every breakpoint needs before anything has to overlap. */
550
+ declare function requiredRows(layouts: ResponsiveLayouts): number;
551
+ /** The ids that sit on top of another widget, in the layout as given. */
552
+ declare function overlappingIds(layouts: ResponsiveLayouts): string[];
553
+ /**
554
+ * The ids whose position or size differ between two sets of layouts.
555
+ *
556
+ * *only* narrows this to a single breakpoint. A narrow breakpoint reflows what a
557
+ * wide one saved, so counting every breakpoint named widgets as moved that
558
+ * nobody looking at the page could see, and saving never cleared the notice.
559
+ */
560
+ declare function movedIds(before: ResponsiveLayouts, after: ResponsiveLayouts, only?: string): string[];
561
+ /**
562
+ * Ensure every grid breakpoint and widget has an explicit layout item.
563
+ *
564
+ * Responsive invents absent breakpoints and children while rendering. Keeping
565
+ * the coverage here means those generated positions never become drafts.
566
+ */
567
+ declare function ensureLayoutCoverage(layouts: ResponsiveLayouts, widgets: Record<string, WidgetSpec>, dashboard: DashboardSpec, gridOverrides?: Partial<Record<Breakpoint, {
568
+ rowHeight?: number;
569
+ cols?: number;
570
+ }>>, unplacedWidgetIds?: string[], maxRows?: number): ResponsiveLayouts;
571
+ /**
572
+ * Scale horizontal geometry when a breakpoint changes column space.
573
+ *
574
+ * Positions and widths stay in the same relative place instead of being
575
+ * clamped into the new grid and then collision-resolved into a new order.
576
+ */
577
+ declare function rescaleLayoutColumns(layouts: ResponsiveLayouts, key: string, oldCols: number, newCols: number): ResponsiveLayouts;
578
+ declare function computeRequiredMaxRows(layouts: ResponsiveLayouts, widget: WidgetSpec, dashboard: DashboardSpec, gridOverrides?: Partial<Record<Breakpoint, {
579
+ rowHeight?: number;
580
+ cols?: number;
581
+ }>>, currentMaxRows?: number): number | undefined;
582
+ declare function addWidgetToLayouts(layouts: ResponsiveLayouts, widget: WidgetSpec, dashboard: DashboardSpec, gridOverrides?: Partial<Record<Breakpoint, {
583
+ rowHeight?: number;
584
+ cols?: number;
585
+ }>>, maxRows?: number): ResponsiveLayouts;
586
+ declare function filterLayoutsByIds(layouts: ResponsiveLayouts, ids: Set<string>): ResponsiveLayouts;
587
+ declare function sanitizeLayouts(layouts: ResponsiveLayouts, cols: {
588
+ lg: number;
589
+ md: number;
590
+ sm: number;
591
+ xs: number;
592
+ xxs: number;
593
+ }, maxRows?: number): ResponsiveLayouts;
594
+ declare function mergeLayouts(base: ResponsiveLayouts, overlay: ResponsiveLayouts): ResponsiveLayouts;
595
+ /**
596
+ * Copy the desktop (md) and wide (lg) layouts to each other when one side is
597
+ * empty. This keeps the editor and the wide preview in sync for dashboards that
598
+ * do not define separate responsive positions for desktop vs wide.
599
+ */
600
+ declare function syncDesktopWideLayouts(layouts: ResponsiveLayouts, cols: {
601
+ lg: number;
602
+ md: number;
603
+ sm: number;
604
+ xs: number;
605
+ xxs: number;
606
+ }): ResponsiveLayouts;
607
+ /**
608
+ * Copy the active layout into its desktop/wide sibling when both breakpoints
609
+ * use the same number of columns. This ensures that dragging or resizing in one
610
+ * view is reflected in the other.
611
+ */
612
+ declare function syncActiveLayoutToDesktopWide(layouts: ResponsiveLayouts, activeKey: string, cols: {
613
+ lg: number;
614
+ md: number;
615
+ sm: number;
616
+ xs: number;
617
+ xxs: number;
618
+ }): ResponsiveLayouts;
619
+ /**
620
+ * Stack the phone breakpoints of a set of layouts, leaving every other
621
+ * breakpoint untouched.
622
+ *
623
+ * Read at render time rather than saved, so a dashboard whose desktop layout
624
+ * changes later still reflows on a phone, and the YAML keeps whatever its author
625
+ * wrote.
626
+ */
627
+ declare function stackNarrowLayouts(layouts: ResponsiveLayouts, cols: {
628
+ xs: number;
629
+ xxs: number;
630
+ }): ResponsiveLayouts;
631
+ declare function buildBaseLayouts(widgets: Record<string, WidgetSpec>, dashboard: DashboardSpec, gridOverrides?: Partial<Record<Breakpoint, {
632
+ rowHeight?: number;
633
+ cols?: number;
634
+ }>>, unplacedWidgetIds?: string[], maxRows?: number,
635
+ /**
636
+ * Set false to read the positions exactly as the specs declare them, which is
637
+ * how a caller can tell what had to be moved to stop widgets overlapping.
638
+ */
639
+ options?: {
640
+ resolve?: boolean;
641
+ }): ResponsiveLayouts;
642
+ /**
643
+ * The grid's layouts renamed for storage: `lg`, `md`, `sm`, `xs` become
644
+ * `wide`, `desktop`, `tablet`, `mobile`, which is how a widget document names
645
+ * its `layout.responsive` entries and what a layout save port expects.
646
+ * `xxs` only fills `mobile` when `xs` gave nothing.
647
+ */
648
+ declare function layoutsForSave(layouts: ResponsiveLayouts): Partial<Record<Breakpoint, LayoutItem[]>>;
649
+
650
+ /**
651
+ * Checks the Builder runs while you type, before the model reaches the API.
652
+ *
653
+ * These are the mistakes that make a widget fail at render time rather than at
654
+ * save time: a join naming a dataset that is not there, columns that do not pair
655
+ * up, a metric spanning two datasets nothing joins, or a join the engine cannot
656
+ * push into one warehouse. Server validation still runs on Validate and Save;
657
+ * this only shortens the loop.
658
+ */
659
+
660
+ /** The store a dataset reads, following the default when it names none. */
661
+ declare function storeOf(dataset: BuilderDataset, stores: BuilderDataStore[]): string | null;
662
+ declare function relationshipIssues(relationship: BuilderRelationship, datasets: BuilderDataset[], stores: BuilderDataStore[]): string[];
663
+ /** Dataset ids a model level metric expression reads, like `daily_sales.X`. */
664
+ declare function datasetsInExpression(expression: string, datasetIds: string[]): string[];
665
+ /** True when relationships connect the two datasets, directly or through others. */
666
+ declare function datasetsAreJoined(a: string, b: string, relationships: BuilderRelationship[]): boolean;
667
+ declare function modelMetricIssues(metric: BuilderModelMetric, datasets: BuilderDataset[], relationships: BuilderRelationship[]): string[];
668
+
669
+ /**
670
+ * Ready-to-edit YAML blocks for the semantic model.
671
+ *
672
+ * Starting from a correct block with the required fields present is the fastest
673
+ * path for someone who has never written the model by hand, and it avoids the
674
+ * two mistakes that cost the most time: a dataset with no `filter_field`, and a
675
+ * relationship with mismatched join columns.
676
+ */
677
+ interface ModelTemplate {
678
+ id: string;
679
+ label: string;
680
+ /** Top-level key the block belongs under. */
681
+ section: "data_stores" | "datasets" | "relationships" | "metrics";
682
+ description: string;
683
+ yaml: string;
684
+ }
685
+ declare const MODEL_TEMPLATES: ModelTemplate[];
686
+ /**
687
+ * Add a template's block to the right section of an existing document.
688
+ *
689
+ * Edits the text rather than re-serialising the document, so comments, key order
690
+ * and formatting survive. Three cases: the section already has entries (append
691
+ * after the last one), the section exists but is empty (replace the `[]`), or the
692
+ * section is missing (append it at the end).
693
+ */
694
+ declare function insertModelTemplate(specYaml: string, template: ModelTemplate): string;
695
+
696
+ /**
697
+ * How far each pivot widget opens in a delivery, as form values.
698
+ *
699
+ * A pivot on the page is folded and unfolded by whoever is reading it. A
700
+ * delivered PNG, PDF or CSV has nobody at the keyboard, so how much of the
701
+ * hierarchy the document shows has to be part of the schedule or export
702
+ * itself. Each pivot gets two controls: how many row levels open and how many
703
+ * column header levels open. Everything open is the default; a level count
704
+ * folds what sits past it, and "widget setting" falls back to the pivot's own
705
+ * snapshot block. The XLSX and PPTX pivots always carry the whole cross-tab,
706
+ * so none of this touches them. The logic lives here rather than in the form
707
+ * component so it is testable on its own.
708
+ */
709
+
710
+ /** What one pivot's two controls hold: a level count, or a named choice. */
711
+ interface PivotAxisValues {
712
+ rows: string;
713
+ columns: string;
714
+ }
715
+ /** What each pivot's controls hold, keyed by widget id. */
716
+ type PivotExpandValues = Record<string, PivotAxisValues>;
717
+ /** Everything open, which sends the axis's own level count. */
718
+ declare const OPEN_ALL = "all";
719
+ /** Fall back to the widget's own snapshot setting for that axis. */
720
+ declare const WIDGET_SETTING = "widget";
721
+ /** Every pivot fully expanded, which is what a new schedule starts from. */
722
+ declare function defaultPivotExpand(pivots: DashboardPivotInfo[]): PivotExpandValues;
723
+ /**
724
+ * Each pivot as it stands open on the dashboard right now, so an export
725
+ * carries the view the reader is looking at. A pivot the page has not drawn
726
+ * this session falls back to fully expanded.
727
+ */
728
+ declare function currentViewPivotExpand(pivots: DashboardPivotInfo[], readPivotOpenLevels?: ReadPivotOpenLevels): PivotExpandValues;
729
+ /**
730
+ * The stored map as the strings the form's controls hold. A stored entry is a
731
+ * bare number of row levels, which is what older schedules wrote, or an
732
+ * object with `rows` and `columns`. A pivot or an axis the map does not name
733
+ * shows "widget setting", which is what its absence meant when it was saved.
734
+ */
735
+ declare function readPivotExpand(stored: Record<string, PivotExpandEntry> | null | undefined, pivots: DashboardPivotInfo[]): PivotExpandValues;
736
+ /** The controls' values as the map the API stores, or undefined when empty. */
737
+ declare function cleanPivotExpand(values: PivotExpandValues, pivots: DashboardPivotInfo[]): Record<string, {
738
+ rows?: number;
739
+ columns?: number;
740
+ }> | undefined;
741
+ /** The reason these values cannot be saved, or null when they can. */
742
+ declare function pivotExpandError(pivots: DashboardPivotInfo[], values: PivotExpandValues): string | null;
743
+
744
+ /**
745
+ * What the dashboard YAML editor checks before it lets an author save: that
746
+ * the text parses, calls itself a dashboard, and that every tab names widgets
747
+ * that exist. It reads the raw document rather than the typed spec so a
748
+ * half-written page can still be reported line by line.
749
+ */
750
+ interface DashboardOutline {
751
+ id: string | null;
752
+ name: string | null;
753
+ /** Tab ids in authored order. Each tab is one dashboard page. */
754
+ tabIds: string[];
755
+ /** Widget refs across every tab, in page order. */
756
+ widgetRefs: string[];
757
+ /** Why the document cannot be saved, or empty. */
758
+ issues: string[];
759
+ }
760
+ declare function readDashboardOutline(specYaml: string): DashboardOutline;
761
+
762
+ /**
763
+ * Ready-to-edit YAML for a brand new widget.
764
+ *
765
+ * A blank widget still has to be a valid document, because the Builder reads it
766
+ * back the moment it is created. Every template therefore carries the metadata
767
+ * block, a layout the grid can place, and the display block the component's
768
+ * renderer reads, with the parts an author fills in left empty rather than
769
+ * absent.
770
+ */
771
+ /** Components a blank widget can be created as. */
772
+ declare const TEMPLATE_COMPONENTS: readonly ["kpi", "filter", "table", "tabulator", "pivot_table", "text", "echarts", "image", "markdown"];
773
+ type TemplateComponent = (typeof TEMPLATE_COMPONENTS)[number];
774
+ /** The shapes a filter widget can take, which change its data block. */
775
+ declare const FILTER_CONTROLS: readonly ["select", "date", "date_range", "custom"];
776
+ type FilterControlType = (typeof FILTER_CONTROLS)[number];
777
+ declare function templateComponentLabel(component: TemplateComponent): string;
778
+ interface WidgetTemplateOptions {
779
+ /** What the widget is called, which also seeds its id. */
780
+ name?: string;
781
+ /** Only read for a filter widget. */
782
+ filterControl?: FilterControlType;
783
+ /**
784
+ * The tail of the generated id. Passed in by a caller that needs the same
785
+ * text twice, and otherwise drawn at random so two blank widgets created in
786
+ * one sitting do not collide.
787
+ */
788
+ suffix?: string;
789
+ }
790
+ /** The YAML of a blank widget of this component. */
791
+ declare function widgetTemplate(component: TemplateComponent, options?: WidgetTemplateOptions): string;
792
+
793
+ /**
794
+ * Put widget problems on the line that causes them.
795
+ *
796
+ * Same idea as the semantic model editor: a list of sentences under the editor
797
+ * leaves the reader hunting for the mapping or the column the sentence is about.
798
+ * These helpers find the node each finding belongs to and return an editor marker,
799
+ * so the offending line is underlined where it lives.
800
+ */
801
+
802
+ /**
803
+ * Markers for everything that would make this widget render empty.
804
+ *
805
+ * A syntax error stops the rest: the document cannot be read, so every other
806
+ * finding would be guesswork, and one accurate marker beats a list of noise.
807
+ */
808
+ declare function widgetMarkers(specYaml: string, model: SemanticSummary): ModelMarker[];
809
+
810
+ declare function valueScaleBounds(values: readonly number[]): {
811
+ min: number;
812
+ max: number;
813
+ };
814
+ declare function applyChartDefaults(option: ChartOption): ChartOption;
815
+
816
+ declare function buildChartRendererModel(widget: WidgetSpec, result: WidgetResult, context?: RendererContext): ChartRendererModel;
817
+
818
+ interface ChartFields {
819
+ x: string;
820
+ category: string;
821
+ value: string;
822
+ }
823
+ declare function inferChartFields(rows: DataRow[]): ChartFields;
824
+ declare function buildChartOption(widget: WidgetSpec, result: WidgetResult): ChartOption;
825
+ declare function chartAxisKey(option: unknown): string;
826
+
827
+ interface ChartThemeTokens {
828
+ foreground: string;
829
+ mutedForeground: string;
830
+ border: string;
831
+ surface: string;
832
+ surfaceForeground: string;
833
+ fontFamily: string;
834
+ seriesColors: readonly string[];
835
+ heatmapColors?: readonly string[];
836
+ }
837
+ interface ChartLoadingOptions {
838
+ text: string;
839
+ color: string;
840
+ textColor: string;
841
+ maskColor: string;
842
+ zlevel: number;
843
+ fontFamily: string;
844
+ fontSize: number;
845
+ }
846
+ declare function buildChartTheme(tokens: ChartThemeTokens): ChartOption;
847
+ declare function withChartMotion(option: ChartOption, reduced: boolean): ChartOption;
848
+ declare function chartStructureKey(option: ChartOption): string;
849
+ declare function chartLoadingOptions(tokens: ChartThemeTokens, mode: "light" | "dark"): ChartLoadingOptions;
850
+
851
+ declare function projectTabularGrid<TOutput>(model: TabularRendererModel, adapter: TabularGridAdapter<TOutput>): TOutput;
852
+
853
+ declare function buildKpiRendererModel(widget: WidgetSpec, result: WidgetResult, context?: RendererContext): KpiRendererModel;
854
+ declare function buildTextRendererModel(widget: WidgetSpec, context?: RendererContext): TextRendererModel;
855
+ declare function buildMarkdownRendererModel(widget: WidgetSpec, context?: RendererContext): MarkdownRendererModel;
856
+ declare function buildImageRendererModel(widget: WidgetSpec, context?: RendererContext): BasicRendererModel;
857
+ declare function buildBasicRendererModel(widget: WidgetSpec, result?: WidgetResult, context?: RendererContext): BasicRendererModel;
858
+ declare function buildWidgetRendererModel(widget: WidgetSpec, result?: WidgetResult, context?: RendererContext): WidgetRenderResolution;
859
+
860
+ declare function isPivotColumnGroup(definition: PivotGridColumnDefinition): definition is PivotGridColumnGroup;
861
+ declare function readPivotPayload(result: Record<string, unknown> | undefined): PivotTablePayload | null;
862
+ declare function buildPivotColumns(payload: PivotTablePayload, collapsedColumns?: ReadonlySet<string>): PivotGridColumnDefinition[];
863
+ declare function pivotColumnGroups(payload: PivotTablePayload): PivotFieldPayload[];
864
+ declare function pivotValueColumns(payload: PivotTablePayload, collapsedColumns?: ReadonlySet<string>): PivotFieldPayload[];
865
+ declare function buildPivotRows(payload: PivotTablePayload, rows?: PivotRowPayload[]): PivotGridRow[];
866
+ declare function buildPivotTotalRow(payload: PivotTablePayload): PivotGridRow | null;
867
+ declare function pivotRowFilters(payload: PivotTablePayload, meta: PivotGridRowMeta): Record<string, string>;
868
+ declare function pivotColumnFilters(payload: PivotTablePayload, prop: string): Record<string, string> | null;
869
+ declare function pivotMeasuresByKey(payload: PivotTablePayload): Map<string, PivotMeasurePayload>;
870
+ declare function pivotRowMeta(row: Record<string, unknown> | undefined): PivotGridRowMeta | null;
871
+ declare function formatPivotValue(value: unknown, measure: PivotMeasurePayload | undefined, emptyValue: string): string;
872
+ declare function pivotHeatmapIntensity(value: unknown, range: {
873
+ min: number;
874
+ max: number;
875
+ } | undefined): number | null;
876
+ declare function pivotTruncationNote(payload: PivotTablePayload): string | null;
877
+
878
+ declare function buildPivotRendererModel(widget: WidgetSpec, result: WidgetResult, context?: RendererContext): PivotRendererModel;
879
+ declare function pivotCellPresentation(model: ReadyPivotRendererModel, row: Record<string, unknown>, column: PivotGridColumn): PivotCellPresentation;
880
+ declare function pivotCellAction(model: ReadyPivotRendererModel, widget: WidgetSpec, row: PivotGridRowMeta, column: PivotGridColumn, value: unknown, detailAvailable?: boolean): PivotCellAction | null;
881
+
882
+ interface PivotOpenLevelsRegistry {
883
+ publish(widgetId: string, levels: PivotOpenLevels): void;
884
+ clear(widgetId: string): void;
885
+ read(widgetId: string): PivotOpenLevels | null;
886
+ }
887
+ declare function createPivotOpenLevelsRegistry(): PivotOpenLevelsRegistry;
888
+
889
+ declare function initialPivotViewState(payload: PivotTablePayload, capture?: boolean): PivotViewState;
890
+ declare function pivotOpenRowLevels(payload: PivotTablePayload, state: PivotViewState): number | null;
891
+ declare function pivotOpenColumnLevels(payload: PivotTablePayload, state: PivotViewState): number | null;
892
+ declare function pivotSignature(payload: PivotTablePayload): string;
893
+ declare function pivotGroupKeys(payload: PivotTablePayload): string[];
894
+ declare function pivotHasGroups(payload: PivotTablePayload): boolean;
895
+ declare function pivotFilterCount(state: PivotViewState): number;
896
+ declare function setPivotColumnFilter(filters: Readonly<Record<string, PivotColumnFilter>>, column: string, filter: PivotColumnFilter | null): Record<string, PivotColumnFilter>;
897
+ declare function pivotFilterKeeps(value: number, filter: PivotColumnFilter): boolean;
898
+ declare function pivotVisibleRows(payload: PivotTablePayload, state: PivotViewState): PivotRowPayload[];
899
+ declare function pivotSortDirection(state: PivotViewState, payload: PivotTablePayload, column: string): PivotDirection | null;
900
+ declare function nextPivotSort(state: PivotViewState, payload: PivotTablePayload, column: string): PivotSortState | null;
901
+ declare function togglePivotGroup(collapsed: ReadonlySet<string>, key: string): Set<string>;
902
+
903
+ interface ReaderGridTile {
904
+ widgetId: string;
905
+ left: number;
906
+ top: number;
907
+ width: number;
908
+ height: number;
909
+ }
910
+ interface ReaderGrid {
911
+ layoutKey: LayoutKey;
912
+ breakpoint: Breakpoint;
913
+ /** The height the tiles need, so a host can size the canvas it draws into. */
914
+ height: number;
915
+ columnCount: number;
916
+ columnWidth: number;
917
+ rowHeight: number;
918
+ tiles: ReaderGridTile[];
919
+ }
920
+ interface ReaderGridInput {
921
+ dashboard: DashboardSpec;
922
+ widgets: Record<string, WidgetSpec>;
923
+ /** The measured canvas width in pixels. */
924
+ width: number;
925
+ }
926
+ /**
927
+ * The reader grid in pixels, from the same layout maths the builder saves.
928
+ *
929
+ * Every UI binding places the tiles this returns, which is why a dashboard reads
930
+ * the same in React, in Angular, in Next.js and in a plain browser page.
931
+ */
932
+ declare function buildReaderGrid(input: ReaderGridInput): ReaderGrid;
933
+ /** The renderer context a dashboard's widget defaults imply, and nothing else. */
934
+ declare function readerRendererContext(dashboard: DashboardSpec): RendererContext;
935
+
936
+ declare function createRendererRegistry(initial?: Readonly<Record<string, RendererExtension>>): RendererRegistry;
937
+
938
+ declare function resolveWidgetRenderState(widget: WidgetSpec, result?: WidgetResult, options?: {
939
+ loading?: boolean;
940
+ answeredOnce?: boolean;
941
+ retryable?: boolean;
942
+ }): WidgetRenderResolution;
943
+
944
+ declare function tableResultColumns(result: WidgetResult, rows?: DataRow[]): string[];
945
+ declare function tableExportModel(display: Record<string, unknown>, fallbackFilename: string, excelExport?: boolean): TableExportModel;
946
+ declare function sortTableRows(rows: DataRow[], sort: TableSortState | null, sortable?: boolean): DataRow[];
947
+ declare function nextTableSort(current: TableSortState | null, column: string, sortable?: boolean): TableSortState | null;
948
+ declare function formatTableCell(value: unknown, emptyValue?: string): string;
949
+ declare function buildTableRendererModel(widget: WidgetSpec, result: WidgetResult, context?: RendererContext): TableRendererModel;
950
+ declare function formatGridCell(value: unknown, formatter: GridColumnFormatterModel | undefined): string;
951
+ declare function buildGridColumns(resultColumns: string[], display: Record<string, unknown>): GridColumnModel[];
952
+ declare function buildTabulatorRendererModel(widget: WidgetSpec, result: WidgetResult, context?: RendererContext): TabulatorRendererModel;
953
+ declare function tableInteraction(widget: WidgetSpec, row: DataRow, columns: string[]): {
954
+ interaction: WidgetInteraction;
955
+ context: WidgetInteractionContext;
956
+ } | undefined;
957
+
958
+ declare const DEFAULT_WIDGET_DEFAULTS: WidgetDefaults;
959
+ declare function resolveTheme(widget: WidgetSpec, component: WidgetComponent, widgetDefaults?: WidgetDefaults): WidgetTheme;
960
+ declare function widgetThemeStyle(theme: WidgetTheme): Record<string, string | number>;
961
+ /**
962
+ * The theme a renderer applies when a host frame already draws the card. Only
963
+ * the inner spacing survives; border, radius, shadow and background belong to
964
+ * the frame, so applying them twice would draw a second box inside the card.
965
+ */
966
+ declare function innerTheme(theme: WidgetTheme): WidgetTheme;
967
+ declare function rendererFrame(widget: WidgetSpec, component: WidgetComponent, widgetDefaults?: WidgetDefaults, framed?: boolean): RendererFrame;
968
+
969
+ interface ValueFormatOptions {
970
+ format?: string;
971
+ prefix?: string;
972
+ compact?: boolean;
973
+ suffix?: string;
974
+ decimals?: number;
975
+ }
976
+ declare function formatCompactNumber(value: number): string;
977
+ declare function formatValue(value: number | null | undefined, options?: ValueFormatOptions): string;
978
+ declare function applyNamedFormatters(option: ChartOption): ChartOption;
979
+
980
+ declare function clearElement(element: HTMLElement): void;
981
+ declare function setStyles(element: HTMLElement, styles: Readonly<Record<string, string | number | undefined>>): void;
982
+ declare function applyWidgetTheme(element: HTMLElement, frame: RendererFrame, tokens: RendererThemeTokens): void;
983
+ declare function createLabel(document: Document, text: string, tokens: RendererThemeTokens): HTMLElement;
984
+ declare function createMessage(document: Document, message: string, kind: "error" | "loading" | "notice", tokens: RendererThemeTokens): HTMLElement;
985
+
986
+ declare function renderInlineMarkdown(document: Document, parent: HTMLElement, content: string): void;
987
+ declare function renderMarkdown(document: Document, parent: HTMLElement, markdown: string): void;
988
+
989
+ declare function createNativeWidgetRenderer(input: NativeWidgetRenderInput): BrowserRenderer<NativeWidgetRenderInput>;
990
+
991
+ interface DashboardReaderShellInput {
992
+ /** The element the reader draws into. It is emptied on mount. */
993
+ element: HTMLElement;
994
+ dashboard: DashboardSpec;
995
+ widgets: Record<string, WidgetSpec>;
996
+ results?: Record<string, WidgetResult>;
997
+ /**
998
+ * Factories keyed by widget component or renderer kind. Anything not named
999
+ * here is drawn by the native browser renderer.
1000
+ */
1001
+ renderers?: WidgetRendererFactories;
1002
+ /** Filter values by widget id, which the host owns. */
1003
+ filters?: Record<string, unknown>;
1004
+ /** Widget ids the reader is still waiting on. */
1005
+ loadingWidgetIds?: string[];
1006
+ activeTabId?: string;
1007
+ theme?: Partial<RendererThemeTokens>;
1008
+ callbacks?: RendererHostCallbacks;
1009
+ onTabChange?: (tabId: string) => void;
1010
+ /** Overrides the measured width, which is how a test fixes a size. */
1011
+ viewportWidth?: number;
1012
+ }
1013
+ interface DashboardReaderShell {
1014
+ /** Redraws with a new document, new results, new filters or a new tab. */
1015
+ update(next: DashboardReaderShellInput): void;
1016
+ /** The tab the reader is showing. */
1017
+ activeTabId(): string | undefined;
1018
+ resize(): void;
1019
+ destroy(): void;
1020
+ }
1021
+ /**
1022
+ * A whole dashboard reader in the browser, with no UI framework.
1023
+ *
1024
+ * The shell owns tabs, the filter panel and the grid; every widget is drawn by a
1025
+ * renderer factory the host wires, so a plain page, an Angular component and a
1026
+ * Next.js page all read a dashboard the same way the React binding does.
1027
+ */
1028
+ declare function mountDashboardReader(input: DashboardReaderShellInput): DashboardReaderShell;
1029
+
1030
+ interface ResizeObserverAttachment {
1031
+ disconnect(): void;
1032
+ }
1033
+ declare function observeElementResize(element: HTMLElement, work: () => void): ResizeObserverAttachment | null;
1034
+
1035
+ /**
1036
+ * The native renderer as a shell factory, so a host wires one entry rather than
1037
+ * repeating the lifecycle for every component the browser draws itself.
1038
+ */
1039
+ declare function createNativeWidgetFactory(): WidgetRendererFactory;
1040
+
1041
+ export { BREAKPOINT_MAP, BasicRendererModel, Breakpoint, BrowserRenderer, BuilderDataStore, BuilderDataset, BuilderModelMetric, BuilderRelationship, CONTROL_COMPONENTS, type ChartLoadingOptions, ChartOption, ChartRendererModel, type ChartThemeTokens, DEFAULT_GRID_CONFIG, DEFAULT_WIDGET_DEFAULTS, DashboardFilterPanelConfig, DashboardGridConfig, type DashboardOutline, DashboardPivotInfo, type DashboardReaderShell, type DashboardReaderShellInput, DashboardSpec, type DashboardTemplateOptions, DataRow, type DocumentKind, type ExpressionContext, type ExpressionRow, FILTER_CONTROLS, type FilterControlType, GridColumnFormatterModel, GridColumnModel, KpiRendererModel, LayoutItem, LayoutKey, MAX_LAYOUT_WIDTHS, MODEL_TEMPLATES, MarkdownRendererModel, ModelMarker, type ModelTemplate, NativeWidgetRenderInput, OPEN_ALL, type PivotAxisValues, PivotCellAction, PivotCellPresentation, PivotColumnFilter, PivotExpandEntry, type PivotExpandValues, PivotFieldPayload, PivotGridColumn, PivotGridColumnDefinition, PivotGridColumnGroup, PivotGridRow, PivotGridRowMeta, PivotMeasurePayload, type PivotOpenLevelsRegistry, PivotRendererModel, PivotRowPayload, PivotSortState, PivotTablePayload, PivotViewState, ReadPivotOpenLevels, type ReaderGrid, type ReaderGridInput, type ReaderGridTile, ReadyPivotRendererModel, RendererContext, RendererExtension, RendererFrame, RendererHostCallbacks, PivotDirection as RendererPivotDirection, PivotOpenLevels as RendererPivotOpenLevels, RendererRegistry, RendererThemeTokens, type ResizeObserverAttachment, ResponsiveLayouts, type SemanticModel, SemanticSummary, TEMPLATE_COMPONENTS, TableExportModel, TableRendererModel, TableSortState, TabularGridAdapter, TabularRendererModel, TabulatorRendererModel, type TemplateComponent, TextRendererModel, type ValueFormatOptions, WIDGET_SETTING, WidgetComponent, WidgetDefaults, WidgetInteraction, WidgetInteractionContext, WidgetRenderResolution, WidgetRendererFactories, WidgetRendererFactory, WidgetResult, WidgetSpec, type WidgetTemplateOptions, WidgetTheme, addWidgetToLayouts, applyChartDefaults, applyFilter, applyNamedFormatters, applyWidgetTheme, buildBaseLayouts, buildBasicRendererModel, buildChartOption, buildChartRendererModel, buildChartTheme, buildGridColumns, buildImageRendererModel, buildKpiRendererModel, buildMarkdownRendererModel, buildPivotColumns, buildPivotRendererModel, buildPivotRows, buildPivotTotalRow, buildReaderGrid, buildTableRendererModel, buildTabulatorRendererModel, buildTextRendererModel, buildWidgetRendererModel, chartAxisKey, chartLoadingOptions, chartStructureKey, cleanPivotExpand, clearElement, computeRequiredMaxRows, createLabel, createMessage, createNativeWidgetFactory, createNativeWidgetRenderer, createPivotOpenLevelsRegistry, createRendererRegistry, currentViewPivotExpand, dashboardTemplate, datasetsAreJoined, datasetsInExpression, defaultPivotExpand, documentKinds, documentVersion, ensureLayoutCoverage, evaluateExpression, evaluateVariables, fillFilterTokens, filterLayoutsByIds, filterPanelConfig, firstFreeSlot, formatCompactNumber, formatFilterValue, formatGridCell, formatPivotValue, formatTableCell, formatValue, inferChartFields, initialPivotViewState, innerTheme, insertModelTemplate, interpolateVariables, isControlComponent, isPanelledControl, isPivotColumnGroup, itemsCollide, layoutForBreakpoint, layoutsForSave, mentionsFilter, mergeLayouts, modelMetricIssues, mountDashboardReader, movedIds, nextPivotSort, nextTableSort, observeElementResize, overlappingIds, pivotCellAction, pivotCellPresentation, pivotColumnFilters, pivotColumnGroups, pivotExpandError, pivotFilterCount, pivotFilterKeeps, pivotGroupKeys, pivotHasGroups, pivotHeatmapIntensity, pivotMeasuresByKey, pivotOpenColumnLevels, pivotOpenRowLevels, pivotRowFilters, pivotRowMeta, pivotSignature, pivotSortDirection, pivotTruncationNote, pivotValueColumns, pivotVisibleRows, projectTabularGrid, readDashboardOutline, readPivotExpand, readPivotPayload, readerRendererContext, relationshipIssues, renderInlineMarkdown, renderMarkdown, rendererFrame, requiredRows, rescaleLayoutColumns, resolveCollisions, resolveFilterDefault, resolveSnap, resolveTheme, resolveWidgetRenderState, sanitizeLayouts, setPivotColumnFilter, setStyles, sortTableRows, stackNarrowLayouts, storeOf, stripPanelledControls, syncActiveLayoutToDesktopWide, syncDesktopWideLayouts, tableExportModel, tableInteraction, tableResultColumns, templateComponentLabel, togglePivotGroup, valueScaleBounds, widgetMarkers, widgetTemplate, widgetThemeStyle, withChartMotion };