foldkit-data-grid 0.1.4 → 0.2.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/dist/crud.d.mts CHANGED
@@ -1,19 +1,32 @@
1
- import { l as ColumnSpec, n as RowModel, r as RowStatus, u as Columns } from "./rows-BfrGLtaa.mjs";
1
+ import { l as ColumnSpec, n as RowModel, r as RowStatus, u as Columns } from "./rows-TYJdJ7tK.mjs";
2
2
  import { DisplayColumn, DisplayWords } from "foldkit-crud";
3
3
  import { Page, RemoteData } from "foldkit-remote";
4
4
  //#region src/crud.d.ts
5
5
  /** What a grid adds to a listed member's column: where it stands, its size, and editing. */
6
6
  type ColumnOptions<Row> = Partial<Omit<ColumnSpec<Row, string>, 'value'>>;
7
+ /**
8
+ * The grid's columns for a list: one per listed member, keyed by its member
9
+ * key, headed by its label, its value the member's text as its Display says
10
+ * it. A member whose Display is hidden (usually the id) starts hidden: it is
11
+ * read, and can be shown, but is not drawn. `columns` adds what only the
12
+ * grid knows to a member's column: pinning, widths, `edit`, or another
13
+ * header; what it gives wins over what the list says.
14
+ */
15
+ declare const columns: <Key extends string, Row extends { readonly [K in Key]: unknown; }, Options extends { readonly [K in Key]?: ColumnOptions<Row>; }>(list: {
16
+ readonly columns: ReadonlyArray<DisplayColumn<Key>>;
17
+ readonly Row: Row;
18
+ }, options?: {
19
+ readonly words?: DisplayWords;
20
+ readonly columns?: Options;
21
+ }) => Columns<Row, { readonly [K in Key]: ColumnSpec<Row, string> & Options[K]; }>;
22
+ declare const rows: <Row>(page: RemoteData<Page<Row>>, key: (row: Row) => string) => RowModel<Row>;
23
+ /** Where a page stands, for the grid to say. */
24
+ declare const status: <Row>(page: RemoteData<Page<Row>>) => RowStatus;
7
25
  export declare const GridCrud: {
8
- columns: <Key extends string, Row extends { readonly [K in Key]: unknown; }, Options extends { readonly [K in Key]?: ColumnOptions<Row>; }>(list: {
9
- readonly columns: ReadonlyArray<DisplayColumn<Key>>;
10
- readonly Row: Row;
11
- }, options?: {
12
- readonly words?: DisplayWords;
13
- readonly columns?: Options;
14
- }) => Columns<Row, { readonly [K in Key]: ColumnSpec<Row, string> & Options[K]; }>;
15
- rows: <Row>(page: RemoteData<Page<Row>>, key: (row: Row) => string) => RowModel<Row>;
16
- status: <Row>(page: RemoteData<Page<Row>>) => RowStatus;
26
+ columns: typeof columns;
27
+ rows: typeof rows;
28
+ status: typeof status;
17
29
  };
18
30
  //#endregion
31
+ export {};
19
32
  //# sourceMappingURL=crud.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"crud.d.mts","names":[],"sources":["../src/crud.ts"],"mappings":";;;;;KAcK,cAAc,OAAO,QAAQ,KAAK,WAAW;qBA+ErC;EApEX,UAAA,oBACA,wBAAwB,KAAK,kBAE7B,4BAA4B,KAAK,OAAO,cAAc,SAAM;aAE3C,SAAS,cAAc,cAAc;aAAgB,KAAK;KAAK;aAC5D,QAAQ;aAAuB,UAAU;QAC5D,QAAQ,iBAAiB,KAAK,MAAM,WAAW,eAAe,QAAQ;EA4B3D,OAAA,KAAG,MAAQ,WAAW,KAAK,OAAK,MAAQ,KAAK,mBAAiB,SAAS;EAuBrE,SAAA,KAAG,MAAQ,WAAW,KAAK,UAAQ"}
1
+ {"version":3,"file":"crud.d.mts","names":[],"sources":["../src/crud.ts"],"mappings":";;;;;KAcK,cAAc,OAAO,QAAQ,KAAK,WAAW;;;;;;;;;cAU5C,UACJ,oBACA,wBAAwB,KAAK,kBAE7B,4BAA4B,KAAK,OAAO,cAAc,SAAM;WAE3C,SAAS,cAAc,cAAc;WAAgB,KAAK;GAAK;WAC5D,QAAQ;WAAuB,UAAU;MAC5D,QAAQ,iBAAiB,KAAK,MAAM,WAAW,eAAe,QAAQ;cA4BnE,OAAQ,KAAG,MAAQ,WAAW,KAAK,OAAK,MAAQ,KAAK,mBAAiB,SAAS;;cAuB/E,SAAU,KAAG,MAAQ,WAAW,KAAK,UAAQ;qBAUtC"}