Commit Graph

71 Commits

Author SHA1 Message Date
Ashwin Ramaswami
174e136af4 Fix uiSchema for additionalProperties (#1144)
* fix: uiSchema for additionalProperties #1132

* doc: update readme

* doc: fix toc

* doc: update docs
2019-01-24 08:37:53 -08:00
Lucian Buzzo
66d800e915 Add preliminary support for the anyOf keyword (#1118)
* Add preliminary support for the anyOf keyword

This change introduces support for the `anyOf` keyword. The keyword is NOT
supported in arrays (using the `items` keyword).
Options provided in the `anyOf` keyword are rendered using a new
component called `AnyOfField` this can be overridden with a custom
field using the `fields` property.

Signed-off-by: Lucian <lucian.buzzo@gmail.com>

* Refactor unnecessary .map

* Change selected option based on form data

* Update README

* Update README FAQ

* Share prop types between fields
2019-01-14 14:49:28 -05:00
Ashwin Ramaswami
597a7ba4eb Give ids to array and object fields (#1102)
* fix typo in css code

* Give ids to array fields and object fields, give "root" id to the topmost fieldset
2019-01-10 15:01:32 -05:00
olzraiti
a3e0e9a397 Pass disabled and readonly to object field template (#1088)
* ObjectField passes readonly & disabled prop to template

* Update README
2019-01-10 14:10:33 -05:00
Ethan Glasser-Camp
7027672c22 Refactor onPropertyChange and reword comment 2019-01-10 11:07:29 -05:00
Ethan Glasser-Camp
4ec38908d3 Rename onDropIndexClick in objects to onDropPropertyClick 2019-01-10 10:41:30 -05:00
Mateusz Puczyński
73794911b1 Add delete button for additionalProperties key-value pair (#1123)
* add del button functionality

* delete unnecesary console.logs

* fix tests

* remove unnecesary console.log

* Fix disappearing key-value pair and repair delete button

* Add .vscode to gitignore

* fix tests

* Make test work for select/radio button

* Add test cases

* Remove one file from PR and one helper function

* Add one classname for value input

* remove accidentally added .vscode

* linted codebase

* remove inline styles, make use of bootstrap 3 styles and fix related tests

* revert changes to .gitignore
2019-01-10 10:34:33 -05:00
Mateusz Puczyński
ae9e58de8b Key-value pair in additional properties retains order when edited (#1101)
* Make key-value pair stay at the same place and remove strange behavior with label

* Handle case when you click input and immediately unclick

* Add two test cases
2018-12-21 17:35:52 +01:00
Christian Lent
1d54db6de4 Add preliminary support for object "additionalProperties" (#1021)
* Initial commit for additionalProperties

* Resolve PR feedback:
* avoid modifying parameters
* avoid unnecessary let using returns
* eliminate unnecessary bind
* terse closure return syntax
* take advantage of class fields

* Fix validation naming issue on additional key change
Fix misnamed "additionalProperties" attribute
Invert conditional to reduce indentation
Added unit tests to ensure non-schema properties are maintained
2018-10-01 21:17:11 -04:00
Edgar Hipp
e4378c2a0b Add idPrefix option (#883) 2018-04-10 10:51:11 +02:00
Ethan Glasser-Camp
2a07603132 Merge branch 'error-schema-array' of git://github.com/knilink/react-jsonschema-form into knilink-error-schema-array 2018-01-26 18:27:59 -05:00
Mark Fulton
132a6cce1f Initial support for property & schema dependencies (#659)
* Add initial dependencies support

- Property dependencies: Make additional properties required whenever
  a trigger property is specified.
- Schema dependencies: Dynamically add schema properties based on data
  entered.

* README.md: explain  usage in schema dependencies

* Add documentation explaining how oneOf works here

* Throw error on wildly invalid schema

* Use hasOwnProperty to check for possibly-missing key

* Tests that demonstrate a need for a retrieveSchema

* retrieveSchema needs to happen before checking for oneOf
2017-10-23 12:01:32 -04:00
olzraiti
8e9aec57dd Add ObjectFieldTemplate (#653)
* Add ObjectFieldTemplate

* ObjectFieldTemplate properties are representative objects instead of React elements

* prettier

* Update README & rename ObjectFieldTemplate props children to content

* Update README

* Fix ObjectFieldTemplate test

* Ran cs-format & cs-check

* Remove index from ObjectFieldTemplate props

* Ran cs-format & cs-check
2017-10-05 16:46:39 -04:00
Ethan Glasser-Camp
e092296314 Update prettier to 1.7.2 (#706)
* Update prettier to 1.7.2

* Reformat some stuff
2017-09-29 13:23:11 -04:00
olzraiti
3c070ee9b7 Make BaseInput overridable (#699)
* Make BaseInput overridable

* prettier

* Update README
2017-09-29 11:13:48 -04:00
Nicolas Perriault
03b54d0860 Upgrade prettier to 1.6.1. 2017-08-31 08:00:12 +02:00
David McNeil
915a92bda6 Fix ui:title for objects (#665) (#676) 2017-08-23 08:58:57 +02:00
Mauricio Minella
40fc2fd4c7 Onfocus support (#657) 2017-08-11 14:28:45 +02:00
Nicolas Perriault
2d390f6e56 Upgrade prettier to 1.5.2. (#629) 2017-07-07 14:59:25 +02:00
Stefan
41f68166eb Add ui:description and ui:title mechanism to ObjectField. (#619) 2017-07-07 14:38:27 +02:00
Vinh Le
34ac1a005f Hotfix for #575 (#576) 2017-05-07 19:45:55 +02:00
Vinh Le
c7c67687b4 Add lazy getDefaultRegistry (#575) 2017-05-07 15:07:25 +02:00
Nicolas Perriault
1a05a86c9b Fix #563: Remove remaining React.PropTypes references. 2017-04-28 16:45:59 +02:00
Nicolas Perriault
84b0a53d05 Update prettier to 1.0.0. (#545) 2017-04-13 20:03:05 +02:00
Nicolas Perriault
7206a2ad09 Add pre-commit hook for linting and code autoformatting. (#510)
Also updated prettier options to use es5 trailing commas.
2017-03-12 12:01:37 +01:00
Nicolas Perriault
4ef657c811 Prettierify code. (#507) 2017-03-10 00:15:31 +01:00
link
c5a69af88d Directly update errorSchema in onChange 2017-03-04 09:13:40 +11:00
link
6f2cb33fca Fix #221: No validating but updating errorSchema base on array operation when live validation is off. 2017-03-04 01:36:03 +11:00
knilink
241ace3269 Centralized shouldComponentUpdate handling in SchemaField (#490) 2017-03-02 22:56:46 +01:00
knilink
4b6fe72e7c Turn ObjectField and ArrayField into stateless components (#480) 2017-02-22 08:52:54 +01:00
Jeff Balboni
befe59666c Add support for a onBlur event handler (#431) 2017-01-24 10:06:36 +01:00
Simon Hewitt
e7b2c4d0a2 asNumber: return undefined when value is empty string (#369)
Also

* add eslint rule for spacing
2016-11-02 18:18:01 +01:00
Fabien Rassinier
9590c42131 Add some rules to keep JS and JSX well formatted (#361) 2016-10-26 13:45:59 +02:00
olzraiti
06f4d8a6d8 Pass empty title to TitleField instead of name (#311) 2016-10-14 11:37:42 +02:00
olzraiti
3f36b18cb3 Add support for form context (#285) 2016-08-30 09:01:01 +02:00
Nicolas Perriault
83523a5058 Fix #255: Replace deeper dependency with local deepEquals helper. (#264) 2016-07-06 13:43:49 +02:00
Amarnath Ravikumar
29ab430f52 Fix corrupted idSchema when the schema has a field named id (#262) 2016-07-06 08:59:14 +02:00
Nicolas Perriault
6a2b0d1569 Fixes #250: Add support for custom widget options. (#252)
pair=@magopian
2016-06-30 17:37:20 +02:00
Nicolas Perriault
a5a0a89cf3 Fixes #231: Reset ObjectField state on diffing formData keys. (#234) 2016-06-09 16:19:11 +02:00
Alexis Metaireau
e6079b1b15 Custom description field (#214)
Among other cosmetic changes, we now pass custom titles and descriptions using
the `fields` property (whereas we were passing it directly before, a behaviour
now deprecated).
2016-05-26 08:35:12 +02:00
Nicolas Perriault
402a3e766f Fixes #195: Preserve array field error index. (#199) 2016-05-10 14:28:07 +02:00
Nicolas Perriault
fdd426e0a9 Fixes #186: Array and Object field TitleField ids. (#187) 2016-05-05 23:06:57 +02:00
Nicolas Perriault
f6b0ddb69b Fixes #126: Added support for disabled and readonly fields (#183) 2016-05-04 08:55:44 +02:00
Nicolas Perriault
6159cb4834 Added a safeRenderCompletion Form prop.
This new option is mostly useful in a test environment where we
don't really want to bother waiting for an arbitrary amount
of time for renders to fully complete, so tests are easier
to write and to read.
2016-04-27 13:03:20 +02:00
Ari-Pekka Koponen
c73e039515 Fixes #31: Denote required Array and Object fields.
r=@n1k0

- Refactored Arrays to use TitleField, added required prop to TitleField.
- Updated the README to reflect the changes.
2016-04-26 14:40:29 +02:00
Nicolas Perriault
0abe31c5d5 Fixes #147: Revisited strategy for async renderings. (#153) 2016-04-21 08:45:38 +02:00
Nicolas Perriault
9e0aca5b16 Object field description is now rendered in a paragraph. 2016-04-12 14:33:17 +02:00
Nicolas Perriault
a58901997a Leverage registry for widgets.
Closes #127.
2016-04-07 10:16:49 +02:00
Nicolas Perriault
6a57c37a57 Now using component instance bound properties.
This eases binding and passing the same reference of
bound functions to child components.
2016-03-29 18:59:52 +02:00
Nicolas Perriault
3c4f5f5400 Added autogenerated ids. 2016-03-27 19:04:42 +02:00