You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: packages/react-renderer-demo/src/app/pages/renderer/component-api.md
+20-18Lines changed: 20 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -23,26 +23,19 @@ Each mapper provided in `react-forms` provides a default API for standard compon
23
23
Standard components are:
24
24
<br />
25
25
26
-
Wrapped in formGroup: <br/>
27
-
text field <br/>
28
-
text area <br/>
29
-
select <br/>
30
-
checkbox <br/>
31
-
radio <br/>
32
-
switch <br/>
33
-
timepicker/datepicker <br/>
34
-
<br />
35
-
36
-
Others: <br/>
37
-
subform <br/>
38
-
tab/tab item <br/>
39
-
wizard <br/>
26
+
|Change form state (input fields)|Others|
27
+
|---------------------------------------|------|
28
+
|text field|subform|
29
+
|textarea|tabs/tab item|
30
+
|select|wizard|
31
+
|checkbox|plain text|
32
+
|radio|
33
+
|switch|
34
+
|timepicker/datepicker|
40
35
41
-
# FormGroup wrapped components
36
+
# Form fields components
42
37
43
-
Basic components are wrapped in formGroup. FormGroup provides a standard API to show labels, helper texts, errors, etc.
44
-
45
-
All those components provides a shared group of props:
38
+
Basic components that can change the form state (inputs) share common props. These components are using [useFieldApi](/renderer/component-mapping#usefieldapi) or [FieldProvider](/renderer/component-mapping#fieldprovider) to access the form state.
46
39
47
40
|Prop|Type|Description|
48
41
|----|:--:|----------:|
@@ -190,6 +183,15 @@ Wizard step <br/>
190
183
191
184
<ExampleLinkto='wizard' />
192
185
186
+
## Plain text
187
+
188
+
|Prop|Type|Description|
189
+
|----|:--:|----------:|
190
+
|label|node/string|A text|
191
+
|variant|string|A variant (depends on mappers: html tags)|
Copy file name to clipboardExpand all lines: packages/react-renderer-demo/src/app/pages/renderer/condition.md
+27-6Lines changed: 27 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -34,7 +34,9 @@ You can show a field only if it meets a condition:
34
34
35
35
`when` - is name of field where the value is stored, **always required!**. It can be either string `'field-name'` or array of strings `['field-1', 'field-2']`.
36
36
37
-
### OR condition. At least one condition must be met
37
+
### OR
38
+
39
+
At least one condition must be met.
38
40
39
41
You can use `or` object to connect two conditions. If either of of fields with name `a` and `b` will have value `x` condition is met.
40
42
@@ -81,7 +83,11 @@ Also, you can use a shorthand:
81
83
}
82
84
```
83
85
84
-
### AND condition. All conditions must be met
86
+
<RawComponentsource="conditions/or" />
87
+
88
+
### AND
89
+
90
+
All conditions must be met.
85
91
86
92
Field `controlled-field-1` must have value `Bar` and field `controlled-field-2` must include `FooBar` somewhere in its value to display field `BarFoo`.
87
93
@@ -154,6 +160,8 @@ Or you can use a shorthand:
154
160
}
155
161
```
156
162
163
+
<RawComponentsource="conditions/and" />
164
+
157
165
### Not
158
166
159
167
You can simple negate a condition by using a `not`. Following condition is a true, when both of values are not a `x`.
@@ -189,9 +197,11 @@ You can simple negate a condition by using a `not`. Following condition is a tru
189
197
190
198
As the value you can use an array (AND) or another condition.
191
199
200
+
<RawComponentsource="conditions/not" />
201
+
192
202
### Nesting
193
203
194
-
Of course it is possible to neste conditions:
204
+
Of course it is possible to nest conditions:
195
205
196
206
```jsx
197
207
condition = {
@@ -202,6 +212,8 @@ condition = {
202
212
};
203
213
```
204
214
215
+
<RawComponentsource="condition" />
216
+
205
217
## Conditions
206
218
207
219
### Is
@@ -217,6 +229,9 @@ condition: {
217
229
// Foo == 'Bar' => true
218
230
// Foo == 'Not a Bar' => false
219
231
```
232
+
233
+
<RawComponentsource="conditions/is" />
234
+
220
235
### Is empty
221
236
222
237
`isEmpty` - tests if the value is empty (using [lodash function](https://lodash.com/docs/4.17.11#isEmpty))
@@ -237,6 +252,9 @@ condition: {
237
252
// Foo = false => true
238
253
// Foo = true => false
239
254
```
255
+
256
+
<RawComponentsource="conditions/is-empty" />
257
+
240
258
### Is not empty
241
259
242
260
`isNotEmpty` - tests if the value is not empty (using [lodash function](https://lodash.com/docs/4.17.11#isEmpty))
@@ -257,6 +275,9 @@ condition: {
257
275
// Foo = true => false
258
276
// Foo = true => true
259
277
```
278
+
279
+
<RawComponentsource="conditions/is-not-empty" />
280
+
260
281
### Pattern
261
282
262
283
`pattern` - tests if the value matches the pattern
0 commit comments