@ekzo-dev/bootstrap-addons 5.2.1 → 5.2.3

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@ekzo-dev/bootstrap-addons",
3
3
  "description": "Aurelia Bootstrap additional component",
4
- "version": "5.2.1",
4
+ "version": "5.2.3",
5
5
  "homepage": "https://github.com/ekzo-dev/aurelia-components/tree/main/packages/bootstrap-addons",
6
6
  "repository": {
7
7
  "type": "git",
@@ -9,7 +9,7 @@ import Ajv, { ErrorObject, Options } from 'ajv';
9
9
  import Ajv2019 from 'ajv/dist/2019';
10
10
  import Ajv2020 from 'ajv/dist/2020';
11
11
  import addFormats from 'ajv-formats';
12
- import { bindable, customElement } from 'aurelia';
12
+ import { bindable, BindingMode, customElement } from 'aurelia';
13
13
  import { JSONValue, parsePath } from 'immutable-json-patch';
14
14
  import {
15
15
  JSONEditorPropsOptional,
@@ -29,7 +29,7 @@ import {
29
29
  dependencies: [JsonEditor],
30
30
  })
31
31
  export class BsJsonInput {
32
- @bindable()
32
+ @bindable({ mode: BindingMode.twoWay })
33
33
  value: unknown;
34
34
 
35
35
  @bindable(coerceBoolean)
@@ -101,7 +101,7 @@ export class BsJsonInput {
101
101
  };
102
102
 
103
103
  get inputRequired(): boolean {
104
- return this.required && this.value != null && this.value !== '';
104
+ return this.required && (this.value == null || this.value === '');
105
105
  }
106
106
 
107
107
  get validator(): Validator | undefined {
@@ -167,7 +167,9 @@ export class BsJsonInput {
167
167
  }
168
168
 
169
169
  #processErrors(errors: ErrorObject[] | null, json: unknown): ValidationError[] {
170
- this.input.setCustomValidity(errors?.length ? "JSON doesn't match schema" : '');
170
+ const message = this.jsonSchema === true ? 'JSON is not a valid JSONSchema' : 'JSON does not match schema';
171
+
172
+ this.input.setCustomValidity(errors?.length ? message : '');
171
173
 
172
174
  return (errors || []).map((error) => ({
173
175
  path: parsePath(json as JSONValue, error.instancePath),