0.0.2-RC • Published 1 year ago

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

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

@croz/nrich-registry-core

Overview

@croz/nrich-registry-core is a module which enables administration of registries. It provides main hooks for loading registry data, adding new, updating existing and deleting unwanted entities. It's a frontend part of nrich-registry backend module.

For create and update forms, it relies on nrich-form-configuration module.

Setup

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

Usage

  1. On the app level where your registry administration will be, use RegistryProvider which loads configurations.
import { RegistryProvider } from "@croz/nrich-registry-core";

const RegistryAdministration = () => (
  <RegistryProvider>
    {/* rest of the administration part... */}
  </RegistryProvider>
);
  1. Use available hooks to add logic for your administration. Hook can be used in your own components, or you can use already available Material UI implementation from @croz/nrich-registry-mui

Available hooks are:

hook nameusage
useRegistryEntityAdministrationMain hook for whole administration, use at top level entity administration component
useRegistryEntityHandles lower level stuff as data handling and configuration fetching
useRegistryFilterContains useful handlers for search query and filter properties
useRegistryFormReturns final configuration (field and validation) and initial values for creating add/update forms
useRegistryEntityFormConfigurationFetches Yup form configuration
useRegistrySortHelps with sorting logic in table headers
0.0.2-RC

1 year ago

0.0.1-RC

1 year ago