1.0.1 • Published 7 months ago

document-model-editors v1.0.1

Weekly downloads
-
License
SEE LICENSE IN LI...
Repository
-
Last release
7 months ago

Powerhouse Document Model Editors

This repository contains the React components that implement the UI to edit a Document Model. These components are to be used inside a container app in a desktop or web environment.

Documention for the Document Model is available at: https://acaldas.github.io/document-model-libs/

Getting started

Install the library:

  • yarn add document-model-editors

Editors

A Document Model Editor is a React controlled component that allows an user to edit a Document Model instance, respecting the predefined business logic.

Storybook

Each Editor has a self contained story to ease development and testing. To use the storybook run

  • yarn storybook

The stories have a Operations addon that will list all the operations performed on the document model instance. The controls also allow changing the document directly and the edictor theme from light to dark.

Budget Statement

A dummy implementation of a Budget Statement UI can be found at src/budget-statement/editor.tsx. It makes use of the hook useBudgetStatementReducer to dispatch actions and apply changes to the budget statement.

The available actions can be seen at https://acaldas.github.io/document-model-libs/modules/BudgetStatement.actions.html.

It has the following props:

  • initialBudget - The BudgetStatement instance to apply the changes to. The component should reset its state whenever this prop changes.
  • onChange - A callback function to call with a new version of the budget statement.
  • editorContext - The context from the container app. { theme: "light" | "dark" }
1.0.1

7 months ago

0.0.10

9 months ago

0.0.11

9 months ago

0.0.9

9 months ago

0.0.8

9 months ago

0.0.7

9 months ago

0.0.6

10 months ago

0.0.5

11 months ago

0.0.4

12 months ago

0.0.3

1 year ago

0.0.2

1 year ago

0.0.1

1 year ago

0.0.0

1 year ago