Skip to content

Commit ec54471

Browse files
jacqueswhojacques-trixtaepicfaace
authored
Feature/semantic documentation (rjsf-team#1907)
* rjsf-team#1897 * fix: documentation links * Apply suggestions from code review Co-authored-by: Ashwin Ramaswami <aramaswamis@gmail.com> Co-authored-by: Jacques <jacques@trixta.com> Co-authored-by: Ashwin Ramaswami <aramaswamis@gmail.com>
1 parent 60fdcad commit ec54471

File tree

7 files changed

+27
-23
lines changed

7 files changed

+27
-23
lines changed

docs/advanced-customization/internals.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ This component follows [JSON Schema](http://json-schema.org/documentation.html)
1414

1515
The `anyOf` and `oneOf` keywords are supported; however, properties declared inside the `anyOf/oneOf` should not overlap with properties "outside" of the `anyOf/oneOf`.
1616

17-
You can also use `oneOf` with [schema dependencies](dependencies.md#schema-dependencies) to dynamically add schema properties based on input data.
17+
You can also use `oneOf` with [schema dependencies](../usage/dependencies.md) to dynamically add schema properties based on input data.
1818

19-
The `allOf` keyword is supported; it uses [json-schema-merge-allof](https://github.com/mokkabonna/json-schema-merge-allof) to merge subschemas to render the final combined schema in the form. When these subschemas are incompatible, though (or if the library has an error merging it), the `allOf` keyword is dropped from the schema.
19+
The `allOf` keyword is supported; it uses [json-schema-merge-allof](https://github.com/mokkabonna/json-schema-merge-allof) to merge subschemas to render the final combined schema in the form. When these subschemas are incompatible, though (or if the library has an error merging it), the `allOf` keyword is dropped from the schema.
2020

2121
* `"additionalProperties":false` produces incorrect schemas when used with [schema dependencies](#schema-dependencies). This library does not remove extra properties, which causes validation to fail. It is recommended to avoid setting `"additionalProperties":false` when you use schema dependencies. See [#848](https://github.com/rjsf-team/react-jsonschema-form/issues/848) [#902](https://github.com/rjsf-team/rjsf-team/issues/902) [#992](https://github.com/rjsf-team/rjsf-team/issues/992)
2222

@@ -32,9 +32,9 @@ Check out the defaults example on the [live playground](https://rjsf-team.github
3232

3333
There are three different cases which need to be considered for the merging. Objects, arrays and scalar values. This library always deeply merges any defaults with the existing form data for objects.
3434

35-
This are the rules which are used when injecting the defaults:
35+
This are the rules which are used when injecting the defaults:
3636

37-
- When the is a scalar in the form data, nothing is changed.
37+
- When there is a scalar in the form data, nothing is changed.
3838
- When the value is `undefined` in the form data, the default is created in the form data.
3939
- When the value is an object in the form data, the defaults are deeply merged into the form data, using the rules defined here for the deep merge.
4040
- Then the value is an array in the form data, defaults are only injected in existing array items. No new array items will be created, even if the schema has minItems or additional items defined.

docs/api-reference/form-props.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ The value of this prop will be passed to the `accept-charset` [HTML attribute on
66

77
## action
88

9-
The value of this prop will be passed to the `action` [HTML attribute on the form](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/form#attr-action).
9+
The value of this prop will be passed to the `action` [HTML attribute on the form](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/form#attr-action).
1010

1111
Note that this just renders the `action` attribute in the HTML markup. There is no real network request being sent to this `action` on submit. Instead, react-jsonschema-form catches the submit event with `event.preventDefault()` and then calls the [`onSubmit`](#onSubmit) function, where you could send a request programmatically with `fetch` or similar.
1212

@@ -16,7 +16,7 @@ This prop allows you to validate the form data against another JSON Schema meta
1616

1717
## ArrayFieldTemplate
1818

19-
React component used to customize how alls arrays are rendered on the form. See [Custom Templates](custom-templates.md) for more information.
19+
React component used to customize how alls arrays are rendered on the form. See [Custom Templates](../advanced-customization/custom-templates.md) for more information.
2020

2121
## autoComplete
2222

@@ -57,28 +57,28 @@ This prop allows you to define custom formats for validation. See [Validation](.
5757

5858
## disabled
5959

60-
It's possible to disable the whole form by setting the `disabled` prop. The `disabled` prop is then forwarded down to each field of the form.
60+
It's possible to disable the whole form by setting the `disabled` prop. The `disabled` prop is then forwarded down to each field of the form.
6161

6262
```jsx
6363
const schema = {
6464
type: "string"
6565
};
6666

6767
render((
68-
<Form schema={schema}
68+
<Form schema={schema}
6969
disabled />
7070
), document.getElementById("app"));
7171
```
7272

73-
If you just want to disable some of the fields, see the `ui:disabled` parameter in `uiSchema`.
73+
If you just want to disable some of the fields, see the `ui:disabled` parameter in `uiSchema`.
7474

7575
## enctype
7676

7777
The value of this prop will be passed to the `enctype` [HTML attribute on the form](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/form#attr-enctype).
7878

7979
## extraErrors
8080

81-
This prop allows passing in custom errors that are augmented with the existing JSON Schema errors on the form; it can be used to implement asynchronous validation. See [Validation](../usage/validation.md) for more information.
81+
This prop allows passing in custom errors that are augmented with the existing JSON Schema errors on the form; it can be used to implement asynchronous validation. See [Validation](../usage/validation.md) for more information.
8282

8383
## ErrorList
8484

@@ -147,7 +147,7 @@ If set to true, turns off all validation. Set to `false` by default.
147147

148148
## ObjectFieldTemplate
149149

150-
React component used to customize how all objects are rendered in the form. See [Custom Templates](custom-templates.md) for more information.
150+
React component used to customize how all objects are rendered in the form. See [Custom Templates](../advanced-customization/custom-templates.md) for more information.
151151

152152
## omitExtraData
153153

@@ -201,7 +201,7 @@ render((
201201
202202
## schema
203203

204-
Form schema. We support JSON schema draft-07 by default. See [Schema Reference](api-reference-schema.md) for more information.
204+
Form schema. We support JSON schema draft-07 by default. See [Schema Reference]((https://json-schema.org/draft-07/json-schema-release-notes.html) for more information.
205205

206206
## showErrorList
207207

@@ -238,7 +238,7 @@ A function can be passed to this prop in order to make modifications to the defa
238238

239239
## uiSchema
240240

241-
Form uiSchema. See [uiSchema Reference](api-reference-uischema.md) for more information.
241+
Form uiSchema. See [uiSchema Reference](uiSchema.md) for more information.
242242

243243
## validate
244244

File renamed without changes.

docs/api-reference/uiSchema.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
# uiSchema
2-
32
JSON Schema is limited for describing how a given data type should be rendered as a form input component. That's why this library introduces the concept of uiSchema.
43

54
A UI schema is basically an object literal providing information on **how** the form should be rendered, while the JSON schema tells **what**.
@@ -218,4 +217,6 @@ const uiSchema = {
218217
"ui:widget": "password",
219218
"ui:title": "Your password"
220219
};
221-
```
220+
```
221+
## Theme Options
222+
[Semantic UI](themes/semantic-ui/uiSchema.md)

docs/quickstart.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ render((
3838
), document.getElementById("app"));
3939
```
4040

41-
For more information and examples of JSON Schema properties that this library supports, see [Using JSON Schema](usage/schema.md).
41+
For more information and examples of JSON Schema properties that this library supports, see [Using JSON Schema](/docs/usage/single.md).
4242

4343
## Form uiSchema
4444

@@ -62,7 +62,7 @@ render((
6262
```
6363

6464
To customize object fields in the uiSchema, the structure of the
65-
uiSchema should be `{key: value}`, where `key` is the property key and `value` is an
65+
uiSchema should be `{key: value}`, where `key` is the property key and `value` is an
6666
object with the uiSchema configuration for that particular property. For example:
6767

6868
```jsx
@@ -127,7 +127,7 @@ render((
127127
128128
### Form event handlers
129129

130-
You can use event handlers such as `onChange`, `onError`, `onSubmit`, `onFocus`, and `onBlur` on the `<Form />` component; see the [Form Props Reference](api-reference-props.md) for more details.
130+
You can use event handlers such as `onChange`, `onError`, `onSubmit`, `onFocus`, and `onBlur` on the `<Form />` component; see the [Form Props Reference](/docs/api-reference/form-props.md) for more details.
131131

132132
### Controlled component
133133

@@ -147,4 +147,4 @@ const App = () => {
147147
render((
148148
<App />
149149
), document.getElementById("app"));
150-
```
150+
```

docs/usage/themes.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ meaning that you must load the Bootstrap stylesheet on the page to view the form
88
Theme Name | Status | Package Name / Link
99
---------- | ------- | -----------
1010
Bootstrap 3 (default) | Published | `@rjsf/core`
11-
material-ui | Published | `@rjsf/material-ui`
12-
fluent-ui | Published | `@rjsf/fluent-ui`
11+
material-ui | Published | `@rjsf/material-ui`
12+
fluent-ui | Published | `@rjsf/fluent-ui`
1313
antd | Published | `@rjsf/antd`
1414
Semantic UI | Published | `@rjsf/semantic-ui`
1515

@@ -23,7 +23,7 @@ first install both `@rjsf/core` and `@rjsf/material-ui`. Then you can import the
2323
import Form from "@rjsf/material-ui";
2424
```
2525

26-
If you would like to contribute a theme with a new UI framework, please develop the theme using the `withTheme` component described in [Theme Customization](theme-customization.md) and make a PR!
26+
If you would like to contribute a theme with a new UI framework, please develop the theme using the `withTheme` component described in [Theme Customization](../advanced-customization/custom-themes.md) and make a PR!
2727

2828
You can also use the uiSchema to add custom CSS class names to your form.
2929

mkdocs.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,10 @@ nav:
2525
- Other Internals: advanced-customization/internals.md
2626
- Contributing: contributing.md
2727
- API Reference:
28-
- uiSchema: api-reference/uiSchema.md
28+
- uiSchema:
29+
- General Reference: api-reference/uiSchema.md
30+
- Theme-Specific Reference:
31+
- semantic-ui: api-reference/themes/semantic-ui/uiSchema.md
2932
- "&lt;Form /&gt; props": api-reference/form-props.md
3033

3134
markdown_extensions:

0 commit comments

Comments
 (0)