@ekzo-dev/bootstrap-addons 5.2.0 → 5.2.2
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.
|
|
4
|
+
"version": "5.2.2",
|
|
5
5
|
"homepage": "https://github.com/ekzo-dev/aurelia-components/tree/main/packages/bootstrap-addons",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -38,7 +38,7 @@ export class BsJsonInput {
|
|
|
38
38
|
@bindable(coerceBoolean)
|
|
39
39
|
disabled: boolean = false;
|
|
40
40
|
|
|
41
|
-
@bindable()
|
|
41
|
+
@bindable({ set: (v) => (v === '' || v === true || v === 'true' ? true : v) })
|
|
42
42
|
jsonSchema?: JSONSchema | boolean;
|
|
43
43
|
|
|
44
44
|
@bindable()
|
|
@@ -101,7 +101,7 @@ export class BsJsonInput {
|
|
|
101
101
|
};
|
|
102
102
|
|
|
103
103
|
get inputRequired(): boolean {
|
|
104
|
-
return this.required && 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.
|
|
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),
|