@koumoul/vjsf 2.21.3 → 2.22.0

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.
package/lib/VJsfNoDeps.js CHANGED
@@ -17,9 +17,10 @@ import Tooltip from './mixins/Tooltip'
17
17
  import Validatable from './mixins/Validatable'
18
18
  import Dependent from './mixins/Dependent'
19
19
  import exprEvalParser from './utils/expr-eval-parser'
20
- const expr = require('property-expr')
20
+ import expr from 'property-expr'
21
+ import debug from 'debug'
21
22
 
22
- const debugExpr = require('debug')('vjsf:expr')
23
+ const debugExpr = debug('vjsf:expr')
23
24
  debugExpr.log = console.log.bind(console)
24
25
 
25
26
  const mountingIncs = {}
@@ -3,9 +3,14 @@
3
3
 
4
4
  import Vue from 'vue'
5
5
  import Draggable from 'vuedraggable'
6
+ import markdownIt from 'markdown-it'
7
+ import ajv from 'ajv'
8
+ import ajvI18n from 'ajv-i18n'
9
+ import ajvFormats from 'ajv-formats'
10
+
6
11
  const _global = (typeof window !== 'undefined' && window) || (typeof global !== 'undefined' && global) || {}
7
- _global.markdownit = require('markdown-it')
12
+ _global.markdownit = markdownIt
8
13
  Vue.component('Draggable', Draggable)
9
- _global.Ajv = require('ajv')
10
- _global.ajvLocalize = require('ajv-i18n')
11
- _global.ajvAddFormats = require('ajv-formats')
14
+ _global.Ajv = ajv
15
+ _global.ajvLocalize = ajvI18n
16
+ _global.ajvAddFormats = ajvFormats
@@ -1,7 +1,7 @@
1
1
  import { deepEqual } from 'fast-equals'
2
2
  import selectUtils from '../utils/select'
3
- const matchAll = require('match-all')
4
- const debounce = require('debounce-promise')
3
+ import matchAll from 'match-all'
4
+ import debounce from 'debounce-promise'
5
5
 
6
6
  export default {
7
7
  data() {
@@ -1,7 +1,7 @@
1
1
  // Inspired by this without the fs references :
2
2
  // https://github.com/coderofsalvation/json-ref-lite/blob/master/index.js
3
3
 
4
- var expr = require('property-expr')
4
+ import expr from 'property-expr'
5
5
 
6
6
  const jrefs = {}
7
7
  jrefs.cache = {}
@@ -15,7 +15,7 @@ export const getRules = (schema, fullSchema, options, required, isOneOfSelect) =
15
15
  }
16
16
  if (fullSchema.type === 'string' && fullSchema.minLength !== undefined) {
17
17
  const msg = options.messages.minLength.replace('{minLength}', fullSchema.minLength.toLocaleString(options.locale))
18
- rules.push((val) => (val === undefined || val === null || val.length >= fullSchema.minLength) || msg)
18
+ rules.push((val) => (val === undefined || val === null || (!required && val === '') || val.length >= fullSchema.minLength) || msg)
19
19
  }
20
20
  if (fullSchema.type === 'string' && fullSchema.maxLength !== undefined) {
21
21
  const msg = options.messages.maxLength.replace('{maxLength}', fullSchema.maxLength.toLocaleString(options.locale))
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@koumoul/vjsf",
3
- "version": "2.21.3",
3
+ "version": "2.22.0",
4
4
  "description": "Generate forms for the vuetify UI library (vuejs) based on annotated JSON schemas.",
5
5
  "main": "dist/main.js",
6
6
  "scripts": {