@ai-matrx/records-ui 0.86.0 → 0.88.0
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/CHANGELOG.md +74 -0
- package/dist/index.cjs +9035 -7890
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +45 -27
- package/dist/index.d.ts +45 -27
- package/dist/index.js +9163 -7994
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -2,7 +2,7 @@ import * as react from 'react';
|
|
|
2
2
|
import { ReactNode, ComponentType, RefObject } from 'react';
|
|
3
3
|
import * as _ai_matrx_records from '@ai-matrx/records';
|
|
4
4
|
import { PermissionLevel, Table, RecordScopeContext, EnrichCell, RecordsError, Field, TableDecorations, Uuid as Uuid$1, StoreFilter, AggregateFilter, RecordDocument, ReadRow, RelationDisplay, WriteConflict, RecordsErrorCode, RecordFilter, RuleExpression, RecordsResult, SavedViewRow, DeclarableFieldKind, ParityFieldType, NewFieldDeclaration, HiddenFieldNotice, ValueEnvelope, ChecklistRequirementKind, ContextPolicy, WorkDueState, FieldSensitivity, StageRuleOnFail, SubscriptionCadence, WorkApprovalState, WorkInboxKind, FieldKind, ArchiveLane, ArchivedRow, WorkInboxView, WorkInboxItem, FormSummary, PortalCard, PortalPrincipal, PortalPreviewRow, MySubscription, DashboardBlockKind, AggregateBucket, AggregateMeasure, AggregateCompare, DashboardTarget, DashboardBlock, DashboardSummary, DocTemplateRow, DocRenderRow, QuietHours, DashboardBlockResult, ChecklistRunStep, BookingSummary, CaptureSheetFace, CaptureField, AnonTokenBinding, RecordsConfig, RecordsActor, RecordsDataSource, HistoryActor, FieldHistoryEntry } from '@ai-matrx/records';
|
|
5
|
-
import { Uuid,
|
|
5
|
+
import { Uuid, Field as Field$1, ReadRow as ReadRow$1, StoreFilter as StoreFilter$1 } from '@ai-matrx/records/react';
|
|
6
6
|
import { TableStyle, GroupAggregateSpec, GroupOrder, ChoiceColorLookup } from '@ai-matrx/design-system/data-table';
|
|
7
7
|
import { FieldFormatConfig } from '@ai-matrx/design-system/field-formats';
|
|
8
8
|
import { RecordsClient } from '@ai-matrx/records/core';
|
|
@@ -289,6 +289,12 @@ type GridPresentation = {
|
|
|
289
289
|
* on, rather than a second "fields shown" list nobody kept in sync.
|
|
290
290
|
*/
|
|
291
291
|
hiddenFields?: string[];
|
|
292
|
+
/**
|
|
293
|
+
* THE ORDER A PERSON DRAGGED THE COLUMNS INTO, by Field key (merge tranche 6a). Sparse like
|
|
294
|
+
* `widths`: a key it does not name keeps its Field's own place after the named ones, and a key
|
|
295
|
+
* whose Field is gone is skipped — a column order can never hide or invent a column.
|
|
296
|
+
*/
|
|
297
|
+
columnOrder?: string[];
|
|
292
298
|
/**
|
|
293
299
|
* The gallery's card size, remembered the same way the grid remembers its
|
|
294
300
|
* row height — a per-view look, not a global default.
|
|
@@ -480,6 +486,14 @@ interface HostLayout {
|
|
|
480
486
|
/** The authored-text slots `renderText` is asked to draw. */
|
|
481
487
|
type RenderTextSlot = "form-intro" | "form-help" | "form-thank-you";
|
|
482
488
|
interface RecordsUiHost {
|
|
489
|
+
/**
|
|
490
|
+
* TEMPORARY (one-grid merge, steps 5-8). Which table grid draws: `classic` — the default Grid
|
|
491
|
+
* as it shipped in 0.86; `merged` — the same grid with the older /data grid's control layer on
|
|
492
|
+
* it (the column header menu, the right-click Cell / Row / Column / Table sections, column
|
|
493
|
+
* settings, column order and hidden columns kept on the view). Left out: `classic`. Removed at
|
|
494
|
+
* merge step 9, when `merged` is the only grid.
|
|
495
|
+
*/
|
|
496
|
+
grid?: "classic" | "merged";
|
|
483
497
|
/** Layouts the host draws beside the package's own. See `HostLayout`. */
|
|
484
498
|
layouts?: HostLayout[];
|
|
485
499
|
/** Answer the rights question for one table. Synchronous: a screen renders now. */
|
|
@@ -1106,10 +1120,6 @@ interface CellRefusal {
|
|
|
1106
1120
|
/** The value that was being written, so Retry can write it again. */
|
|
1107
1121
|
attempted: unknown;
|
|
1108
1122
|
}
|
|
1109
|
-
/**
|
|
1110
|
-
* FLD-9. A computed Field is not editable and never will be — the store works
|
|
1111
|
-
* it out. Saying so here, once, keeps every caller from re-deciding it.
|
|
1112
|
-
*/
|
|
1113
1123
|
declare function fieldIsEditable(field: Field): boolean;
|
|
1114
1124
|
interface GridEditing {
|
|
1115
1125
|
/** The value to DRAW for one cell — the optimistic one when there is one. */
|
|
@@ -1121,7 +1131,12 @@ interface GridEditing {
|
|
|
1121
1131
|
type: (value: unknown) => void;
|
|
1122
1132
|
stateOf: (rowId: Uuid$1, key: string) => CellState;
|
|
1123
1133
|
refusalOf: (rowId: Uuid$1, key: string) => CellRefusal | null;
|
|
1124
|
-
|
|
1134
|
+
/**
|
|
1135
|
+
* Open a cell's editor. `seed` is what the person TYPED to open it (type-to-edit: a letter, an
|
|
1136
|
+
* IME composition, an Option/AltGr character): a column a person types into opens holding
|
|
1137
|
+
* exactly that, replacing the value, as every spreadsheet does; a picker column opens as usual.
|
|
1138
|
+
*/
|
|
1139
|
+
begin: (address: CellAddress, seed?: string | null) => void;
|
|
1125
1140
|
cancel: () => void;
|
|
1126
1141
|
/**
|
|
1127
1142
|
* Commit the open cell — whatever is in `draft`. `move` opens the
|
|
@@ -1592,6 +1607,28 @@ declare function handOrderSortState(args: {
|
|
|
1592
1607
|
saving?: boolean | undefined;
|
|
1593
1608
|
}): SortStateControlProps;
|
|
1594
1609
|
|
|
1610
|
+
/**
|
|
1611
|
+
* One Field becomes one column. The header is the Field's own NAME — never its
|
|
1612
|
+
* key (`names.ts`) — and the cell is the value, rendered by its parity type and
|
|
1613
|
+
* editable in place when an editing session is passed.
|
|
1614
|
+
*/
|
|
1615
|
+
declare function columnForField(field: Field$1, editing?: GridEditing | null, mayWriteRow?: (rowId: Uuid) => boolean, whyNotRow?: (rowId: Uuid) => string, look?: {
|
|
1616
|
+
format?: FieldFormatConfig;
|
|
1617
|
+
frozen?: boolean;
|
|
1618
|
+
},
|
|
1619
|
+
/** "Who changed this?" from the cell's own menu. Absent, no control is drawn. */
|
|
1620
|
+
onAskWhoChanged?: ((fieldKey: string, recordId: Uuid) => void) | undefined,
|
|
1621
|
+
/**
|
|
1622
|
+
* PRODUCTS row 10 — the provenance of a cell a MODEL owns. `cellFor` answers the page's
|
|
1623
|
+
* already-fetched badge data for one row; `onPin` is bound only where this person may
|
|
1624
|
+
* change the record, so a viewer reads every badge and is offered no control they do not
|
|
1625
|
+
* have. Absent entirely, no badge is drawn and the column looks exactly as it did.
|
|
1626
|
+
*/
|
|
1627
|
+
enrich?: {
|
|
1628
|
+
cellFor: (recordId: Uuid) => _ai_matrx_records.EnrichCell | undefined;
|
|
1629
|
+
onPin?: ((recordId: Uuid, fieldKey: string, pinned: boolean) => void | Promise<void>) | undefined;
|
|
1630
|
+
}): MatrxColumnDef<ReadRow$1>;
|
|
1631
|
+
|
|
1595
1632
|
/**
|
|
1596
1633
|
* WHAT A TABLE WITH NO COLUMNS SAYS. Named here because the gate asserts on it:
|
|
1597
1634
|
* the state it describes is what a first-time person met for two days.
|
|
@@ -1702,27 +1739,6 @@ interface GridProps {
|
|
|
1702
1739
|
className?: string | undefined;
|
|
1703
1740
|
}
|
|
1704
1741
|
declare function Grid({ tableId, pageSize, filter, onOpenRecord, onAddField, onNewRecordForm, toolbarActions, editable, presentation, onPresentationChange, viewOrder, footer, className, onAskWhoChanged, }: GridProps): react.JSX.Element;
|
|
1705
|
-
/**
|
|
1706
|
-
* One Field becomes one column. The header is the Field's own NAME — never its
|
|
1707
|
-
* key (`names.ts`) — and the cell is the value, rendered by its parity type and
|
|
1708
|
-
* editable in place when an editing session is passed.
|
|
1709
|
-
*/
|
|
1710
|
-
declare function columnForField(field: Field$1, editing?: GridEditing | null, mayWriteRow?: (rowId: Uuid) => boolean, whyNotRow?: (rowId: Uuid) => string, look?: {
|
|
1711
|
-
format?: FieldFormatConfig;
|
|
1712
|
-
frozen?: boolean;
|
|
1713
|
-
},
|
|
1714
|
-
/** "Who changed this?" from the cell's own menu. Absent, no control is drawn. */
|
|
1715
|
-
onAskWhoChanged?: ((fieldKey: string, recordId: Uuid) => void) | undefined,
|
|
1716
|
-
/**
|
|
1717
|
-
* PRODUCTS row 10 — the provenance of a cell a MODEL owns. `cellFor` answers the page's
|
|
1718
|
-
* already-fetched badge data for one row; `onPin` is bound only where this person may
|
|
1719
|
-
* change the record, so a viewer reads every badge and is offered no control they do not
|
|
1720
|
-
* have. Absent entirely, no badge is drawn and the column looks exactly as it did.
|
|
1721
|
-
*/
|
|
1722
|
-
enrich?: {
|
|
1723
|
-
cellFor: (recordId: Uuid) => _ai_matrx_records.EnrichCell | undefined;
|
|
1724
|
-
onPin?: ((recordId: Uuid, fieldKey: string, pinned: boolean) => void | Promise<void>) | undefined;
|
|
1725
|
-
}): MatrxColumnDef<ReadRow$1>;
|
|
1726
1742
|
|
|
1727
1743
|
/** Answers "what is the record with this id called", for one Field's values. */
|
|
1728
1744
|
type LabelLookup = (field: Field$1, id: string) => string | null;
|
|
@@ -2536,6 +2552,8 @@ declare const LOOK_WORDS: {
|
|
|
2536
2552
|
readonly saveToView: "Save to view";
|
|
2537
2553
|
readonly saveAsNew: "Save as new view";
|
|
2538
2554
|
readonly reset: "Reset to view";
|
|
2555
|
+
/** The one button your look's doors fold into when the toolbar row has no room for three. */
|
|
2556
|
+
readonly folded: "Your look";
|
|
2539
2557
|
readonly newName: "Name for the new view";
|
|
2540
2558
|
};
|
|
2541
2559
|
|
package/dist/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import * as react from 'react';
|
|
|
2
2
|
import { ReactNode, ComponentType, RefObject } from 'react';
|
|
3
3
|
import * as _ai_matrx_records from '@ai-matrx/records';
|
|
4
4
|
import { PermissionLevel, Table, RecordScopeContext, EnrichCell, RecordsError, Field, TableDecorations, Uuid as Uuid$1, StoreFilter, AggregateFilter, RecordDocument, ReadRow, RelationDisplay, WriteConflict, RecordsErrorCode, RecordFilter, RuleExpression, RecordsResult, SavedViewRow, DeclarableFieldKind, ParityFieldType, NewFieldDeclaration, HiddenFieldNotice, ValueEnvelope, ChecklistRequirementKind, ContextPolicy, WorkDueState, FieldSensitivity, StageRuleOnFail, SubscriptionCadence, WorkApprovalState, WorkInboxKind, FieldKind, ArchiveLane, ArchivedRow, WorkInboxView, WorkInboxItem, FormSummary, PortalCard, PortalPrincipal, PortalPreviewRow, MySubscription, DashboardBlockKind, AggregateBucket, AggregateMeasure, AggregateCompare, DashboardTarget, DashboardBlock, DashboardSummary, DocTemplateRow, DocRenderRow, QuietHours, DashboardBlockResult, ChecklistRunStep, BookingSummary, CaptureSheetFace, CaptureField, AnonTokenBinding, RecordsConfig, RecordsActor, RecordsDataSource, HistoryActor, FieldHistoryEntry } from '@ai-matrx/records';
|
|
5
|
-
import { Uuid,
|
|
5
|
+
import { Uuid, Field as Field$1, ReadRow as ReadRow$1, StoreFilter as StoreFilter$1 } from '@ai-matrx/records/react';
|
|
6
6
|
import { TableStyle, GroupAggregateSpec, GroupOrder, ChoiceColorLookup } from '@ai-matrx/design-system/data-table';
|
|
7
7
|
import { FieldFormatConfig } from '@ai-matrx/design-system/field-formats';
|
|
8
8
|
import { RecordsClient } from '@ai-matrx/records/core';
|
|
@@ -289,6 +289,12 @@ type GridPresentation = {
|
|
|
289
289
|
* on, rather than a second "fields shown" list nobody kept in sync.
|
|
290
290
|
*/
|
|
291
291
|
hiddenFields?: string[];
|
|
292
|
+
/**
|
|
293
|
+
* THE ORDER A PERSON DRAGGED THE COLUMNS INTO, by Field key (merge tranche 6a). Sparse like
|
|
294
|
+
* `widths`: a key it does not name keeps its Field's own place after the named ones, and a key
|
|
295
|
+
* whose Field is gone is skipped — a column order can never hide or invent a column.
|
|
296
|
+
*/
|
|
297
|
+
columnOrder?: string[];
|
|
292
298
|
/**
|
|
293
299
|
* The gallery's card size, remembered the same way the grid remembers its
|
|
294
300
|
* row height — a per-view look, not a global default.
|
|
@@ -480,6 +486,14 @@ interface HostLayout {
|
|
|
480
486
|
/** The authored-text slots `renderText` is asked to draw. */
|
|
481
487
|
type RenderTextSlot = "form-intro" | "form-help" | "form-thank-you";
|
|
482
488
|
interface RecordsUiHost {
|
|
489
|
+
/**
|
|
490
|
+
* TEMPORARY (one-grid merge, steps 5-8). Which table grid draws: `classic` — the default Grid
|
|
491
|
+
* as it shipped in 0.86; `merged` — the same grid with the older /data grid's control layer on
|
|
492
|
+
* it (the column header menu, the right-click Cell / Row / Column / Table sections, column
|
|
493
|
+
* settings, column order and hidden columns kept on the view). Left out: `classic`. Removed at
|
|
494
|
+
* merge step 9, when `merged` is the only grid.
|
|
495
|
+
*/
|
|
496
|
+
grid?: "classic" | "merged";
|
|
483
497
|
/** Layouts the host draws beside the package's own. See `HostLayout`. */
|
|
484
498
|
layouts?: HostLayout[];
|
|
485
499
|
/** Answer the rights question for one table. Synchronous: a screen renders now. */
|
|
@@ -1106,10 +1120,6 @@ interface CellRefusal {
|
|
|
1106
1120
|
/** The value that was being written, so Retry can write it again. */
|
|
1107
1121
|
attempted: unknown;
|
|
1108
1122
|
}
|
|
1109
|
-
/**
|
|
1110
|
-
* FLD-9. A computed Field is not editable and never will be — the store works
|
|
1111
|
-
* it out. Saying so here, once, keeps every caller from re-deciding it.
|
|
1112
|
-
*/
|
|
1113
1123
|
declare function fieldIsEditable(field: Field): boolean;
|
|
1114
1124
|
interface GridEditing {
|
|
1115
1125
|
/** The value to DRAW for one cell — the optimistic one when there is one. */
|
|
@@ -1121,7 +1131,12 @@ interface GridEditing {
|
|
|
1121
1131
|
type: (value: unknown) => void;
|
|
1122
1132
|
stateOf: (rowId: Uuid$1, key: string) => CellState;
|
|
1123
1133
|
refusalOf: (rowId: Uuid$1, key: string) => CellRefusal | null;
|
|
1124
|
-
|
|
1134
|
+
/**
|
|
1135
|
+
* Open a cell's editor. `seed` is what the person TYPED to open it (type-to-edit: a letter, an
|
|
1136
|
+
* IME composition, an Option/AltGr character): a column a person types into opens holding
|
|
1137
|
+
* exactly that, replacing the value, as every spreadsheet does; a picker column opens as usual.
|
|
1138
|
+
*/
|
|
1139
|
+
begin: (address: CellAddress, seed?: string | null) => void;
|
|
1125
1140
|
cancel: () => void;
|
|
1126
1141
|
/**
|
|
1127
1142
|
* Commit the open cell — whatever is in `draft`. `move` opens the
|
|
@@ -1592,6 +1607,28 @@ declare function handOrderSortState(args: {
|
|
|
1592
1607
|
saving?: boolean | undefined;
|
|
1593
1608
|
}): SortStateControlProps;
|
|
1594
1609
|
|
|
1610
|
+
/**
|
|
1611
|
+
* One Field becomes one column. The header is the Field's own NAME — never its
|
|
1612
|
+
* key (`names.ts`) — and the cell is the value, rendered by its parity type and
|
|
1613
|
+
* editable in place when an editing session is passed.
|
|
1614
|
+
*/
|
|
1615
|
+
declare function columnForField(field: Field$1, editing?: GridEditing | null, mayWriteRow?: (rowId: Uuid) => boolean, whyNotRow?: (rowId: Uuid) => string, look?: {
|
|
1616
|
+
format?: FieldFormatConfig;
|
|
1617
|
+
frozen?: boolean;
|
|
1618
|
+
},
|
|
1619
|
+
/** "Who changed this?" from the cell's own menu. Absent, no control is drawn. */
|
|
1620
|
+
onAskWhoChanged?: ((fieldKey: string, recordId: Uuid) => void) | undefined,
|
|
1621
|
+
/**
|
|
1622
|
+
* PRODUCTS row 10 — the provenance of a cell a MODEL owns. `cellFor` answers the page's
|
|
1623
|
+
* already-fetched badge data for one row; `onPin` is bound only where this person may
|
|
1624
|
+
* change the record, so a viewer reads every badge and is offered no control they do not
|
|
1625
|
+
* have. Absent entirely, no badge is drawn and the column looks exactly as it did.
|
|
1626
|
+
*/
|
|
1627
|
+
enrich?: {
|
|
1628
|
+
cellFor: (recordId: Uuid) => _ai_matrx_records.EnrichCell | undefined;
|
|
1629
|
+
onPin?: ((recordId: Uuid, fieldKey: string, pinned: boolean) => void | Promise<void>) | undefined;
|
|
1630
|
+
}): MatrxColumnDef<ReadRow$1>;
|
|
1631
|
+
|
|
1595
1632
|
/**
|
|
1596
1633
|
* WHAT A TABLE WITH NO COLUMNS SAYS. Named here because the gate asserts on it:
|
|
1597
1634
|
* the state it describes is what a first-time person met for two days.
|
|
@@ -1702,27 +1739,6 @@ interface GridProps {
|
|
|
1702
1739
|
className?: string | undefined;
|
|
1703
1740
|
}
|
|
1704
1741
|
declare function Grid({ tableId, pageSize, filter, onOpenRecord, onAddField, onNewRecordForm, toolbarActions, editable, presentation, onPresentationChange, viewOrder, footer, className, onAskWhoChanged, }: GridProps): react.JSX.Element;
|
|
1705
|
-
/**
|
|
1706
|
-
* One Field becomes one column. The header is the Field's own NAME — never its
|
|
1707
|
-
* key (`names.ts`) — and the cell is the value, rendered by its parity type and
|
|
1708
|
-
* editable in place when an editing session is passed.
|
|
1709
|
-
*/
|
|
1710
|
-
declare function columnForField(field: Field$1, editing?: GridEditing | null, mayWriteRow?: (rowId: Uuid) => boolean, whyNotRow?: (rowId: Uuid) => string, look?: {
|
|
1711
|
-
format?: FieldFormatConfig;
|
|
1712
|
-
frozen?: boolean;
|
|
1713
|
-
},
|
|
1714
|
-
/** "Who changed this?" from the cell's own menu. Absent, no control is drawn. */
|
|
1715
|
-
onAskWhoChanged?: ((fieldKey: string, recordId: Uuid) => void) | undefined,
|
|
1716
|
-
/**
|
|
1717
|
-
* PRODUCTS row 10 — the provenance of a cell a MODEL owns. `cellFor` answers the page's
|
|
1718
|
-
* already-fetched badge data for one row; `onPin` is bound only where this person may
|
|
1719
|
-
* change the record, so a viewer reads every badge and is offered no control they do not
|
|
1720
|
-
* have. Absent entirely, no badge is drawn and the column looks exactly as it did.
|
|
1721
|
-
*/
|
|
1722
|
-
enrich?: {
|
|
1723
|
-
cellFor: (recordId: Uuid) => _ai_matrx_records.EnrichCell | undefined;
|
|
1724
|
-
onPin?: ((recordId: Uuid, fieldKey: string, pinned: boolean) => void | Promise<void>) | undefined;
|
|
1725
|
-
}): MatrxColumnDef<ReadRow$1>;
|
|
1726
1742
|
|
|
1727
1743
|
/** Answers "what is the record with this id called", for one Field's values. */
|
|
1728
1744
|
type LabelLookup = (field: Field$1, id: string) => string | null;
|
|
@@ -2536,6 +2552,8 @@ declare const LOOK_WORDS: {
|
|
|
2536
2552
|
readonly saveToView: "Save to view";
|
|
2537
2553
|
readonly saveAsNew: "Save as new view";
|
|
2538
2554
|
readonly reset: "Reset to view";
|
|
2555
|
+
/** The one button your look's doors fold into when the toolbar row has no room for three. */
|
|
2556
|
+
readonly folded: "Your look";
|
|
2539
2557
|
readonly newName: "Name for the new view";
|
|
2540
2558
|
};
|
|
2541
2559
|
|