1.3.7 • Published 3 years ago

@kromtech/react-expression v1.3.7

Weekly downloads
186
License
MIT
Repository
-
Last release
3 years ago

react-expression

NPM JavaScript Style Guide

Flexibile UI expression builder for React.

Install

npm install --save react-expression

Usage

import React, { useState } from 'react';
import Expression from 'react-expression';

const presets = {
  functions: {/* functions presets */},
  datatypes: {/* datatypes presets */},
  references: [/* references presets */],
  operators: {/* operators presets */},
  suggestions: {/* suggestions presets */},
};

function Example() {
  const [operation, setOperation] = useState({
    uuid: '',
    args: [],
  });
  const [errors, setErrors] = useState([]);

  const props = {
    ...presets,
    operation
  };
  const onChange = (operation, errors) => {
    setOperation(operation);
    setErrors(errors);
  }

  return (
    <>
      <Expression {...props} isEditable onChange={onChange} />
      Errors: {errors.join('; ')}
    </>
  );
};

Available Scripts

In the project directory, you can run:

npm run start

Runs the app in the development mode. Open http://localhost:3000 to view it in the browser.

The page will reload if you make edits. You will also see any lint errors in the console.

cd example && npm run start

Runs the example app in the development mode. By default open http://localhost:3000 to view it in the browser.

npm run build

Builds the app for production to the dist folder.

npm run test

Launches the jest test runner in the interactive watch mode.

npm run cypress:run

Runs Cypress tests to completion. Before running, you need to run npm install and npm run build in the example (cd example).

npm run cypress:open

Opens the Cypress Test Runner. Before running, you need to run npm install and npm run build in the example (cd example).

License

MIT License ©. Author lempiy. Collaborator grimm.

1.3.7

3 years ago

1.3.7-alpha.0

3 years ago

1.3.6-alpha.7

3 years ago

1.3.6-alpha.8

3 years ago

1.3.6

3 years ago

1.3.6-alpha.6

3 years ago

1.3.6-alpha.5

3 years ago

1.3.6-alpha.4

3 years ago

1.3.6-alpha.3

3 years ago

1.3.6-alpha.2

3 years ago

1.3.6-alpha.1

3 years ago

1.3.6-alpha.0

3 years ago

1.3.4-alpha.0

3 years ago

1.3.5

3 years ago

1.3.4

3 years ago

1.3.3

3 years ago

1.3.2

3 years ago

1.3.1

3 years ago

1.3.0

3 years ago

1.3.0-alpha.1

3 years ago

1.3.0-alpha.0

3 years ago

1.2.0

3 years ago

1.2.0-alpha.3

3 years ago

1.2.0-alpha.2

3 years ago

1.2.0-alpha.0

3 years ago

1.2.0-alpha.1

3 years ago

1.1.3

3 years ago

1.1.2

3 years ago

1.1.1

4 years ago

1.1.0

4 years ago

1.0.32

4 years ago

1.0.31

4 years ago

1.0.30

4 years ago

1.0.29

4 years ago

1.0.28

4 years ago

1.0.26

4 years ago

1.0.27

4 years ago

1.0.25

4 years ago

1.0.24

4 years ago

1.0.23

4 years ago

1.0.22

4 years ago

1.0.21

4 years ago

1.0.20

4 years ago

1.0.19

4 years ago

1.0.18

4 years ago

1.0.17

4 years ago

1.0.16

4 years ago

1.0.15

4 years ago

1.0.14

4 years ago

1.0.13

4 years ago

1.0.12

4 years ago

1.0.11

4 years ago

1.0.10

4 years ago

1.0.9

5 years ago

1.0.8

5 years ago

1.0.7

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago