@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/dist/framework.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.AppBar=e.AppBar;exports.BlankSlate=e.BlankSlate;exports.Breadcrumbs=e.Breadcrumbs;exports.Dashboard=e.Dashboard;exports.DashboardWidget=e.DashboardWidget;exports.Drawer=e.Drawer;exports.FilterBuilder=e.FilterBuilder;exports.FilterConditionEditor=e.FilterConditionEditor;exports.FilterField=e.FilterField;exports.Scaffold=e.Scaffold;exports.Section=e.Section;exports.Sidebar=e.Sidebar;exports.Stepper=e.Stepper;exports.addNodeAtPath=e.addNodeAtPath;exports.applyFilter=e.applyFilter;exports.countActiveConditionsByField=e.countActiveConditionsByField;exports.countTopLevelFilters=e.countTopLevelFilters;exports.countTopLevelFiltersMap=e.countTopLevelFiltersMap;exports.emptyCondition=e.emptyCondition;exports.emptyFilterGroup=e.emptyFilterGroup;exports.fieldOptionsFromColumns=e.fieldOptionsFromColumns;exports.getDefaultOperator=e.getDefaultOperator;exports.getOperatorsForType=e.getOperatorsForType;exports.isFilterActive=e.isFilterActive;exports.mergeFilters=e.mergeFilters;exports.removeFieldFilters=e.removeFieldFilters;exports.removeNodeAtPath=e.removeNodeAtPath;exports.stripByFields=e.stripByFields;exports.updateNodeAtPath=e.updateNodeAtPath;exports.useDashboard=e.useDashboard;exports.useScaffold=e.useScaffold;
|
package/dist/framework.d.ts
CHANGED
|
@@ -150,9 +150,8 @@ interface StepperProps extends React.HTMLAttributes<HTMLElement> {
|
|
|
150
150
|
}
|
|
151
151
|
|
|
152
152
|
/**
|
|
153
|
-
* Horizontal stepper
|
|
154
|
-
* Steps before `current` are
|
|
155
|
-
* as a `Tag` whose state changes with the step status.
|
|
153
|
+
* Horizontal stepper rendering ordered steps with idle/active/done states, each as a
|
|
154
|
+
* `Tag`. Steps before `current` are marked done automatically.
|
|
156
155
|
*/
|
|
157
156
|
declare const Stepper: React__default.FC<StepperProps>;
|
|
158
157
|
|
|
@@ -376,9 +375,8 @@ interface ProgressBarProps {
|
|
|
376
375
|
}
|
|
377
376
|
|
|
378
377
|
/**
|
|
379
|
-
* Maps each CellType to the component
|
|
380
|
-
*
|
|
381
|
-
* the underlying component actually understands.
|
|
378
|
+
* Maps each CellType to the component props accepted by `uiVariant`, so TypeScript
|
|
379
|
+
* only allows props the underlying component understands.
|
|
382
380
|
*/
|
|
383
381
|
type CellUIVariantMap = {
|
|
384
382
|
[K in CellType]: K extends "IMAGE" ? Partial<Omit<IconProps, "src">> : K extends "TAG" ? Partial<{
|
|
@@ -408,10 +406,8 @@ type LookupCellType<TData, TColumns extends readonly DataStructureColumn<TData>[
|
|
|
408
406
|
/** Comparison operators for AST-like UI rules */
|
|
409
407
|
type UIRuleOperator = "==" | "!=" | ">" | ">=" | "<" | "<=" | "includes" | "startsWith" | "endsWith" | "isEmpty" | "isNotEmpty";
|
|
410
408
|
/**
|
|
411
|
-
* A
|
|
412
|
-
*
|
|
413
|
-
*
|
|
414
|
-
* When `field` and `op` are omitted, the rule always matches (static styling).
|
|
409
|
+
* A declarative styling rule evaluated against a row, compiled once into a fast
|
|
410
|
+
* evaluator. Omitting `field` and `op` makes it a static rule that always matches.
|
|
415
411
|
*
|
|
416
412
|
* @example conditional
|
|
417
413
|
* { field: "price", op: ">", value: 100, uiVariant: { color: "var(--rst-color-success)", fontWeight: "bold" } }
|
|
@@ -481,26 +477,20 @@ interface DataStructureColumn<TData, TValue = TData[keyof TData]> {
|
|
|
481
477
|
/** Helper text shown below the field (e.g. "Opzionale", "Usa +/− per il segno"). */
|
|
482
478
|
helperText?: string;
|
|
483
479
|
/**
|
|
484
|
-
*
|
|
485
|
-
*
|
|
486
|
-
* referenced by `cellType` (e.g. ChartProps for CHART, TableGridProps for TABLE_GRID).
|
|
487
|
-
* `data` and `columns` are excluded — they come from the cell value and schema.
|
|
480
|
+
* Column-level config for the component named by `cellType` (e.g. ChartProps for
|
|
481
|
+
* CHART). `data` and `columns` are excluded — they come from the cell value and schema.
|
|
488
482
|
*/
|
|
489
483
|
columnConfig?: Record<string, unknown>;
|
|
490
484
|
/**
|
|
491
|
-
* Called when an interactive cell (e.g. BUTTON
|
|
492
|
-
*
|
|
493
|
-
* action id (for BUTTON = `option.value`). Works in any data-component
|
|
494
|
-
* that renders Cell in display mode (CardList, TableGrid, …).
|
|
485
|
+
* Called when an interactive cell (e.g. BUTTON) fires an action; the first argument
|
|
486
|
+
* is the action id (for BUTTON, `option.value`).
|
|
495
487
|
*/
|
|
496
488
|
onCellClick?: (actionId: string, rowData: TData, column: DataStructureColumn<TData, TValue>) => void;
|
|
497
489
|
}
|
|
498
490
|
|
|
499
491
|
/**
|
|
500
|
-
* Derives `FilterFieldProp[]` from column definitions
|
|
501
|
-
*
|
|
502
|
-
* Columns without a resolvable ID or header are skipped.
|
|
503
|
-
* SELECT / BUTTON_GROUP columns populate `availableOptions` from `col.options`.
|
|
492
|
+
* Derives `FilterFieldProp[]` from column definitions, skipping columns without a
|
|
493
|
+
* resolvable ID or header and populating options from SELECT / BUTTON_GROUP columns.
|
|
504
494
|
*/
|
|
505
495
|
declare function fieldOptionsFromColumns<TData>(columns: DataStructureColumn<TData>[]): FilterFieldProp[];
|
|
506
496
|
/** Returns the available operator options for a given column type. */
|
|
@@ -544,12 +534,8 @@ declare function removeFieldFilters(root: FilterGroup, fieldId: string): FilterG
|
|
|
544
534
|
declare function countTopLevelFiltersMap(filters: Record<string, FilterGroup | null> | null): number;
|
|
545
535
|
|
|
546
536
|
/**
|
|
547
|
-
* Filters `data`
|
|
548
|
-
*
|
|
549
|
-
* - Returns the original `data` array reference unchanged when `filter` is
|
|
550
|
-
* `null` or contains no active conditions (avoids unnecessary re-renders).
|
|
551
|
-
* - Works with any `DataStructureComponent`-compatible column definition,
|
|
552
|
-
* resolving values via `accessorFn` or `accessorKey`.
|
|
537
|
+
* Filters `data` with a `FilterGroup` AST, returning the same array reference when
|
|
538
|
+
* the filter is null or empty. Values resolve via `accessorFn` or `accessorKey`.
|
|
553
539
|
*
|
|
554
540
|
* @example
|
|
555
541
|
* const visible = applyFilter(data, filterGroup, columns);
|
|
@@ -577,17 +563,8 @@ interface FilterConditionEditorProps {
|
|
|
577
563
|
readonly onGuidedComplete?: () => void;
|
|
578
564
|
}
|
|
579
565
|
/**
|
|
580
|
-
* Shared row-level filter
|
|
581
|
-
*
|
|
582
|
-
* Reused by both `FilterBuilder` (panel rows inside groups) and `FilterField`
|
|
583
|
-
* (inline chips in edit-in-place mode). This is the single place where field /
|
|
584
|
-
* operator / value input switching logic lives.
|
|
585
|
-
*
|
|
586
|
-
* Each piece (field, operator, value, delete) can be individually locked via
|
|
587
|
-
* `condition.readOnly` or the `readOnly` prop.
|
|
588
|
-
*
|
|
589
|
-
* When `guided` is `true`, the editor walks the user through the three steps,
|
|
590
|
-
* auto-opening the dropdown / focusing the input of the current step.
|
|
566
|
+
* Shared row-level filter editor (field → operator → value), used by both `FilterBuilder`
|
|
567
|
+
* and `FilterField`. Each piece can be locked, and `guided` walks the user through the steps.
|
|
591
568
|
*/
|
|
592
569
|
declare const FilterConditionEditor: React.FC<FilterConditionEditorProps>;
|
|
593
570
|
|
|
@@ -664,21 +641,13 @@ type ResponsiveLayout = {
|
|
|
664
641
|
};
|
|
665
642
|
|
|
666
643
|
/**
|
|
667
|
-
* Props for the Dashboard orchestrator
|
|
668
|
-
*
|
|
669
|
-
* Dashboard provides global filters to all child DashboardWidget instances
|
|
670
|
-
* and arranges them using the responsive Layout system.
|
|
671
|
-
*
|
|
672
|
-
* Global filters are organised per data source: each entry in `filters` is
|
|
673
|
-
* keyed by the data source id (e.g. "transactions", "budgets") and contains
|
|
674
|
-
* the filter tree specific to that source. Widgets pick the entry matching
|
|
675
|
-
* their own data source via context.
|
|
644
|
+
* Props for the Dashboard orchestrator, which feeds global filters (keyed by data
|
|
645
|
+
* source id) to every child DashboardWidget and lays them out with the Layout system.
|
|
676
646
|
*/
|
|
677
647
|
interface DashboardProps {
|
|
678
648
|
/**
|
|
679
|
-
* Global filter trees keyed by data source id.
|
|
680
|
-
*
|
|
681
|
-
* then merges it with its own per-section filters.
|
|
649
|
+
* Global filter trees keyed by data source id. Each widget merges the entry matching
|
|
650
|
+
* its own data source with its per-section filters.
|
|
682
651
|
*/
|
|
683
652
|
filters: Record<string, FilterGroup | null> | null;
|
|
684
653
|
/** Called when a data-source filter tree changes (key + new tree) */
|
|
@@ -686,9 +655,8 @@ interface DashboardProps {
|
|
|
686
655
|
/** Responsive layout configuration (mobile / tablet / desktop breakpoints) */
|
|
687
656
|
layout: ResponsiveLayout;
|
|
688
657
|
/**
|
|
689
|
-
*
|
|
690
|
-
*
|
|
691
|
-
* overlay. Required when `enableFilter` is true.
|
|
658
|
+
* FilterBuilder fields keyed by data source id, each shown as its own tab in the global
|
|
659
|
+
* filter overlay. Required when `enableFilter` is true.
|
|
692
660
|
*/
|
|
693
661
|
fieldOptions?: Record<string, FilterFieldProp[]>;
|
|
694
662
|
/** Show a filter button that opens the FilterBuilder overlay */
|
|
@@ -709,23 +677,14 @@ interface DashboardContextValue {
|
|
|
709
677
|
}
|
|
710
678
|
|
|
711
679
|
/**
|
|
712
|
-
*
|
|
713
|
-
*
|
|
714
|
-
* It provides global filters to all child DashboardWidget instances via
|
|
715
|
-
* context, keyed by data source id, and arranges widgets using the
|
|
716
|
-
* responsive Layout system.
|
|
717
|
-
*
|
|
718
|
-
* When `enableFilter` is set, a filter button opens the FilterBuilder
|
|
719
|
-
* overlay where the user picks a data source and edits its filter tree.
|
|
720
|
-
* The button shows the total number of active top-level filters across
|
|
721
|
-
* all data sources.
|
|
680
|
+
* Top-level orchestrator for a page of data widgets: shares global filters with every
|
|
681
|
+
* child DashboardWidget (keyed by data source id) and arranges them with the Layout system.
|
|
722
682
|
*/
|
|
723
683
|
declare const Dashboard: React__default.FC<DashboardProps>;
|
|
724
684
|
|
|
725
685
|
/**
|
|
726
|
-
*
|
|
727
|
-
*
|
|
728
|
-
* Returns null when used outside a Dashboard.
|
|
686
|
+
* Reads the DashboardContext, returning the current filters and `onFilterChange`,
|
|
687
|
+
* or null outside a Dashboard.
|
|
729
688
|
*/
|
|
730
689
|
declare function useDashboard(): DashboardContextValue | null;
|
|
731
690
|
|
|
@@ -737,14 +696,8 @@ interface DashboardWidgetRenderPayload<TData> {
|
|
|
737
696
|
data: TData[];
|
|
738
697
|
}
|
|
739
698
|
/**
|
|
740
|
-
* Props for
|
|
741
|
-
*
|
|
742
|
-
* Three modes are supported, depending on which props you provide:
|
|
743
|
-
*
|
|
744
|
-
* - **Passthrough mode**: provide only `data`. The data is used as-is —
|
|
745
|
-
* the server already prepared it. Zero frontend processing.
|
|
746
|
-
* - **Legacy mode**: provide `data` + `columns`. Global dashboard filters
|
|
747
|
-
* are applied client-side via `applyFilter()`.
|
|
699
|
+
* Props for DashboardWidget. Passthrough mode takes only `data` and uses it as-is;
|
|
700
|
+
* legacy mode takes `data` + `columns` and applies global filters client-side.
|
|
748
701
|
*/
|
|
749
702
|
interface DashboardWidgetProps<TData> {
|
|
750
703
|
/** Unique identifier for this widget (used as Layout block key) */
|
|
@@ -752,9 +705,8 @@ interface DashboardWidgetProps<TData> {
|
|
|
752
705
|
/** Widget title displayed in the Section header */
|
|
753
706
|
title: string;
|
|
754
707
|
/**
|
|
755
|
-
* Data source
|
|
756
|
-
*
|
|
757
|
-
* global filters (otherwise only the per-section filter applies).
|
|
708
|
+
* Data source id that picks this widget's entry from the dashboard's per-source
|
|
709
|
+
* filter map. Required to receive global filters.
|
|
758
710
|
*/
|
|
759
711
|
dataSourceId?: string;
|
|
760
712
|
/** Optional subtitle displayed below the title */
|
|
@@ -762,10 +714,8 @@ interface DashboardWidgetProps<TData> {
|
|
|
762
714
|
/** Optional icon name (bundled SVG) shown before the title in the Section header */
|
|
763
715
|
icon?: string;
|
|
764
716
|
/**
|
|
765
|
-
* Data for this widget
|
|
766
|
-
*
|
|
767
|
-
* - **Passthrough**: provide `data` alone → used as-is (server-ready).
|
|
768
|
-
* - **Legacy**: provide `data` + `columns` → global filters applied.
|
|
717
|
+
* Data for this widget: alone it is used as-is (passthrough); with `columns`,
|
|
718
|
+
* global filters are applied client-side.
|
|
769
719
|
*/
|
|
770
720
|
data?: TData[];
|
|
771
721
|
/**
|
|
@@ -798,14 +748,8 @@ interface DashboardWidgetProps<TData> {
|
|
|
798
748
|
}
|
|
799
749
|
|
|
800
750
|
/**
|
|
801
|
-
*
|
|
802
|
-
*
|
|
803
|
-
* 2. Renders a Section with a toolbar of actions (export, screenshot, expand)
|
|
804
|
-
* 3. Passes data to the render prop
|
|
805
|
-
*
|
|
806
|
-
* Three modes:
|
|
807
|
-
* - **Passthrough**: provide only `data` → used as-is (server-ready, zero processing)
|
|
808
|
-
* - **Legacy**: provide `data` + `columns` → global filters applied via `applyFilter()`
|
|
751
|
+
* Self-contained widget that takes its own data (raw, pre-filtered, or engine-backed),
|
|
752
|
+
* renders a Section with an action toolbar, and passes the data to the render prop.
|
|
809
753
|
*/
|
|
810
754
|
declare const DashboardWidget: {
|
|
811
755
|
<TData extends object>({ title, subtitle, icon, data, columns, children, enableExport, enableScreenshot, enableExpand, enableFilter, fieldOptions, filters, onFilterChange, ignoreGlobalFilters, dataSourceId, className, }: DashboardWidgetProps<TData>): React__default.JSX.Element;
|
package/dist/framework.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as t, C as e, Q as s, S as r, X as o, Y as i, Z as d, _ as l, at as p, b as F, ct as n, d as u, dt as m, et as c, ft as f, g as h, h as v, it as y, lt as S, m as b, nt as A, ot as B, p as g, rt as C, st as D, tt as N, u as O, ut as P, v as T, x, y as L } from "./src-
|
|
1
|
+
import { $ as t, C as e, Q as s, S as r, X as o, Y as i, Z as d, _ as l, at as p, b as F, ct as n, d as u, dt as m, et as c, ft as f, g as h, h as v, it as y, lt as S, m as b, nt as A, ot as B, p as g, rt as C, st as D, tt as N, u as O, ut as P, v as T, x, y as L } from "./src-Bzrq1hWW.js";
|
|
2
2
|
export {
|
|
3
3
|
r as AppBar,
|
|
4
4
|
v as BlankSlate,
|
package/dist/index.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.AIChatPanel=e.AIChatPanel;exports.AnchoredOverlay=e.AnchoredOverlay;exports.AppBar=e.AppBar;exports.Banner=e.Banner;exports.BlankSlate=e.BlankSlate;exports.Breadcrumbs=e.Breadcrumbs;exports.Button=e.Button;exports.ButtonDropdown=e.ButtonDropdown;exports.ButtonGroup=e.ButtonGroup;exports.Calendar=e.Calendar;exports.Card=e.Card;exports.CardList=e.CardList;exports.Cell=e.Cell;exports.CellType=e.CellType;exports.Chart=e.Chart;exports.Checkbox=e.Checkbox;exports.CheckboxGroup=e.CheckboxGroup;exports.Dashboard=e.Dashboard;exports.DashboardWidget=e.DashboardWidget;exports.DataComponentConfigurator=e.DataComponentConfigurator;exports.DatePicker=e.DatePicker;exports.DateRangePicker=e.DateRangePicker;exports.Drawer=e.Drawer;exports.FileUpload=e.FileUpload;exports.FilterBuilder=e.FilterBuilder;exports.FilterConditionEditor=e.FilterConditionEditor;exports.FilterField=e.FilterField;exports.Form=e.Form;exports.Gantt=e.Gantt;exports.Icon=e.Icon;exports.Input=e.Input;exports.KPI=e.KPI;exports.Kbd=e.Kbd;exports.Label=e.Label;exports.Layout=e.Layout;exports.Markdown=e.Markdown;exports.Menu=e.Menu;exports.MindTree=e.MindTree;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.Scaffold=e.Scaffold;exports.Section=e.Section;exports.Select=e.Select;exports.SelectionGrid=e.SelectionGrid;exports.ShortcutProvider=e.ShortcutProvider;exports.Sidebar=e.Sidebar;exports.Stack=e.Stack;exports.Stepper=e.Stepper;exports.Switcher=e.Switcher;exports.TableGrid=e.TableGrid;exports.Tag=e.Tag;exports.TextInput=e.TextInput;exports.Textarea=e.Textarea;exports.Timeline=e.Timeline;exports.Tree=e.Tree;exports.TreeCard=e.TreeCard;exports.Typography=e.Typography;exports.Workflow=e.Workflow;exports.WorkflowPanel=e.WorkflowPanel;exports.WorkflowToolbar=e.WorkflowToolbar;exports.addNodeAtPath=e.addNodeAtPath;exports.applyFilter=e.applyFilter;exports.cardLayoutPresetOptions=e.cardLayoutPresetOptions;exports.cardLayoutWithIcon=e.cardLayoutWithIcon;exports.countActiveConditionsByField=e.countActiveConditionsByField;exports.countTopLevelFilters=e.countTopLevelFilters;exports.countTopLevelFiltersMap=e.countTopLevelFiltersMap;exports.createDataStructureFromFile=e.createDataStructureFromFile;exports.emptyCondition=e.emptyCondition;exports.emptyFilterGroup=e.emptyFilterGroup;exports.fieldOptionsFromColumns=e.fieldOptionsFromColumns;exports.financeKpiLayout=e.financeKpiLayout;exports.financeKpiLayoutWithIcon=e.financeKpiLayoutWithIcon;exports.getDefaultOperator=e.getDefaultOperator;exports.getOperatorsForType=e.getOperatorsForType;exports.getReachableNodes=e.getReachableNodes;exports.getTopologicalOrder=e.getTopologicalOrder;exports.isFilterActive=e.isFilterActive;exports.kpiLayoutPresetOptions=e.kpiLayoutPresetOptions;exports.mergeFilters=e.mergeFilters;exports.removeFieldFilters=e.removeFieldFilters;exports.removeNodeAtPath=e.removeNodeAtPath;exports.resolveCardLayoutPreset=e.resolveCardLayoutPreset;exports.resolveKpiLayoutPreset=e.resolveKpiLayoutPreset;exports.stripByFields=e.stripByFields;exports.updateNodeAtPath=e.updateNodeAtPath;exports.useDashboard=e.useDashboard;exports.useDynamicVirtualList=e.useDynamicVirtualList;exports.useScaffold=e.useScaffold;exports.useShortcut=e.useShortcut;exports.validateWorkflow=e.validateWorkflow;
|