@nivaro/react 0.1.233 → 0.1.234

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -2317,10 +2317,13 @@ export declare function matchScopeDimension(scopes: UserScopesInfo | null, probe
2317
2317
  collection?: string;
2318
2318
  }): UserScopesInfo['dimensions'][number] | null;
2319
2319
 
2320
- export declare function MatrixEditor({ config, initialScope }: {
2320
+ export declare function MatrixEditor({ config, initialScope, lockScope }: {
2321
2321
  config: MatrixEditorConfig;
2322
2322
  /** Pre-seed scope pickers (drill-down hosts scope the matrix to a record). */
2323
2323
  initialScope?: Record<string, unknown>;
2324
+ /** Scope fields supplied by initialScope render as fixed context, not pickers
2325
+ * (a sheet already scoped to one project). */
2326
+ lockScope?: boolean;
2324
2327
  }): JSX.Element;
2325
2328
 
2326
2329
  declare interface MatrixEditorConfig {
@@ -2404,6 +2407,23 @@ declare interface MatrixEditorConfig {
2404
2407
  label?: string;
2405
2408
  format?: 'currency' | 'number';
2406
2409
  }>;
2410
+ /** Computed columns over the row: `{{__current__}}` (saved value),
2411
+ * `{{__new__}}` (live value incl. the edit) and any metric field —
2412
+ * e.g. Remaining = `{{__new__}} - {{current_spend}} - {{committed_costs}}`.
2413
+ * Aggregated levels sum the inputs first, then apply the formula. */
2414
+ derived?: Array<{
2415
+ label: string;
2416
+ formula: string;
2417
+ format?: 'currency' | 'number';
2418
+ }>;
2419
+ /** Metric rows that match no rendered cell still count: shown read-only as
2420
+ * an "Other …" row per group (options outside the project's list) and an
2421
+ * "Other …" group (groups outside the project's list), so the totals
2422
+ * reconcile with the project-level figures. */
2423
+ unmatched?: {
2424
+ option_label?: string;
2425
+ group_label?: string;
2426
+ } | false;
2407
2427
  };
2408
2428
  }
2409
2429
 
@@ -2938,9 +2958,16 @@ declare interface QuerySheetDef {
2938
2958
  title?: string;
2939
2959
  width?: number | string;
2940
2960
  config?: QueryWidgetConfig;
2961
+ /** A tab is a nested query view OR a MatrixEditor (`matrix`): its scope is
2962
+ * seeded from the clicked row — `scope: {project: '$row.id'}` — and those
2963
+ * fields render as fixed context, not pickers. */
2941
2964
  tabs?: Array<{
2942
2965
  label: string;
2943
- config: QueryWidgetConfig;
2966
+ config?: QueryWidgetConfig;
2967
+ matrix?: {
2968
+ config: MatrixEditorConfig;
2969
+ scope: Record<string, string>;
2970
+ };
2944
2971
  }>;
2945
2972
  }
2946
2973
 
@@ -2989,9 +3016,14 @@ declare interface QueryTableColumn {
2989
3016
  * alternating groups get a faint band so wide grids stay scannable. */
2990
3017
  group?: string;
2991
3018
  /** Cell text color (any CSS color) — EFP forecast/actual column tinting.
2992
- * color_dark overrides in dark mode (defaults to color). */
3019
+ * color_dark overrides in dark mode (defaults to color). Either may be a
3020
+ * role name — accent | ink | muted | positive | negative | warning | info —
3021
+ * instead of a hex; roles follow the host theme (see COLOR_ROLES). */
2993
3022
  color?: string;
2994
3023
  color_dark?: string;
3024
+ /** Colour (role or hex) used instead of `color` when the cell's value is
3025
+ * negative — a Remaining Budget column reads green until it goes red. */
3026
+ color_negative?: string;
2995
3027
  /** Second field rendered as a stacked line under the main value in the SAME
2996
3028
  * cell (EFP month cells: Fcst over Act — halves the column count). Toggles
2997
3029
  * hide individual lines; the column collapses when both lines hide. */
@@ -3166,7 +3198,8 @@ declare interface QueryWidgetStat {
3166
3198
  * render with a leading '+'. */
3167
3199
  field_subtract?: string;
3168
3200
  /** EFP stat-card accent: colored top border + value (accent_dark in dark
3169
- * mode; accent_negative when a delta goes negative). */
3201
+ * mode; accent_negative when a delta goes negative). Each may be a role name
3202
+ * — accent | positive | negative | info … — see QueryTable COLOR_ROLES. */
3170
3203
  accent?: string;
3171
3204
  accent_dark?: string;
3172
3205
  accent_negative?: string;
@@ -3436,6 +3469,14 @@ export declare function RecordGridEditor({ config }: {
3436
3469
  declare interface RecordGridEditorConfig {
3437
3470
  collection: string;
3438
3471
  title?: string;
3472
+ /**
3473
+ * BROWSE-THEN-EDIT: the key columns become header pickers. Until every key
3474
+ * is chosen the grid shows read-only totals rolled up by the unpicked keys
3475
+ * (click a rollup to drill into it); once all keys are chosen the matching
3476
+ * row(s) edit inline and a missing row can be created. Month values render
3477
+ * formatted (thousands separators) until focused.
3478
+ */
3479
+ browse?: boolean;
3439
3480
  /** Scope pickers: every field must be chosen before rows load; values filter
3440
3481
  * loaded rows and seed created rows. `filter` supports '$scope.<field>'
3441
3482
  * tokens off the other scope values. */