1.5.76 • Published 8 days ago

vhp-component-library v1.5.76

Weekly downloads
-
License
MIT
Repository
github
Last release
8 days ago

TODO

Document:

  • Paragraph

  • DataTable

  • TableRow

  • JSONDataTable

  • JSONObjectForm

  • JSONRow

  • InputForm

  • Canvas

React Component Guide

Below is a documentation guide to using the React library. This guide lists only components to be used in your application itself - internal components like the ButtonContainer, etc will not be documented here and should not be used in an application.

App Box and Setting up your first Application

Initial Setup

To initialize an app, first create a react app using create-react-app. Once you have created an app, pull in this react repo into a Components folder located inside your application's src directory. Create an Apps folder inside src. To create your first application, create a folder with your app name. Copy and paste the SampleApp.jsx file from Components/Templates into your app folder. Rename the file to YourAppNameApp.jsx and rename the class SampleApp to YourAppNameApp. Create a folder instead your app folder named Containers.

Run Application

Before you run npm start, you must pass your application into the application itself. In App.js, go to the DevApp class. Within this class, go to the renderApp() function. In the return, add your component inside the root div. Next, from a command line in the root directory, run npm install and then npm start. Now, you can begin adding components and containers to your application in it's app component.

Creating a container

Each App file is defaulted to include a menu bar with a SetTab function. This allows you to switch between pages in the application. This default behavior can be removed, customized, or expanded.

Styling

Base components pull from a style file located in Style within Components. Styles for an app can be customized by adding CSS files to the Styles folder within your application folder.

Component API

A guide to using the VHP React Components to create an application. Assume all components by default have customizable ids, however some may be missing depending on how they're being created. Please document where id is missing.

Certain components support a customizable componentClass. This functionality replicates adding a class, so one can string classes together. Note this functionality should not be used for show/hide functionality, as the class is only set on component mount. Refer to the functionality guide for information on how to create a toggleable component using state.

See the naming convention guide for a more detailed view at the naming of props, functions, and components.

Note that each component also has documentation attached to it, which may not be here.

Containers

Containers are components which are the basis of an application and will by default display all of their children. Each container can be customized using a class or id.

AppContainer: A basic container used for containing an application. Can hold any object other than another container.

containerClass: the CSS class of the component.


FloatContainer: A floating container used for containing an application. Features a dark semi-transparent background which takes up the entire screen. Can be used to contain floating elements, such as editable forms or save dialogues.

containerClass: the CSS class of the component.

Cards

Cards are elements which can be used to hold and display a variety of different components, including tables, forms, buttons, and menus. A card can be the entirety of your application, or your application can be made up of a variety of different cards.

Card: The outermost card element, used to hold any CardContent elements which contain your data. By default, a Card contains a single CardContent element which displays the children of the card.

cardClass: the CSS class of the component.

titlebar: boolean to determine whether the card will have a CardTitlebar component. See CardTitlebar documentation for details on its properties.


CardContent: The inner container of a card which holds its content. A Card may contain multiple CardContent elements. By default, displays its children elements inside it.

cardContentClass: the CSS class of the component.


CardTitlebar: A customizable titlebar for a Card element. Can be customized to support a number of actions. Currently, close and minimize are planned, however dynamic actions can be added in the future. Note that due to the way it currently works, when providing actions, you must provide both, and you must provide data, even if its just set to null.

title: string, title to display.

actions: {minimize: function, close: function} table of functions which make up the titlebar.

data: {minimize: data or null, close: data or null} data passed into the function of each action.


Buttons

Buttons are components which enable a basic level of interactivity between the application and the user. Each button internally is a ButtonContainer component, however a ButtonContainer should not be used in an application.

TextButton: A basic button which supports clicking.

buttonClass: the CSS class of the component.

ButtonType: the type of button. Used for setting base CSS customization. Defaults to action-button.

text: text to display over the button.

ClickFunction: the function activated by clicking the button. Replicates onClick().

data: the data being passed into the ClickFunction. To pass in more than one property, pass as an array or object as specified by your click function.

ImageButton: Identical to the TextButton, but with the ability to specify an image and optional text.

src: image to display on the button.


DropDowns

A dropdown class fills the role of the HTML select element, with additional functionality and customization. Like the HTML select, a DropDown is composed of two things: a DropDown, and a set of options.

DropDown: the base of the DropDown, replicating the HTML select.

searchable: boolean which determines whether a search bar will be displayed. Currently, only supports text filtering however can be expanded to support other filtering types in the future.

data:object passed into ChangeFunction from the parent component, for example, the key of the object in state.

list: array of {text:string, value:string} which are mapped to DropOption components.

ChangeFunction: Function called when changing the selected element. Passes the new value into the function.

DropOption: Replicates the HTML option tag. Internal component use only.

MultiSelectDropDown: a DropDown which allows multiple selections

data:object passed into ChangeFunction from the parent component, for example, the key of the object in state.

list: array of {text:string, value:string} which are mapped to DropOption components.

ChangeFunction: Function called when changing the selected element. Passes the new value into the function.


Lists

A list class fills the role of the standard list HTML elements. Note that right now, only a numbered list is supported.


Tables

Table: the basic table class, with optional functions for sorting and filtering.

data: Array of Objects which you wish to display in the table.

fields: Array of Objects which describe where to find the data you wish to display as well as the header name of the fields.

> For example, to display the dateschedule property in a ticket, you would use {wo:{dateschedule:"Date"}}

headers: Boolean which determines whether to show headers.

ClickFunction: an optional Function called when clicking on a row. Passes the object respective to that row into the function.

FilterFunction: an optional Function called which filters the list.

SortFunction: an optional Function used for enabling sorting a table using the table headers. Will still run even if headers are not visible.

FormatFunctions: an optional Array of Functions used for formatting each row. Formats each row using the respectively matched function. Use null for fields you wish not to format.

actions: an Array of actions put it an ActionRow at the end of the table row. Sets dataindex as the data passed into each function.

rowClass: an optional String describing the class assigned to each tablerow.


JSON Objects


Static Objects

A collection of basic text and image objects that can be used to replicate images, paragraphs, and headers.


ViewControllers

A set of controllers that can be used to create menus and pages. A combination of components and CSS can be used to customize the look and functionality of different menu types.

License

MIT © mathewh-vhc

1.5.76

8 days ago

1.5.74

15 days ago

1.5.75

15 days ago

1.5.73

16 days ago

1.5.7

17 days ago

1.5.72

17 days ago

1.5.71

17 days ago

1.5.58

21 days ago

1.5.57

21 days ago

1.5.56

24 days ago

1.5.52

1 month ago

1.5.51

1 month ago

1.5.54

1 month ago

1.5.53

1 month ago

1.5.55

1 month ago

1.5.5

1 month ago

1.5.4

1 month ago

1.5.32

1 month ago

1.5.31

1 month ago

1.5.3

2 months ago

1.5.25

2 months ago

1.5.11

2 months ago

1.5.21

2 months ago

1.5.20

2 months ago

1.5.23

2 months ago

1.5.22

2 months ago

1.5.24

2 months ago

1.5.10

2 months ago

1.4.34

2 months ago

1.4.33

2 months ago

1.4.31

2 months ago

1.4.32

2 months ago

1.4.20

3 months ago

1.4.22

3 months ago

1.4.21

3 months ago

1.4.24

3 months ago

1.4.23

3 months ago

1.4.26

3 months ago

1.4.25

3 months ago

1.4.28

3 months ago

1.4.27

3 months ago

1.4.29

3 months ago

1.4.30

3 months ago

1.4.12

3 months ago

1.4.11

3 months ago

1.3.94

3 months ago

1.3.97

3 months ago

1.3.98

3 months ago

1.3.95

3 months ago

1.3.96

3 months ago

1.3.99

3 months ago

1.3.92

3 months ago

1.3.91

3 months ago

1.3.90

3 months ago

1.3.77

3 months ago

1.3.82

3 months ago

1.3.81

3 months ago

1.3.75

3 months ago

1.3.76

3 months ago

1.3.74

3 months ago

1.3.72

3 months ago

1.3.73

3 months ago

1.3.7

3 months ago

1.3.6

3 months ago

1.3.5

3 months ago

1.3.4

3 months ago

1.3.71

3 months ago

1.2.98

3 months ago

1.2.99

3 months ago

1.3.3

3 months ago

1.3.2

3 months ago

1.3.1

3 months ago

1.3.0

3 months ago

1.2.96

3 months ago

1.2.97

3 months ago

1.2.95

3 months ago

1.2.94

3 months ago

1.2.92

3 months ago

1.2.93

3 months ago

1.2.91

3 months ago

1.2.90

4 months ago

1.2.85

4 months ago

1.2.86

4 months ago

1.2.84

4 months ago

1.2.87

4 months ago

1.2.88

4 months ago

1.2.81

4 months ago

1.2.80

4 months ago

1.2.78

4 months ago

1.2.76

4 months ago

1.2.77

4 months ago

1.2.74

5 months ago

1.2.75

5 months ago

1.2.73

5 months ago

1.2.72

5 months ago

1.2.71

5 months ago

1.2.63

5 months ago

1.2.64

5 months ago

1.2.61

5 months ago

1.2.62

5 months ago

1.2.67

5 months ago

1.2.68

5 months ago

1.2.65

5 months ago

1.2.66

5 months ago

1.2.69

5 months ago

1.2.70

5 months ago

1.2.53

5 months ago

1.2.56

5 months ago

1.2.57

5 months ago

1.2.54

5 months ago

1.2.55

5 months ago

1.2.58

5 months ago

1.2.59

5 months ago

1.2.52

5 months ago

1.2.51

5 months ago

1.2.49

5 months ago

1.2.48

5 months ago

1.2.47

5 months ago

1.2.0

5 months ago

1.2.3

5 months ago

1.2.2

5 months ago

1.2.1

5 months ago

1.1.92

5 months ago

1.1.91

5 months ago

1.1.90

5 months ago

1.1.96

5 months ago

1.1.95

5 months ago

1.1.94

5 months ago

1.1.93

5 months ago

1.1.99

5 months ago

1.1.98

5 months ago

1.1.97

5 months ago

1.1.70

7 months ago

1.2.41

5 months ago

1.1.74

6 months ago

1.2.42

5 months ago

1.1.73

7 months ago

1.1.72

7 months ago

1.1.71

7 months ago

1.2.45

5 months ago

1.1.78

6 months ago

1.2.46

5 months ago

1.1.77

6 months ago

1.2.43

5 months ago

1.1.76

6 months ago

1.2.44

5 months ago

1.1.75

6 months ago

1.1.79

6 months ago

1.1.81

6 months ago

1.1.80

6 months ago

1.1.85

6 months ago

1.1.84

6 months ago

1.1.83

6 months ago

1.1.82

6 months ago

1.1.89

6 months ago

1.1.88

6 months ago

1.1.87

6 months ago

1.1.86

6 months ago

1.1.56

7 months ago

1.1.55

7 months ago

1.1.54

7 months ago

1.1.59

7 months ago

1.1.58

7 months ago

1.1.57

7 months ago

1.1.63

7 months ago

1.1.62

7 months ago

1.1.61

7 months ago

1.1.66

7 months ago

1.1.65

7 months ago

1.1.64

7 months ago

1.1.69

7 months ago

1.1.68

7 months ago

1.1.29

9 months ago

1.1.28

9 months ago

1.1.30

9 months ago

1.1.34

9 months ago

1.1.33

9 months ago

1.1.32

9 months ago

1.1.31

9 months ago

1.1.38

9 months ago

1.1.37

9 months ago

1.1.36

9 months ago

1.1.35

9 months ago

1.1.39

9 months ago

1.1.41

9 months ago

1.1.40

9 months ago

1.1.45

8 months ago

1.1.44

8 months ago

1.1.43

9 months ago

1.1.42

9 months ago

1.1.49

8 months ago

1.1.48

8 months ago

1.1.47

8 months ago

1.1.46

8 months ago

1.1.1

11 months ago

1.1.0

11 months ago

1.1.9

11 months ago

1.1.8

11 months ago

1.1.7

11 months ago

1.1.6

11 months ago

1.1.5

11 months ago

1.1.4

11 months ago

1.1.2

11 months ago

1.1.12

11 months ago

1.1.11

11 months ago

1.1.10

11 months ago

1.1.16

11 months ago

1.1.15

11 months ago

1.1.14

11 months ago

1.1.13

11 months ago

1.1.19

9 months ago

1.1.18

10 months ago

1.1.17

10 months ago

1.1.23

9 months ago

1.1.22

9 months ago

1.1.21

9 months ago

1.1.20

9 months ago

1.1.27

9 months ago

1.1.26

9 months ago

1.1.25

9 months ago

1.1.24

9 months ago

1.1.52

8 months ago

1.1.51

8 months ago

1.1.50

8 months ago

1.1.53

7 months ago

1.0.99

12 months ago

1.0.98

1 year ago

1.0.97

1 year ago

1.0.96

1 year ago

1.0.95

1 year ago

1.0.94

1 year ago

1.0.93

1 year ago

1.0.92

1 year ago

1.0.91

1 year ago

1.0.87

1 year ago

1.0.86

1 year ago

1.0.85

1 year ago

1.0.84

1 year ago

1.0.82

1 year ago

1.0.81

1 year ago

1.0.80

1 year ago

1.0.79

1 year ago

1.0.78

1 year ago

1.0.77

1 year ago

1.0.76

1 year ago

1.0.75

1 year ago

1.0.74

1 year ago

1.0.73

1 year ago

1.0.72

1 year ago

1.0.70

1 year ago

1.0.65

1 year ago

1.0.64

1 year ago

1.0.63

1 year ago

1.0.62

1 year ago

1.0.61

1 year ago

1.0.60

1 year ago

1.0.59

1 year ago

1.0.58

1 year ago

1.0.57

1 year ago

1.0.56

1 year ago

1.0.55

1 year ago

1.0.54

1 year ago

1.0.53

1 year ago

1.0.50

1 year ago

1.0.45

1 year ago

1.0.44

1 year ago

1.0.43

1 year ago

1.0.42

1 year ago

1.0.41

1 year ago

1.0.40

1 year ago

1.0.35

1 year ago

1.0.33

1 year ago

1.0.32

1 year ago

1.0.31

1 year ago

1.0.30

1 year ago

1.0.239

1 year ago

1.0.238

1 year ago

1.0.237

1 year ago

1.0.236

1 year ago

1.0.235

1 year ago

1.0.234

1 year ago

1.0.233

1 year ago

1.0.232

1 year ago

1.0.231

1 year ago

1.0.23

1 year ago

1.0.22

1 year ago

1.0.21

1 year ago

1.0.20

1 year ago

1.0.19

1 year ago

1.0.18

1 year ago

1.0.17

1 year ago

1.0.16

1 year ago

1.0.15

1 year ago

1.0.14

1 year ago

1.0.13

1 year ago

1.0.12

1 year ago

1.0.11

1 year ago

1.0.10

1 year ago

1.0.9

1 year ago

1.0.8

1 year ago

1.0.7

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago