@greendrake/ui-data 0.3.0 → 0.5.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/README.md CHANGED
@@ -21,7 +21,7 @@ No build step, no `.d.ts`: `exports` points at `src/main.ts` and the consumer's
21
21
 
22
22
  ## Styling contract
23
23
 
24
- As for `@greendrake/ui`: the app loads `@greendrake/theme` and defines the app-provided custom properties its README lists. The table and panel additionally read the optional `--cell-padding`, `--list-row-padding`, `--row-border-bottom`, `--row-select-color` and `--row-select-color-hover` from that list, each with a fallback.
24
+ As for `@greendrake/ui`: the app defines the custom properties that package's README lists as read with no fallback — this one reads a subset of them. The table and panel additionally read `--cell-padding`, `--list-row-padding`, `--row-border-bottom`, `--row-select-color` and `--row-select-color-hover`, each with a fallback.
25
25
 
26
26
  Layout: `InfiniteScrollTable` measures its own container to decide how many rows to render, so its height must flow top-down. Place it in a flex column whose items have `min-height: 0`, or pass `visibleHeight`; a content-driven height makes the measurement loop until every row is rendered.
27
27
 
@@ -46,7 +46,7 @@ type LoaderFunction<T> = (params: LoaderParams, loading: Ref<boolean>, backgroun
46
46
 
47
47
  `loading` is the table's spinner flag, handed to the loader to set around its call. The spinner also shows while the viewport overlaps rows not yet buffered, so a loader that never touches `loading` still gets one for gaps.
48
48
 
49
- `background` is true when nobody asked for the load — a live binding re-reading after a server push or a dropped connection (`refresh(true)`). What that means for the request is the loader's to decide; with `@greendrake/vue-api` it is `backgroundCall(background)`, a call that shows no spinner and raises no error prompt.
49
+ `background` is true when nobody asked for the load — a live binding re-reading after a server push or a dropped connection (`refresh(true)`). What that means for the request is the loader's to decide — typically a call that shows no spinner and raises no error prompt.
50
50
 
51
51
  `T` must satisfy `Record<string, unknown>`, so declare row types as type aliases (`type User = { … }`), not interfaces: an interface carries no implicit index signature and is rejected where the table's generic is inferred.
52
52
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@greendrake/ui-data",
3
- "version": "0.3.0",
3
+ "version": "0.5.0",
4
4
  "description": "Data-heavy dashboard components: virtualized InfiniteScrollTable, CrudPanel/MasterDetail, record editing and the admin-CRUD kit",
5
5
  "license": "MIT",
6
6
  "author": "Eugene Greendrake <eugene@greendrake.nz>",
@@ -33,14 +33,14 @@
33
33
  },
34
34
  "prettier": "@greendrake/dev-config/prettier",
35
35
  "dependencies": {
36
- "@greendrake/scss-kit": "0.3.0",
37
- "@greendrake/ui": "0.3.0"
36
+ "@greendrake/scss-kit": "0.5.0",
37
+ "@greendrake/ui": "0.5.0"
38
38
  },
39
39
  "peerDependencies": {
40
40
  "vue": "^3.5.34"
41
41
  },
42
42
  "devDependencies": {
43
- "@greendrake/dev-config": "0.3.0",
43
+ "@greendrake/dev-config": "0.5.0",
44
44
  "typescript": "6.0.3",
45
45
  "vue": "^3.5.34",
46
46
  "vue-tsc": "^2.2.0"
package/src/listLoader.ts CHANGED
@@ -17,7 +17,7 @@ export type PageArgs = {
17
17
  // exactly the methods with server-side search/sort support; the rest get the
18
18
  // bare offset/limit window. Extra filter fields ride the `fetch` closure, and
19
19
  // so does what a background read costs — the flag is handed on verbatim:
20
- // listLoader((args, background) => api.call('admin.thread.list', [{ ...args, type }], backgroundCall(background)))
20
+ // listLoader((args, background) => listThreads({ ...args, type }, background))
21
21
  export const listLoader =
22
22
  <T>(fetch: (args: PageArgs, background: boolean) => Promise<LoaderResponse<T>>, sort?: SortState) =>
23
23
  (params: LoaderParams, _loading: Ref<boolean>, background: boolean): Promise<LoaderResponse<T>> =>