* Switch JSON path tests to strict equality
The tests for `stringifyPath` and `parsePath` were using
[`assert.deepEqual`](https://nodejs.org/api/assert.html#assert_assert_deepequal_actual_expected_message),
which was causing the tests to pass when they should not have. Beyond
that, the `deepEqual` method is deprecated. The suggested replacement is
[`assert.deepStrictEqual`](https://nodejs.org/api/assert.html#assert_assert_deepstrictequal_actual_expected_message),
which causes the tests to fail where they should.
The difference between the two methods is the different between `==` and
`===`. `deepEqual` would coerce the input `"2"` to `2`, so the test was
passing even though the output was of the wrong type (string instead of
number).
* Coerce numeric indices to numbers in parsePath
This fixes a regression introduced in
3e7e1cebfd.
* Fixed a bug where using hyphens in the path for custom validatons error didn't work
* Added closing bracket check and unit tests
* Automatically add brackets when path component contains hyphens
* use regexp to check if dot notation is safe
* Display schema defaults inline next to Nodes
* Improve usability of schema default display
- When value is default, make it bold and set a tooltip
- When value is not default, display the default next to the value
- When value is default and is a select, show "Default" next to it
- Lighten the color of green used for values
This increases the contrast between normal values and default values.
* Remove styling when value is the same as the schema default
This styling may have been confusing for some users and may not have
been applicable to all situations.
* Apply is-default and is-not-default classes to values
This allows the user to supply custom styling for these states.
To set styles for values that match the default value in the schema, use
the class `.jsoneditor-is-default`.
To set styles for values that _do not_ match the default value in the
schema, use the class `.jsoneditor-is-not-default`.
* Remove extra newline after schema examples in tooltip
* Move schema default display from inline to tooltip
This presents less opportunity for user confusion and is likely to be
more widely applicable.
* Add examples of schema metadata display
* Add documentation on styling
* Add test setup function for simulating browser globals
* Add tests for Node._findSchema
Some of the tests currently fail, which will be helpful in fixing the
incorrect behavior of the `_findSchema` function. The current failures
are:
- the last schema in the pattern properties object is always returned
- when pattern properties are present, wrong object schemas are returned
* Add schema-based tooltip to field names
Using the `title` and `description` properties from the schema, create
and set a tooltip on each field name. When the user hovers over a field
name, it will show the applicable information: title, description, both,
or neither, depending on what data is present in the schema.
* Remove redundant setting of field name title
* Remove accidental .only() from Node tests
* Fix Node._findSchema for pattern properties
The method now checks the key against the RegExp specified by the
pattern properties instead of always returning the last pattern property
in the object.
* Fix path used for recursive calls in Node._findSchema
* Add failing Node._findSchema tests for multi-level pattern properties
* Fix Node._findSchema for schemas with properties and patternProperties
Using the `title` and `description` properties from the schema, create
and set a tooltip on each field name. When the user hovers over a field
name, it will show the applicable information: title, description, both,
or neither, depending on what data is present in the schema.
* update for gulp 4.0.0
* added an ability to set custom css classes for Node's field and value
* v5.9.8-beta
* wip
* wip
* wip
* wip
* wip
* wip
* cleanup
* reverted ./dist/ files
* cleanup
* reverted package-lock.json
* updated onClassName signature
* recursive node class name update on change
* add/remove css classes on node
* example fix
* merged remote
* removed yarn.lock
* changes get reflected on both sides of the diff view in example 20
* refactored and cleaned up example 20
* Update Node.js
add both:
1. fix childSchema with $ref, and not display the select element on the child schema because of not found enum
2. add title from schema description to show the tips for user input
* Update Node.js
fix this.editor.options.schema could be nullable.
* Update Node.js
improve the Node._findSchema to Node._findSchema = function (schema, schemaRefs, path) { ... } by tylerchen
* update Node._findSchema to Node._findSchema = function (schema, schemaRefs, path)