@storepass/components 0.7.0 → 0.8.1
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 +34 -0
- package/README.md +21 -14
- package/dist/components/Accordion/index.js +1 -1
- package/dist/components/AlertDialog/index.js +1 -1
- package/dist/components/Avatar/index.js +1 -1
- package/dist/components/Badge/index.js +1 -1
- package/dist/components/Breadcrumbs/index.js +1 -1
- package/dist/components/Button/index.js +1 -1
- package/dist/components/ButtonGroup/index.js +1 -1
- package/dist/components/Card/index.js +1 -1
- package/dist/components/Carousel/index.js +1 -1
- package/dist/components/Checkbox/index.js +1 -1
- package/dist/components/Collapsible/index.js +1 -1
- package/dist/components/Combobox/index.js +1 -1
- package/dist/components/Command/index.js +1 -1
- package/dist/components/DataGrid/DataGrid.d.ts +30 -5
- package/dist/components/DataGrid/DataGrid.d.ts.map +1 -1
- package/dist/components/DataGrid/fixtures.d.ts +6 -0
- package/dist/components/DataGrid/fixtures.d.ts.map +1 -1
- package/dist/components/DataGrid/index.d.ts +3 -1
- package/dist/components/DataGrid/index.d.ts.map +1 -1
- package/dist/components/DataGrid/index.js +1 -116
- package/dist/components/DataGrid/parts.d.ts.map +1 -1
- package/dist/components/DataGrid/query.d.ts +29 -2
- package/dist/components/DataGrid/query.d.ts.map +1 -1
- package/dist/components/DataGrid/server.d.ts +52 -0
- package/dist/components/DataGrid/server.d.ts.map +1 -0
- package/dist/components/DatePicker/index.js +1 -1
- package/dist/components/Dialog/index.js +1 -1
- package/dist/components/Drawer/index.js +1 -1
- package/dist/components/DropdownMenu/index.js +1 -1
- package/dist/components/FeaturedIcon/index.js +1 -1
- package/dist/components/Field/index.js +1 -1
- package/dist/components/FileUpload/index.js +1 -1
- package/dist/components/Footer/index.js +1 -1
- package/dist/components/Form/index.js +1 -1
- package/dist/components/Gloss/Gloss.d.ts +6 -0
- package/dist/components/Gloss/Gloss.d.ts.map +1 -0
- package/dist/components/Gloss/datetime.d.ts +24 -0
- package/dist/components/Gloss/datetime.d.ts.map +1 -0
- package/dist/components/Gloss/disclosure.d.ts +35 -0
- package/dist/components/Gloss/disclosure.d.ts.map +1 -0
- package/dist/components/Gloss/index.d.ts +2 -0
- package/dist/components/Gloss/index.d.ts.map +1 -0
- package/dist/components/Gloss/index.js +1 -0
- package/dist/components/Gloss/money.d.ts +33 -0
- package/dist/components/Gloss/money.d.ts.map +1 -0
- package/dist/components/Gloss/read.d.ts +25 -0
- package/dist/components/Gloss/read.d.ts.map +1 -0
- package/dist/components/Icon/index.js +1 -1
- package/dist/components/ImperativeDialog/index.js +1 -1
- package/dist/components/InlineAlert/index.js +1 -1
- package/dist/components/Input/index.js +1 -1
- package/dist/components/InputGroup/index.js +1 -1
- package/dist/components/Item/index.js +1 -1
- package/dist/components/Kbd/index.js +1 -1
- package/dist/components/Label/index.js +1 -1
- package/dist/components/LoadingIndicator/index.js +1 -1
- package/dist/components/MoneyAmount/index.js +1 -1
- package/dist/components/Navbar/index.js +1 -1
- package/dist/components/NumberField/index.js +1 -1
- package/dist/components/PageHeading/index.js +1 -1
- package/dist/components/PageLayout/index.js +1 -1
- package/dist/components/Pagination/index.js +1 -1
- package/dist/components/Panel/index.js +1 -1
- package/dist/components/PinInput/index.js +1 -1
- package/dist/components/Progress/index.js +1 -1
- package/dist/components/RadioGroup/index.js +1 -1
- package/dist/components/Rating/index.js +1 -1
- package/dist/components/Select/index.js +1 -1
- package/dist/components/Settings/index.js +1 -1
- package/dist/components/Sidebar/index.js +1 -1
- package/dist/components/Slider/index.js +1 -1
- package/dist/components/Table/index.js +1 -1
- package/dist/components/Tabs/index.js +1 -1
- package/dist/components/Tags/index.js +1 -1
- package/dist/components/Text/index.js +1 -1
- package/dist/components/Textarea/index.js +1 -1
- package/dist/components/Toast/index.js +1 -1
- package/dist/components/Toggle/index.js +1 -1
- package/dist/components/Tooltip/index.js +1 -1
- package/dist/components/VideoDialog/index.js +1 -1
- package/dist/components/index.d.ts +2 -1
- package/dist/components/index.d.ts.map +1 -1
- package/dist/index-0k26fpsr.js +2 -0
- package/dist/index-0x3exa89.js +1 -0
- package/dist/index-12m8pd4x.js +1 -0
- package/dist/index-1n7ke68v.js +1 -0
- package/dist/index-207wxbj2.js +1 -0
- package/dist/index-2cbcq1ak.js +1 -0
- package/dist/index-39gyjttt.js +2 -0
- package/dist/index-3nj3vfyf.js +1 -0
- package/dist/index-3qz0mz4s.js +1 -0
- package/dist/index-3xevqp5j.js +1 -0
- package/dist/index-3y89rrea.js +1 -0
- package/dist/index-3yf2yecs.js +1 -0
- package/dist/index-4p3htnp4.js +1 -0
- package/dist/index-5k17f917.js +0 -0
- package/dist/index-626k16zr.js +0 -0
- package/dist/index-6bayqdg2.js +0 -0
- package/dist/index-6hjt8vvj.js +2 -0
- package/dist/index-6wj27sgg.js +1 -0
- package/dist/index-77e650nh.js +0 -0
- package/dist/index-79863hrw.js +1 -0
- package/dist/index-7nb0kh49.js +1 -0
- package/dist/index-80vgqvbb.js +1 -0
- package/dist/index-8bvab16j.js +1 -0
- package/dist/index-8e82vsma.js +1 -0
- package/dist/index-99dvdfty.js +122 -0
- package/dist/index-9w3q13x9.js +1 -0
- package/dist/index-a5xdyq4r.js +1 -0
- package/dist/index-awgxtt2c.js +2 -0
- package/dist/index-aym8f7kk.js +1 -0
- package/dist/index-bfj32kdy.js +1 -0
- package/dist/index-czhrx6qc.js +1 -0
- package/dist/index-dha7m2cb.js +2 -0
- package/dist/index-dyqfzdwm.js +1 -0
- package/dist/index-dzrvgand.js +1 -0
- package/dist/index-e3jk5qws.js +1 -0
- package/dist/index-e57a5m40.js +1 -0
- package/dist/index-f7d8em7k.js +1 -0
- package/dist/index-fse0pbfb.js +1 -0
- package/dist/index-gerw8wbs.js +1 -0
- package/dist/index-h0evkh77.js +2 -0
- package/dist/index-h0t7cb54.js +2 -0
- package/dist/index-heb6hak3.js +2 -0
- package/dist/index-hjxh9rqy.js +1 -0
- package/dist/index-jbzvn81j.js +1 -0
- package/dist/index-jk047paq.js +1 -0
- package/dist/index-m532p9sh.js +0 -0
- package/dist/index-mq3xffc2.js +0 -0
- package/dist/index-mtn2afhs.js +1 -0
- package/dist/index-n11bq2ez.js +1 -0
- package/dist/index-n7fq9hv6.js +1 -0
- package/dist/index-nbp2rcyj.js +1 -0
- package/dist/index-qkjr9w4c.js +1 -0
- package/dist/index-s3543vem.js +0 -0
- package/dist/index-s3888qb0.js +1 -0
- package/dist/index-s4wzrj6b.js +1 -0
- package/dist/index-s7qkq2f8.js +1 -0
- package/dist/index-s7ttw4jf.js +1 -0
- package/dist/index-sxaagzqf.js +1 -0
- package/dist/index-warqb7rs.js +2 -0
- package/dist/index-whmj1gae.js +1 -0
- package/dist/index-wv5wqvwb.js +1 -0
- package/dist/index-xqphyc4g.js +1 -0
- package/dist/index-yeehx7kc.js +2 -0
- package/dist/index-yzm4k2ye.js +1 -0
- package/dist/index-zke98cz9.js +1 -0
- package/dist/index-zxjkp0aj.js +1 -0
- package/dist/index.js +1 -1
- package/dist/lib/utils.js +1 -2
- package/package.json +5 -1
- package/dist/index-6mfb0zwd.js +0 -2
- package/dist/index-9gwtrg7s.js +0 -2
- package/dist/index-a7vw7m0b.js +0 -2
- package/dist/index-js40dzxy.js +0 -2
- package/dist/index-jxbz6exn.js +0 -2
- package/dist/index-mjpsfjd0.js +0 -2
- package/dist/index-r3vmx2km.js +0 -2
- package/dist/index-xpvf3pk5.js +0 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,39 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.8.1
|
|
4
|
+
|
|
5
|
+
PR #17 is the only pull request merged since 0.8.0.
|
|
6
|
+
|
|
7
|
+
### Improved
|
|
8
|
+
|
|
9
|
+
- DataGrid footer totals copy each header cell's width and sit under the scrollport. They stay aligned with their columns after horizontal scroll and after a column resize.
|
|
10
|
+
- Page scroll keeps the row drawer in the viewport. The drawer anchors to the row sheet below the toolbar.
|
|
11
|
+
- The focus ring is painted inside the cell. It stays under the sticky header and inside pinned columns.
|
|
12
|
+
- Pinned columns paint an opaque card past the hairline, so scrolled text does not show through the seam.
|
|
13
|
+
- A disabled row keeps full opacity and uses the disabled text and fill. That fill is separate from the hover fill.
|
|
14
|
+
- The search field can shrink, so Sort and View stay on the search row.
|
|
15
|
+
|
|
16
|
+
### Compatibility notes
|
|
17
|
+
|
|
18
|
+
- `SELECT_COLUMN_WIDTH` changed from 40 to 48. Callers that offset pinned columns by `SELECT_COLUMN_WIDTH` need 48.
|
|
19
|
+
|
|
20
|
+
## 0.8.0
|
|
21
|
+
|
|
22
|
+
### Added
|
|
23
|
+
|
|
24
|
+
- DataGrid can take a server `result` — one page already filtered, sorted, and sliced — instead of every row. `toGridRequest(query)` is the request to send, and `resolveGridResult` applies that page. Grids that pass `rows` still filter, sort, and page locally.
|
|
25
|
+
- Server search waits briefly after the last keystroke before it changes the query. Clearing the field applies at once.
|
|
26
|
+
- Gloss: a short reading of a datetime or an amount, with the exact value on hover or focus. A live datetime updates when its compact label changes. Instant strings must end in `Z` or a UTC offset. Compact money truncates, and the precise time always names its zone.
|
|
27
|
+
|
|
28
|
+
### Improved
|
|
29
|
+
|
|
30
|
+
- While a server page refreshes, the grid keeps the current rows and range on screen and ignores selection on those stale rows. An empty stale page recovers instead of sticking.
|
|
31
|
+
- The All tab uses the server total. With a facet selected, tab counts come from `facetCounts`.
|
|
32
|
+
|
|
33
|
+
### Compatibility notes
|
|
34
|
+
|
|
35
|
+
- `GridModel` facet `count` is `number | null`. It is null when a server result leaves `facetCounts` out.
|
|
36
|
+
|
|
3
37
|
## 0.7.0
|
|
4
38
|
|
|
5
39
|
### Added
|
package/README.md
CHANGED
|
@@ -83,10 +83,12 @@ Tool versions are managed with mise. From this repository:
|
|
|
83
83
|
|
|
84
84
|
```sh
|
|
85
85
|
mise install
|
|
86
|
-
bun install
|
|
86
|
+
doppler run -- bun install
|
|
87
87
|
bun run dev
|
|
88
88
|
```
|
|
89
89
|
|
|
90
|
+
`.npmrc` installs Font Awesome Pro from `npm.fontawesome.com` and reads the token from `FONTAWESOME_AUTH_TOKEN`. `doppler run` injects that variable. Do not commit the token.
|
|
91
|
+
|
|
90
92
|
Storybook runs at http://localhost:6006. Stories live beside components in `src/components/<Name>/<Name>.stories.tsx`; theme and control-size showcases live in `src/styles/`.
|
|
91
93
|
|
|
92
94
|
| Command | Purpose |
|
|
@@ -112,20 +114,25 @@ Color ramps are generated by `scripts/gen-scale.ts`. Change the generator, run `
|
|
|
112
114
|
|
|
113
115
|
## Release
|
|
114
116
|
|
|
115
|
-
|
|
117
|
+
A release is a pull request that bumps `version` in `package.json` and adds a `## <version>` section to [CHANGELOG.md](./CHANGELOG.md). Merging that pull request to `main` publishes `@storepass/components`, tags `v<version>`, and creates a GitHub Release whose notes are that changelog section.
|
|
116
118
|
|
|
117
|
-
|
|
118
|
-
bun run check
|
|
119
|
-
bun test
|
|
120
|
-
bun run test
|
|
121
|
-
bun run build
|
|
122
|
-
bun publish --dry-run
|
|
123
|
-
```
|
|
119
|
+
Cloud agents cut a release by opening that pull request. Do not publish from a laptop, and do not push the tag.
|
|
124
120
|
|
|
125
|
-
|
|
121
|
+
Each release step is idempotent. Publish runs only when `npm view` shows that `@storepass/components@<version>` is not on npm yet. The tag and GitHub Release are created only when that release is missing. A version that is already published and released is a no-op, including after a partial failure. `0.7.0` is already on npm. There is not yet a GitHub Release for `v0.7.0`, so the first run on `main` creates that release from the changelog and does not publish again.
|
|
126
122
|
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
123
|
+
[`.github/workflows/ci.yml`](./.github/workflows/ci.yml) runs on pull requests and on pushes to `main`, on Blacksmith (`blacksmith-4vcpu-ubuntu-2404`). It installs dependencies, checks, tests, builds, and runs `npm pack --dry-run`.
|
|
124
|
+
|
|
125
|
+
[`.github/workflows/release.yml`](./.github/workflows/release.yml) runs on pushes to `main` and from `workflow_dispatch`. When the version is not on npm yet, it installs, checks, tests, and builds, then runs `npm publish --access public` on Node 24. It then creates the tag and GitHub Release if that release is missing. A concurrency group keeps two releases from racing.
|
|
126
|
+
|
|
127
|
+
Publish uses npm trusted publishing (GitHub OIDC). There is no `NPM_TOKEN`. Trusted publishing only accepts tokens from GitHub-hosted runners, so the publish job stays on `ubuntu-latest` while CI uses Blacksmith. This repository is private, so the workflow does not pass `--provenance` and provenance is not attached.
|
|
128
|
+
|
|
129
|
+
The package ships `dist/`, package metadata, the README, and the changelog.
|
|
130
|
+
|
|
131
|
+
### One-time setup
|
|
130
132
|
|
|
131
|
-
|
|
133
|
+
1. **npm trusted publisher** for `@storepass/components`: GitHub Actions, organization `Storepass`, repository `components`, workflow filename `release.yml`. Leave the environment name empty. Allow direct `npm publish` (a publisher created now defaults to staged publish only). The workflow file has to be on `main` before this is saved. A new publisher expires if its first successful publish does not happen within two days. Merging this setup does not publish, because `v0.7.0` already exists, so create the publisher when the next version bump is ready to merge.
|
|
134
|
+
2. **Doppler → GitHub** already syncs `FONTAWESOME_AUTH_TOKEN` into this repository's Actions secrets. Workflows read `secrets.FONTAWESOME_AUTH_TOKEN`. Do not add a Doppler CLI step or `DOPPLER_TOKEN`.
|
|
135
|
+
3. **Rotate the Font Awesome token** that used to live in `.npmrc`, then update the Doppler secret. Git history still has the old value until it is revoked.
|
|
136
|
+
4. **Blacksmith:** install the Blacksmith GitHub app on `Storepass/components` if it is not already installed. CI cannot start on Blacksmith runners until then.
|
|
137
|
+
5. **Railway:** set `FONTAWESOME_AUTH_TOKEN` on the `components` service (the same Doppler secret). Railway's Dockerfile builder cannot mount BuildKit secrets — it only accepts `ARG`, which ends up in image history, and a `Dockerfile` at the repo root forces that builder — so the service builds with Railpack. `railpack.json` names that variable as an install secret. Railpack mounts it with BuildKit (`id=FONTAWESOME_AUTH_TOKEN`) for `bun install` only and does not save secrets in the image. The build then deletes `.npmrc`, so the published image has neither the token nor `.npmrc`. A sealed variable is not copied into a pull-request environment, so the preview stays red until the variable exists there. `docker/Dockerfile` is the same secret mount for a BuildKit `docker build` outside Railway.
|
|
138
|
+
6. **Optional:** protect `v*` tags, and allow GitHub Actions to create them so the release workflow can still tag.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{bo,xo,ho,Ra,Sa,Ta,ka}from"../../index-gerw8wbs.js";import"../../index-6hjt8vvj.js";export{Ra as Accordion,ka as AccordionContent,Sa as AccordionItem,Ta as AccordionTrigger,bo as accordionItemVariants,ho as accordionPanelVariants,xo as accordionTriggerVariants};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{hn,yn,vn,Pn,Cn,u}from"../../index-zxjkp0aj.js";import"../../index-6hjt8vvj.js";export{u as AlertDialog,Cn as alertDialogActionsVariants,Pn as alertDialogDescriptionVariants,hn as alertDialogOverlayVariants,yn as alertDialogPopupVariants,vn as alertDialogTitleVariants};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{yo,L,Z}from"../../index-a5xdyq4r.js";import"../../index-6hjt8vvj.js";export{L as Avatar,Z as AvatarGroup,yo as avatarVariants};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{vo,f}from"../../index-aym8f7kk.js";import"../../index-6hjt8vvj.js";export{f as Badge,vo as badgeVariants};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import{Ia,Da,Va,Fa,Oa,Ma,La}from"../../index-dyqfzdwm.js";import"../../index-s3543vem.js";import"../../index-yeehx7kc.js";import"../../index-6hjt8vvj.js";export{La as BreadcrumbEllipsis,Va as BreadcrumbItem,Fa as BreadcrumbLink,Da as BreadcrumbList,Oa as BreadcrumbPage,Ma as BreadcrumbSeparator,Ia as Breadcrumbs};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import"../../index-626k16zr.js";import{o}from"../../index-39gyjttt.js";import"../../index-6hjt8vvj.js";export{o as Button};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{an,ma,ga}from"../../index-8e82vsma.js";import"../../index-6hjt8vvj.js";export{ma as ButtonGroup,ga as ButtonGroupSeparator,an as buttonGroupVariants};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import"../../index-mq3xffc2.js";import{wn,Re,Nn,nn,sn,ln,dn,pn,Rn,Se,Sn,un}from"../../index-h0t7cb54.js";import"../../index-6hjt8vvj.js";export{Re as Card,pn as CardAction,Se as CardContent,dn as CardDescription,un as CardFooter,nn as CardHeader,sn as CardHeaderContent,ln as CardTitle,Rn as cardContentVariants,Sn as cardFooterVariants,Nn as cardHeaderVariants,wn as cardVariants};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{S,fa,ba,xa,ha,ya,va}from"../../index-s7ttw4jf.js";import"../../index-39gyjttt.js";import"../../index-yeehx7kc.js";import"../../index-6hjt8vvj.js";export{fa as Carousel,ba as CarouselContent,va as CarouselDots,xa as CarouselItem,ya as CarouselNext,ha as CarouselPrevious,S as useCarousel};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{At,Bt,F}from"../../index-sxaagzqf.js";import"../../index-yeehx7kc.js";import"../../index-6hjt8vvj.js";export{F as Checkbox,Bt as checkboxIndicatorVariants,At as checkboxVariants};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import{zt,Gt,_t,Ht,Wt,$t,Ut,Pa}from"../../index-3qz0mz4s.js";import"../../index-s3543vem.js";import"../../index-yeehx7kc.js";import"../../index-6hjt8vvj.js";export{Pa as Collapsible,Ut as CollapsibleChevron,$t as CollapsibleContent,Wt as CollapsiblePanel,_t as CollapsibleRoot,Ht as CollapsibleTrigger,Gt as collapsiblePanelVariants,zt as collapsibleTriggerVariants};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{Kt,jt,Te,Xt,Yt,Qt,Zt,Jt,qt,eo,to,Ca}from"../../index-n11bq2ez.js";import"../../index-s3543vem.js";import"../../index-yeehx7kc.js";import"../../index-6hjt8vvj.js";export{Ca as Combobox,Te as comboboxButtonVariants,to as comboboxChipRemoveVariants,eo as comboboxChipVariants,qt as comboboxChipsVariants,Xt as comboboxContentVariants,Qt as comboboxEmptyVariants,Jt as comboboxGroupLabelVariants,jt as comboboxInputGroupVariants,Kt as comboboxInputVariants,Yt as comboboxItemVariants,Zt as comboboxStatusVariants};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{io,so,lo,co,po,uo,mo,go,fo,wa}from"../../index-2cbcq1ak.js";import"../../index-fse0pbfb.js";import"../../index-e3jk5qws.js";import"../../index-6hjt8vvj.js";export{wa as Command,co as commandEmptyVariants,po as commandGroupVariants,so as commandInputVariants,fo as commandInputWrapperVariants,mo as commandItemVariants,lo as commandListVariants,uo as commandSeparatorVariants,go as commandShortcutVariants,io as commandVariants};
|
|
@@ -3,12 +3,28 @@ import type { ControlSize } from "../../lib/controlSize";
|
|
|
3
3
|
import type { GridSchema } from "./columns";
|
|
4
4
|
import { type RowAction } from "./parts";
|
|
5
5
|
import { type Density, type GridQuery } from "./query";
|
|
6
|
+
import { type GridResult } from "./server";
|
|
6
7
|
export type { ControlSize } from "../../lib/controlSize";
|
|
7
8
|
export type { RowAction } from "./parts";
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
/**
|
|
10
|
+
* `loading` has no rows yet and shows skeletons. `refreshing` keeps the
|
|
11
|
+
* current rows on screen, dimmed, while a new server page loads.
|
|
12
|
+
*/
|
|
13
|
+
export type GridStatus = "ready" | "loading" | "refreshing" | "error";
|
|
14
|
+
/**
|
|
15
|
+
* Where rows come from. `rows` hands the grid every row and it filters, sorts,
|
|
16
|
+
* and pages them itself. `result` hands it one page the server already
|
|
17
|
+
* filtered, sorted, and sliced for `toGridRequest(query)`.
|
|
18
|
+
*/
|
|
19
|
+
export type GridData<TRow, S extends GridSchema<TRow>> = {
|
|
11
20
|
rows: readonly TRow[];
|
|
21
|
+
result?: never;
|
|
22
|
+
} | {
|
|
23
|
+
result: GridResult<TRow, S>;
|
|
24
|
+
rows?: never;
|
|
25
|
+
};
|
|
26
|
+
export type DataGridProps<TRow, S extends GridSchema<TRow>> = GridData<TRow, S> & {
|
|
27
|
+
schema: S;
|
|
12
28
|
query: GridQuery<S>;
|
|
13
29
|
onQueryChange: (query: GridQuery<S>) => void;
|
|
14
30
|
label: string;
|
|
@@ -21,6 +37,12 @@ export type DataGridProps<TRow, S extends GridSchema<TRow>> = {
|
|
|
21
37
|
empty?: ReactNode;
|
|
22
38
|
/** Placeholder for the toolbar search field. */
|
|
23
39
|
searchPlaceholder?: string;
|
|
40
|
+
/**
|
|
41
|
+
* With a server `result`, how long the search field waits after the last
|
|
42
|
+
* keystroke before it changes the query, so typing sends one request.
|
|
43
|
+
* Clearing the search applies at once. Client rows always search at once.
|
|
44
|
+
*/
|
|
45
|
+
searchDelay?: number;
|
|
24
46
|
inspector?: (row: TRow) => ReactNode;
|
|
25
47
|
/**
|
|
26
48
|
* Per-row menu, shown as a trailing "…" column pinned to the right edge and
|
|
@@ -43,7 +65,10 @@ export type DataGridProps<TRow, S extends GridSchema<TRow>> = {
|
|
|
43
65
|
* for a column narrower than the panel.
|
|
44
66
|
*/
|
|
45
67
|
frame?: "full" | "contained";
|
|
46
|
-
/**
|
|
68
|
+
/**
|
|
69
|
+
* Panel the row drawer must stay inside. The drawer anchors to the row
|
|
70
|
+
* sheet below the toolbar, and this element keeps it from covering the shell.
|
|
71
|
+
*/
|
|
47
72
|
drawerContainer?: RefObject<HTMLElement | null>;
|
|
48
73
|
/** `grid` adds a hairline between columns, like a spreadsheet. */
|
|
49
74
|
lines?: "rows" | "grid";
|
|
@@ -63,5 +88,5 @@ export type GridRowCue = {
|
|
|
63
88
|
* Inventory grid: a query-driven table with search, filters, multi-sort,
|
|
64
89
|
* pinned columns, row actions and keyboard navigation.
|
|
65
90
|
*/
|
|
66
|
-
export declare function DataGrid<TRow, S extends GridSchema<TRow>>({ schema, rows, query, onQueryChange, label, density, onDensityChange, controlSize, status, error, onRetry, empty, searchPlaceholder, inspector, rowActions, actions, toolbar, footer, scroll, frame, drawerContainer, lines, crosshair, rowCue, className, }: DataGridProps<TRow, S>): import("react").JSX.Element;
|
|
91
|
+
export declare function DataGrid<TRow, S extends GridSchema<TRow>>({ schema, rows, result, query, onQueryChange, label, density, onDensityChange, controlSize, status, error, onRetry, empty, searchPlaceholder, searchDelay, inspector, rowActions, actions, toolbar, footer, scroll, frame, drawerContainer, lines, crosshair, rowCue, className, }: DataGridProps<TRow, S>): import("react").JSX.Element;
|
|
67
92
|
//# sourceMappingURL=DataGrid.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DataGrid.d.ts","sourceRoot":"","sources":["../../../src/components/DataGrid/DataGrid.tsx"],"names":[],"mappings":"AAMA,OAAO,EAMN,KAAK,SAAS,EACd,KAAK,SAAS,EAOd,MAAM,OAAO,CAAC;AACf,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAoBzD,OAAO,KAAK,EAAa,UAAU,EAAE,MAAM,WAAW,CAAC;AACvD,OAAO,EAMN,KAAK,SAAS,EAMd,MAAM,SAAS,CAAC;AACjB,OAAO,EAQN,KAAK,OAAO,EAMZ,KAAK,SAAS,EAKd,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"DataGrid.d.ts","sourceRoot":"","sources":["../../../src/components/DataGrid/DataGrid.tsx"],"names":[],"mappings":"AAMA,OAAO,EAMN,KAAK,SAAS,EACd,KAAK,SAAS,EAOd,MAAM,OAAO,CAAC;AACf,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAoBzD,OAAO,KAAK,EAAa,UAAU,EAAE,MAAM,WAAW,CAAC;AACvD,OAAO,EAMN,KAAK,SAAS,EAMd,MAAM,SAAS,CAAC;AACjB,OAAO,EAQN,KAAK,OAAO,EAMZ,KAAK,SAAS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AI,CAAC,EAAE,EAC1D,MAAM,EACN,IAAI,EACJ,MAAM,EACN,KAAK,EACL,aAAa,EACb,KAAK,EACL,OAAmB,EACnB,eAAe,EACf,WAAkB,EAClB,MAAgB,EAChB,KAAK,EACL,OAAO,EACP,KAAK,EACL,iBAA6B,EAC7B,WAAiB,EACjB,SAAS,EACT,UAAU,EACV,OAAO,EACP,OAAO,EACP,MAAM,EACN,MAAe,EACf,KAAK,EACL,eAAe,EACf,KAAc,EACd,SAAiB,EACjB,MAAM,EACN,SAAS,GACT,EAAE,aAAa,CAAC,IAAI,EAAE,CAAC,CAAC,+BAmvCxB"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { AvatarStackValue, AvatarValue } from "./columns";
|
|
2
|
+
import type { GridRequest, GridResult } from "./server";
|
|
2
3
|
export type Listing = {
|
|
3
4
|
id: string;
|
|
4
5
|
name: string;
|
|
@@ -20,4 +21,9 @@ export type Listing = {
|
|
|
20
21
|
};
|
|
21
22
|
export declare const inventory: import("./columns").GridSchema<Listing, readonly [import("./columns").EntityColumn<Listing, "card", true, true, true>, import("./columns").EnumColumn<Listing, "status", "draft" | "paused" | "live" | "archived", true, true, true, true>, import("./columns").TextColumn<Listing, "sku", true, true, true>, import("./columns").TextColumn<Listing, "number", true, true, true>, import("./columns").TextColumn<Listing, "rarity", true, true, true>, import("./columns").EnumColumn<Listing, "condition", "NM" | "LP" | "MP", false, true, true, true>, import("./columns").NumberColumn<Listing, "qty", true, true, true>, import("./columns").MoneyColumn<Listing, "price", true, true, true>, import("./columns").MoneyColumn<Listing, "marketPrice", true, true, true>, import("./columns").SparklineColumn<Listing, "lastSold", true>, import("./columns").AvatarColumn<Listing, "seller", true, true, true>, import("./columns").AvatarsColumn<Listing, "watchers", true>, import("./columns").TagsColumn<Listing, "tags", true, true, true>]>;
|
|
22
23
|
export declare function inventoryRows(count: number): Listing[];
|
|
24
|
+
/**
|
|
25
|
+
* A stand-in for an inventory endpoint: answers a grid request the way a
|
|
26
|
+
* server would, with one page, the total, facet counts, and footer totals.
|
|
27
|
+
*/
|
|
28
|
+
export declare function serveInventory(rows: readonly Listing[], request: GridRequest<typeof inventory>): GridResult<Listing, typeof inventory>;
|
|
23
29
|
//# sourceMappingURL=fixtures.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fixtures.d.ts","sourceRoot":"","sources":["../../../src/components/DataGrid/fixtures.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAG/D,MAAM,MAAM,OAAO,GAAG;IACrB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,GAAG,OAAO,GAAG,QAAQ,GAAG,UAAU,CAAC;IACjD,SAAS,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IAC9B,GAAG,EAAE,MAAM,CAAC;IACZ,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,SAAS,MAAM,EAAE,CAAC;IAC5B,MAAM,EAAE,WAAW,CAAC;IACpB,QAAQ,EAAE,gBAAgB,CAAC;IAC3B,IAAI,EAAE,SAAS,MAAM,EAAE,CAAC;IACxB,UAAU,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,eAAO,MAAM,SAAS,y/BAoGpB,CAAC;AAyVH,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,EAAE,CAqEtD"}
|
|
1
|
+
{"version":3,"file":"fixtures.d.ts","sourceRoot":"","sources":["../../../src/components/DataGrid/fixtures.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAG/D,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAExD,MAAM,MAAM,OAAO,GAAG;IACrB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,GAAG,OAAO,GAAG,QAAQ,GAAG,UAAU,CAAC;IACjD,SAAS,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IAC9B,GAAG,EAAE,MAAM,CAAC;IACZ,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,SAAS,MAAM,EAAE,CAAC;IAC5B,MAAM,EAAE,WAAW,CAAC;IACpB,QAAQ,EAAE,gBAAgB,CAAC;IAC3B,IAAI,EAAE,SAAS,MAAM,EAAE,CAAC;IACxB,UAAU,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,eAAO,MAAM,SAAS,y/BAoGpB,CAAC;AAyVH,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,EAAE,CAqEtD;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAC7B,IAAI,EAAE,SAAS,OAAO,EAAE,EACxB,OAAO,EAAE,WAAW,CAAC,OAAO,SAAS,CAAC,GACpC,UAAU,CAAC,OAAO,EAAE,OAAO,SAAS,CAAC,CAqBvC"}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
export { AvatarCell, AvatarGroupCell, EmptyCell, EntityCell, MoneyCell, SparklineCell, StatusCell, TagsCell, } from "./cells";
|
|
2
2
|
export type { AnyColumn, AvatarStackValue, AvatarValue, EntityValue, GridSchema, LinkValue, } from "./columns";
|
|
3
3
|
export { column, defineGrid } from "./columns";
|
|
4
|
-
export type { ControlSize, DataGridProps, GridStatus, RowAction, } from "./DataGrid";
|
|
4
|
+
export type { ControlSize, DataGridProps, GridData, GridStatus, RowAction, } from "./DataGrid";
|
|
5
5
|
export { DataGrid } from "./DataGrid";
|
|
6
6
|
export type { ViewMenuColumn } from "./parts";
|
|
7
7
|
export { ColumnMenu, FilterButton, FilterChips, formatCount, GridPagination, RowActionsMenu, SearchField, SelectionBar, SortMenu, ViewMenu, } from "./parts";
|
|
8
8
|
export type { AggregateValue, ColumnLayout, Density, FilterDraft, FilterOf, GridAction, GridModel, GridQuery, GridQueryWire, ParseDrop, ParseGridQueryResult, ResolvedSelection, Selection, SortDir, } from "./query";
|
|
9
9
|
export { ACTIONS_COLUMN_WIDTH, applyGridQuery, DENSITY_ROW_PY, emptyGridQuery, PAGE_SIZE_DEFAULT, PAGE_SIZE_MAX, parseGridQuery, SELECT_COLUMN_WIDTH, serializeGridQuery, transitionGridQuery, } from "./query";
|
|
10
|
+
export type { GridRequest, GridRequestFilter, GridResult } from "./server";
|
|
11
|
+
export { resolveGridResult, toGridRequest } from "./server";
|
|
10
12
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/DataGrid/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,UAAU,EACV,eAAe,EACf,SAAS,EACT,UAAU,EACV,SAAS,EACT,aAAa,EACb,UAAU,EACV,QAAQ,GACR,MAAM,SAAS,CAAC;AACjB,YAAY,EACX,SAAS,EACT,gBAAgB,EAChB,WAAW,EACX,WAAW,EACX,UAAU,EACV,SAAS,GACT,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAC/C,YAAY,EACX,WAAW,EACX,aAAa,EACb,UAAU,EACV,SAAS,GACT,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,YAAY,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAC9C,OAAO,EACN,UAAU,EACV,YAAY,EACZ,WAAW,EACX,WAAW,EACX,cAAc,EACd,cAAc,EACd,WAAW,EACX,YAAY,EACZ,QAAQ,EACR,QAAQ,GACR,MAAM,SAAS,CAAC;AACjB,YAAY,EACX,cAAc,EACd,YAAY,EACZ,OAAO,EACP,WAAW,EACX,QAAQ,EACR,UAAU,EACV,SAAS,EACT,SAAS,EACT,aAAa,EACb,SAAS,EACT,oBAAoB,EACpB,iBAAiB,EACjB,SAAS,EACT,OAAO,GACP,MAAM,SAAS,CAAC;AACjB,OAAO,EACN,oBAAoB,EACpB,cAAc,EACd,cAAc,EACd,cAAc,EACd,iBAAiB,EACjB,aAAa,EACb,cAAc,EACd,mBAAmB,EACnB,kBAAkB,EAClB,mBAAmB,GACnB,MAAM,SAAS,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/DataGrid/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,UAAU,EACV,eAAe,EACf,SAAS,EACT,UAAU,EACV,SAAS,EACT,aAAa,EACb,UAAU,EACV,QAAQ,GACR,MAAM,SAAS,CAAC;AACjB,YAAY,EACX,SAAS,EACT,gBAAgB,EAChB,WAAW,EACX,WAAW,EACX,UAAU,EACV,SAAS,GACT,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAC/C,YAAY,EACX,WAAW,EACX,aAAa,EACb,QAAQ,EACR,UAAU,EACV,SAAS,GACT,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,YAAY,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAC9C,OAAO,EACN,UAAU,EACV,YAAY,EACZ,WAAW,EACX,WAAW,EACX,cAAc,EACd,cAAc,EACd,WAAW,EACX,YAAY,EACZ,QAAQ,EACR,QAAQ,GACR,MAAM,SAAS,CAAC;AACjB,YAAY,EACX,cAAc,EACd,YAAY,EACZ,OAAO,EACP,WAAW,EACX,QAAQ,EACR,UAAU,EACV,SAAS,EACT,SAAS,EACT,aAAa,EACb,SAAS,EACT,oBAAoB,EACpB,iBAAiB,EACjB,SAAS,EACT,OAAO,GACP,MAAM,SAAS,CAAC;AACjB,OAAO,EACN,oBAAoB,EACpB,cAAc,EACd,cAAc,EACd,cAAc,EACd,iBAAiB,EACjB,aAAa,EACb,cAAc,EACd,mBAAmB,EACnB,kBAAkB,EAClB,mBAAmB,GACnB,MAAM,SAAS,CAAC;AACjB,YAAY,EAAE,WAAW,EAAE,iBAAiB,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAC3E,OAAO,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC"}
|