@nivaro/react 0.1.198 → 0.1.199

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
@@ -1753,7 +1753,7 @@ declare interface ImportValidationReport {
1753
1753
  truncated: boolean;
1754
1754
  }
1755
1755
 
1756
- export declare function InlineTableField({ relatedCollection, manyField, parentId, parentCollection, layoutId, showRowRevisions, rowComments, allowRevisionRestore, saveMode, showLineNumbers, enableReorder, parentCascades, rowRules, columnPresets, defaultPreset, drawerRelations, parentContextFields, uniqueBy, sortField, sortDir, sectionGroupBy, freezeFirstColumn, rowFilter, rowDefaults, allocateDrawer, autoAllocate, rowBulkActions, uploadTemplate, submissionErrors, prefillParentId, parentFieldKey, readOnly, emptyLabel }: {
1756
+ export declare function InlineTableField({ relatedCollection, manyField, parentId, parentCollection, layoutId, showRowRevisions, rowComments, allowRevisionRestore, saveMode, showLineNumbers, enableReorder, parentCascades, rowRules, columnPresets, defaultPreset, drawerRelations, parentContextFields, uniqueBy, sortField, sortDir, sectionGroupBy, freezeFirstColumn, rowFilter, rowDefaults, allocateDrawer, autoAllocate, rowBulkActions, uploadTemplate, rowMatchPanel, submissionErrors, prefillParentId, parentFieldKey, readOnly, emptyLabel }: {
1757
1757
  relatedCollection: string;
1758
1758
  manyField: string;
1759
1759
  parentId: string;
@@ -1802,6 +1802,9 @@ export declare function InlineTableField({ relatedCollection, manyField, parentI
1802
1802
  /** Import template NAME — renders that template's upload button in this
1803
1803
  * grid's toolbar (existing records; wired to ItemEditForm's reimport flow). */
1804
1804
  uploadTemplate?: string;
1805
+ /** "Which related record is this row matched to, and if not, why" — see
1806
+ * RowMatchPanel (options.row_match_panel). Rendered in the row editor. */
1807
+ rowMatchPanel?: RowMatchPanelConfig;
1805
1808
  /** Flag rows a failed ERP push rejected (options.submission_errors) — the
1806
1809
  * latest failed nivaro_erp_submissions row for the PARENT record is parsed
1807
1810
  * for "LineNumber N: reason" entries and matching rows tint red with the
@@ -3593,6 +3596,57 @@ export declare function rowHighlightClass(color?: string | null): string | undef
3593
3596
 
3594
3597
  export declare function rowHighlightTextClass(color?: string | null): string;
3595
3598
 
3599
+ /**
3600
+ * "Which related record is this row matched to, and if none, why not?"
3601
+ *
3602
+ * Config-driven (`options.row_match_panel` on an inline-table field): the
3603
+ * O2M alias on the child that points at the matched records (a workflow
3604
+ * line's `po_line_items`), the columns to show for a match, and — for the
3605
+ * unmatched case — how to find the nearest candidate among a filtered set
3606
+ * (the record's linked purchase orders) and which keys the match rule
3607
+ * compares. `useRowMatches` resolves this ONCE for every saved row of a
3608
+ * grid (two batched reads); the row shows a small dot, the row editor the
3609
+ * full panel with the reason a match fails.
3610
+ */
3611
+ declare interface RowMatchPanelConfig {
3612
+ /** O2M alias on the child collection (e.g. workflow_line_items.po_line_items). */
3613
+ relation: string;
3614
+ /** Panel heading. Default "Match". */
3615
+ title?: string;
3616
+ /** Shown per matched record. `path` is a column or dotted M2O path on the
3617
+ * target; `formula` is `{{col}}` arithmetic over the target row. */
3618
+ columns: Array<{
3619
+ path?: string;
3620
+ formula?: string;
3621
+ label: string;
3622
+ format?: 'currency' | 'number' | 'text';
3623
+ }>;
3624
+ /** How to explain a miss, and which keys a match is judged on. */
3625
+ candidates?: {
3626
+ /** Filter over the target collection; `$parent.<field>` tokens resolve
3627
+ * from the parent record (M2M aliases give id arrays). Unresolved token
3628
+ * = the parent has nothing to match against yet. */
3629
+ filter: Record<string, unknown>;
3630
+ /** The match rule: each key pairs a row field with a candidate field. */
3631
+ keys: Array<{
3632
+ row: string;
3633
+ candidate: string;
3634
+ label: string;
3635
+ format?: 'currency' | 'number' | 'text';
3636
+ /** Dotted path on the candidate for a human label (line_type.type). */
3637
+ candidate_display?: string;
3638
+ }>;
3639
+ /** Row field of the key that locates the nearest candidate (default: first key). */
3640
+ primary?: string;
3641
+ /** Label for the candidate's parent ("PO"), used in reasons; `parent_path`
3642
+ * is the dotted path to its human id (purchase_order.number). */
3643
+ parent_label?: string;
3644
+ parent_path?: string;
3645
+ };
3646
+ no_parent_message?: string;
3647
+ empty_message?: string;
3648
+ }
3649
+
3596
3650
  declare interface RowRule {
3597
3651
  trigger_field?: string | null;
3598
3652
  trigger_op?: string;