Skip to content

Commit 9016a26

Browse files
committed
Update docs for next release
1 parent 45f48c9 commit 9016a26

File tree

3 files changed

+114
-4
lines changed

3 files changed

+114
-4
lines changed

docs/src/demos.js

Lines changed: 93 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,99 @@ const DEMOS = [
331331
age: {type: 'number', required: true, minimum: 50},
332332
}
333333
}
334-
}
334+
},
335+
336+
{
337+
name: 'AnyOf',
338+
slug: 'anyof',
339+
schema: {
340+
type: 'object',
341+
title: 'Person info',
342+
properties: {
343+
name: {type: 'string'},
344+
age_or_birthdate: {
345+
title: 'Age or Birthdate',
346+
anyOf: [
347+
{type: 'integer', title: 'Age'},
348+
{type: 'string', 'format': 'date-time', title: 'Birthdate'},
349+
]
350+
},
351+
contacts: {
352+
type: 'array',
353+
items: {
354+
anyOf: [
355+
{type: 'string', title: 'Email', placeholder: 'you@example.com'},
356+
{type: 'integer', title: 'Phone', placeholder: '1234567890'},
357+
]
358+
}
359+
}
360+
},
361+
},
362+
},
363+
364+
{
365+
name: 'OneOf',
366+
slug: 'oneof',
367+
schema: {
368+
type: 'object',
369+
properties: {
370+
location: {
371+
oneOf: [
372+
{
373+
type: 'object',
374+
title: 'Coordinates',
375+
properties: {
376+
latitude: {type: 'number'},
377+
longitude: {type: 'number'},
378+
}
379+
},
380+
{
381+
type: 'object',
382+
title: 'City & Country',
383+
properties: {
384+
city: {type: 'string'},
385+
country: {type: 'string'},
386+
}
387+
},
388+
]
389+
},
390+
secret_code: {
391+
oneOf: [
392+
{type: 'integer', title: 'Numeric code'},
393+
{type: 'string', title: 'String code'},
394+
]
395+
},
396+
},
397+
},
398+
},
399+
400+
{
401+
name: 'AllOf',
402+
slug: 'allof',
403+
schema: {
404+
type: 'object',
405+
title: 'Person',
406+
allOf: [
407+
{
408+
properties: {
409+
name: {type: 'string'}
410+
}
411+
},
412+
{
413+
properties: {
414+
age: {type: 'integer'}
415+
}
416+
},
417+
]
418+
},
419+
description: () => (
420+
<div>
421+
Currently, <code>allOf</code> supports very limited features.
422+
It only works inside objects and won't work inside arrays or other types.
423+
</div>
424+
)
425+
426+
},
335427
];
336428

337429

docs/static/css/docs.css

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ h1, h2, h3, h4, h5, h6 {
1818
a {
1919
color: #40f;
2020
text-decoration: underline dashed;
21+
text-decoration-thickness: 1px;
22+
text-underline-offset: 0.13em;
2123
}
2224
a:hover {
2325
color: #3409ab;
@@ -654,6 +656,22 @@ button.rjf-add-button:hover {
654656
}
655657
.rjf-form-row-controls button span {
656658
pointer-events: none;
659+
}
660+
.rjf-oneof-group {
661+
border: 0;
662+
padding: 0;
663+
}
664+
.rjf-oneof-selector {
665+
display: table;
666+
width: 100%;
667+
padding: 5px;
668+
padding-bottom: 10px;
669+
}
670+
.rjf-oneof-selector .rjf-oneof-selector-input {
671+
672+
}
673+
.rjf-oneof-selector label + .rjf-oneof-selector-input {
674+
657675
}
658676
.rjf-input-group,
659677
.rjf-file-field {

docs/static/js/playground.js

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)