3.0.1 • Published 1 year ago

@jouwomgeving/ui-form v3.0.1

Weekly downloads
23
License
UNLICENSED
Repository
bitbucket
Last release
1 year ago

Form

$ npm install @jouwomgeving/ui-form

Usage

import * as Form from '@jouwomgeving/ui-form';

function Layout() {
  return (
    <Form.Form>

      <Form.Header>Dit is een formulier</Form.Header>

      <Form.Fieldset title="Dit is een fieldset">

        <Form.Field
          label="Voornaam"
          direction="horizontal"
          helpText="Cras justo odio, dapibus ac facilisis in, egestas eget quam."
        >
          <Form.Input
            placeholder="Vul hier je voornaam in.."
          />
        </Form.Field>

      </Form.Fieldset>

      <Form.Fieldset title="Dit is een ander fieldset">

        <Form.Field
          label="Voornaam"
          direction="horizontal"
          helpText="Cras justo odio, dapibus ac facilisis in, egestas eget quam."
        >
          <Form.Input
            placeholder="Vul hier je voornaam in.."
          />
        </Form.Field>

        <Form.Field
          label="Nieuwsbrief ontvangen"
          direction="horizontal"
        >
          <Form.Switch
            checked
            disabled
            onChange={() => {}}
          />
        </Form.Field>

      </Form.Fieldset>
    </Form.Form>
  )
}

export default Layout

Components

Form

About

The basic form component. Wraps Fields and Fieldsets. No custom styling yet.

Header

About

Form Header component. Wraps children in H1 with a border.

Properties

PropValuesDefaultRequired
childrenReactElementfalse

Fieldset

About

The fieldset wraps any number of field components. TODO: Fieldsets should be able to display a number in front of the title

Properties

PropValuesDefaultRequired
childrenReactElementfalse
titlestringtrue

Field

About

The Field component wraps a Input component and delivers a label and helptext on correct places. Is provided with aria-attributes for screenreaders.

Properties

PropValuesDefaultRequired
childrenReactElementfalse
labelstringfalse
helpTextstringfalse
directionenumverticaltrue

Hoc Components and Object Composition

TLDR; added multiple HoC containers for forms Components. These in general will handle:

  • Events: before a call from each component was necessary to call Parent / WrappedContainer (callParent), these events where not stacked. Events are now handled with composition; each HoC can receive multipe events, these events are stacked and called by any which is { enhanced => with => Events }.

Changelog

3.0.1

1 year ago

3.0.0

1 year ago

2.0.3

3 years ago

2.0.2

3 years ago

2.0.4

3 years ago

2.0.1

3 years ago

1.4.19

5 years ago

1.4.17

5 years ago

1.4.18

5 years ago

1.4.16

6 years ago

1.4.15

6 years ago

1.4.14

6 years ago

1.4.13

7 years ago

1.4.12

7 years ago

1.4.11

7 years ago

1.4.10

7 years ago

1.4.9

7 years ago

1.4.8

7 years ago

1.4.7

7 years ago

1.4.6

7 years ago

1.4.5

7 years ago

1.4.4

7 years ago

1.4.3

7 years ago

1.4.2

7 years ago

1.4.1

7 years ago

1.4.0

7 years ago

1.3.5

7 years ago

1.3.4

7 years ago

1.3.3

7 years ago

1.3.2

7 years ago

1.3.1

7 years ago

1.3.0

7 years ago

1.2.21

7 years ago

1.2.20

7 years ago

1.2.19

7 years ago

1.2.18

7 years ago

1.2.17

7 years ago

1.2.16

7 years ago

1.2.15

7 years ago

1.2.14

7 years ago

1.2.13

7 years ago

1.2.12

7 years ago

1.2.11

7 years ago

1.2.10

7 years ago

1.2.9

7 years ago

1.2.8

7 years ago

1.2.7

8 years ago

1.2.6

8 years ago

1.2.5

8 years ago

1.2.4

8 years ago

1.2.3

8 years ago

1.2.2

8 years ago

1.2.1

8 years ago

1.2.0

8 years ago

1.1.27

8 years ago

1.1.26

8 years ago

1.1.25

8 years ago

1.1.24

8 years ago

1.1.23

8 years ago

1.1.22

8 years ago

1.1.21

8 years ago

1.1.20

8 years ago

1.1.19

8 years ago

1.1.18

8 years ago

1.1.17

8 years ago

1.1.16

8 years ago

1.1.15

8 years ago

1.1.14

8 years ago

1.1.13

8 years ago

1.1.12

8 years ago

1.1.11

8 years ago

1.1.10

8 years ago

1.1.9

8 years ago

1.1.8

8 years ago

1.1.7

8 years ago

1.1.6

8 years ago

1.1.5

8 years ago

1.1.4

8 years ago

1.1.3

8 years ago

1.1.2

8 years ago

1.1.1

8 years ago

1.1.0

8 years ago

1.0.2

8 years ago

2.0.0

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago

0.0.3-beta

9 years ago

0.0.2

9 years ago