@restio/ui 0.2.1-20260917153719 → 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 +11 -47
- package/dist/core.js +1 -1
- package/dist/data.cjs +1 -1
- package/dist/data.d.ts +55 -146
- package/dist/data.js +1 -1
- 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 +34 -90
- package/dist/framework.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +92 -268
- package/dist/index.js +1 -1
- package/dist/{src-CIojZORu.js → src-Bzrq1hWW.js} +1450 -1442
- package/dist/{src-Cr-lHp0p.cjs → src-kY7g6XFo.cjs} +47 -45
- package/dist/ui.css +1 -1
- package/package.json +3 -5
package/README.md
CHANGED
|
@@ -61,16 +61,13 @@ Complex/high-risk flows currently covered by automated tests include:
|
|
|
61
61
|
- Menu and Select: keyboard navigation and controlled/uncontrolled behavior
|
|
62
62
|
- Focus management: focus trap tab loop and focus restoration
|
|
63
63
|
|
|
64
|
-
## Documentation
|
|
64
|
+
## Documentation
|
|
65
65
|
|
|
66
|
-
Component documentation
|
|
66
|
+
Component documentation lives in Storybook (`npm run dev`).
|
|
67
67
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
- https://restio.leonardosignorelli.com/operations-control-room.html
|
|
72
|
-
- https://restio.leonardosignorelli.com/operations-portfolio-pulse.html
|
|
73
|
-
- https://restio.leonardosignorelli.com/operations-commitment-register.html
|
|
68
|
+
The standalone showcase that used to live in this repository has moved to the
|
|
69
|
+
[`restio-showcase`](https://github.com/Leonardo-Signorelli/restio-showcase) Next.js app, which consumes
|
|
70
|
+
this package the way a customer does.
|
|
74
71
|
|
|
75
72
|
## Development
|
|
76
73
|
|
|
@@ -81,15 +78,9 @@ npm install
|
|
|
81
78
|
# Start Storybook
|
|
82
79
|
npm run dev
|
|
83
80
|
|
|
84
|
-
# Start standalone showcase pages
|
|
85
|
-
npm run dev:showcase
|
|
86
|
-
|
|
87
81
|
# Build library
|
|
88
82
|
npm run build
|
|
89
83
|
|
|
90
|
-
# Build standalone showcase pages
|
|
91
|
-
npm run build:showcase
|
|
92
|
-
|
|
93
84
|
# Run tests
|
|
94
85
|
npm run test:components
|
|
95
86
|
|
|
@@ -97,28 +88,11 @@ npm run test:components
|
|
|
97
88
|
npm run visual-test
|
|
98
89
|
```
|
|
99
90
|
|
|
100
|
-
##
|
|
101
|
-
|
|
102
|
-
The standalone showcase is deployed to Vercel at `restio.leonardosignorelli.com`. Vercel builds with `npm run build:showcase` and serves the `showcase-static` output directory (see `vercel.json`). Each push and pull request gets an automatic deployment with a preview URL.
|
|
103
|
-
|
|
104
|
-
The base path defaults to `/` (root) for Vercel. It can be overridden via the `SHOWCASE_BASE` environment variable for GitHub Pages preview deploys:
|
|
105
|
-
|
|
106
|
-
```bash
|
|
107
|
-
# Vercel (default, root)
|
|
108
|
-
npm run build:showcase
|
|
109
|
-
|
|
110
|
-
# GitHub Pages root deploy
|
|
111
|
-
SHOWCASE_BASE=/restio-ui/ npm run build:showcase
|
|
112
|
-
|
|
113
|
-
# GitHub Pages /test preview deploy
|
|
114
|
-
SHOWCASE_BASE=/restio-ui/test/ npm run build:showcase
|
|
115
|
-
```
|
|
116
|
-
|
|
117
|
-
Workflows:
|
|
91
|
+
## Workflows
|
|
118
92
|
|
|
119
|
-
- `.github/workflows/
|
|
120
|
-
- `.github/workflows/
|
|
121
|
-
- `.github/workflows/develop-release.yaml` — push to `develop
|
|
93
|
+
- `.github/workflows/test.yaml` — PRs to `develop`, runs lint, build and unit tests
|
|
94
|
+
- `.github/workflows/visual-regression.yml` — PRs to `develop`, runs the visual tests
|
|
95
|
+
- `.github/workflows/develop-release.yaml` — push to `develop` or a tag, builds the library and publishes it to npm
|
|
122
96
|
|
|
123
97
|
## License
|
|
124
98
|
|
package/dist/core.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.AnchoredOverlay=e.AnchoredOverlay;exports.Banner=e.Banner;exports.Button=e.Button;exports.ButtonDropdown=e.ButtonDropdown;exports.ButtonGroup=e.ButtonGroup;exports.CellType=e.CellType;exports.Checkbox=e.Checkbox;exports.CheckboxGroup=e.CheckboxGroup;exports.DatePicker=e.DatePicker;exports.DateRangePicker=e.DateRangePicker;exports.FileUpload=e.FileUpload;exports.Icon=e.Icon;exports.Input=e.Input;exports.Kbd=e.Kbd;exports.Label=e.Label;exports.Menu=e.Menu;exports.NumberInput=e.NumberInput;exports.OTP=e.OTPComponent;exports.OverlayPanel=e.OverlayPanel;exports.ProgressBar=e.ProgressBar;exports.Radio=e.Radio;exports.RadioGroup=e.RadioGroup;exports.Select=e.Select;exports.SelectionGrid=e.SelectionGrid;exports.ShortcutProvider=e.ShortcutProvider;exports.Stack=e.Stack;exports.Tag=e.Tag;exports.TextInput=e.TextInput;exports.Textarea=e.Textarea;exports.Typography=e.Typography;exports.useDynamicVirtualList=e.useDynamicVirtualList;exports.useShortcut=e.useShortcut;
|
package/dist/core.d.ts
CHANGED
|
@@ -310,12 +310,8 @@ declare const OverlayPanelHeader: React__default.FC<OverlayPanelHeaderProps>;
|
|
|
310
310
|
/** OverlayPanelPosition defines the possible positions for the OverlayPanel. */
|
|
311
311
|
type OverlayPanelPosition = "center" | "left" | "right" | "top" | "bottom";
|
|
312
312
|
/**
|
|
313
|
-
*
|
|
314
|
-
*
|
|
315
|
-
* - "dialog": Center dialog, lighter backdrop, may allow outside click to close.
|
|
316
|
-
* - "sidepanel": Left/right slide-in panel, typically with backdrop.
|
|
317
|
-
* - "drawer": Mobile-friendly drawer, usually slides from bottom or side.
|
|
318
|
-
* - "popover": Light overlay, anchored to element, minimal/no backdrop.
|
|
313
|
+
* Visual and behavioral variant: "modal", "dialog", "sidepanel", "drawer", or
|
|
314
|
+
* "popover" (light, anchored, minimal backdrop).
|
|
319
315
|
*/
|
|
320
316
|
type OverlayPanelVariant = "modal" | "dialog" | "sidepanel" | "drawer" | "popover";
|
|
321
317
|
/** Props for the OverlayPanel component.*/
|
|
@@ -664,8 +660,7 @@ declare const DatePicker: React__default.FC<DatePickerProps>;
|
|
|
664
660
|
|
|
665
661
|
/**
|
|
666
662
|
* Date range picker supporting day, month, quarter, and year modes.
|
|
667
|
-
*
|
|
668
|
-
* Clicking once sets the start date; clicking again sets the end date.
|
|
663
|
+
* Two calendars select the range: the first click sets the start, the second the end.
|
|
669
664
|
*/
|
|
670
665
|
declare const DateRangePicker: React__default.FC<DateRangePickerProps>;
|
|
671
666
|
|
|
@@ -843,29 +838,8 @@ interface ShortcutProviderProps {
|
|
|
843
838
|
readonly children: React__default.ReactNode;
|
|
844
839
|
}
|
|
845
840
|
/**
|
|
846
|
-
*
|
|
847
|
-
*
|
|
848
|
-
* Features:
|
|
849
|
-
* - Global and component-scoped shortcuts
|
|
850
|
-
* - Visual feedback with tooltips appearing near cursor
|
|
851
|
-
* - Hold-to-execute shortcuts with progress indicators (3s default)
|
|
852
|
-
* - Automatic cleanup of component-scoped shortcuts
|
|
853
|
-
* - Key release detection for cancelling hold shortcuts
|
|
854
|
-
*
|
|
855
|
-
* How it works:
|
|
856
|
-
* 1. Maintains a map of registered shortcuts with their configurations
|
|
857
|
-
* 2. Tracks active components for scoping validation
|
|
858
|
-
* 3. Listens for keyboard events and matches against registered shortcuts
|
|
859
|
-
* 4. Shows tooltip with shortcut keys and function name near cursor
|
|
860
|
-
* 5. Executes actions only after full hold duration (for hold shortcuts)
|
|
861
|
-
* 6. Cancels hold shortcuts when any key is released
|
|
862
|
-
*
|
|
863
|
-
* Component Scoping:
|
|
864
|
-
* - Global shortcuts (no componentId) always available
|
|
865
|
-
* - Component shortcuts only trigger when their component is registered as active
|
|
866
|
-
* - Components auto-register/unregister through useShortcut hook focus/hover handlers
|
|
867
|
-
*
|
|
868
|
-
* @param children - Child components that will have access to shortcut context
|
|
841
|
+
* Manages global and per-component keyboard shortcuts and shows the cursor-anchored
|
|
842
|
+
* feedback tooltip, including progress for hold-to-execute shortcuts (3s default).
|
|
869
843
|
*/
|
|
870
844
|
declare const ShortcutProvider: React__default.FC<ShortcutProviderProps>;
|
|
871
845
|
|
|
@@ -885,9 +859,7 @@ interface ShortcutConfig {
|
|
|
885
859
|
*/
|
|
886
860
|
interface UseShortcutOptions {
|
|
887
861
|
/**
|
|
888
|
-
* Scope of the shortcuts:
|
|
889
|
-
* - 'component': Shortcuts only work when this component is focused or hovered
|
|
890
|
-
* - 'global': Shortcuts work globally across the application
|
|
862
|
+
* Scope of the shortcuts: 'global' works app-wide, 'component' only when focused or hovered.
|
|
891
863
|
*/
|
|
892
864
|
scope?: 'global' | 'component';
|
|
893
865
|
/** Whether shortcuts are enabled */
|
|
@@ -927,9 +899,8 @@ interface UseDynamicVirtualListOptions {
|
|
|
927
899
|
/** Fallback height used for items that have not been measured yet */
|
|
928
900
|
estimatedItemHeight?: number;
|
|
929
901
|
/**
|
|
930
|
-
* Extra items rendered above and below the
|
|
931
|
-
*
|
|
932
|
-
* Defaults to 10.
|
|
902
|
+
* Extra items rendered above and below the viewport. Higher values scroll more
|
|
903
|
+
* smoothly at the cost of more DOM nodes. Defaults to 10.
|
|
933
904
|
*/
|
|
934
905
|
overscan?: number;
|
|
935
906
|
}
|
|
@@ -959,14 +930,10 @@ interface UseDynamicVirtualListResult {
|
|
|
959
930
|
scrollTop: number;
|
|
960
931
|
}
|
|
961
932
|
/**
|
|
962
|
-
*
|
|
963
|
-
*
|
|
964
|
-
* Unlike fixed-height virtualizers, this hook uses a ResizeObserver to measure
|
|
965
|
-
* each rendered item's actual height and falls back to `estimatedItemHeight` for
|
|
966
|
-
* items that have not yet been rendered. This allows rows with variable content
|
|
967
|
-
* (wrapped text, expandable cells, group headers) to scroll correctly.
|
|
933
|
+
* Dynamic-height virtual list hook: measures every rendered item with a ResizeObserver
|
|
934
|
+
* and falls back to `estimatedItemHeight`, so variable-height rows scroll correctly.
|
|
968
935
|
*
|
|
969
|
-
*
|
|
936
|
+
* @example
|
|
970
937
|
* ```tsx
|
|
971
938
|
* const { virtualItems, totalSize, containerRef, onScroll, measureElement } =
|
|
972
939
|
* useDynamicVirtualList({ count: rows.length, estimatedItemHeight: 40, overscan: 10 });
|
|
@@ -987,9 +954,6 @@ interface UseDynamicVirtualListResult {
|
|
|
987
954
|
* </div>
|
|
988
955
|
* );
|
|
989
956
|
* ```
|
|
990
|
-
*
|
|
991
|
-
* For table usage, pair with padding `<tr>` spacers at the top and bottom of
|
|
992
|
-
* `<tbody>` and attach `measureElement` to each `<tr>` via a ref callback.
|
|
993
957
|
*/
|
|
994
958
|
declare function useDynamicVirtualList({ count, estimatedItemHeight, overscan, }: UseDynamicVirtualListOptions): UseDynamicVirtualListResult;
|
|
995
959
|
|
package/dist/core.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
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-
|
|
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
3
|
A as AnchoredOverlay,
|
|
4
4
|
x as Banner,
|
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
|
@@ -190,9 +190,8 @@ interface ProgressBarProps {
|
|
|
190
190
|
}
|
|
191
191
|
|
|
192
192
|
/**
|
|
193
|
-
* Maps each CellType to the component
|
|
194
|
-
*
|
|
195
|
-
* 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.
|
|
196
195
|
*/
|
|
197
196
|
type CellUIVariantMap = {
|
|
198
197
|
[K in CellType]: K extends "IMAGE" ? Partial<Omit<IconProps, "src">> : K extends "TAG" ? Partial<{
|
|
@@ -222,10 +221,8 @@ type LookupCellType<TData, TColumns extends readonly DataStructureColumn<TData>[
|
|
|
222
221
|
/** Comparison operators for AST-like UI rules */
|
|
223
222
|
type UIRuleOperator = "==" | "!=" | ">" | ">=" | "<" | "<=" | "includes" | "startsWith" | "endsWith" | "isEmpty" | "isNotEmpty";
|
|
224
223
|
/**
|
|
225
|
-
* A
|
|
226
|
-
*
|
|
227
|
-
*
|
|
228
|
-
* 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.
|
|
229
226
|
*
|
|
230
227
|
* @example conditional
|
|
231
228
|
* { field: "price", op: ">", value: 100, uiVariant: { color: "var(--rst-color-success)", fontWeight: "bold" } }
|
|
@@ -310,17 +307,13 @@ interface DataStructureColumn<TData, TValue = TData[keyof TData]> {
|
|
|
310
307
|
/** Helper text shown below the field (e.g. "Opzionale", "Usa +/− per il segno"). */
|
|
311
308
|
helperText?: string;
|
|
312
309
|
/**
|
|
313
|
-
*
|
|
314
|
-
*
|
|
315
|
-
* referenced by `cellType` (e.g. ChartProps for CHART, TableGridProps for TABLE_GRID).
|
|
316
|
-
* `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.
|
|
317
312
|
*/
|
|
318
313
|
columnConfig?: Record<string, unknown>;
|
|
319
314
|
/**
|
|
320
|
-
* Called when an interactive cell (e.g. BUTTON
|
|
321
|
-
*
|
|
322
|
-
* action id (for BUTTON = `option.value`). Works in any data-component
|
|
323
|
-
* 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`).
|
|
324
317
|
*/
|
|
325
318
|
onCellClick?: (actionId: string, rowData: TData, column: DataStructureColumn<TData, TValue>) => void;
|
|
326
319
|
}
|
|
@@ -367,10 +360,8 @@ declare namespace Card {
|
|
|
367
360
|
}
|
|
368
361
|
|
|
369
362
|
/**
|
|
370
|
-
* Per-series row of the composed-
|
|
371
|
-
* `
|
|
372
|
-
* `type` decides which cartesian primitive (line/bar/area/scatter) renders;
|
|
373
|
-
* `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.
|
|
374
365
|
*/
|
|
375
366
|
interface ChartSeriesConfig<TData = Record<string, unknown>> {
|
|
376
367
|
column: keyof TData | string;
|
|
@@ -378,11 +369,8 @@ interface ChartSeriesConfig<TData = Record<string, unknown>> {
|
|
|
378
369
|
color?: string;
|
|
379
370
|
}
|
|
380
371
|
/**
|
|
381
|
-
*
|
|
382
|
-
*
|
|
383
|
-
* - Null/undefined/empty values in a row are skipped, creating a direct link
|
|
384
|
-
* between the nearest non-empty columns on both sides.
|
|
385
|
-
* 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.
|
|
386
374
|
*
|
|
387
375
|
* @example 2-level (source → target)
|
|
388
376
|
* { stageColumns: ["from", "to"], valueColumn: "amount" }
|
|
@@ -395,11 +383,8 @@ interface SankeyConfig<TData> {
|
|
|
395
383
|
valueColumn: keyof TData;
|
|
396
384
|
}
|
|
397
385
|
/**
|
|
398
|
-
*
|
|
399
|
-
*
|
|
400
|
-
* regionColumn: column in TData that maps to the "name" property in geoJson features.
|
|
401
|
-
* valueColumn: numeric column used for the choropleth color scale.
|
|
402
|
-
* 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.
|
|
403
388
|
*/
|
|
404
389
|
interface GeoConfig<TData> {
|
|
405
390
|
geoJson: {
|
|
@@ -435,11 +420,8 @@ interface ChartSpecificProps<TData> {
|
|
|
435
420
|
/** Custom colors for chart series */
|
|
436
421
|
colors?: string[];
|
|
437
422
|
/**
|
|
438
|
-
* Per-series matrix
|
|
439
|
-
*
|
|
440
|
-
* (line/bar/area/scatter), the matrix is derived from yAxisColumns and
|
|
441
|
-
* every entry adopts `type` — so the prop form only needs to manage one
|
|
442
|
-
* 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.
|
|
443
425
|
*/
|
|
444
426
|
series?: ChartSeriesConfig<TData>[];
|
|
445
427
|
/** Show/hide chart elements */
|
|
@@ -524,20 +506,13 @@ interface AIQuickAction {
|
|
|
524
506
|
|
|
525
507
|
type GanttView = "year" | "month" | "week" | "day";
|
|
526
508
|
/**
|
|
527
|
-
*
|
|
528
|
-
*
|
|
529
|
-
* - SS (Start-to-Start): arrow from start of predecessor to start of successor
|
|
530
|
-
* - FF (Finish-to-Finish): arrow from end of predecessor to end of successor
|
|
531
|
-
* - 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).
|
|
532
511
|
*/
|
|
533
512
|
type GanttRelationType = "FS" | "SS" | "FF" | "SF";
|
|
534
513
|
/**
|
|
535
|
-
* A single dependency descriptor.
|
|
536
|
-
*
|
|
537
|
-
* - `string` — single dependency ID (defaults to "FS")
|
|
538
|
-
* - `string[]` — multiple dependency IDs (all default to "FS")
|
|
539
|
-
* - `GanttDependency` — single dependency with explicit type
|
|
540
|
-
* - `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").
|
|
541
516
|
*/
|
|
542
517
|
interface GanttDependency {
|
|
543
518
|
id: string;
|
|
@@ -601,10 +576,8 @@ interface PivotValueField {
|
|
|
601
576
|
label?: string;
|
|
602
577
|
}
|
|
603
578
|
/**
|
|
604
|
-
*
|
|
605
|
-
*
|
|
606
|
-
* columnFields: column IDs whose unique values become dynamic columns.
|
|
607
|
-
* 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.
|
|
608
581
|
*/
|
|
609
582
|
interface PivotConfig {
|
|
610
583
|
rowFields: string[];
|
|
@@ -693,15 +666,8 @@ interface FilterGroup {
|
|
|
693
666
|
type FilterNode = FilterCondition | FilterGroup;
|
|
694
667
|
|
|
695
668
|
/**
|
|
696
|
-
* Row model switch and feature-by-model registry
|
|
697
|
-
*
|
|
698
|
-
* Single source of truth binding each grid feature to the row models that
|
|
699
|
-
* support it. The registry makes explicit what runs where:
|
|
700
|
-
* - "client" — feature executes in the browser on the full dataset
|
|
701
|
-
* - "server" — feature executes on the server
|
|
702
|
-
* - "server-only" — server-mandatory when rowModel="server"; client otherwise
|
|
703
|
-
* - "dual" — runs in both, where is user-decidable
|
|
704
|
-
* - "blocked-on-server" — cannot work server-side (UI disabled + dev warning)
|
|
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).
|
|
705
671
|
*/
|
|
706
672
|
/** All row models the grid supports. */
|
|
707
673
|
declare const TableRowModel: {
|
|
@@ -820,9 +786,8 @@ interface TableGridSpecificProps<TData> {
|
|
|
820
786
|
/** Height of each row in pixels (required for virtualization) */
|
|
821
787
|
virtualizedRowHeight?: number;
|
|
822
788
|
/**
|
|
823
|
-
*
|
|
824
|
-
*
|
|
825
|
-
* content (fill mode in a flex parent).
|
|
789
|
+
* Scrollable container height in pixels. Required with virtualization; otherwise the
|
|
790
|
+
* container grows with its content (fill mode in a flex parent).
|
|
826
791
|
*/
|
|
827
792
|
containerHeight?: number;
|
|
828
793
|
/** When true, cells keep a fixed single-line height; overflowing content is clipped. */
|
|
@@ -842,9 +807,8 @@ interface TableGridSpecificProps<TData> {
|
|
|
842
807
|
/** Enable the formula builder — shows the formula icon in the right toolbar */
|
|
843
808
|
enableFormulaBuilder?: boolean;
|
|
844
809
|
/**
|
|
845
|
-
*
|
|
846
|
-
*
|
|
847
|
-
* - `"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.
|
|
848
812
|
*/
|
|
849
813
|
columnSizing?: "auto" | "fixed";
|
|
850
814
|
/** Show loading skeleton state while data is being fetched */
|
|
@@ -864,21 +828,18 @@ interface TableGridSpecificProps<TData> {
|
|
|
864
828
|
/** Pre-configured action buttons shown in the AI chat panel for one-click commands */
|
|
865
829
|
aiQuickActions?: AIQuickAction[];
|
|
866
830
|
/**
|
|
867
|
-
* Called
|
|
868
|
-
*
|
|
869
|
-
* 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.
|
|
870
833
|
*/
|
|
871
834
|
onFormulaColumnAdd?: (col: ColumnDef<TData>) => void;
|
|
872
835
|
/**
|
|
873
|
-
* Forwarded to the inner scroll container (`rst-table-container`)
|
|
874
|
-
*
|
|
875
|
-
* 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.
|
|
876
838
|
*/
|
|
877
839
|
onScroll?: UIEventHandler<HTMLDivElement>;
|
|
878
840
|
/**
|
|
879
|
-
* Ref
|
|
880
|
-
*
|
|
881
|
-
* 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.
|
|
882
843
|
*/
|
|
883
844
|
scrollContainerRef?: Ref<HTMLDivElement>;
|
|
884
845
|
}
|
|
@@ -898,10 +859,8 @@ type TableGridProps<TData> = DataStructureComponent<TData> & TableGridSpecificPr
|
|
|
898
859
|
/** Global row-model switch — decides where each data-pipeline feature runs. Default "client". See `TableRowModel`. */
|
|
899
860
|
rowModel?: TableRowModel;
|
|
900
861
|
/**
|
|
901
|
-
* Pagination —
|
|
902
|
-
*
|
|
903
|
-
* (request.range = [pageStart, pageEnd)). Only honored when virtualization
|
|
904
|
-
* is disabled (mutually exclusive). Defaults to off.
|
|
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.
|
|
905
864
|
*/
|
|
906
865
|
pagination?: TableGridPagination;
|
|
907
866
|
} & TableGridServerModelProps<TData>;
|
|
@@ -1084,12 +1043,8 @@ interface FormColumnDelta<TData> {
|
|
|
1084
1043
|
column: FormColumn<TData>;
|
|
1085
1044
|
}
|
|
1086
1045
|
/**
|
|
1087
|
-
* Server response to a field change.
|
|
1088
|
-
*
|
|
1089
|
-
*
|
|
1090
|
-
* - `data`: partial data to merge (e.g. reset dependent fields to null)
|
|
1091
|
-
* - `columns`: delta operations on columns (add new dependent fields, update options, remove fields)
|
|
1092
|
-
* - `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`.
|
|
1093
1048
|
*/
|
|
1094
1049
|
interface FormChangeResponse<TData> {
|
|
1095
1050
|
/** Partial data delta — merged with current formData */
|
|
@@ -1115,18 +1070,9 @@ interface FormSpecificProps<TData> {
|
|
|
1115
1070
|
/** Custom action buttons rendered in the form footer.*/
|
|
1116
1071
|
actions?: ButtonProps[];
|
|
1117
1072
|
/**
|
|
1118
|
-
* Server-driven callback invoked on every field change
|
|
1119
|
-
*
|
|
1120
|
-
* The server receives the current form state and the changed field,
|
|
1121
|
-
* and returns a **partial delta** — only the pieces that changed.
|
|
1122
|
-
* The form merges the delta into its state and re-renders only
|
|
1123
|
-
* the affected fields.
|
|
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.
|
|
1124
1075
|
*
|
|
1125
|
-
* Fields not yet resolved (loading) show a skeleton placeholder.
|
|
1126
|
-
*
|
|
1127
|
-
* @param formData - Current complete form data
|
|
1128
|
-
* @param changedField - The accessorKey of the field that changed
|
|
1129
|
-
* @param newValue - The new value of the changed field
|
|
1130
1076
|
* @returns A partial delta with data, column operations, and optional layout
|
|
1131
1077
|
*/
|
|
1132
1078
|
onFormChange?: (formData: TData, changedField: keyof TData, newValue: TData[keyof TData]) => Promise<FormChangeResponse<TData>>;
|
|
@@ -1327,11 +1273,8 @@ type KPIProps<TData> = Omit<DataStructureComponent<TData>, "data"> & KPISpecific
|
|
|
1327
1273
|
declare function KPI<TData>({ data, columns, layout, slotMap, className, uiConfig, onClick }: KPIProps<TData>): React$1.JSX.Element;
|
|
1328
1274
|
|
|
1329
1275
|
/**
|
|
1330
|
-
* Shared finance layouts
|
|
1331
|
-
* `
|
|
1332
|
-
*
|
|
1333
|
-
* Field IDs are intentionally generic so they work with any dataset that
|
|
1334
|
-
* 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`.
|
|
1335
1278
|
*/
|
|
1336
1279
|
/**
|
|
1337
1280
|
* Compact KPI layout: label on top, big value in the middle, delta/trend
|
|
@@ -1354,14 +1297,8 @@ interface CardLayoutPreset {
|
|
|
1354
1297
|
layout: ResponsiveLayout;
|
|
1355
1298
|
}
|
|
1356
1299
|
/**
|
|
1357
|
-
* Card layout: icon
|
|
1358
|
-
*
|
|
1300
|
+
* Card layout: icon left, name + type beside it, actions right-aligned.
|
|
1359
1301
|
* Field IDs: `icon`, `name`, `type`, `actions`.
|
|
1360
|
-
*
|
|
1361
|
-
* ┌──────────────────────────────────────┐
|
|
1362
|
-
* │ icon name actions │
|
|
1363
|
-
* │ type │
|
|
1364
|
-
* └──────────────────────────────────────┘
|
|
1365
1302
|
*/
|
|
1366
1303
|
declare const cardLayoutWithIcon: ResponsiveLayout;
|
|
1367
1304
|
/** Maps a preset id to its `ResponsiveLayout`. Falls back to `undefined`. */
|
|
@@ -1375,12 +1312,8 @@ declare const cardLayoutPresetOptions: {
|
|
|
1375
1312
|
}[];
|
|
1376
1313
|
|
|
1377
1314
|
/**
|
|
1378
|
-
* A registered KPI layout preset
|
|
1379
|
-
*
|
|
1380
|
-
* `id` is the value stored in the widget config (and resolved back to a
|
|
1381
|
-
* `ResponsiveLayout` at render time by the Switcher). `label` / `description`
|
|
1382
|
-
* drive the selector UI; `layout` is the actual tree rendered in the preview
|
|
1383
|
-
* 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.
|
|
1384
1317
|
*/
|
|
1385
1318
|
interface KpiLayoutPreset {
|
|
1386
1319
|
id: string;
|
|
@@ -1418,14 +1351,8 @@ type ComponentSpecificPropsMap<TData> = {
|
|
|
1418
1351
|
"kpi": KPISpecificProps<TData>;
|
|
1419
1352
|
};
|
|
1420
1353
|
/**
|
|
1421
|
-
* Props for the Switcher component.
|
|
1422
|
-
*
|
|
1423
|
-
*
|
|
1424
|
-
* Two modes:
|
|
1425
|
-
* - **Uncontrolled**: provide `initialComponent` / `initialComponentProps`. Switcher manages its own state.
|
|
1426
|
-
* - **Controlled**: provide `activeComponent` / `componentProps`. The parent manages state,
|
|
1427
|
-
* and the Switcher reflects changes immediately. Use this when an external configurator
|
|
1428
|
-
* (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`.
|
|
1429
1356
|
*/
|
|
1430
1357
|
interface SwitcherProps<TData> extends DataStructureComponent<TData> {
|
|
1431
1358
|
/** Initial active component. Defaults to "table-grid". (Uncontrolled mode) */
|
|
@@ -1445,22 +1372,14 @@ interface SwitcherProps<TData> extends DataStructureComponent<TData> {
|
|
|
1445
1372
|
}
|
|
1446
1373
|
|
|
1447
1374
|
/**
|
|
1448
|
-
*
|
|
1449
|
-
*
|
|
1450
|
-
* Specific props are managed per-component via the config overlay.
|
|
1451
|
-
*
|
|
1452
|
-
* Two modes:
|
|
1453
|
-
* - **Uncontrolled**: provide `initialComponent` / `initialComponentProps`
|
|
1454
|
-
* - **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.
|
|
1455
1377
|
*/
|
|
1456
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;
|
|
1457
1379
|
|
|
1458
1380
|
/**
|
|
1459
|
-
* Where a prop field is configurable
|
|
1460
|
-
*
|
|
1461
|
-
* - `"switcher"`: visible only in the Switcher panel
|
|
1462
|
-
* - `"dashboard"`: visible only in the Dashboard configurator
|
|
1463
|
-
* - `"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).
|
|
1464
1383
|
*/
|
|
1465
1384
|
type PropFieldScope = "all" | "switcher" | "dashboard" | "none";
|
|
1466
1385
|
/**
|
|
@@ -1503,11 +1422,8 @@ interface PropFieldDescriptor {
|
|
|
1503
1422
|
type PropSchemaRegistry = Record<string, PropFieldDescriptor[]>;
|
|
1504
1423
|
|
|
1505
1424
|
/**
|
|
1506
|
-
* Props for the shared DataComponentConfigurator
|
|
1507
|
-
*
|
|
1508
|
-
* This component is used in two contexts:
|
|
1509
|
-
* 1. **Switcher** — shows the component selector + prop form (scope: "switcher")
|
|
1510
|
-
* 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).
|
|
1511
1427
|
*/
|
|
1512
1428
|
interface DataComponentConfiguratorProps {
|
|
1513
1429
|
/** Schema for the active component's configurable fields. */
|
|
@@ -1536,15 +1452,8 @@ interface DataComponentConfiguratorProps {
|
|
|
1536
1452
|
}
|
|
1537
1453
|
|
|
1538
1454
|
/**
|
|
1539
|
-
* Shared configurator for data-components
|
|
1540
|
-
*
|
|
1541
|
-
* Renders:
|
|
1542
|
-
* - An optional **component selector** (when `componentMetaList` is provided)
|
|
1543
|
-
* - A **dynamic prop form** filtered by the given scope
|
|
1544
|
-
*
|
|
1545
|
-
* Used by:
|
|
1546
|
-
* - **Switcher** — full configurator with component selector + all props
|
|
1547
|
-
* - **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`.
|
|
1548
1457
|
*/
|
|
1549
1458
|
declare const DataComponentConfigurator: {
|
|
1550
1459
|
({ schema, values, onChange, columns, scope, componentId, onComponentChange, componentMetaList, }: DataComponentConfiguratorProps): React__default.JSX.Element;
|
package/dist/data.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as s, B as t, F as e, H as r, I as o, K as i, L as n, M as p, N as u, P as c, R as C, T as L, U as d, V as l, W as y, j as P, k as m, pt as K, q as f, w as h, z as F } from "./src-
|
|
1
|
+
import { A as s, B as t, F as e, H as r, I as o, K as i, L as n, M as p, N as u, P as c, R as C, T as L, U as d, V as l, W as y, j as P, k as m, pt as K, q as f, w as h, z as F } from "./src-Bzrq1hWW.js";
|
|
2
2
|
export {
|
|
3
3
|
l as Calendar,
|
|
4
4
|
y as Card,
|