@restio/ui 0.2.1-20260901160735 → 0.2.1-20261007123729
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/README.md +9 -35
- package/dist/core.cjs +1 -1
- package/dist/core.d.ts +245 -87
- package/dist/core.js +32 -27
- package/dist/data.cjs +1 -1
- package/dist/data.d.ts +186 -145
- package/dist/data.js +19 -19
- package/dist/experimental.cjs +2 -1
- package/dist/experimental.d.ts +206 -33
- package/dist/experimental.js +899 -566
- package/dist/framework.cjs +1 -1
- package/dist/framework.d.ts +73 -101
- package/dist/framework.js +29 -26
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +431 -304
- package/dist/index.js +96 -88
- package/dist/{src-DaTjVaGd.js → src-Bzrq1hWW.js} +12070 -11460
- package/dist/src-kY7g6XFo.cjs +158 -0
- package/dist/ui.css +1 -1
- package/package.json +6 -5
- package/dist/src-gB-fpYMb.cjs +0 -156
package/dist/core.js
CHANGED
|
@@ -1,30 +1,35 @@
|
|
|
1
|
-
import { At as a,
|
|
1
|
+
import { At as a, Bt as s, Ct as e, Dt as o, Et as r, Ft as n, Gt as u, Ht as p, It as c, Kt as i, Mt as l, Nt as d, Ot as P, Pt as T, Rt as h, St as y, Tt as b, Ut as k, Vt as x, Wt as B, _t as S, bt as g, gt as m, ht as C, jt as D, kt as G, qt as I, vt as O, wt as v, xt as R, yt as w, zt as A } from "./src-Bzrq1hWW.js";
|
|
2
2
|
export {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
A as AnchoredOverlay,
|
|
4
|
+
x as Banner,
|
|
5
|
+
p as Button,
|
|
6
6
|
c as ButtonDropdown,
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
7
|
+
s as ButtonGroup,
|
|
8
|
+
O as CellType,
|
|
9
|
+
n as Checkbox,
|
|
10
|
+
T as CheckboxGroup,
|
|
11
|
+
e as DatePicker,
|
|
12
|
+
y as DateRangePicker,
|
|
13
|
+
g as FileUpload,
|
|
14
|
+
I as Icon,
|
|
15
|
+
i as Input,
|
|
16
|
+
a as Kbd,
|
|
17
|
+
b as Label,
|
|
18
|
+
R as Menu,
|
|
19
|
+
G as NumberInput,
|
|
20
|
+
u as OTP,
|
|
21
|
+
D as OverlayPanel,
|
|
22
|
+
w as ProgressBar,
|
|
23
|
+
d as Radio,
|
|
24
|
+
l as RadioGroup,
|
|
25
|
+
r as Select,
|
|
26
|
+
P as SelectionGrid,
|
|
27
|
+
S as ShortcutProvider,
|
|
28
|
+
o as Stack,
|
|
29
|
+
k as Tag,
|
|
30
|
+
h as TextInput,
|
|
31
|
+
v as Textarea,
|
|
32
|
+
B as Typography,
|
|
33
|
+
C as useDynamicVirtualList,
|
|
34
|
+
m as useShortcut
|
|
30
35
|
};
|
package/dist/data.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./src-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./src-kY7g6XFo.cjs");exports.Calendar=e.Calendar;exports.Card=e.Card;exports.CardList=e.CardList;exports.Cell=e.Cell;exports.Chart=e.Chart;exports.DataComponentConfigurator=e.DataComponentConfigurator;exports.Form=e.Form;exports.Gantt=e.Gantt;exports.KPI=e.KPI;exports.Switcher=e.Switcher;exports.TableGrid=e.TableGrid;exports.Tree=e.Tree;exports.TreeCard=e.TreeCard;exports.cardLayoutPresetOptions=e.cardLayoutPresetOptions;exports.cardLayoutWithIcon=e.cardLayoutWithIcon;exports.createDataStructureFromFile=e.createDataStructureFromFile;exports.financeKpiLayout=e.financeKpiLayout;exports.financeKpiLayoutWithIcon=e.financeKpiLayoutWithIcon;exports.kpiLayoutPresetOptions=e.kpiLayoutPresetOptions;exports.resolveCardLayoutPreset=e.resolveCardLayoutPreset;exports.resolveKpiLayoutPreset=e.resolveKpiLayoutPreset;
|
package/dist/data.d.ts
CHANGED
|
@@ -50,46 +50,59 @@ type CellType = typeof CellType[keyof typeof CellType];
|
|
|
50
50
|
/** Responsive layout breakpoint */
|
|
51
51
|
type Breakpoint = 'mobile' | 'tablet' | 'desktop';
|
|
52
52
|
|
|
53
|
+
/** Horizontal alignment: main axis for flex, inside the cell for grid */
|
|
53
54
|
type alignX = 'start' | 'center' | 'end' | 'space-between' | 'space-around';
|
|
55
|
+
/** Vertical alignment: cross axis for flex, inside the cell for grid */
|
|
54
56
|
type alignY = 'start' | 'center' | 'end' | 'stretch';
|
|
55
|
-
/**
|
|
57
|
+
/** Leaf node: renders content through `renderBlock(fieldId)` */
|
|
56
58
|
type BlockNode = {
|
|
57
59
|
type: 'block';
|
|
58
|
-
/**
|
|
60
|
+
/** Identifier passed to `renderBlock` to resolve this block's content */
|
|
59
61
|
fieldId: string;
|
|
60
62
|
};
|
|
61
|
-
/**
|
|
63
|
+
/** A child placed on a grid cell, with its position, span and content alignment */
|
|
62
64
|
type GridChild = {
|
|
63
65
|
node: LayoutNode;
|
|
66
|
+
/** Column to start at (1-based) */
|
|
64
67
|
col: number;
|
|
68
|
+
/** Row to start at (1-based) */
|
|
65
69
|
row: number;
|
|
70
|
+
/** Number of columns to span */
|
|
66
71
|
w: number;
|
|
72
|
+
/** Number of rows to span */
|
|
67
73
|
h: number;
|
|
68
|
-
/**
|
|
74
|
+
/** Alignment of the content inside the cell */
|
|
69
75
|
alignX?: alignX;
|
|
70
|
-
/**
|
|
76
|
+
/** Alignment of the content inside the cell */
|
|
71
77
|
alignY?: alignY;
|
|
72
78
|
};
|
|
73
|
-
/** Grid container
|
|
79
|
+
/** Grid container: positions children on a column/row matrix */
|
|
74
80
|
type GridContainer = {
|
|
75
81
|
type: 'grid';
|
|
82
|
+
/** Number of equal-width columns */
|
|
76
83
|
columns: number;
|
|
84
|
+
/** Number of rows; omit to size rows automatically */
|
|
77
85
|
rows?: number;
|
|
86
|
+
/** Space between children, in units of 0.25rem (`8` = 2rem) */
|
|
78
87
|
gap?: number;
|
|
79
88
|
children: GridChild[];
|
|
80
89
|
};
|
|
81
|
-
/** Flex container
|
|
90
|
+
/** Flex container: lays children out along one axis */
|
|
82
91
|
type FlexContainer = {
|
|
83
92
|
type: 'flex';
|
|
93
|
+
/** Main axis; defaults to `row` */
|
|
84
94
|
direction?: 'row' | 'column';
|
|
95
|
+
/** Space between children, in units of 0.25rem (`8` = 2rem) */
|
|
85
96
|
gap?: number;
|
|
97
|
+
/** Alignment along the main axis */
|
|
86
98
|
alignX?: alignX;
|
|
99
|
+
/** Alignment along the cross axis */
|
|
87
100
|
alignY?: alignY;
|
|
88
101
|
children: LayoutNode[];
|
|
89
102
|
};
|
|
90
|
-
/**
|
|
103
|
+
/** Any node in a layout tree */
|
|
91
104
|
type LayoutNode = BlockNode | GridContainer | FlexContainer;
|
|
92
|
-
/**
|
|
105
|
+
/** One layout tree per breakpoint; every breakpoint is required, with no fallback between them */
|
|
93
106
|
type ResponsiveLayout = {
|
|
94
107
|
[K in Breakpoint]: LayoutNode;
|
|
95
108
|
};
|
|
@@ -177,9 +190,8 @@ interface ProgressBarProps {
|
|
|
177
190
|
}
|
|
178
191
|
|
|
179
192
|
/**
|
|
180
|
-
* Maps each CellType to the component
|
|
181
|
-
*
|
|
182
|
-
* the underlying component actually understands.
|
|
193
|
+
* Maps each CellType to the component props accepted by `uiVariant`, so TypeScript
|
|
194
|
+
* only allows props the underlying component understands.
|
|
183
195
|
*/
|
|
184
196
|
type CellUIVariantMap = {
|
|
185
197
|
[K in CellType]: K extends "IMAGE" ? Partial<Omit<IconProps, "src">> : K extends "TAG" ? Partial<{
|
|
@@ -209,10 +221,8 @@ type LookupCellType<TData, TColumns extends readonly DataStructureColumn<TData>[
|
|
|
209
221
|
/** Comparison operators for AST-like UI rules */
|
|
210
222
|
type UIRuleOperator = "==" | "!=" | ">" | ">=" | "<" | "<=" | "includes" | "startsWith" | "endsWith" | "isEmpty" | "isNotEmpty";
|
|
211
223
|
/**
|
|
212
|
-
* A
|
|
213
|
-
*
|
|
214
|
-
*
|
|
215
|
-
* When `field` and `op` are omitted, the rule always matches (static styling).
|
|
224
|
+
* A declarative styling rule evaluated against a row, compiled once into a fast
|
|
225
|
+
* evaluator. Omitting `field` and `op` makes it a static rule that always matches.
|
|
216
226
|
*
|
|
217
227
|
* @example conditional
|
|
218
228
|
* { field: "price", op: ">", value: 100, uiVariant: { color: "var(--rst-color-success)", fontWeight: "bold" } }
|
|
@@ -297,17 +307,13 @@ interface DataStructureColumn<TData, TValue = TData[keyof TData]> {
|
|
|
297
307
|
/** Helper text shown below the field (e.g. "Opzionale", "Usa +/− per il segno"). */
|
|
298
308
|
helperText?: string;
|
|
299
309
|
/**
|
|
300
|
-
*
|
|
301
|
-
*
|
|
302
|
-
* referenced by `cellType` (e.g. ChartProps for CHART, TableGridProps for TABLE_GRID).
|
|
303
|
-
* `data` and `columns` are excluded — they come from the cell value and schema.
|
|
310
|
+
* Column-level config for the component named by `cellType` (e.g. ChartProps for
|
|
311
|
+
* CHART). `data` and `columns` are excluded — they come from the cell value and schema.
|
|
304
312
|
*/
|
|
305
313
|
columnConfig?: Record<string, unknown>;
|
|
306
314
|
/**
|
|
307
|
-
* Called when an interactive cell (e.g. BUTTON
|
|
308
|
-
*
|
|
309
|
-
* action id (for BUTTON = `option.value`). Works in any data-component
|
|
310
|
-
* that renders Cell in display mode (CardList, TableGrid, …).
|
|
315
|
+
* Called when an interactive cell (e.g. BUTTON) fires an action; the first argument
|
|
316
|
+
* is the action id (for BUTTON, `option.value`).
|
|
311
317
|
*/
|
|
312
318
|
onCellClick?: (actionId: string, rowData: TData, column: DataStructureColumn<TData, TValue>) => void;
|
|
313
319
|
}
|
|
@@ -354,10 +360,8 @@ declare namespace Card {
|
|
|
354
360
|
}
|
|
355
361
|
|
|
356
362
|
/**
|
|
357
|
-
* Per-series row of the composed-
|
|
358
|
-
* `
|
|
359
|
-
* `type` decides which cartesian primitive (line/bar/area/scatter) renders;
|
|
360
|
-
* `color` is optional — falls back to the chart palette when omitted.
|
|
363
|
+
* Per-series row of the composed matrix: `column` names the Y-axis data column,
|
|
364
|
+
* `type` the cartesian primitive, `color` an optional override for the palette.
|
|
361
365
|
*/
|
|
362
366
|
interface ChartSeriesConfig<TData = Record<string, unknown>> {
|
|
363
367
|
column: keyof TData | string;
|
|
@@ -365,11 +369,8 @@ interface ChartSeriesConfig<TData = Record<string, unknown>> {
|
|
|
365
369
|
color?: string;
|
|
366
370
|
}
|
|
367
371
|
/**
|
|
368
|
-
*
|
|
369
|
-
*
|
|
370
|
-
* - Null/undefined/empty values in a row are skipped, creating a direct link
|
|
371
|
-
* between the nearest non-empty columns on both sides.
|
|
372
|
-
* valueColumn: numeric column used as the flow weight.
|
|
372
|
+
* Sankey chart config. `stageColumns` lists the ordered flow stages (min 2); empty
|
|
373
|
+
* values are skipped, linking the nearest non-empty stages on either side.
|
|
373
374
|
*
|
|
374
375
|
* @example 2-level (source → target)
|
|
375
376
|
* { stageColumns: ["from", "to"], valueColumn: "amount" }
|
|
@@ -382,11 +383,8 @@ interface SankeyConfig<TData> {
|
|
|
382
383
|
valueColumn: keyof TData;
|
|
383
384
|
}
|
|
384
385
|
/**
|
|
385
|
-
*
|
|
386
|
-
*
|
|
387
|
-
* regionColumn: column in TData that maps to the "name" property in geoJson features.
|
|
388
|
-
* valueColumn: numeric column used for the choropleth color scale.
|
|
389
|
-
* colorRange: [minColor, maxColor] — two CSS color strings for the gradient.
|
|
386
|
+
* Geo (choropleth) chart config: GeoJSON features matched to `regionColumn`,
|
|
387
|
+
* with `valueColumn` driving the colour scale and `colorRange` as its endpoints.
|
|
390
388
|
*/
|
|
391
389
|
interface GeoConfig<TData> {
|
|
392
390
|
geoJson: {
|
|
@@ -422,11 +420,8 @@ interface ChartSpecificProps<TData> {
|
|
|
422
420
|
/** Custom colors for chart series */
|
|
423
421
|
colors?: string[];
|
|
424
422
|
/**
|
|
425
|
-
* Per-series matrix
|
|
426
|
-
*
|
|
427
|
-
* (line/bar/area/scatter), the matrix is derived from yAxisColumns and
|
|
428
|
-
* every entry adopts `type` — so the prop form only needs to manage one
|
|
429
|
-
* matrix for all cartesian charts. Ignored for pie/sankey/sparkline/geo.
|
|
423
|
+
* Per-series matrix for "composed" cartesian charts (line + bar + area + scatter).
|
|
424
|
+
* Single-type cartesian charts derive it from `yAxisColumns`; ignored for pie/sankey/sparkline/geo.
|
|
430
425
|
*/
|
|
431
426
|
series?: ChartSeriesConfig<TData>[];
|
|
432
427
|
/** Show/hide chart elements */
|
|
@@ -511,20 +506,13 @@ interface AIQuickAction {
|
|
|
511
506
|
|
|
512
507
|
type GanttView = "year" | "month" | "week" | "day";
|
|
513
508
|
/**
|
|
514
|
-
*
|
|
515
|
-
*
|
|
516
|
-
* - SS (Start-to-Start): arrow from start of predecessor to start of successor
|
|
517
|
-
* - FF (Finish-to-Finish): arrow from end of predecessor to end of successor
|
|
518
|
-
* - SF (Start-to-Finish): arrow from start of predecessor to end of successor
|
|
509
|
+
* Dependency relation types: FS (finish→start), SS (start→start), FF (finish→finish)
|
|
510
|
+
* and SF (start→finish).
|
|
519
511
|
*/
|
|
520
512
|
type GanttRelationType = "FS" | "SS" | "FF" | "SF";
|
|
521
513
|
/**
|
|
522
|
-
* A single dependency descriptor.
|
|
523
|
-
*
|
|
524
|
-
* - `string` — single dependency ID (defaults to "FS")
|
|
525
|
-
* - `string[]` — multiple dependency IDs (all default to "FS")
|
|
526
|
-
* - `GanttDependency` — single dependency with explicit type
|
|
527
|
-
* - `GanttDependency[]` — multiple dependencies with explicit types
|
|
514
|
+
* A single dependency descriptor. A row's `dependencyColumnId` may resolve to a string,
|
|
515
|
+
* string[], `GanttDependency`, or `GanttDependency[]` (strings default to "FS").
|
|
528
516
|
*/
|
|
529
517
|
interface GanttDependency {
|
|
530
518
|
id: string;
|
|
@@ -588,10 +576,8 @@ interface PivotValueField {
|
|
|
588
576
|
label?: string;
|
|
589
577
|
}
|
|
590
578
|
/**
|
|
591
|
-
*
|
|
592
|
-
*
|
|
593
|
-
* columnFields: column IDs whose unique values become dynamic columns.
|
|
594
|
-
* valueFields: numeric fields to aggregate at each row × column intersection.
|
|
579
|
+
* Pivot config: `rowFields` form the row groups, `columnFields` become dynamic columns,
|
|
580
|
+
* and `valueFields` are aggregated at each intersection.
|
|
595
581
|
*/
|
|
596
582
|
interface PivotConfig {
|
|
597
583
|
rowFields: string[];
|
|
@@ -679,6 +665,92 @@ interface FilterGroup {
|
|
|
679
665
|
/** Recursive union — use `node.type` to discriminate */
|
|
680
666
|
type FilterNode = FilterCondition | FilterGroup;
|
|
681
667
|
|
|
668
|
+
/**
|
|
669
|
+
* Row model switch and feature-by-model registry: single source of truth binding each grid
|
|
670
|
+
* feature to the models that support it (client, server, server-only, dual, blocked-on-server).
|
|
671
|
+
*/
|
|
672
|
+
/** All row models the grid supports. */
|
|
673
|
+
declare const TableRowModel: {
|
|
674
|
+
readonly client: "client";
|
|
675
|
+
readonly server: "server";
|
|
676
|
+
};
|
|
677
|
+
type TableRowModel = (typeof TableRowModel)[keyof typeof TableRowModel];
|
|
678
|
+
/** Where a dual feature executes. */
|
|
679
|
+
declare const TableSortingMode: {
|
|
680
|
+
readonly client: "client";
|
|
681
|
+
readonly server: "server";
|
|
682
|
+
};
|
|
683
|
+
type TableSortingMode = (typeof TableSortingMode)[keyof typeof TableSortingMode];
|
|
684
|
+
/** How one feature relates to the row models. */
|
|
685
|
+
type FeatureSupport = "client" | "server" | "server-only" | "dual" | "blocked-on-server";
|
|
686
|
+
/** Feature registry — keep in sync with the matrix in `table-grid-row-models.md`. */
|
|
687
|
+
declare const TABLE_MODEL_FEATURES: {
|
|
688
|
+
/** Client: applyFilter on full data. Server: app filters inside getRows. */
|
|
689
|
+
readonly filtering: "server-only";
|
|
690
|
+
/** Client: groupData on full data. Server: app returns group rows. */
|
|
691
|
+
readonly grouping: "server-only";
|
|
692
|
+
/** Server model: server by default, sortingMode="client" sorts loaded rows. */
|
|
693
|
+
readonly sorting: "dual";
|
|
694
|
+
/** Pivot needs the whole dataset in memory — blocked on server. */
|
|
695
|
+
readonly pivot: "blocked-on-server";
|
|
696
|
+
/** Local in both; over loaded rows only on server. */
|
|
697
|
+
readonly cellEditing: "dual";
|
|
698
|
+
/** Local in both; rendered rows only on server. */
|
|
699
|
+
readonly rowSelection: "dual";
|
|
700
|
+
/** Tree data is unsupported with rowModel="server" (v1). */
|
|
701
|
+
readonly treeData: "blocked-on-server";
|
|
702
|
+
/** Model-agnostic; on server the scrollbar total is totalRowCount. */
|
|
703
|
+
readonly virtualization: "dual";
|
|
704
|
+
/** Pagination runs on top of the non-virtualized render in both models:
|
|
705
|
+
* client = local slice, server = per-page fetch. */
|
|
706
|
+
readonly pagination: "dual";
|
|
707
|
+
};
|
|
708
|
+
type TableModelFeature = keyof typeof TABLE_MODEL_FEATURES;
|
|
709
|
+
|
|
710
|
+
/** Request the grid sends to the app datasource (server model only). */
|
|
711
|
+
interface ServerRowRequest {
|
|
712
|
+
/** Inclusive/exclusive window of flat rows the grid currently needs. */
|
|
713
|
+
range: {
|
|
714
|
+
start: number;
|
|
715
|
+
end: number;
|
|
716
|
+
};
|
|
717
|
+
/** Active sort: [{ id, desc }] — same shape as client SortingState. */
|
|
718
|
+
sorting: SortingState;
|
|
719
|
+
/** Active filter tree, or null. Same FilterGroup consumed by the filter panel. */
|
|
720
|
+
filtering: FilterGroup | null;
|
|
721
|
+
/** Ordered group-by column ids. */
|
|
722
|
+
grouping: string[];
|
|
723
|
+
/** Ids (derived paths) of expanded group rows — see ServerGroupRow.id. */
|
|
724
|
+
expandedGroups: string[];
|
|
725
|
+
}
|
|
726
|
+
/** A group row returned by the server (server model only). */
|
|
727
|
+
interface ServerGroupRow {
|
|
728
|
+
kind: "group";
|
|
729
|
+
/** Grouped values from root to this node, e.g. ["IT", "Milan"]. */
|
|
730
|
+
path: string[];
|
|
731
|
+
/** Depth = path.length - 1 (root groups = 0). */
|
|
732
|
+
depth: number;
|
|
733
|
+
/** Total leaf rows in the group — shown in the group banner/count. */
|
|
734
|
+
childCount: number;
|
|
735
|
+
}
|
|
736
|
+
/** Response the app datasource returns. */
|
|
737
|
+
interface ServerRowResponse<TData> {
|
|
738
|
+
/**
|
|
739
|
+
* Flat sequence of rows for the requested window, in final display order.
|
|
740
|
+
* Data rows are raw TData; group rows are wrapped in {@link ServerGroupRow}.
|
|
741
|
+
*/
|
|
742
|
+
rows: Array<TData | ServerGroupRow>;
|
|
743
|
+
/** Total rows matching the query (data + group rows), for the scrollbar size. */
|
|
744
|
+
totalRowCount: number;
|
|
745
|
+
}
|
|
746
|
+
/**
|
|
747
|
+
* Datasource contract for `rowModel: "server"`. The app implements `getRows`
|
|
748
|
+
* and owns filtering, sorting and grouping server-side.
|
|
749
|
+
*/
|
|
750
|
+
interface ServerDatasource<TData> {
|
|
751
|
+
getRows(request: ServerRowRequest): Promise<ServerRowResponse<TData>>;
|
|
752
|
+
}
|
|
753
|
+
|
|
682
754
|
type TableGridDisplayMode = "tree" | "table" | "table-tree";
|
|
683
755
|
/** Which grid lines (cell borders) are visible. */
|
|
684
756
|
type TableGridShowGrid = ShowGridLines;
|
|
@@ -713,8 +785,11 @@ interface TableGridSpecificProps<TData> {
|
|
|
713
785
|
enableVirtualization?: boolean;
|
|
714
786
|
/** Height of each row in pixels (required for virtualization) */
|
|
715
787
|
virtualizedRowHeight?: number;
|
|
716
|
-
/**
|
|
717
|
-
|
|
788
|
+
/**
|
|
789
|
+
* Scrollable container height in pixels. Required with virtualization; otherwise the
|
|
790
|
+
* container grows with its content (fill mode in a flex parent).
|
|
791
|
+
*/
|
|
792
|
+
containerHeight?: number;
|
|
718
793
|
/** When true, cells keep a fixed single-line height; overflowing content is clipped. */
|
|
719
794
|
oneLine?: boolean;
|
|
720
795
|
/** Which grid lines (cell borders) are visible. Defaults to "both". */
|
|
@@ -732,9 +807,8 @@ interface TableGridSpecificProps<TData> {
|
|
|
732
807
|
/** Enable the formula builder — shows the formula icon in the right toolbar */
|
|
733
808
|
enableFormulaBuilder?: boolean;
|
|
734
809
|
/**
|
|
735
|
-
*
|
|
736
|
-
*
|
|
737
|
-
* - `"fixed"`: each column uses its `size` value; the table scrolls horizontally when the total exceeds the container.
|
|
810
|
+
* How column widths are calculated: "auto" shares the available width (ignoring `size`),
|
|
811
|
+
* "fixed" uses each column's `size` and scrolls horizontally when the total overflows.
|
|
738
812
|
*/
|
|
739
813
|
columnSizing?: "auto" | "fixed";
|
|
740
814
|
/** Show loading skeleton state while data is being fetched */
|
|
@@ -754,25 +828,42 @@ interface TableGridSpecificProps<TData> {
|
|
|
754
828
|
/** Pre-configured action buttons shown in the AI chat panel for one-click commands */
|
|
755
829
|
aiQuickActions?: AIQuickAction[];
|
|
756
830
|
/**
|
|
757
|
-
* Called
|
|
758
|
-
*
|
|
759
|
-
* re-supplied via the `columns` prop on the next load.
|
|
831
|
+
* Called when a new formula column is created (builder or AI). Persist the definition
|
|
832
|
+
* on your server so it can be re-supplied via `columns` on the next load.
|
|
760
833
|
*/
|
|
761
834
|
onFormulaColumnAdd?: (col: ColumnDef<TData>) => void;
|
|
762
835
|
/**
|
|
763
|
-
* Forwarded to the inner scroll container (`rst-table-container`)
|
|
764
|
-
*
|
|
765
|
-
* Works for both virtualized and non-virtualized modes.
|
|
836
|
+
* Forwarded to the inner scroll container (`rst-table-container`), so an external
|
|
837
|
+
* component can react to scroll events. Works in both row models.
|
|
766
838
|
*/
|
|
767
839
|
onScroll?: UIEventHandler<HTMLDivElement>;
|
|
768
840
|
/**
|
|
769
|
-
* Ref
|
|
770
|
-
*
|
|
771
|
-
* Works for both virtualized and non-virtualized modes.
|
|
841
|
+
* Ref to the inner scroll container (`rst-table-container`), so an external component
|
|
842
|
+
* can read or set `scrollTop`. Works in both row models.
|
|
772
843
|
*/
|
|
773
844
|
scrollContainerRef?: Ref<HTMLDivElement>;
|
|
774
845
|
}
|
|
775
|
-
|
|
846
|
+
/** Props that only apply when `rowModel` is "server". See table-model-registry. */
|
|
847
|
+
interface TableGridServerModelProps<TData> {
|
|
848
|
+
/** Datasource — required when rowModel="server", ignored otherwise. */
|
|
849
|
+
datasource?: ServerDatasource<TData>;
|
|
850
|
+
/** Server model only: where sorting executes (default "server"). */
|
|
851
|
+
sortingMode?: TableSortingMode;
|
|
852
|
+
}
|
|
853
|
+
/** Pagination config — only honored when virtualization is disabled. */
|
|
854
|
+
interface TableGridPagination {
|
|
855
|
+
/** Rows per page. */
|
|
856
|
+
readonly pageSize: number;
|
|
857
|
+
}
|
|
858
|
+
type TableGridProps<TData> = DataStructureComponent<TData> & TableGridSpecificProps<TData> & {
|
|
859
|
+
/** Global row-model switch — decides where each data-pipeline feature runs. Default "client". See `TableRowModel`. */
|
|
860
|
+
rowModel?: TableRowModel;
|
|
861
|
+
/**
|
|
862
|
+
* Pagination — orthogonal to the row model: client pages slice in-memory data, server
|
|
863
|
+
* pages fetch a window. Honored only when virtualization is off. Defaults to off.
|
|
864
|
+
*/
|
|
865
|
+
pagination?: TableGridPagination;
|
|
866
|
+
} & TableGridServerModelProps<TData>;
|
|
776
867
|
interface ColumnDef<TData, TValue = TData[keyof TData]> extends DataStructureColumn<TData, TValue> {
|
|
777
868
|
/** Column width */
|
|
778
869
|
size?: number;
|
|
@@ -846,7 +937,7 @@ type SortingState = {
|
|
|
846
937
|
desc: boolean;
|
|
847
938
|
}[];
|
|
848
939
|
|
|
849
|
-
declare function TableGrid<TData>({ data, columns, getSubRows, onDataChange, onSelectionChange, enableSorting, enableSelection, enableEditing, enableGrouping, enableVirtualization, stickyHeader, stickyFooter, columnSizing, enableColumnReorder, enableColumnVisibility, enableFiltering, enableAIAssistant, aiProvider, onFormulaColumnAdd: externalOnFormulaColumnAdd, loading, uiConfig, oneLine, showGrid, ...toolPassThrough }: TableGridProps<TData>): React$1.JSX.Element;
|
|
940
|
+
declare function TableGrid<TData>({ data, columns, getSubRows, onDataChange, onSelectionChange, enableSorting, enableSelection, enableEditing, enableGrouping, enableVirtualization, stickyHeader, stickyFooter, columnSizing, enableColumnReorder, enableColumnVisibility, enableFiltering, enableAIAssistant, enablePivot, aiProvider, onFormulaColumnAdd: externalOnFormulaColumnAdd, loading, uiConfig, oneLine, showGrid, rowModel, datasource, sortingMode, pagination, ...toolPassThrough }: TableGridProps<TData>): React$1.JSX.Element;
|
|
850
941
|
|
|
851
942
|
/**
|
|
852
943
|
* Read a CSV/TSV/custom-delimited file and convert it into
|
|
@@ -952,12 +1043,8 @@ interface FormColumnDelta<TData> {
|
|
|
952
1043
|
column: FormColumn<TData>;
|
|
953
1044
|
}
|
|
954
1045
|
/**
|
|
955
|
-
* Server response to a field change.
|
|
956
|
-
*
|
|
957
|
-
*
|
|
958
|
-
* - `data`: partial data to merge (e.g. reset dependent fields to null)
|
|
959
|
-
* - `columns`: delta operations on columns (add new dependent fields, update options, remove fields)
|
|
960
|
-
* - `layout`: optional new layout. If omitted, the form recalculates from current columns.
|
|
1046
|
+
* Server response to a field change. Only the changed pieces are returned; the form
|
|
1047
|
+
* merges `data` (partial rows), `columns` (add/update/remove deltas) and optional `layout`.
|
|
961
1048
|
*/
|
|
962
1049
|
interface FormChangeResponse<TData> {
|
|
963
1050
|
/** Partial data delta — merged with current formData */
|
|
@@ -983,18 +1070,9 @@ interface FormSpecificProps<TData> {
|
|
|
983
1070
|
/** Custom action buttons rendered in the form footer.*/
|
|
984
1071
|
actions?: ButtonProps[];
|
|
985
1072
|
/**
|
|
986
|
-
* Server-driven callback invoked on every field change
|
|
987
|
-
*
|
|
988
|
-
* The server receives the current form state and the changed field,
|
|
989
|
-
* and returns a **partial delta** — only the pieces that changed.
|
|
990
|
-
* The form merges the delta into its state and re-renders only
|
|
991
|
-
* the affected fields.
|
|
992
|
-
*
|
|
993
|
-
* Fields not yet resolved (loading) show a skeleton placeholder.
|
|
1073
|
+
* Server-driven callback invoked on every field change: it receives the form state
|
|
1074
|
+
* and the changed field, and returns the partial delta to merge. Unresolved fields show skeletons.
|
|
994
1075
|
*
|
|
995
|
-
* @param formData - Current complete form data
|
|
996
|
-
* @param changedField - The accessorKey of the field that changed
|
|
997
|
-
* @param newValue - The new value of the changed field
|
|
998
1076
|
* @returns A partial delta with data, column operations, and optional layout
|
|
999
1077
|
*/
|
|
1000
1078
|
onFormChange?: (formData: TData, changedField: keyof TData, newValue: TData[keyof TData]) => Promise<FormChangeResponse<TData>>;
|
|
@@ -1195,11 +1273,8 @@ type KPIProps<TData> = Omit<DataStructureComponent<TData>, "data"> & KPISpecific
|
|
|
1195
1273
|
declare function KPI<TData>({ data, columns, layout, slotMap, className, uiConfig, onClick }: KPIProps<TData>): React$1.JSX.Element;
|
|
1196
1274
|
|
|
1197
1275
|
/**
|
|
1198
|
-
* Shared finance layouts
|
|
1199
|
-
* `
|
|
1200
|
-
*
|
|
1201
|
-
* Field IDs are intentionally generic so they work with any dataset that
|
|
1202
|
-
* follows the KPI shape: `label`, `value`, `delta`, `trend`, `icon`.
|
|
1276
|
+
* Shared finance layouts for any component taking a `ResponsiveLayout` (Card, KPI,
|
|
1277
|
+
* CardList). Field IDs are generic: `label`, `value`, `delta`, `trend`, `icon`.
|
|
1203
1278
|
*/
|
|
1204
1279
|
/**
|
|
1205
1280
|
* Compact KPI layout: label on top, big value in the middle, delta/trend
|
|
@@ -1222,14 +1297,8 @@ interface CardLayoutPreset {
|
|
|
1222
1297
|
layout: ResponsiveLayout;
|
|
1223
1298
|
}
|
|
1224
1299
|
/**
|
|
1225
|
-
* Card layout: icon
|
|
1226
|
-
*
|
|
1300
|
+
* Card layout: icon left, name + type beside it, actions right-aligned.
|
|
1227
1301
|
* Field IDs: `icon`, `name`, `type`, `actions`.
|
|
1228
|
-
*
|
|
1229
|
-
* ┌──────────────────────────────────────┐
|
|
1230
|
-
* │ icon name actions │
|
|
1231
|
-
* │ type │
|
|
1232
|
-
* └──────────────────────────────────────┘
|
|
1233
1302
|
*/
|
|
1234
1303
|
declare const cardLayoutWithIcon: ResponsiveLayout;
|
|
1235
1304
|
/** Maps a preset id to its `ResponsiveLayout`. Falls back to `undefined`. */
|
|
@@ -1243,12 +1312,8 @@ declare const cardLayoutPresetOptions: {
|
|
|
1243
1312
|
}[];
|
|
1244
1313
|
|
|
1245
1314
|
/**
|
|
1246
|
-
* A registered KPI layout preset
|
|
1247
|
-
*
|
|
1248
|
-
* `id` is the value stored in the widget config (and resolved back to a
|
|
1249
|
-
* `ResponsiveLayout` at render time by the Switcher). `label` / `description`
|
|
1250
|
-
* drive the selector UI; `layout` is the actual tree rendered in the preview
|
|
1251
|
-
* and passed to the `KPI` component.
|
|
1315
|
+
* A registered KPI layout preset: `id` is stored in the widget config and resolved
|
|
1316
|
+
* back to a `ResponsiveLayout`; `label` / `description` drive the selector UI.
|
|
1252
1317
|
*/
|
|
1253
1318
|
interface KpiLayoutPreset {
|
|
1254
1319
|
id: string;
|
|
@@ -1286,14 +1351,8 @@ type ComponentSpecificPropsMap<TData> = {
|
|
|
1286
1351
|
"kpi": KPISpecificProps<TData>;
|
|
1287
1352
|
};
|
|
1288
1353
|
/**
|
|
1289
|
-
* Props for the Switcher component.
|
|
1290
|
-
*
|
|
1291
|
-
*
|
|
1292
|
-
* Two modes:
|
|
1293
|
-
* - **Uncontrolled**: provide `initialComponent` / `initialComponentProps`. Switcher manages its own state.
|
|
1294
|
-
* - **Controlled**: provide `activeComponent` / `componentProps`. The parent manages state,
|
|
1295
|
-
* and the Switcher reflects changes immediately. Use this when an external configurator
|
|
1296
|
-
* (e.g. DashboardBuilder) drives the configuration.
|
|
1354
|
+
* Props for the Switcher, which wraps a data-component and manages its specific props.
|
|
1355
|
+
* Uncontrolled: `initialComponent` / `initialComponentProps`; controlled: `activeComponent` / `componentProps`.
|
|
1297
1356
|
*/
|
|
1298
1357
|
interface SwitcherProps<TData> extends DataStructureComponent<TData> {
|
|
1299
1358
|
/** Initial active component. Defaults to "table-grid". (Uncontrolled mode) */
|
|
@@ -1313,22 +1372,14 @@ interface SwitcherProps<TData> extends DataStructureComponent<TData> {
|
|
|
1313
1372
|
}
|
|
1314
1373
|
|
|
1315
1374
|
/**
|
|
1316
|
-
*
|
|
1317
|
-
*
|
|
1318
|
-
* Specific props are managed per-component via the config overlay.
|
|
1319
|
-
*
|
|
1320
|
-
* Two modes:
|
|
1321
|
-
* - **Uncontrolled**: provide `initialComponent` / `initialComponentProps`
|
|
1322
|
-
* - **Controlled**: provide `activeComponent` / `componentProps` (external configurator drives state)
|
|
1375
|
+
* Wraps a data-component: shared props (data, columns, uiConfig, getSubRows) go to every
|
|
1376
|
+
* component, specific props are managed via the config overlay. Uncontrolled or controlled.
|
|
1323
1377
|
*/
|
|
1324
1378
|
declare const Switcher: <TData extends object>({ data, columns, getSubRows, uiConfig, initialComponent, initialComponentProps, activeComponent: controlledComponent, componentProps: controlledProps, showConfigurator, onComponentChange, onComponentPropsChange, }: SwitcherProps<TData>) => React__default.JSX.Element;
|
|
1325
1379
|
|
|
1326
1380
|
/**
|
|
1327
|
-
* Where a prop field is configurable
|
|
1328
|
-
*
|
|
1329
|
-
* - `"switcher"`: visible only in the Switcher panel
|
|
1330
|
-
* - `"dashboard"`: visible only in the Dashboard configurator
|
|
1331
|
-
* - `"none"`: not configurable via UI (callbacks, complex objects, etc.)
|
|
1381
|
+
* Where a prop field is configurable: "all" (both), "switcher", "dashboard",
|
|
1382
|
+
* or "none" (not configurable via UI).
|
|
1332
1383
|
*/
|
|
1333
1384
|
type PropFieldScope = "all" | "switcher" | "dashboard" | "none";
|
|
1334
1385
|
/**
|
|
@@ -1371,11 +1422,8 @@ interface PropFieldDescriptor {
|
|
|
1371
1422
|
type PropSchemaRegistry = Record<string, PropFieldDescriptor[]>;
|
|
1372
1423
|
|
|
1373
1424
|
/**
|
|
1374
|
-
* Props for the shared DataComponentConfigurator
|
|
1375
|
-
*
|
|
1376
|
-
* This component is used in two contexts:
|
|
1377
|
-
* 1. **Switcher** — shows the component selector + prop form (scope: "switcher")
|
|
1378
|
-
* 2. **Dashboard widget configurator** — shows only the prop form (scope: "dashboard")
|
|
1425
|
+
* Props for the shared DataComponentConfigurator, used by the Switcher (selector +
|
|
1426
|
+
* form, scope "switcher") and the Dashboard widget configurator (form only).
|
|
1379
1427
|
*/
|
|
1380
1428
|
interface DataComponentConfiguratorProps {
|
|
1381
1429
|
/** Schema for the active component's configurable fields. */
|
|
@@ -1404,20 +1452,13 @@ interface DataComponentConfiguratorProps {
|
|
|
1404
1452
|
}
|
|
1405
1453
|
|
|
1406
1454
|
/**
|
|
1407
|
-
* Shared configurator for data-components
|
|
1408
|
-
*
|
|
1409
|
-
* Renders:
|
|
1410
|
-
* - An optional **component selector** (when `componentMetaList` is provided)
|
|
1411
|
-
* - A **dynamic prop form** filtered by the given scope
|
|
1412
|
-
*
|
|
1413
|
-
* Used by:
|
|
1414
|
-
* - **Switcher** — full configurator with component selector + all props
|
|
1415
|
-
* - **Dashboard widget configurator** — prop form only (scope: "dashboard")
|
|
1455
|
+
* Shared configurator for data-components: an optional component selector
|
|
1456
|
+
* (`componentMetaList`) plus a dynamic prop form filtered by `scope`.
|
|
1416
1457
|
*/
|
|
1417
1458
|
declare const DataComponentConfigurator: {
|
|
1418
1459
|
({ schema, values, onChange, columns, scope, componentId, onComponentChange, componentMetaList, }: DataComponentConfiguratorProps): React__default.JSX.Element;
|
|
1419
1460
|
displayName: string;
|
|
1420
1461
|
};
|
|
1421
1462
|
|
|
1422
|
-
export { Calendar, Card, CardList, Cell, Chart, DataComponentConfigurator, Form, Gantt, KPI, Switcher, TableGrid, Tree, TreeCard, cardLayoutPresetOptions, cardLayoutWithIcon, createDataStructureFromFile, financeKpiLayout, financeKpiLayoutWithIcon, kpiLayoutPresetOptions, resolveCardLayoutPreset, resolveKpiLayoutPreset };
|
|
1423
|
-
export type { CalendarProps, CardLayoutPreset, CardListProps, CardProps, CellProps, ChartProps, ChartType, ColumnDef, ComponentSpecificPropsMap, ComputedPivotData, DataComponentConfiguratorProps, DataComponentId, DataStructureColumn, DataStructureComponent, DataStructureUIColumn, DataStructureUIConfig, DataStructureUIContainer, DataStructureUIRule, FormChangeResponse, FormColumn, FormColumnDelta, FormProps, GanttDependency, GanttProps, GanttRelationType, GanttView, GeoConfig, KPIProps, KPISpecificProps, KpiLayoutPreset, PivotAggregation, PivotConfig, PivotValueField, PropFieldDescriptor, PropFieldScope, PropSchemaRegistry, ResolvedCellUI, SankeyConfig, SwitcherProps, TableGridProps, TableRow, TableState, TreeCardProps, TreeDropPayload, TreeDropPosition, TreeHandle, TreeProps, TreeRowScope, TreeRowState, UIRuleOperator };
|
|
1463
|
+
export { Calendar, Card, CardList, Cell, Chart, DataComponentConfigurator, Form, Gantt, KPI, Switcher, TableGrid, TableRowModel, TableSortingMode, Tree, TreeCard, cardLayoutPresetOptions, cardLayoutWithIcon, createDataStructureFromFile, financeKpiLayout, financeKpiLayoutWithIcon, kpiLayoutPresetOptions, resolveCardLayoutPreset, resolveKpiLayoutPreset };
|
|
1464
|
+
export type { BlockNode, CalendarProps, CardLayoutPreset, CardListProps, CardProps, CellProps, ChartProps, ChartType, ColumnDef, ComponentSpecificPropsMap, ComputedPivotData, DataComponentConfiguratorProps, DataComponentId, DataStructureColumn, DataStructureComponent, DataStructureUIColumn, DataStructureUIConfig, DataStructureUIContainer, DataStructureUIRule, FeatureSupport, FlexContainer, FormChangeResponse, FormColumn, FormColumnDelta, FormProps, GanttDependency, GanttProps, GanttRelationType, GanttView, GeoConfig, GridChild, GridContainer, KPIProps, KPISpecificProps, KpiLayoutPreset, LayoutNode, PivotAggregation, PivotConfig, PivotValueField, PropFieldDescriptor, PropFieldScope, PropSchemaRegistry, ResolvedCellUI, ResponsiveLayout, SankeyConfig, ServerDatasource, ServerGroupRow, ServerRowRequest, ServerRowResponse, SwitcherProps, TableGridProps, TableModelFeature, TableRow, TableState, TreeCardProps, TreeDropPayload, TreeDropPosition, TreeHandle, TreeProps, TreeRowScope, TreeRowState, UIRuleOperator };
|