Repository navigation
Releases
v2.2.0
Minor Changes
-
a6232da: Added: a "Shown fields" menu next to a list's filters hides and shows fields in every layout — table, cards, board, calendar, gallery, items, split — instead of only a table's columns, one table at a time
views.list.fields: { toggle, persist, hidden }: the menu (on by default), where the choice is kept ("local"orfalse), and the fields hidden until the reader shows them.- Fields are data keys, nested ones included: hiding
userhidesuser.name;user.emailcan be hidden alone. <Field name="price">…</Field>anduseFieldVisible("price")let a list component of your own follow the menu;useFieldVisibility()reads and changes the whole choice.- The choice is kept per resource, shared by its layouts, through the new
fieldVisibilityport ofconfigurePorts(read,write, optionalsubscribe):localStorageby default, SSR-safe, or an API. - The table's "Properties" menu keeps the column order; the columns hidden there before are carried over to the new store the first time the list opens.
- Saved views and presets remember the fields hidden as
hiddenFields; a view saved withcolumns.hiddenstill applies it.
v2.1.0
Minor Changes
-
dc3301a: Added:
layout.table({ virtualize })draws only the rows on screen past 200 rows, instead of mounting every row of the page — a table of thousands of records opens, scrolls and restyles like one of fifty- On by default above 200 rows;
virtualize: truealways,virtualize: falsenever,{ threshold, overscan }sets the number of rows and how many are drawn beyond each edge of the screen (8 by default). - The table stays a
<table>: the rows off screen are spacer rows of their measured height, the header and the pinned cells are untouched, and column widths are held while scrolling. - Groups (folded or not) and views opened inline under a row are virtualized as one flat list.
- Select all and bulk actions work on every record of the page, drawn or not; ↑ / ↓ and Ctrl+Home / Ctrl+End move to another row and scroll to it; the table carries
aria-rowcountand each row itsaria-rowindex. - New dependency:
@tanstack/react-virtual.
- On by default above 200 rows;
Patch Changes
-
f8f91bf: Changed: the built-in components no longer compile to selectors that make Chrome restyle the whole page when a window opens or closes, instead of
:has()placed before the element it styles and~between any two slots- Applications scanning
react-resource-view/distwith@sourceno longer getgroup-has-*,has-[…]:*:orhas-[…]:[&>…]:rules (field, checkbox, item, alert dialog, button group), nor[data-slot] ~ [data-slot](button group). On a page of tens of thousands of nodes, each of them cost hundreds of milliseconds per opening or closing of a dialog. - The same rules are written with a class as the subject, the
:has()on the styled element itself, or:nth-child(n + 2 of [data-slot]): the components look the same, at the same specificity or higher. - An application that worked around these classes with
@source not inline(…)can drop that workaround.
- Applications scanning
v2.0.0
Major Changes
-
b7c6b83: Breaking: the index no longer re-exports the internal helpers nor the testing tools: these names can no longer be imported from
react-resource-view, their code stays in its moduleRemoved from the index, to be released with version 2.0.0:
onResourceViewDefaultsChange(marked@internal) andgetRegisteredOpenFramesBUILT_IN_OPENandresolveOpenadoptResourcesanduseInlineClaimwriteOptimistically,isOptimisticandnotifyWriteErrorjoinPath,appendBracketParamandflattenStrapiRecordPermissionCacheContextresetApiConfig, for testsHeaderandContentList, internal components of the list view (names that collided with the router's)
None of these names is used by the documentation or the website.
@internaldeclarations no longer appear in the published.d.tsfiles (stripInternal). A test now freezes the list of public exports: any addition or removal changes it.
Minor Changes
-
150902e: Added:
commandPaletteonAdminLayout/createAdminLayoutopens a Cmd+K / Ctrl+K palette built from the scope — go to a menu entry, start a creation — and lists only what the resources permit, instead of leaving the back office without keyboard navigation.commandPalette: { searchable: true }also looks records up by thetitleFieldof each resource, sent as a filter like the list's own.- The palette is a
role="dialog"holding acomboboxand alistbox; Escape closes it.
-
51a6912: Changed:
afterSave: "read"onviews.createandviews.updateleads to the page of the saved record, anduseFormByResourcefills the form itself when the record arrives, instead of a view copying the synchronisation ofEditView"read"is accepted by the development validation next to"close","stay"and"reload".- A form handed a
dataof its own (a row of a list) keeps that record and is not refilled.
-
5fb8020: Changed:
layout.board({ groupBy: "status" })draws one column per option of the form'sstatusinput, instead of asking forcolumnsnext to theoptionsit already declarescolumnsstays available to reorder the columns or show only some of them.- In development, a board without
columnsis refused only when the input it groups by has nooptionsto read them from.
-
37179f8: Added:
layout.board({ columns })accepts a function({ viewResourceContext, rows, defaults }) => columns, read again at each render, andhideEmpty(on the board or on a column) hides the columns holding no card except while a card is dragged, instead of replacing the whole board list component to do eitherdefaultsare the options of the form's input the board groups by.- "Move to…" still lists every column, hidden or not.
-
6d40944: Changed: below
sm, the calendar's month view shows the initials of the days, one dot per event and the list of the tapped day underneath, instead of titles cut to "02:" in 44 px cells. -
f5a2886: Changed:
layout.cards({ frame: false })drawscomponents.rowon its own, without border, padding or actions footer, andactions: falseremoves the actions footer of a framed card, instead of always wrapping the row in a card of its own- A row component that already draws its own card no longer gets a double frame; selection and opening keep working.
- The codemod writes
frame: falseon cards whosecardViewOptionFactoryhad arowComponent.
-
82bd6e2: Added:
createPage("help", { name, icon, component })declares a page without data (a home, a help, a dashboard): a menu entry and a route to a component, with nocreate,read,updateordeleteroute and no request to the API, instead of acreateViewResourcewith every permission turned off and a fakegetCollection.migratewrites a 0.x resource made only of a name, an icon and aviewComponentascreatePage, and no longer reports RV1-PERM-002 on it.
-
029a3d9: Changed: in development, a tab with neither
resourcenorcomponentor whose resource is an unknown id, alayout.chart()with neithergroupBynordateFieldand alayout.cards({ columns })outside 1 to 6 throw an explicit error, instead of passing silently. -
31915ba: Added:
ChartAggregate,ChartInterval,BaseJsonLdItemInterfaceandDefinitionProblemtypes are exported, as isinspectDefinition, which lists the problems of a declaration without throwing, so it can be tested in CI. The README shows a vitest example. -
7f556f2: Added:
npx react-resource-view generate resourceswrites one resource declaration per collection of the OpenAPI schema, instead of leaving everycreateViewResourceto be written by hand afterinit- Reads OpenAPI 3.0/3.1 and Swagger 2.0 (API Platform, FastAPI, Supabase…) from a file or a URL — by default
src/api-schema/openapi.json. - Writes the
path, theform.inputs(enums as selects, IRIs and foreign keys as searchable relations, dates, numbers, booleans), thepermissionsthe exposed operations allow, a table, and a board when an enum namedstatusis among the inputs. - Registers the resources in the scope's
resources;--only books,authorsrestricts them,--dry-runlists the files, and no existing file is overwritten without--force.
- Reads OpenAPI 3.0/3.1 and Swagger 2.0 (API Platform, FastAPI, Supabase…) from a file or a URL — by default
-
7b8b0b7: Added:
react-resource-view/i18nexportsmessages, the English reference of every message the library shows, andmissingKeys(dictionary), which lists the keys a dictionary leaves untranslated, instead of copying the keys by hand into each projectmessagesis keyed on the English text:messages["Saved"] === "Saved". A dictionary for another language has one entry per key.missingKeysreturns the keys without an entry, and those with an empty one. Call it from a test to fail when a new version of the library adds a message your dictionary does not translate.- The documentation has an "i18n" page that shows how to merge the catalogue with your own keys.
-
5ca6970: Added:
layout.gallery({ imageField })draws a grid of cards headed by a picture, for products, articles or profilesimageFieldis typed on the item and accepts an URL, a data URL, a media object ({ url, name }) or a list of them; a record without an image gets a placeholder, and the pictures load lazily.aspect("4/3","1/1","16/9"),fit("cover","contain"),titleField,columnsandfieldsshape the cards.
-
7744b2b: Changed: below
sm, the layout switcher shows the icon of each layout alone (its name stays the tab's accessible name), instead of cutting the last tabs off at 390 px. -
a0855d0: Changed: an empty list tells "nothing yet" from "nothing matched", draws the resource's own icon and name, and offers to clear the filters when one is active, instead of always saying "Nothing matched your search"
- New
views.list.empty: { icon, title, body, filteredTitle }declares them without a component;icondefaults to the resource'sicon,titleto "No yet". - The create button only shows where
permissions.createallows it. components.emptystill replaces the whole state.
- New
-
5d87b71: Added: two media controls,
createMediaImageInput(one image: preview, replace, crop, remove) andcreateMediaFilesInput(a list of documents: name, type, size, preview or icon, download, removal), which keep the file as base64 in the record instead of requiring an upload API- Options:
accept(MIME types,image/*families or extensions),maxSize,maxFiles,dragAndDrop,crop: { aspect }; a refused file is named under the field with the reason, throughreact-mini-i18n. storechanges what becomes of a file: a data URL by default (storeAsDataUrl), or the URL returned by a function that sends it to the API.components: { dropzone, imagePreview, fileItem }replaces part of the rendering;mediaImageInputControllerFactoryandmediaFilesInputControllerFactoryset these options once for the whole application.- Outside a form,
MediaValueshows a thumbnail for an image and an icon with the name for a document: on a detail page, in a table cell (two files then "+N") and on the cards, instead of the raw base64.
- Options:
-
fba905e: Added:
mobileNavMaxItemsonAdminLayout/createAdminLayout(4 by default) caps the entries of the mobile bottom bar; the following ones move into the "More" drawer, ahead offooterMenu, and "More" is marked current when the page on screen is one of them. -
c93ffa0: Changed: a burst of realtime pushes is read once, 250 ms after the last one (
realtime: { debounce }to change it), and a read that a newer one replaces, or that the unmount outlives, is aborted:ResourceContextcarries asignalthat the REST repository passes tofetch, instead of five full reads of the list whose stale answers were only dropped on arrival. -
7e51ed8: Added:
realtimeaccepts{ subscribe, withCredentials }: the channel is pluggable (Supabase Realtime, SSE, WebSockets), and Mercure reconnects with a growing delay and reads the views again when the hub comes back, instead of closing for good after an HTTP error. -
365ffc7: Changed: a hand-written
repositoryanswers{ items, totalItems }and always receives{ id: string }, instead of a JSON-LD collection and an id that was sometimes the item, the IRI or the bare segmentgetCollectionaccepts{ data: { items, totalItems, nextCursor? } }without a cast;createResourceCollectionand JSON-LD collections still work.getItemandremoveItemreceive{ id }andupdateItemthe record with itsid, always the short identifier as a string. A repository that read the@idof the item it was given must readidinstead.- New
idFieldon the resource: links, keys and selection are built from that field, so the records need no@id.
-
f454c8e: Added:
restDialectdescribes a common REST API through configuration (X-Total-Count,Linkheader, cursor paginati...
v1.2.2
Patch Changes
- a8cad12: docs: the README and the starter written by
initlink api-dumper atgithub.com/hermez-agency/api-dumper, where the repository moved
v1.2.1
Patch Changes
-
17ca3d1: fix(ui): les dialogs, drawers, popovers et selects s'ouvrent et se ferment en fondu, au lieu d'apparaître et disparaître d'un coup
dialog,alert-dialog,popoveretselects'animaient avecanimate-in,fade-in-0,zoom-in-95etslide-in-from-*. Ces classes ne viennent pas de Tailwind : elles appartiennent àtailwindcss-animate/tw-animate-css, qui n'est ni installé ni importé — elles ne généraient donc aucun CSS. Elles sont remplacées par des transitions suropacityetscale, pilotées par les attributsdata-starting-style/data-ending-stylede Base UI, comme le fait déjàdrawer. Rien à installer côté application : ce sont des utilitaires Tailwind de base.- Une vue ouverte en dialog ou en drawer n'animait ni son entrée ni sa sortie, quel que soit le CSS : le cadre était monté déjà ouvert, et la fermeture changeait l'URL, donc le démontait, avant que la transition ait pu démarrer. Il s'ouvre maintenant juste avant que la page soit peinte sans lui, et l'URL ne change qu'une fois la transition de sortie terminée.
- Le popup d'un
selectaligné sur son déclencheur (alignItemWithTrigger, la valeur par défaut) reste sans animation : l'élément sélectionné y est posé sur le bouton, et le faire grandir l'en ferait glisser.
v1.2.0
Minor Changes
-
3fd769d: feat(admin): un hôte configure le layout d'admin par ses options, au lieu de le corriger de l'extérieur
- Le menu d'un scope garde les getters de ses entrées : un nom qui suit la langue, un lien qui suit le dernier choix du lecteur, sont relus à chaque dessin au lieu d'être figés au chargement du scope.
MenuItemInterface.badge: un composant dessiné au bout de l'entrée (un compteur), sans remplacer l'entrée par uncomponentqui refait son lien et son état actif.useIsActiveMenuEntryest exporté pour les entrées qui en ont quand même un.- La barre du bas d'un téléphone porte
data-slot="admin-mobile-nav"etaria-current, et ses entrées se partagent sa largeur au lieu de défiler de côté. SidebarInsetestmin-w-0: une vuefullWidthplus large que l'écran ne pousse plus la barre du haut hors de l'écran.- Le fil d'Ariane se coupe à la place que lui laisse la barre, au lieu de passer sous son extrémité.
- L'icône d'une liste s'aligne sur son titre (
data-slot="list-header-title"), et les cartes d'une colonne de board portentdata-slot="board-column-cards". - Le bouton « créer » d'une liste prend le reste de sa ligne sur téléphone, à côté du sélecteur de layout, au lieu d'une ligne à lui.
- La barre de filtres n'élargit plus son contenu à
fit-content: des filtres de l'application qui passent à la ligne y passent à la largeur de la liste. - Une vue ouverte en dialog ne dépasse plus la hauteur de l'écran : le titre garde sa ligne, le contenu défile dans le reste.
-
941d036: feat(views): the list's export button offers CSV and JSON and reads every page itself, instead of downloading a server CSV
- The rows are read page by page through the resource's repository, with the list's current filters and sort, so the export works on any dialect — Strapi and local storage included — and the button shows how many rows have been read so far.
- Only the columns the table shows are exported. CSV cells holding commas, quotes or line breaks are quoted, and the file opens in Excel with its accents intact; JSON keeps the raw values.
dialect.exportRequestis no longer used by the button.
-
dccab91: feat(views): the table's columns are shown, hidden and reordered from a "Properties" menu, as in Notion, without touching the declaration
- A box per column shows or hides it, a handle drags it elsewhere (Alt + ↑ / ↓ from the keyboard); the table keeps one column at least.
- The choice is kept in
localStorage, per resource and per layout (react-resource-view:columns:<resource>:<layout>). The declaration stays the default: "Reset to default" forgets the choice, and a field added to the form later appears where it is declared.
-
f71220b: feat(views): Shift+click on column headers sorts a table on several columns, with their rank shown, instead of replacing the sort
- A plain click still goes ascending, descending, then no sort, on that column alone; Shift+click keeps the other sorted columns and queues the clicked one behind them (a column already sorted keeps its rank while its direction moves on).
- Once two columns or more are sorted, each header shows its rank next to the arrow. The sort stays in the URL and goes to the API as
order[field]=asc|desc, in that order.
Patch Changes
-
5bd5cd4: fix: the
react-data-formandreact-mini-i18npeers accept their current releases (^0.3.0,^0.1.0 || ^0.2.0), sopnpm add react-resource-view react-data-form react-mini-i18n resource-registryinstalls them instead of react-data-form 0.1.0- In 0.x a caret pins the minor:
^0.1.0ruled out react-data-form 0.2 and 0.3 and react-mini-i18n 0.2, which only add features.initwrites the same ranges into a new starter. react-mini-i18nkeeps^0.1.0alongside^0.2.0: react-data-form 0.3.0 still asks for^0.1.0, and npm would otherwise refuse the install withERESOLVE.
- In 0.x a caret pins the minor:
v1.1.0
Minor Changes
-
d3a7625: refactor: the optional
react-resource-view/styles.csstheme now follows the Hermez design system, not shadcn's neutral greysVisible only to applications that import the library's stylesheet; an application with its own shadcn variables sees nothing change.
- Colours: warm "stone" greys (background
#fafaf9, cards#ffffff, text#1c1917, secondary text#57534e, borders#e7e5e4, fields#d6d3d1), an orange primary#bf4a02under white text, the brand orange#e46212as focus ring, and#fff6eeas highlight. The.darkblock keeps the same hue (background#0c0a09, primary#ff8b44). The destructive red is#b91c1c, so the destructive button reaches 4.5:1. - New tokens:
--success,--info,--gloryand--warning(thesuccess,info,gloryandwarningbuttons and badges had no colour until now),--chart-1to--chart-5, and the typography variables--typeface-heading,--typeface-body,--typeface-mono,--heading-weight,--heading-tracking(withfont-heading,font-sansandfont-monomapped to them). - Radius:
--radiusgoes from0.875remto0.75rem, and--radius-2xlto--radius-4xlnow derive from it — buttons, selects and badges stay pills, slightly tighter, and follow a custom--radius. - Shadows:
shadow-sm,shadow-mdandshadow-lgare tinted with the theme's text colour, lighter than Tailwind's. - No font is shipped and no rule restyles the application's headings:
--typeface-headingnames Bricolage Grotesque, used only if the application loads it. The variables stay in@layer base, so the application's own still win.
- Colours: warm "stone" greys (background
Patch Changes
-
c0e4eb4: fix(views): the table keeps its row actions in sight when it is wider than the screen, instead of pushing them out of view
- The actions column and its header are
position: stickyon the right edge, opaque, with a shadow on their left; the buttons are at least 40 px wide and tall. A fade on the table's edges tells that columns are hidden on that side. layout.table({ stickyActions: false })leaves the actions in the flow;layout.table({ stickyFirstColumn: true })also pins the first column to the left.
- The actions column and its header are
v1.0.0
Major Changes
-
60d41c1: 1.0: a declaration that reads once and makes sense without the documentation.
Breaking changes, each one rewritten bynpx react-resource-view migrateor
explained step by step inMIGRATION-1.0.md;migrations/1.0.jsonis the same
list as data, for a script or an AI to apply.- One place per notion.
viewis gone: what every action shares —form,
fullWidth,titleField,components,description— sits at the root of
the resource; what belongs to one action sits inviews.list | read | create | update | delete, each typed with only the options that have an effect there.
Root, action and layout are merged deeply, soviews.updatesays only what
differs, andinputs: { notes: false }removes an inherited field. Actions
are plain strings (views.update,rowActions: ["read"]);ActionListis
still accepted. - Permissions.
canRead,canList,canCreate,canUpdate,canDelete
andbehavior.canExportbecome onepermissionsobject —"all",
"readonly", a list of actions, or a boolean or a function per action.
Everything is allowed by default, so the shortest declaration has all its
buttons. A function is told the record (({ item }) => item.status !== "done")
and may answer asynchronously; answers are cached per record while a list is
on screen. A refused action also protects its route:/books/update/1draws
the scope'sforbiddenFallbackinstead of the form.canListis now read for
the list (it was ignored).usePermission(action, item)and
useAllowedActions(actions, item)are added;permissionResourcetakes
{ item, context }and may return a promise. behavioris gone, each option moved to where it has an effect:
openIn→views.<action>.open("page","dialog","drawer");
closeAfterUpdate,refreshDataAfterUpdate,redirectToAfterUpdate→ one
afterSave: "close" | "stay" | "reload" | { redirect: (item) => string };
rowActions→views.list.rowActions;eventSourced→realtimeat the
root;openRecordIn→views.read.open;selectable,bulkActions→
views.list.selectable,views.list.bulkActions, for every layout of the
list (bulkActionsalso takes"delete").- Layouts.
viewVariantsbecomesviews.list.layouts, and the seven
factories onelayoutnamespace:layout.table(),layout.cards({ columns }),
layout.board({ groupBy, columns }),layout.calendar({ dateField }),
layout.timeline({ startField, endField, groupBy }),layout.split({ readInList }),
layout.items()andlayout.custom()for one's own (read its options with
useLayout()). Field options are checked against the resource's item type —
a typo is a TypeScript error — and share one suffix:titleField,
dateField,colorField,statusField. A layout's URL id is its type, so a
new label breaks no shared link;fieldspicks a layout's columns. - Data. Without
path,storage: "local"must be declared: a forgotten
path no longer turns into localStorage silently.preGetCollection,
preGetItem,preCreate,preUpdatebecomehooks.beforeList,
beforeRead,beforeCreate,beforeUpdate, joined bybeforeDelete,
afterSaveandafterDelete; hooks may be asynchronous and always receive
the view context — creations and updates used to lose it on the way to the
repository. Hand-written repository methods move torepository: { … }.
limitbecomesquota: { get, fallback }(useLimit→useQuota). - Titles and components.
nameis declared once; titles are derived and
overridden withviews.<action>.title, a button's text withbuttonLabel.
viewComponentand the otherxxxComponentkeys, anddecoratorComponent,
become onecomponentsobject (view,wrapper,top,bottom,empty
— exnoResult—,pagination,navigation,title,actions). - Tabs.
subViewResourcebecomesviews.read | update.tabs: { orientation, aside, items }, a tab being{ id, label, resource, filter: ({ item }) => … }
instead of anonInitViewResourcereturning the whole context. - Scopes and defaults. A resource no longer names its
scope: the scope's
resourcesties them, andmenu: "auto"(or a list mixing resources, links
and groups) builds the navigation.setResourceConfig({ defaultResource })
becomesconfigureResourceView({ defaults }), merged deeply into every
resource, including those declared before it is called. - Types.
ResourceDefinitionis what one writes,ViewResourcewhat the
library builds;ViewResourceInterface,ResourceOptionInterface,
ViewInterfaceand the factory option interfaces are replaced. - Optimistic writes. Every write going through a resource's repository —
a form saved, a row deleted, a cell edited in place, a card moved, the
writes of a bulk action made through its newmutationargument — is drawn
before the API answers: the row changes at once (a created one appears,
marked as being saved), the API's answer replaces it as soon as it comes,
and a refusal puts it back with a toast — a form keeps the API's violations
on its fields. Several writes to one record show the last one; a list read
again while a write is in flight (a realtime push) keeps the row as
written. On by default — a change of perceived behaviour —, turned off with
optimistic: falseat the root or per action
(views.delete: { optimistic: false }).useResourceMutation(resource)
gives an application's own actions the same optimism and rollback
(create,update,remove,mutate,isPending), andRowInterface
gainspending. Built on the library's own state rather than React 19's
useOptimistic: no new requirement on the React version. - One routed opening.
views.<action>.openis resolved once, and anything
but"page"is written into the URL under the view it was opened from
(…/tasks/list/tasks/update/12, filter and layout kept): a row's button —
now a real link —, a board's card and a link typed by hand open the same
frame, Back closes it, a reload opens it again over the same list, and a
save closes it by going back to that URL. A list reads itself again once per
save, instead of once per button of its rows.layout.board({ openRecord, expandable })is gone: a card opens the record'sreadview where
views.read.opensays — on its page by default, where it used to open
nothing. - Frames of one's own.
open.custom({ type, placement, component }), on
the model oflayout.custom(): the component receives the title, the view,
closeand the link to the full page.placement: "inline"draws the view
under the row that opened it in a table, a plain list or a card grid — a
layout.custom()says it can withsupports: ["inline"]and draws
<InlineChildView row={row} />— and falls back to a dialog elsewhere, with
a warning in development.configureResourceView({ open: { accordion } })
registers a frame under a name, typed through theOpenFramesinterface. - "Open in full page". A
readorupdateview opened in a frame has a
link to the same view on its page beside the close button, a real
<a href>that Ctrl/Cmd+click opens in a new tab.expandable: falseon
the view takes it away;createanddeletedo not have it unless they say
expandable: true. - Checked in development.
createViewResourceandlayout.*throw on a key
they do not read — with the closest key, or the exact 1.0 rewrite of a 0.x
one — on a resource with no data source, a board withoutgroupBy, two
layouts sharing a URL id, and warn about a title identical to the derived
one. Nothing is checked in production. - Command line.
npx react-resource-view migrate [paths]rewrites 0.x
declarations (--dry-run,--check);create-view-variantwrites a
layout.custom()file;initstarts on the 1.0 syntax.
- One place per notion.
Minor Changes
-
29ce470: feat(views): a list sorts by its column headers, selects its records in every layout and says when it could not load, not only on the board and not with an empty list
views.list.sort: { fields, initial }: the table's headers of the fields named sort ascending, then descending, then not at all (aria-sort); the sort goes to the API through the dialect, into the URL, and survives "Clear the search".useSort()gives the same to a layout of one's own.- Breaking (1.0):
selectableandbulkActionsleavelayout.board()forviews.list, and reach every layout: checkboxes on the table's rows (and "Select all" in its header), the cards and the items.bulkActionsaccepts"delete", which deletes the selection after a confirmation, as far aspermissions.deleteallows.selectabledefaults totrueon a board and wherever bulk actions are declared.npx react-resource-view migraterewrites both (RV1-BEHAV-006, RV1-LAYOUT-014). - A view whose records could not be loaded draws what the API answered and "Try again" (
components.errorreplaces it), rather than "An error occurred" in a list, or an empty form that could be saved over the record.loadErroron the view context holds what the request threw.
-
e7e7654: Moving to another view shows that the click was heard, instead of nothing until
the next view appears at once: a thin bar runs along the top of the screen, in
the theme's primary colour, until the new view has its data, and the view fades
in, sliding up a few pixels. No new dependency.- The bar waits 150 ms, so an instant navigation flashes nothing, then stays
300 ms at least; it runs quickly, then slower, and fills up when the view is
there. The loading view is markedaria-busy, the b...
- The bar waits 150 ms, so an instant navigation flashes nothing, then stays
v0.15.0
Minor Changes
-
b1f8272: Open a card of a board, select several and move them together, instead of only
dragging one card at a time onto a column.behavior.openRecordIn("drawer","popup"or"window") makes the whole
card clickable — hover and focus states, Enter from the keyboard — and opens
the record'sreadview: in a panel on the right or a dialog, both written
into the URL as a child view of the list (…/tasks/list/tasks/read/12, which
parseLinknow reads), so the link is shareable and Back closes it; or on
the record's own page, throughgenerateLink. The panel has a way to edit the
record, traps the focus and gives it back to the card.- A button, a link, a menu, a checkbox or a drag handle drawn in a card keeps
its click, without anystopPropagation: the card only opens on a click that
lands on none of them (data-card-controlmarks anything else), and not when
text is being selected. - Cards can be selected — checkbox, Ctrl/Cmd+click, Shift+click for a range, a
long press on a phone, Escape to clear — and a bar offers "Move to…",
behavior.bulkActionsand "Deselect all". Dragging a selected card moves the
whole selection under an "N cards" preview. Each record is updated through
the repository and drawn in its new column at once; one that fails goes back,
and a message says how many could not be moved.behavior.selectable: false
turns selection off. - Each column scrolls on its own, and an empty column shows where to drop.
-
d970551: Add a Django REST Framework dialect:
djangoDialect()reads DRF's
{ count, next, previous, results }page (or a bare array when the view has no
paginator), pages withpage/page_size— orlimit/offsetwith
pagination: "limit-offset"— sorts withordering=-field, sends filters as
query parameters for django-filter, addresses a record at/articles/{id}/with
DRF's trailing slash, and pins a 400's{ field: ["message"] }on its input.
Options:primaryKey,pagination,pageSizeParam,defaultItemsPerPage,
orderParamandtrailingSlash.npx react-resource-view init -b djangostarts a back office on it, dumping the
schema drf-spectacular serves at/api/schema/?format=json.
Patch Changes
- 9582599:
initwrites thereact-data-form,react-mini-i18n,resource-registryand
@tanstack/react-routerranges from the package's ownpeerDependencies, so a
generated starter installs without--legacy-peer-depsinstead of failing with
ERESOLVEon a hard-codedreact-data-form@^0.2.1against a^0.1.0peer. - 35a40a9: A record saved from a button opening over a list (
openIn: "popup"or
"drawer") reads the list again with the filter it has now, instead of the one
the button mounted with — a list filtered on « A », then on « B », no longer
shows the rows of « A » under « B » after a save. The buttons of every row also
share a single request instead of each reading the list again.
v0.14.0
Minor Changes
-
642aac2: Add a FastAPI dialect:
fastapiDialect()lists, reads, creates, updates and
deletes against a standard FastAPI CRUD router, instead of showing empty lists
under the JSON-LD default.A page is
skip/limit, as in the FastAPI tutorial, orpage/sizewith
pagination: "page-size"for fastapi-pagination, whose{ items, total }
drives the page count; a bare array hides the pagination. A sort is
order_by=-created_at,title, an array filter repeats its parameter, and a 422
lands under the field itslocnames —["body", "address", "city"]on
address.city. Options:primaryKey,pagination,defaultItemsPerPage,
orderParamandtrailingSlash. -
5dfb920: Add
npx react-resource-view init: it starts a back office on your API — API
Platform, Spring Boot, another REST API, Supabase, Strapi or FastAPI — with the
dialect wired, the URL in.env, andapi-schema/api-schema:checkscripts
that dump the OpenAPI schema into TypeScript with api-dumper.Add a Spring Boot dialect:
springDialect()pages withpage(from 0) and
size, sorts withsort=field,desc, reads aPage, aPagedModelor Spring
Data REST's HAL, and pins Bean Validation errors on their field.
Patch Changes
- ef36d4e: Capitalise the first letter of each view name in the view switcher, so a
boardorvue d'ensembletab readsBoardandVue d'ensemble, custom and
translated names included — the rest of the label is left as written.