1.45.0 • Published 2 years ago

valleform v1.45.0

Weekly downloads
107
License
MIT
Repository
github
Last release
2 years ago

valleForm

React component for convert the valle screens-api data structure to web component based forms.

npm dependencies Status

Write

<valleForm
    tabs = { [...] }
    buttons = { [...] }
    baseApi = ''
    canonicalApi = ''
    params = { {...} }
/>

... and build:

valleForm overview

Table of contents

Features

  • Mounts forms with infinite fields combinations easy.
  • Mounts fields with specific validations easy.
  • Mounts dynamic actions for Rest integrations (Post | Put | Delete).
  • Registration mode for dynamic CREATE.
  • View mode for dynamic vizualization.
  • Edit mode for dynamic UPDATE and DELETE.
  • Read only automatic for all fields.
  • a11y forms (by valle web components).
  • Responsive forms.
  • Dynamic speed dial buttons.
  • Inherited features. - All valle-input features. - All valle-select features. - All valle-speed-dial features.
  • Switch button for toggle visible_screen fields.
  • User feedbacks: - Snackbar report for all fields validation. - Snackbar report for CREATE submit success. - Snackbar report for CREATE submit error. - Snackbar report for UPDATE submit success. - Snackbar report for UPDATE submit error. - Snackbar report for DELETE submit success. - Snackbar report for DELETE submit error.
  • Keyboard controls: - Press enter for submit form.

Environment dependencies

Verify if you have this valle web components avaible in your project.

Installation

1 - Download the latest release.

2 - Import the styles on css/main.css folder to your project.

Usage

Registration mode

  • Mounts all fields.
  • Allow POST with all values and custom params.
import valleForm from './<path>/valleForm';

...
render() {
    return (
        <valleForm
            tabs = { equipamentos }
            buttons = { equipamentos.buttons }
            baseApi = 'http://localhost:3000/'
            canonicalApi = 'api/equipamentos'
            params = { {empresa: '', estabelecimento: ''} }
        />
    );
}
...

Result:

Registration mode example

View mode

  • Mounts all fields with values.
  • Allow edit mode for submit a update.
import valleForm from './<path>/valleForm';

...
render() {
    return (
        <valleForm
            tabs = { equipamentos.lines }
            buttons = { equipamentos.buttons }
            baseApi = 'http://localhost:3000/'
            canonicalApi = 'api/equipamentos'
            params = { {empresa: '', estabelecimento: ''} }
            values = { {valuesObj} }
            _id = '123'
            readOnly
        />
    );
}
...

Result:

View mode example

Edit mode

  • Mounts all fields with values.
  • Allow UPDATE and DELETE for any consulting.
import valleForm from './<path>/valleForm';

...
render() {
    return (
        <valleForm
            tabs = { equipamentos }
            buttons = { equipamentos.buttons }
            baseApi = 'http://localhost:3000/'
            canonicalApi = 'api/equipamentos'
            params = { {empresa: '', estabelecimento: ''} }
            values = { {valuesObj} }
            _id = '123'
            readOnly
        />
    );
}
...

Result:

Edit mode example

Props

  • tabs (array) - All form tabs with rows using the valle data structure.
  • buttons (array) - All form buttons using the valle data structure.
  • baseApi (string) - Base API url for RESTFul.
  • canonicalApi (string) - Canonial API url for RESTFul.
  • params (object) - Custom params that are added to all requests.
  • values (object) - All values for populate a view/edit form.
  • _id (string) - Unique Identifier for UPDATE and DELETE.
  • token (string) - JWT for requests authorization.
  • readOnly (boolean) - Make all fiels read only.

Development

Install dependencies

$ yarn

Tasks

  • yarn start - launch storybook to develop your component.
  • yarn build - build component to external use.
  • yarn pub - build and publish the component to npm.
  • yarn storybook - launch storybook to develop your component.
  • yarn build-storybook - build an static storybook to .out folder.
  • yarn deploy-storybook - build and deploy a storybook with component to gh-pages.
  • yarn test - run all specs.
  • yarn test:tdd - run all specs and watch.
  • yarn test:coverage - run all specs and coverage.
  • yarn lint:js - lint all files searching for errors.
  • yarn lint:fix - fix some lint errors.

Architecture

We've developed this component using the following boilerplate: lyef-react-component.

Versioning

To keep better organization of releases we follow the Semantic Versioning 2.0.0 guidelines.

Contributing

Find on our issues the next steps of the project ;) Want to contribute? Follow these recommendations.

History

See Releases for detailed changelog.

License

MIT License @ valleweb

1.45.0

2 years ago

1.44.0

2 years ago

1.43.8

2 years ago

1.41.0

2 years ago

1.42.0

2 years ago

1.43.1

2 years ago

1.43.0

2 years ago

1.43.5

2 years ago

1.43.7

2 years ago

1.43.6

2 years ago

1.40.4

2 years ago

1.40.3

2 years ago

1.40.0

3 years ago

1.40.2

3 years ago

1.40.1

3 years ago

1.38.4

3 years ago

1.39.0

3 years ago

1.38.2

3 years ago

1.38.3

3 years ago

1.38.1

3 years ago

1.38.0

3 years ago

1.37.3

3 years ago

1.37.0

3 years ago

1.37.1

3 years ago

1.37.2

3 years ago

1.36.1

3 years ago

1.36.2

3 years ago

1.36.3

3 years ago

1.35.1

3 years ago

1.36.0

3 years ago

1.35.0

3 years ago

1.34.0

3 years ago

1.33.0

3 years ago

1.32.1

3 years ago

1.32.0

3 years ago

1.31.0

3 years ago

1.30.0

3 years ago

1.29.0

3 years ago

1.26.0

3 years ago

1.27.0

3 years ago

1.28.1

3 years ago

1.28.2

3 years ago

1.28.0

3 years ago

1.28.3

3 years ago

1.25.0

3 years ago

1.25.1

3 years ago

1.23.0

3 years ago

1.24.1

3 years ago

1.24.2

3 years ago

1.24.0

3 years ago

1.21.0

3 years ago

1.21.1

3 years ago

1.22.0

3 years ago

1.22.1

3 years ago

1.20.0

3 years ago

1.19.0

3 years ago

1.18.0

3 years ago

1.17.4

3 years ago

1.17.3

3 years ago

1.17.2

3 years ago

1.17.1

3 years ago

1.17.0

3 years ago

1.16.5

3 years ago

1.16.4

3 years ago

1.16.3

3 years ago

1.16.2

3 years ago

1.16.1

3 years ago

1.16.0

3 years ago

1.15.1

3 years ago

1.15.0

3 years ago

1.14.0

3 years ago

1.13.0

4 years ago

1.12.6

4 years ago

1.12.5

4 years ago

1.12.3

4 years ago

1.12.4

4 years ago

1.12.2

4 years ago

1.12.1

4 years ago

1.12.0

4 years ago

1.11.0

4 years ago

1.10.10

4 years ago

1.10.9

4 years ago

1.10.8

4 years ago

1.10.7

4 years ago

1.10.5

4 years ago

1.10.6

4 years ago

1.10.4

4 years ago

1.10.3

4 years ago

1.10.2

4 years ago

1.9.0

4 years ago

1.10.1

4 years ago

1.10.0

4 years ago

1.8.10

4 years ago

1.8.9

4 years ago

1.8.8

4 years ago

1.8.7

4 years ago

1.8.6

4 years ago

1.8.5

4 years ago

1.8.4

4 years ago

1.8.3

4 years ago

1.8.2

4 years ago

1.6.4

4 years ago

1.8.1

4 years ago

1.7.2

4 years ago

1.6.3

4 years ago

1.8.0

4 years ago

1.7.1

4 years ago

1.6.2

4 years ago

1.7.0

4 years ago

1.6.5

4 years ago

1.6.1

4 years ago

1.6.0

4 years ago

1.5.0

4 years ago

1.4.3

4 years ago

1.4.2

4 years ago

1.4.0

4 years ago

1.3.1

4 years ago

1.3.0

4 years ago

1.2.1

4 years ago

1.2.0

4 years ago

1.1.1

4 years ago

1.1.2

4 years ago

1.1.0

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago

0.8.1

4 years ago

0.8.0

4 years ago

0.7.0

4 years ago

0.6.1

4 years ago

0.6.0

4 years ago

0.5.1

4 years ago

0.5.0

4 years ago

0.4.1

4 years ago

0.4.0

4 years ago

0.4.3

4 years ago

0.4.2

4 years ago

0.3.1

5 years ago

0.3.0

5 years ago

0.2.1

6 years ago

0.2.0

6 years ago

0.1.3

6 years ago

0.1.2

6 years ago

0.1.1

6 years ago