@trevianxyz/messagecenter-ui v1.0.0
MessageCenter UI
This library comprises the modular form interface used to construct MessageCenter forms. It provides a modular data structure that can easily be adapted and implemented by other packages, and make use of a centralized plugin library to extend its functionality.
Installation
npm install git+ssh://git@github.com:trevianxyz/MessageCenter-UI
Usage
<Form
editable={isEditable}
inputs={[ ...inputs ]}
onDataChange={(form, data) => { ... }}
onEdit={(form, input) => { ... }} />
Creating Inputs
Input modules must export a const type
object that implements the InputType
interface. This specifies various details about the type of input, as well as a React component class to render.
React input components should extend the Input
class, which supplies various utility methods and allows the input to behave as declared in its type object. It also provides an interface for editing parameters used by the input if the supplied "editable" param is true.
Development
This project should be developed on Node v12.13.0. pnpm
is preferred, but should be interoperable with npm
for most things.
Command | Description |
---|---|
make test | Installs dependencies and runs any project test files. |
make serve | Starts a webpack server for development. |
make build | Compiles the library into the dist/ directory for distribution. |
make build-dev | Compiles the library with type checking. |
make clean | Removes build files. |
4 years ago