@ai-matrx/records-ui 0.89.3 → 0.90.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 +53 -0
- package/dist/index.cjs +5053 -4162
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +77 -1
- package/dist/index.d.ts +77 -1
- package/dist/index.js +4789 -3889
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
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
|
-
import { PermissionLevel, Table, RecordScopeContext, EnrichCell, RecordsError, Field, TableDecorations, Uuid as Uuid$1, StoreFilter, AggregateFilter,
|
|
4
|
+
import { PermissionLevel, Table, RecordScopeContext, EnrichCell, RecordsError, Field, TableDecorations, Uuid as Uuid$1, RowAction, RecordDocument, StoreFilter, AggregateFilter, 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
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';
|
|
@@ -413,6 +413,49 @@ declare function styleFromDecorations(decorations: TableDecorations | null | und
|
|
|
413
413
|
*/
|
|
414
414
|
declare function resolveTableStyle(decorations: TableDecorations | null | undefined, fields: readonly Field[], viewStyle: TableStyle | undefined): TableStyle;
|
|
415
415
|
|
|
416
|
+
/** One record as the grid shows it: its id, its name (the row label) and its masked document. */
|
|
417
|
+
interface GridContextRecord {
|
|
418
|
+
id: Uuid$1;
|
|
419
|
+
title: string;
|
|
420
|
+
document: RecordDocument;
|
|
421
|
+
}
|
|
422
|
+
interface GridContextSnapshot {
|
|
423
|
+
tableId: Uuid$1;
|
|
424
|
+
tableName: string;
|
|
425
|
+
/** The table's own description (`metadata.description`), when it has one. */
|
|
426
|
+
tableDescription: string | null;
|
|
427
|
+
/** The Field key that names each record (`title_field`), or null. */
|
|
428
|
+
titleField: string | null;
|
|
429
|
+
/** The columns in the order the grid draws them (hidden columns left out). */
|
|
430
|
+
fields: Field[];
|
|
431
|
+
/** The table's row actions as the store lists them (update and agent). */
|
|
432
|
+
rowActions: RowAction[];
|
|
433
|
+
/** May this person change records here at all. */
|
|
434
|
+
canWrite: boolean;
|
|
435
|
+
/** The cell the cursor is on: its record, its Field key and the value drawn in it. */
|
|
436
|
+
currentCell: {
|
|
437
|
+
rowId: Uuid$1;
|
|
438
|
+
key: string;
|
|
439
|
+
value: unknown;
|
|
440
|
+
} | null;
|
|
441
|
+
/** The record the cursor is on (or whose editor is open). */
|
|
442
|
+
currentRow: GridContextRecord | null;
|
|
443
|
+
/** A block of more than one cell: Excel/Sheets TSV with a header line of Field keys. */
|
|
444
|
+
selectedRange: {
|
|
445
|
+
tsv: string;
|
|
446
|
+
cellCount: number;
|
|
447
|
+
rowIds: Uuid$1[];
|
|
448
|
+
keys: string[];
|
|
449
|
+
} | null;
|
|
450
|
+
/** The rows ticked with the row boxes. */
|
|
451
|
+
selectedRows: GridContextRecord[];
|
|
452
|
+
/** The page of records on screen, in screen order. */
|
|
453
|
+
visibleRows: GridContextRecord[];
|
|
454
|
+
/** How many records match the search and filters, when the store said. */
|
|
455
|
+
total: number | null;
|
|
456
|
+
search: string;
|
|
457
|
+
}
|
|
458
|
+
|
|
416
459
|
/**
|
|
417
460
|
* What a person may do to one table. The four words and the ladder are the
|
|
418
461
|
* store's (`rights.ts`), not ours.
|
|
@@ -485,6 +528,7 @@ interface HostLayout {
|
|
|
485
528
|
}
|
|
486
529
|
/** The authored-text slots `renderText` is asked to draw. */
|
|
487
530
|
type RenderTextSlot = "form-intro" | "form-help" | "form-thank-you";
|
|
531
|
+
|
|
488
532
|
interface RecordsUiHost {
|
|
489
533
|
/**
|
|
490
534
|
* TEMPORARY (one-grid merge, steps 5-8). Which table grid draws: `classic` — the default Grid
|
|
@@ -496,6 +540,38 @@ interface RecordsUiHost {
|
|
|
496
540
|
grid?: "classic" | "merged";
|
|
497
541
|
/** Layouts the host draws beside the package's own. See `HostLayout`. */
|
|
498
542
|
layouts?: HostLayout[];
|
|
543
|
+
/**
|
|
544
|
+
* OPTIONAL. CLEAN A PASTED PIECE OF HTML INTO PLAIN TEXT (merge tranche 6m, inventory A7).
|
|
545
|
+
*
|
|
546
|
+
* A cell pasted from a web page or an email carries its tags, entities and inline styles. The
|
|
547
|
+
* platform has ONE cleaner (the host's content-cleanup), so this is a port rather than a second
|
|
548
|
+
* one here. The merged grid offers "Clean HTML" in a text cell's right-click Cell section and in
|
|
549
|
+
* the whole-text editor; the cleaned text is written through the grid's own one-cell write (one
|
|
550
|
+
* undo step). Unbound, the item is ABSENT, never dead.
|
|
551
|
+
*/
|
|
552
|
+
cleanText?: (text: string) => string;
|
|
553
|
+
/**
|
|
554
|
+
* OPTIONAL. WHERE THE PERSON IS IN THE GRID, told as it changes (merge tranche 6l, inventory H1).
|
|
555
|
+
*
|
|
556
|
+
* An agent in the host's side chat is asked about "this cell", "these rows", "the table". Only
|
|
557
|
+
* the grid knows the table, its columns, the cell the cursor is on, the selected block, the
|
|
558
|
+
* ticked rows, the rows on screen and the search. The merged grid calls this after any of them
|
|
559
|
+
* changes (identical snapshots are not repeated); the host builds its agent scope from it. The
|
|
560
|
+
* snapshot carries the store's own `Field` records and the masked documents exactly as drawn.
|
|
561
|
+
* Unbound, nothing is built.
|
|
562
|
+
*/
|
|
563
|
+
onGridContext?: (snapshot: GridContextSnapshot) => void;
|
|
564
|
+
/**
|
|
565
|
+
* OPTIONAL. THE PLATFORM'S ONE ICON PICKER (merge tranche 6j, inventory G2). A row action's
|
|
566
|
+
* button may carry an icon from the canonical icon set; that set and its picker are the host's
|
|
567
|
+
* (this package carries no icon library). Unbound, the row-action editor draws no icon control
|
|
568
|
+
* and keeps whatever icon an action already carries.
|
|
569
|
+
*/
|
|
570
|
+
iconPicker?: (props: {
|
|
571
|
+
value: string;
|
|
572
|
+
label: string;
|
|
573
|
+
onChange: (name: string) => void;
|
|
574
|
+
}) => ReactNode;
|
|
499
575
|
/** Answer the rights question for one table. Synchronous: a screen renders now. */
|
|
500
576
|
rights?: (table: Table) => TableRights;
|
|
501
577
|
/** Where a record's own page lives, when the host has one. A peek is used when it does not. */
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
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
|
-
import { PermissionLevel, Table, RecordScopeContext, EnrichCell, RecordsError, Field, TableDecorations, Uuid as Uuid$1, StoreFilter, AggregateFilter,
|
|
4
|
+
import { PermissionLevel, Table, RecordScopeContext, EnrichCell, RecordsError, Field, TableDecorations, Uuid as Uuid$1, RowAction, RecordDocument, StoreFilter, AggregateFilter, 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
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';
|
|
@@ -413,6 +413,49 @@ declare function styleFromDecorations(decorations: TableDecorations | null | und
|
|
|
413
413
|
*/
|
|
414
414
|
declare function resolveTableStyle(decorations: TableDecorations | null | undefined, fields: readonly Field[], viewStyle: TableStyle | undefined): TableStyle;
|
|
415
415
|
|
|
416
|
+
/** One record as the grid shows it: its id, its name (the row label) and its masked document. */
|
|
417
|
+
interface GridContextRecord {
|
|
418
|
+
id: Uuid$1;
|
|
419
|
+
title: string;
|
|
420
|
+
document: RecordDocument;
|
|
421
|
+
}
|
|
422
|
+
interface GridContextSnapshot {
|
|
423
|
+
tableId: Uuid$1;
|
|
424
|
+
tableName: string;
|
|
425
|
+
/** The table's own description (`metadata.description`), when it has one. */
|
|
426
|
+
tableDescription: string | null;
|
|
427
|
+
/** The Field key that names each record (`title_field`), or null. */
|
|
428
|
+
titleField: string | null;
|
|
429
|
+
/** The columns in the order the grid draws them (hidden columns left out). */
|
|
430
|
+
fields: Field[];
|
|
431
|
+
/** The table's row actions as the store lists them (update and agent). */
|
|
432
|
+
rowActions: RowAction[];
|
|
433
|
+
/** May this person change records here at all. */
|
|
434
|
+
canWrite: boolean;
|
|
435
|
+
/** The cell the cursor is on: its record, its Field key and the value drawn in it. */
|
|
436
|
+
currentCell: {
|
|
437
|
+
rowId: Uuid$1;
|
|
438
|
+
key: string;
|
|
439
|
+
value: unknown;
|
|
440
|
+
} | null;
|
|
441
|
+
/** The record the cursor is on (or whose editor is open). */
|
|
442
|
+
currentRow: GridContextRecord | null;
|
|
443
|
+
/** A block of more than one cell: Excel/Sheets TSV with a header line of Field keys. */
|
|
444
|
+
selectedRange: {
|
|
445
|
+
tsv: string;
|
|
446
|
+
cellCount: number;
|
|
447
|
+
rowIds: Uuid$1[];
|
|
448
|
+
keys: string[];
|
|
449
|
+
} | null;
|
|
450
|
+
/** The rows ticked with the row boxes. */
|
|
451
|
+
selectedRows: GridContextRecord[];
|
|
452
|
+
/** The page of records on screen, in screen order. */
|
|
453
|
+
visibleRows: GridContextRecord[];
|
|
454
|
+
/** How many records match the search and filters, when the store said. */
|
|
455
|
+
total: number | null;
|
|
456
|
+
search: string;
|
|
457
|
+
}
|
|
458
|
+
|
|
416
459
|
/**
|
|
417
460
|
* What a person may do to one table. The four words and the ladder are the
|
|
418
461
|
* store's (`rights.ts`), not ours.
|
|
@@ -485,6 +528,7 @@ interface HostLayout {
|
|
|
485
528
|
}
|
|
486
529
|
/** The authored-text slots `renderText` is asked to draw. */
|
|
487
530
|
type RenderTextSlot = "form-intro" | "form-help" | "form-thank-you";
|
|
531
|
+
|
|
488
532
|
interface RecordsUiHost {
|
|
489
533
|
/**
|
|
490
534
|
* TEMPORARY (one-grid merge, steps 5-8). Which table grid draws: `classic` — the default Grid
|
|
@@ -496,6 +540,38 @@ interface RecordsUiHost {
|
|
|
496
540
|
grid?: "classic" | "merged";
|
|
497
541
|
/** Layouts the host draws beside the package's own. See `HostLayout`. */
|
|
498
542
|
layouts?: HostLayout[];
|
|
543
|
+
/**
|
|
544
|
+
* OPTIONAL. CLEAN A PASTED PIECE OF HTML INTO PLAIN TEXT (merge tranche 6m, inventory A7).
|
|
545
|
+
*
|
|
546
|
+
* A cell pasted from a web page or an email carries its tags, entities and inline styles. The
|
|
547
|
+
* platform has ONE cleaner (the host's content-cleanup), so this is a port rather than a second
|
|
548
|
+
* one here. The merged grid offers "Clean HTML" in a text cell's right-click Cell section and in
|
|
549
|
+
* the whole-text editor; the cleaned text is written through the grid's own one-cell write (one
|
|
550
|
+
* undo step). Unbound, the item is ABSENT, never dead.
|
|
551
|
+
*/
|
|
552
|
+
cleanText?: (text: string) => string;
|
|
553
|
+
/**
|
|
554
|
+
* OPTIONAL. WHERE THE PERSON IS IN THE GRID, told as it changes (merge tranche 6l, inventory H1).
|
|
555
|
+
*
|
|
556
|
+
* An agent in the host's side chat is asked about "this cell", "these rows", "the table". Only
|
|
557
|
+
* the grid knows the table, its columns, the cell the cursor is on, the selected block, the
|
|
558
|
+
* ticked rows, the rows on screen and the search. The merged grid calls this after any of them
|
|
559
|
+
* changes (identical snapshots are not repeated); the host builds its agent scope from it. The
|
|
560
|
+
* snapshot carries the store's own `Field` records and the masked documents exactly as drawn.
|
|
561
|
+
* Unbound, nothing is built.
|
|
562
|
+
*/
|
|
563
|
+
onGridContext?: (snapshot: GridContextSnapshot) => void;
|
|
564
|
+
/**
|
|
565
|
+
* OPTIONAL. THE PLATFORM'S ONE ICON PICKER (merge tranche 6j, inventory G2). A row action's
|
|
566
|
+
* button may carry an icon from the canonical icon set; that set and its picker are the host's
|
|
567
|
+
* (this package carries no icon library). Unbound, the row-action editor draws no icon control
|
|
568
|
+
* and keeps whatever icon an action already carries.
|
|
569
|
+
*/
|
|
570
|
+
iconPicker?: (props: {
|
|
571
|
+
value: string;
|
|
572
|
+
label: string;
|
|
573
|
+
onChange: (name: string) => void;
|
|
574
|
+
}) => ReactNode;
|
|
499
575
|
/** Answer the rights question for one table. Synchronous: a screen renders now. */
|
|
500
576
|
rights?: (table: Table) => TableRights;
|
|
501
577
|
/** Where a record's own page lives, when the host has one. A peek is used when it does not. */
|