@ai-matrx/records-ui 0.92.2 → 0.93.2
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 +41 -0
- package/dist/index.cjs +5721 -5314
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +42 -5
- package/dist/index.d.ts +42 -5
- package/dist/index.js +5098 -4691
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -559,8 +559,12 @@ interface HostLayout {
|
|
|
559
559
|
toolbarSlot?: HTMLElement | null | undefined;
|
|
560
560
|
}) => ReactNode;
|
|
561
561
|
}
|
|
562
|
-
/**
|
|
563
|
-
|
|
562
|
+
/**
|
|
563
|
+
* The authored-text slots `renderText` is asked to draw. `cell`: a long-text cell of the merged
|
|
564
|
+
* grid and the whole-text dialog's preview — the host may return block content there (the grid
|
|
565
|
+
* clips it to the row); the form slots take phrasing content only.
|
|
566
|
+
*/
|
|
567
|
+
type RenderTextSlot = "form-intro" | "form-help" | "form-thank-you" | "cell";
|
|
564
568
|
|
|
565
569
|
interface RecordsUiHost {
|
|
566
570
|
/**
|
|
@@ -666,6 +670,21 @@ interface RecordsUiHost {
|
|
|
666
670
|
ok: false;
|
|
667
671
|
reason: string;
|
|
668
672
|
}>;
|
|
673
|
+
/**
|
|
674
|
+
* OPTIONAL. THE HOST'S OWN FILE WINDOW (one-grid merge, inventory: the older grid's
|
|
675
|
+
* AttachmentInput). An attachment cell adds files the person already holds through the host's
|
|
676
|
+
* file picker — Airtable's "Attach" over your own files — rather than a second browser this
|
|
677
|
+
* package would invent. `multiple`: the column holds several files; `accept`: the native
|
|
678
|
+
* `accept` list, when the column restricts types. Resolves the host's file ids (the store turns
|
|
679
|
+
* each into its kernel File record at the write door), or `null` when the person cancelled.
|
|
680
|
+
*
|
|
681
|
+
* Unbound, the editor offers `upload` alone; with neither bound it says no file store is bound
|
|
682
|
+
* (`NO_UPLOAD_REASON`) — never a dead button.
|
|
683
|
+
*/
|
|
684
|
+
pickFiles?: (ask: {
|
|
685
|
+
multiple: boolean;
|
|
686
|
+
accept?: string;
|
|
687
|
+
}) => Promise<Uuid$1[] | null>;
|
|
669
688
|
/**
|
|
670
689
|
* Where this app serves its PUBLIC pages from, when that is not the origin
|
|
671
690
|
* the screen is running on. A form's link is built here, so an owner copying
|
|
@@ -1821,6 +1840,13 @@ interface GridProps {
|
|
|
1821
1840
|
* the store compiles both into the one WHERE clause.
|
|
1822
1841
|
*/
|
|
1823
1842
|
filter?: StoreFilter$1 | undefined;
|
|
1843
|
+
/**
|
|
1844
|
+
* Clear the question `filter` carries (the view's own filter), for the "No rows match these
|
|
1845
|
+
* filters" screen's Clear filters. Left out, that screen clears only the grid's own search and
|
|
1846
|
+
* column filters, and when `filter` alone holds every row back it says so instead of offering a
|
|
1847
|
+
* button that could not clear it.
|
|
1848
|
+
*/
|
|
1849
|
+
onClearFilter?: (() => void) | undefined;
|
|
1824
1850
|
/** Opened from a row's handle, Space or the row menu. A host that has a record page passes its own. */
|
|
1825
1851
|
onOpenRecord?: ((recordId: Uuid) => void) | undefined;
|
|
1826
1852
|
/**
|
|
@@ -1889,7 +1915,7 @@ interface GridProps {
|
|
|
1889
1915
|
footer?: FooterPlacement | undefined;
|
|
1890
1916
|
className?: string | undefined;
|
|
1891
1917
|
}
|
|
1892
|
-
declare function Grid({ tableId, pageSize, filter, onOpenRecord, openRecordId, onAddField, onNewRecordForm, toolbarActions, editable, presentation, onPresentationChange, viewOrder, footer, className, onAskWhoChanged, }: GridProps): react.JSX.Element;
|
|
1918
|
+
declare function Grid({ tableId, pageSize, filter, onClearFilter, onOpenRecord, openRecordId, onAddField, onNewRecordForm, toolbarActions, editable, presentation, onPresentationChange, viewOrder, footer, className, onAskWhoChanged, }: GridProps): react.JSX.Element;
|
|
1893
1919
|
|
|
1894
1920
|
/** Answers "what is the record with this id called", for one Field's values. */
|
|
1895
1921
|
type LabelLookup = (field: Field$1, id: string) => string | null;
|
|
@@ -2436,7 +2462,7 @@ declare function ProvenanceBadge({ document, fieldKey }: {
|
|
|
2436
2462
|
* export, a chat line) keeps calling `renderValue` with no resolver and says
|
|
2437
2463
|
* "Loading…" rather than printing an id.
|
|
2438
2464
|
*/
|
|
2439
|
-
declare function RecordValue({ field, value, document, format, withheld, }: {
|
|
2465
|
+
declare function RecordValue({ field, value, document, format, withheld, inCell, }: {
|
|
2440
2466
|
field: Field;
|
|
2441
2467
|
value: unknown;
|
|
2442
2468
|
document?: RecordDocument | undefined;
|
|
@@ -2459,6 +2485,12 @@ declare function RecordValue({ field, value, document, format, withheld, }: {
|
|
|
2459
2485
|
* means the cell is empty (`withheld.tsx`).
|
|
2460
2486
|
*/
|
|
2461
2487
|
withheld?: HiddenFieldNotice | null | undefined;
|
|
2488
|
+
/**
|
|
2489
|
+
* Drawn in a GRID CELL. In the merged grid a long-text cell reads through the host's text
|
|
2490
|
+
* renderer (`RecordsUiHost.renderText`, slot `cell` — markdown, formatted), clipped to the row;
|
|
2491
|
+
* unbound, the words as written.
|
|
2492
|
+
*/
|
|
2493
|
+
inCell?: boolean | undefined;
|
|
2462
2494
|
}): react.JSX.Element;
|
|
2463
2495
|
/**
|
|
2464
2496
|
* WHAT ONE CARD SAYS — the kanban's, the calendar's, the gallery's and the pipeline's alike, so
|
|
@@ -2771,6 +2803,11 @@ interface ViewSwitcherProps {
|
|
|
2771
2803
|
* store's Rule shape). The grid, the board's headings and the numbers all ask it.
|
|
2772
2804
|
*/
|
|
2773
2805
|
filter?: StoreFilter | undefined;
|
|
2806
|
+
/**
|
|
2807
|
+
* Clear the question `filter` carries, for the "No rows match these filters" screen of every
|
|
2808
|
+
* layout. Left out, that screen says the view's filter holds every row back without a button.
|
|
2809
|
+
*/
|
|
2810
|
+
onClearFilter?: (() => void) | undefined;
|
|
2774
2811
|
/**
|
|
2775
2812
|
* The HOST layout showing now (`RecordsUiHost.layouts`, by id), or null for the
|
|
2776
2813
|
* package's own. Controlled by the page, because the address names it.
|
|
@@ -2826,7 +2863,7 @@ declare function useViewRecords(view: SavedViewSpec, pageSize?: number, filter?:
|
|
|
2826
2863
|
*/
|
|
2827
2864
|
membership: string;
|
|
2828
2865
|
};
|
|
2829
|
-
declare function ViewSwitcher({ view, onLayoutChange, onViewChange, onOpenRecord, openRecordId, onMoved, onNewRecordForm, onAskWhoChanged, pageSize, titleField, filter, hostLayout, onHostLayoutChange, chooser, openExport, viewId, onOrderPlaced, footer, className, }: ViewSwitcherProps): react.JSX.Element;
|
|
2866
|
+
declare function ViewSwitcher({ view, onLayoutChange, onViewChange, onOpenRecord, openRecordId, onMoved, onNewRecordForm, onAskWhoChanged, pageSize, titleField, filter, onClearFilter, hostLayout, onHostLayoutChange, chooser, openExport, viewId, onOrderPlaced, footer, className, }: ViewSwitcherProps): react.JSX.Element;
|
|
2830
2867
|
|
|
2831
2868
|
/** What the screen says above the list, so nobody has to be told twice that nothing was destroyed. */
|
|
2832
2869
|
declare const ARCHIVE_MEANS = "Archiving never destroys anything. A record you remove from the grid waits here until somebody brings it back.";
|
package/dist/index.d.ts
CHANGED
|
@@ -559,8 +559,12 @@ interface HostLayout {
|
|
|
559
559
|
toolbarSlot?: HTMLElement | null | undefined;
|
|
560
560
|
}) => ReactNode;
|
|
561
561
|
}
|
|
562
|
-
/**
|
|
563
|
-
|
|
562
|
+
/**
|
|
563
|
+
* The authored-text slots `renderText` is asked to draw. `cell`: a long-text cell of the merged
|
|
564
|
+
* grid and the whole-text dialog's preview — the host may return block content there (the grid
|
|
565
|
+
* clips it to the row); the form slots take phrasing content only.
|
|
566
|
+
*/
|
|
567
|
+
type RenderTextSlot = "form-intro" | "form-help" | "form-thank-you" | "cell";
|
|
564
568
|
|
|
565
569
|
interface RecordsUiHost {
|
|
566
570
|
/**
|
|
@@ -666,6 +670,21 @@ interface RecordsUiHost {
|
|
|
666
670
|
ok: false;
|
|
667
671
|
reason: string;
|
|
668
672
|
}>;
|
|
673
|
+
/**
|
|
674
|
+
* OPTIONAL. THE HOST'S OWN FILE WINDOW (one-grid merge, inventory: the older grid's
|
|
675
|
+
* AttachmentInput). An attachment cell adds files the person already holds through the host's
|
|
676
|
+
* file picker — Airtable's "Attach" over your own files — rather than a second browser this
|
|
677
|
+
* package would invent. `multiple`: the column holds several files; `accept`: the native
|
|
678
|
+
* `accept` list, when the column restricts types. Resolves the host's file ids (the store turns
|
|
679
|
+
* each into its kernel File record at the write door), or `null` when the person cancelled.
|
|
680
|
+
*
|
|
681
|
+
* Unbound, the editor offers `upload` alone; with neither bound it says no file store is bound
|
|
682
|
+
* (`NO_UPLOAD_REASON`) — never a dead button.
|
|
683
|
+
*/
|
|
684
|
+
pickFiles?: (ask: {
|
|
685
|
+
multiple: boolean;
|
|
686
|
+
accept?: string;
|
|
687
|
+
}) => Promise<Uuid$1[] | null>;
|
|
669
688
|
/**
|
|
670
689
|
* Where this app serves its PUBLIC pages from, when that is not the origin
|
|
671
690
|
* the screen is running on. A form's link is built here, so an owner copying
|
|
@@ -1821,6 +1840,13 @@ interface GridProps {
|
|
|
1821
1840
|
* the store compiles both into the one WHERE clause.
|
|
1822
1841
|
*/
|
|
1823
1842
|
filter?: StoreFilter$1 | undefined;
|
|
1843
|
+
/**
|
|
1844
|
+
* Clear the question `filter` carries (the view's own filter), for the "No rows match these
|
|
1845
|
+
* filters" screen's Clear filters. Left out, that screen clears only the grid's own search and
|
|
1846
|
+
* column filters, and when `filter` alone holds every row back it says so instead of offering a
|
|
1847
|
+
* button that could not clear it.
|
|
1848
|
+
*/
|
|
1849
|
+
onClearFilter?: (() => void) | undefined;
|
|
1824
1850
|
/** Opened from a row's handle, Space or the row menu. A host that has a record page passes its own. */
|
|
1825
1851
|
onOpenRecord?: ((recordId: Uuid) => void) | undefined;
|
|
1826
1852
|
/**
|
|
@@ -1889,7 +1915,7 @@ interface GridProps {
|
|
|
1889
1915
|
footer?: FooterPlacement | undefined;
|
|
1890
1916
|
className?: string | undefined;
|
|
1891
1917
|
}
|
|
1892
|
-
declare function Grid({ tableId, pageSize, filter, onOpenRecord, openRecordId, onAddField, onNewRecordForm, toolbarActions, editable, presentation, onPresentationChange, viewOrder, footer, className, onAskWhoChanged, }: GridProps): react.JSX.Element;
|
|
1918
|
+
declare function Grid({ tableId, pageSize, filter, onClearFilter, onOpenRecord, openRecordId, onAddField, onNewRecordForm, toolbarActions, editable, presentation, onPresentationChange, viewOrder, footer, className, onAskWhoChanged, }: GridProps): react.JSX.Element;
|
|
1893
1919
|
|
|
1894
1920
|
/** Answers "what is the record with this id called", for one Field's values. */
|
|
1895
1921
|
type LabelLookup = (field: Field$1, id: string) => string | null;
|
|
@@ -2436,7 +2462,7 @@ declare function ProvenanceBadge({ document, fieldKey }: {
|
|
|
2436
2462
|
* export, a chat line) keeps calling `renderValue` with no resolver and says
|
|
2437
2463
|
* "Loading…" rather than printing an id.
|
|
2438
2464
|
*/
|
|
2439
|
-
declare function RecordValue({ field, value, document, format, withheld, }: {
|
|
2465
|
+
declare function RecordValue({ field, value, document, format, withheld, inCell, }: {
|
|
2440
2466
|
field: Field;
|
|
2441
2467
|
value: unknown;
|
|
2442
2468
|
document?: RecordDocument | undefined;
|
|
@@ -2459,6 +2485,12 @@ declare function RecordValue({ field, value, document, format, withheld, }: {
|
|
|
2459
2485
|
* means the cell is empty (`withheld.tsx`).
|
|
2460
2486
|
*/
|
|
2461
2487
|
withheld?: HiddenFieldNotice | null | undefined;
|
|
2488
|
+
/**
|
|
2489
|
+
* Drawn in a GRID CELL. In the merged grid a long-text cell reads through the host's text
|
|
2490
|
+
* renderer (`RecordsUiHost.renderText`, slot `cell` — markdown, formatted), clipped to the row;
|
|
2491
|
+
* unbound, the words as written.
|
|
2492
|
+
*/
|
|
2493
|
+
inCell?: boolean | undefined;
|
|
2462
2494
|
}): react.JSX.Element;
|
|
2463
2495
|
/**
|
|
2464
2496
|
* WHAT ONE CARD SAYS — the kanban's, the calendar's, the gallery's and the pipeline's alike, so
|
|
@@ -2771,6 +2803,11 @@ interface ViewSwitcherProps {
|
|
|
2771
2803
|
* store's Rule shape). The grid, the board's headings and the numbers all ask it.
|
|
2772
2804
|
*/
|
|
2773
2805
|
filter?: StoreFilter | undefined;
|
|
2806
|
+
/**
|
|
2807
|
+
* Clear the question `filter` carries, for the "No rows match these filters" screen of every
|
|
2808
|
+
* layout. Left out, that screen says the view's filter holds every row back without a button.
|
|
2809
|
+
*/
|
|
2810
|
+
onClearFilter?: (() => void) | undefined;
|
|
2774
2811
|
/**
|
|
2775
2812
|
* The HOST layout showing now (`RecordsUiHost.layouts`, by id), or null for the
|
|
2776
2813
|
* package's own. Controlled by the page, because the address names it.
|
|
@@ -2826,7 +2863,7 @@ declare function useViewRecords(view: SavedViewSpec, pageSize?: number, filter?:
|
|
|
2826
2863
|
*/
|
|
2827
2864
|
membership: string;
|
|
2828
2865
|
};
|
|
2829
|
-
declare function ViewSwitcher({ view, onLayoutChange, onViewChange, onOpenRecord, openRecordId, onMoved, onNewRecordForm, onAskWhoChanged, pageSize, titleField, filter, hostLayout, onHostLayoutChange, chooser, openExport, viewId, onOrderPlaced, footer, className, }: ViewSwitcherProps): react.JSX.Element;
|
|
2866
|
+
declare function ViewSwitcher({ view, onLayoutChange, onViewChange, onOpenRecord, openRecordId, onMoved, onNewRecordForm, onAskWhoChanged, pageSize, titleField, filter, onClearFilter, hostLayout, onHostLayoutChange, chooser, openExport, viewId, onOrderPlaced, footer, className, }: ViewSwitcherProps): react.JSX.Element;
|
|
2830
2867
|
|
|
2831
2868
|
/** What the screen says above the list, so nobody has to be told twice that nothing was destroyed. */
|
|
2832
2869
|
declare const ARCHIVE_MEANS = "Archiving never destroys anything. A record you remove from the grid waits here until somebody brings it back.";
|