@json-layout/vocabulary 2.3.0 → 2.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/normalize.js +1 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@json-layout/vocabulary",
3
- "version": "2.3.0",
3
+ "version": "2.3.1",
4
4
  "description": "Main JSON Layout vocabulary as JSON schemas and Typescript types. Also contains some small utility functions to validate and normalize annotations.",
5
5
  "type": "module",
6
6
  "exports": {
package/src/normalize.js CHANGED
@@ -140,7 +140,7 @@ function getDefaultComp (partial, schemaFragment, type, options, schemaChild) {
140
140
  if (schemaChild === 'patternProperties') return 'list'
141
141
  if (hasSimpleType && schemaFragment.enum) return schemaFragment.enum.length > 20 ? 'autocomplete' : 'select'
142
142
  if (hasSimpleType && schemaFragment.oneOf) return schemaFragment.oneOf.length > 20 ? 'autocomplete' : 'select'
143
- if (hasSimpleType && schemaFragment.examples && options.useExamples === 'items') return type === 'string' ? 'combobox' : 'number-combobox'
143
+ if (hasSimpleType && schemaFragment.examples && options.useExamples === 'items' && !(schemaFragment.format && ['date', 'date-time', 'time'].includes(schemaFragment.format))) return type === 'string' ? 'combobox' : 'number-combobox'
144
144
  if (hasSimpleType && schemaFragment.anyOf && schemaFragment.anyOf.length && Object.keys(schemaFragment.anyOf[schemaFragment.anyOf.length - 1]).length === 0) {
145
145
  return type === 'string' ? 'combobox' : 'number-combobox'
146
146
  }