6.0.0 • Published 8 months ago

@bionamic/component v6.0.0

Weekly downloads
-
License
ISC
Repository
github
Last release
8 months ago

Bionamic component library

The library is used by the Bionamic application and implements basic components for the JC-Bn system. The JC side is responsible for handling state and actions. The Bn side is responsible for rendering the state and triggering actions from user interactions. Every component has an interface which defines what state and actions are needed to render the component. For components that implement a dedicated JC class, the interface object can be created using the helper "getI..." function. Some of the more basic components (which do not require any state) do not need a JC class, instead, conventient pure interface functions are provided.

Example: MyFirstComponent

Naming

The following is an example of how the different classes for a component should be named.

Interface

Interfaces are named by placing the component name after "I" (which stands for "Interface"). Example: IMyFirstComponent

Interfaces use functions both to get and set values and these functions are prefixed with "get" or "set". Examples: getValue(): () => string; setValue(): (value: string) => void;

JC

JC classes are named by placing the component name after "JC" (which stands for "Javascript Component"). Example: JCMyFirstComponent

The JC class provides an interface function named "getIMyFirstComponent" which returns an interface object (which fulfilles IMyFirstComponent) and can be used to render the corresponding Bn component.

Bn

Bn classes are named by placing the component name after "Bn" (which stands for "Bionamic"). Example: BnMyFirstComponent

Tags

The web component html tags are named by placing the component name (lowercased and split with "-") after "bn-" Example: \

File structure

A component is defined inside a folder (named the lowercased component name, "myfirstcomponent" in this example) in the "src" directory. The folder contains an "interface.ts" file defining the JC-Bn interface and any necessary helper types. The "myfirstcomponent" folder also contains a "jc" folder (containing the JC class and any helper logic) and a "bn" folder (containing the Bn class written as a Lit component).

5.0.4

10 months ago

5.2.1

9 months ago

5.0.3

10 months ago

5.2.0

9 months ago

5.1.1

9 months ago

5.0.2

10 months ago

5.1.0

9 months ago

5.0.1

10 months ago

5.0.0

10 months ago

6.0.0

8 months ago

2.0.3

10 months ago

2.0.2

10 months ago

2.0.1

10 months ago

2.0.0

10 months ago

3.3.0

10 months ago

3.2.0

10 months ago

3.1.0

10 months ago

3.0.0

10 months ago

4.1.0

10 months ago

4.0.0

10 months ago

1.2.0

11 months ago

1.2.5

10 months ago

1.2.4

10 months ago

1.2.3

10 months ago

1.2.2

11 months ago

1.2.1

11 months ago

1.1.5

11 months ago

1.1.4

11 months ago

1.1.3

11 months ago

1.1.2

11 months ago

1.0.1

11 months ago

1.1.1

11 months ago

1.1.0

11 months ago

1.0.0

12 months ago