Skip to content

Commit 07acf21

Browse files
committed
Remote markdown hyphens
1 parent e2702ec commit 07acf21

File tree

11 files changed

+2
-98
lines changed

11 files changed

+2
-98
lines changed

articles/ArrayForm.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,10 @@ A component that provides array manipulation functions and optimizations. This i
88

99
The parent form which contains the array field to create a array child form for.
1010

11-
---
12-
1311
#### `name` **(required)**
1412

1513
The name of the array field in the parent form.
1614

17-
---
18-
1915
#### `render` **(required)**
2016

2117
A function that renders the array.

articles/ChildForm.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,10 @@ Use the `ChildForm` component if you want to make fields inside an object field
88

99
The parent form which contains the object field to create a child form for.
1010

11-
---
12-
1311
#### `name` (required)
1412

1513
The name of the field in the parent form to create
1614

17-
---
18-
1915
#### `render` (required)
2016

2117
A function that renders, and creates inputs for the child form, which is passed as a parameter.

articles/FormError.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,4 @@ function CustomFormError<T>(props: { form: FormState<T>; name: keyof T }) {
3636
}
3737
```
3838

39-
You can also create custom input components, look [here](/docs/Custom-inputs).
39+
You can also create custom input components, look [here](/docs/Custom-input).

articles/FormInput.md

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -98,58 +98,40 @@ You **cannot** use FormInput to create a submit button (type="submit"). Use one
9898

9999
The form or child form that contains the field to bind to this input.
100100

101-
---
102-
103101
#### `name` **(required)**
104102

105103
The name of the field in the form that will be bound to this input.
106104

107-
---
108-
109105
#### `errorClassName` and `errorStyle`
110106

111107
The className and/or style to set when there is an error on this field. Default className is `typed-form-error`.
112108

113-
---
114-
115109
#### `dirtyClassName` and `dirtyStyle`
116110

117111
The className and/or style to set when this field has been modified. Default className is `typed-form-dirty`.
118112

119-
---
120-
121113
#### `disableOnSubmitting`
122114

123115
Disable this input on submit? Default is `true`.
124116

125-
---
126-
127117
#### `dateAsNumber` (only type="date")
128118

129119
Serialize this fields value as a timestamp instead of a Date object.
130120

131-
---
132-
133121
#### `hideWhenNull`
134122

135123
Set this prop if you want to hide this input when its field value is `null/undefined`. Default is `false`.
136124

137-
---
138-
139125
#### `setNullOnUncheck` and `setUndefinedOnUncheck` (only type="checkbox")
140126

141127
When using one of these props, the checkbox will set null/undefined on the field when unchecked. This prop is only valid for checkboxes. (Can mimic the same behaviour with radio buttons using value props).
142128

143129
Make sure you pass along a `value` too, this is the value that will be set when it gets checked again. Not doing so, will cause a console warning.
144130

145-
---
146-
147131
#### `value` (only type="radio" or type="checkbox")
148132

149133
- The value of the radio button when using multi-value fields.
150134
- The value of the checkbox when using primitive arrays.
151135
- The on-checked value of the checkbox when using the `setNullOnUncheck/setUndefinedOnUncheck` prop.
152136

153-
---
154-
155137
All of the input components are wrappers and abstractions around the [`useListener`](/docs/useListener) hook. Using this hook, you can create your own [custom inputs](/docs/Custom-input).

articles/FormSelect.md

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -32,32 +32,22 @@ const form = useForm({
3232

3333
The form or child form that contains the field to bind to this select input.
3434

35-
---
36-
3735
#### `name` (required)
3836

3937
The name of the field in the form that will be bound to this select input.
4038

41-
---
42-
4339
#### `errorClassName` and `errorStyle`
4440

4541
The className and/or style to set when there is an error on this field. Default className is `typed-form-error`.
4642

47-
---
48-
4943
#### `dirtyClassName` and `dirtyStyle`
5044

5145
The className and/or style to set when this field has been modified. Default className is `typed-form-dirty`.
5246

53-
---
54-
5547
#### `disableOnSubmitting`
5648

5749
Disable this select input on submit? Default is `true`.
5850

59-
---
60-
6151
#### `hideWhenNull`
6252

6353
Set this prop if you want to hide this input when its field value is `null/undefined`. Default is `false`.

articles/FormState.md

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -10,58 +10,40 @@ This class provides a lot of useful functions to manipulate form values and stat
1010

1111
The values of the form. Can be set with `setValues()`.
1212

13-
---
14-
1513
#### `defaultValues` **(readonly)**
1614

1715
The default values of the form. Input elements do not change this. This gets used to reset the form and to calculate dirty flags. Can be set with `setDefaultValues()`.
1816

19-
---
20-
2117
#### `childMap` **(readonly)**
2218

2319
Each child form bound registers itself in this object. It maps field names to `ChildFormState` instances.
2420

25-
---
26-
2721
#### `dirtyMap` **(readonly)**
2822

2923
Maps field names to dirty values. A field is dirty when its value is not equal anymore to its default value.
3024

31-
---
32-
3325
#### `errorMap` **(readonly)**
3426

3527
Maps field names to errors. Can be set with `setErrors()`.
3628

37-
---
38-
3929
#### `state` **(readonly)**
4030

4131
Gets the current form state. Form state contains variables like `isSubmitting` etc. This state is synced with parent and child forms. Can be set with [`setState()`](/docs/FormState#setstatenewstate).
4232

4333
See [`useForm`](/docs/useForm) for a guide on how to create custom form state.
4434

45-
---
46-
4735
#### `dirty` **(readonly)**
4836

4937
Has any field in this form been modified?
5038

51-
---
52-
5339
#### `error` **(readonly)**
5440

5541
Is there any error in this form?
5642

57-
---
58-
5943
#### `validateOnChange`
6044

6145
Validate on value change?
6246

63-
---
64-
6547
#### `validator`
6648

6749
The form's validator.
@@ -77,8 +59,6 @@ Sets a field value or default value.
7759
- `validate` **(optional)**: Validate? When defined, overrides `validateOnChange`.
7860
- `isDefault` **(optional, false)**: When true, updates the default value instead of the normal value.
7961

80-
---
81-
8262
#### `setValues(values, validate = true, isDefault = false, notifyChild = true, notifyParent = true)`
8363

8464
Sets values _OR_ default values for a form.
@@ -87,62 +67,46 @@ Sets values _OR_ default values for a form.
8767
- `validate` **(optional)**: Validate? When defined, overrides `validateOnChange`.
8868
- `isDefault` **(optional, false)**: When true, updates the default values instead of the normal values. Only updates one or the other, to set both at the same time, use `setDefaultValues()` or 2 function calls.
8969

90-
---
91-
9270
#### `setDefaultValues(values, validate = true, notifyChild = true, notifyParent = true)`
9371

9472
Set both values _AND_ default values for a form. If you only want to set default values, use `setValues(...,...,true)`.
9573

9674
- `values` **(required)**: The new values to set on this form.
9775
- `validate` **(optional)**: Validate? When defined, overrides `validateOnChange`.
9876

99-
---
100-
10177
#### `validate()`
10278

10379
Force validation on this form. Required when `validateOnChange` is disabled. Takes no parameters.
10480

105-
---
106-
10781
#### `setError(name, error, notifyChild = true, notifyParent = true)`
10882

10983
Set an error on a specific field in this form.
11084

11185
- `name` **(required)**: The field name to set an error on.
11286
- `error` **(required)**: The error to set.
11387

114-
---
115-
11688
#### `setErrors(errors, notifyChild = true, notifyParent = true)`
11789

11890
Set all the errors on this form and child forms.
11991

12092
- `errors` **(required)**: The new errors for this form. Use {} to clear errors. **The format of this error object must follow the same structure of the values object, but each value is replaced by its error.**
12193

122-
---
123-
12494
#### `resetAll(validate = true, notifyChild = true, notifyParent = true)`
12595

12696
Resets the values in this form to the default values. Causes validation.
12797

128-
---
129-
13098
#### `reset(name, validate = true, notifyChild = true, notifyParent = true)`
13199

132100
Reset a specific field in this form to its default value.
133101

134102
- `name` **(required)**: The field to reset to its default value.
135103

136-
---
137-
138104
#### `setState(newState)`
139105

140106
Updates the state of this form, this causes every input to rerender. This also updates the state in parent and child forms **by default**.
141107

142108
- `newState` **(required)**: The new form state.
143109

144-
---
145-
146110
### notifyChild/notifyParent parameters **(Advanced)**
147111

148112
A lot of functions have the parameters `notifyChild/notifyParent`, these parameters tells the form if the action that was just done has to notify parent or child forms. **Parent and child forms are always notified by default**
@@ -157,8 +121,6 @@ ChildFormState inherits from FormState, and provides these additional properties
157121

158122
The parent form of this form. Which is a `FormState` or `ChildFormState` instance.
159123

160-
---
161-
162124
#### `name`
163125

164126
The name of this form, which is the name of the field in the parent form which this child form represents.

articles/FormTextArea.md

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,32 +20,22 @@ Pretty self-explanatory...
2020

2121
The form or child form that contains the field to bind to this input.
2222

23-
---
24-
2523
#### `name` (required)
2624

2725
The name of the field in the form that will be bound to this textarea.
2826

29-
---
30-
3127
#### `errorClassName` and `errorStyle`
3228

3329
The className and/or style to set when there is an error on this field. Default className is `typed-form-error`.
3430

35-
---
36-
3731
#### `dirtyClassName` and `dirtyStyle`
3832

3933
The className and/or style to set when this field has been modified. Default className is `typed-form-dirty`.
4034

41-
---
42-
4335
#### `disableOnSubmitting`
4436

4537
Disable this textarea on submit? Default is `true`.
4638

47-
---
48-
4939
#### `hideWhenNull`
5040

5141
Set this prop if you want to hide this input when its field value is `null/undefined`. Default is `false`.

articles/Getting-started.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ This library provides the following built-in components to create type-checked i
6565
- [FormSelect](/docs/FormSelect)
6666
- [FormTextArea](/docs/FormTextArea)
6767

68-
When these inputs do not satisfy your needs, you can always [implement your own](/docs/Custom-inputs#example-custom-input). These built-in components are just abstractions around hook calls.
68+
When these inputs do not satisfy your needs, you can always [implement your own](/docs/Custom-input#example-custom-input). These built-in components are just abstractions around hook calls.
6969

7070
✔️ **Example type-checked form consisting of 2 fields**
7171

articles/useArrayForm.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@ This hook must be called, unconditionally, at the start of your component, just
1414

1515
The parent form which contains the array field to create a array child form for.
1616

17-
---
18-
1917
#### `name` **(required)**
2018

2119
The name of the array field in the parent form.

articles/useChildForm.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@ This hook must be called, unconditionally, at the start of your component, just
1414

1515
The parent form that contains the field to create a child form for.
1616

17-
---
18-
1917
#### `name` **(required)**
2018

2119
The name of a field in the parent form to create a child form for.

0 commit comments

Comments
 (0)