Repository navigation
material-v0.3.7
·
130 commits
to main
since this release
Component props are typed from the catalog's Zod schemas. The 25 Material components used hand-written prop interfaces that had to be kept in step with the schemas by hand; they now read their types from the schemas, so the two can no longer drift.
The new MaterialProps<'Card'> export is that type for one component: its schema's props with every field optional, because the renderer hands props over as the spec wrote them and checks them only when validate is on. Use it to type a replacement component:
import { type MaterialProps, materialComponents } from 'ngx-json-render-material';
export class BrandedCard {
readonly ctx = injectRenderContext<MaterialProps<'Card'>>();
}
const registry = defineRegistry(materialCatalog, {
components: { ...materialComponents, Card: BrandedCard },
actions: {},
});Upgrading
npm i ngx-json-render-material@^0.3.7No code changes are needed; the components render exactly as before. It works with ngx-json-render 0.7.x.
Full Changelog: material-v0.3.6...material-v0.3.7