0.0.2-RC • Published 1 year ago

@croz/nrich-registry-mui v0.0.2-RC

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
1 year ago

@croz/nrich-registry-mui

Overview

@croz/nrich-registry-mui is a MUI wrapper for the @croz/nrich-registry-core module. Module uses generic MUI components to provide basic functionality for registry administration.

Setup

To use this module in your project run npm install @croz/nrich-registry-mui or yarn add @croz/nrich-registry-mui

Usage

In your app, inside your registry administration, use RegistryProvider which loads configurations. Be vary that you also need FormConfigurationProvider somewhere in the tree so that form validations are loaded. Inside the RegistryProvider you can use RegistryEntity component which encapsulates display with filtering, actions for adding, editing and removing entities.

<FormConfigurationProvider>
  <RegistryProvider>
    <RegistryEntity entityName="Address"/>
  </RegistryProvider>
</FormConfigurationProvider>

If you want to customize the display, or use some part from the RegistryEntity component, you can also use RegistryTable, RegistryFilter and RegistryForm components together with useRegistryEntityAdministration hook.

There is also a RegistryEntityPicker component which can be used to pick an entity from a list of available entities.

List of component and which hooks they use internally:

Component nameDescriptionUsed hook
RegistryEntityMain component which encapsulates whole entity administrationuseRegistryEntityAdministration
RegistryTableTable with data, with filtering and sortinguseRegistryEntityContext, useRegistrySort
RegistryFilterSearch input and filter propertiesuseRegistryFilter
RegistryFormForm for adding and updating entitiesuseRegistryEntity, useRegistryForm
RegistryEntityPickerComponent for picking an entity from a list of available entitiesuseRegistryConfigurationStore