@aemforms/af-core 0.22.54 → 0.22.56
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/BaseNode.js +2 -1
- package/lib/Field.d.ts +3 -0
- package/lib/Field.js +18 -2
- package/lib/Form.d.ts +1 -0
- package/lib/types/Json.d.ts +1 -0
- package/package.json +2 -2
package/lib/BaseNode.js
CHANGED
|
@@ -19,6 +19,8 @@ exports.editableProperties = [
|
|
|
19
19
|
'description',
|
|
20
20
|
'visible',
|
|
21
21
|
'enabled',
|
|
22
|
+
'valid',
|
|
23
|
+
'errorMessage',
|
|
22
24
|
'readOnly',
|
|
23
25
|
'enum',
|
|
24
26
|
'enumNames',
|
|
@@ -33,7 +35,6 @@ exports.editableProperties = [
|
|
|
33
35
|
];
|
|
34
36
|
exports.dynamicProps = [
|
|
35
37
|
...exports.editableProperties,
|
|
36
|
-
'valid',
|
|
37
38
|
'index',
|
|
38
39
|
'activeChild'
|
|
39
40
|
];
|
package/lib/Field.d.ts
CHANGED
|
@@ -33,6 +33,7 @@ declare class Field extends Scriptable<FieldJson> implements FieldModel {
|
|
|
33
33
|
get enabled(): boolean | undefined;
|
|
34
34
|
set enabled(e: boolean | undefined);
|
|
35
35
|
get valid(): any;
|
|
36
|
+
set valid(e: any);
|
|
36
37
|
get validity(): any;
|
|
37
38
|
get emptyValue(): "" | null | undefined;
|
|
38
39
|
get enum(): any[] | undefined;
|
|
@@ -59,6 +60,7 @@ declare class Field extends Scriptable<FieldJson> implements FieldModel {
|
|
|
59
60
|
toString(): any;
|
|
60
61
|
getErrorMessage(constraint: keyof (ConstraintsMessages)): string;
|
|
61
62
|
get errorMessage(): string | undefined;
|
|
63
|
+
set errorMessage(e: string | undefined);
|
|
62
64
|
get screenReaderText(): string | undefined;
|
|
63
65
|
_getConstraintObject(): {
|
|
64
66
|
enum: (constraint: any, inputVal: any) => {
|
|
@@ -184,6 +186,7 @@ declare class Field extends Scriptable<FieldJson> implements FieldModel {
|
|
|
184
186
|
dataRef?: string | null | undefined;
|
|
185
187
|
lang?: string | undefined;
|
|
186
188
|
':type': string;
|
|
189
|
+
appliedCssClassNames?: string | undefined;
|
|
187
190
|
label?: import("./types").Label | undefined;
|
|
188
191
|
visible?: boolean | undefined;
|
|
189
192
|
name?: string | undefined;
|
package/lib/Field.js
CHANGED
|
@@ -204,6 +204,13 @@ class Field extends Scriptable_1.default {
|
|
|
204
204
|
var _a, _b;
|
|
205
205
|
return (_b = (_a = this._jsonModel) === null || _a === void 0 ? void 0 : _a.validity) === null || _b === void 0 ? void 0 : _b.valid;
|
|
206
206
|
}
|
|
207
|
+
set valid(e) {
|
|
208
|
+
const validity = {
|
|
209
|
+
valid: e
|
|
210
|
+
};
|
|
211
|
+
this._setProperty('valid', e);
|
|
212
|
+
this._setProperty('validity', validity);
|
|
213
|
+
}
|
|
207
214
|
get validity() {
|
|
208
215
|
return this._jsonModel.validity;
|
|
209
216
|
}
|
|
@@ -416,6 +423,10 @@ class Field extends Scriptable_1.default {
|
|
|
416
423
|
get errorMessage() {
|
|
417
424
|
return this._jsonModel.errorMessage;
|
|
418
425
|
}
|
|
426
|
+
set errorMessage(e) {
|
|
427
|
+
this._setProperty('errorMessage', e);
|
|
428
|
+
this._setProperty('validationMessage', e);
|
|
429
|
+
}
|
|
419
430
|
get screenReaderText() {
|
|
420
431
|
return this._jsonModel.screenReaderText;
|
|
421
432
|
}
|
|
@@ -665,9 +676,11 @@ class Field extends Scriptable_1.default {
|
|
|
665
676
|
'validity': Object.assign({ valid: false }, (constraint != null ? { [types_1.constraintKeys[constraint]]: true } : {}))
|
|
666
677
|
};
|
|
667
678
|
const updates = this._applyUpdates(['valid', 'errorMessage', 'validationMessage', 'validity'], changes);
|
|
668
|
-
this.triggerValidationEvent(updates);
|
|
669
679
|
const changeAction = new Events_1.Change({ changes: [].concat(Object.values(updates)) });
|
|
670
|
-
|
|
680
|
+
if (changeAction.payload.changes.length !== 0) {
|
|
681
|
+
this.triggerValidationEvent(updates);
|
|
682
|
+
this.dispatch(changeAction);
|
|
683
|
+
}
|
|
671
684
|
}
|
|
672
685
|
}
|
|
673
686
|
__decorate([
|
|
@@ -699,6 +712,9 @@ __decorate([
|
|
|
699
712
|
__decorate([
|
|
700
713
|
(0, BaseNode_1.dependencyTracked)()
|
|
701
714
|
], Field.prototype, "value", null);
|
|
715
|
+
__decorate([
|
|
716
|
+
(0, BaseNode_1.dependencyTracked)()
|
|
717
|
+
], Field.prototype, "errorMessage", null);
|
|
702
718
|
__decorate([
|
|
703
719
|
(0, BaseNode_1.include)('text-input', 'date-input', 'file-input', 'email')
|
|
704
720
|
], Field.prototype, "format", null);
|
package/lib/Form.d.ts
CHANGED
|
@@ -51,6 +51,7 @@ declare class Form extends Container<FormJson> implements FormModel {
|
|
|
51
51
|
dataRef?: string | null | undefined;
|
|
52
52
|
lang?: string | undefined;
|
|
53
53
|
':type'?: string | undefined;
|
|
54
|
+
appliedCssClassNames?: string | undefined;
|
|
54
55
|
label?: import("./types/Json").Label | undefined;
|
|
55
56
|
enabled?: boolean | undefined;
|
|
56
57
|
visible?: boolean | undefined;
|
package/lib/types/Json.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aemforms/af-core",
|
|
3
|
-
"version": "0.22.
|
|
3
|
+
"version": "0.22.56",
|
|
4
4
|
"description": "Core Module for Forms Runtime",
|
|
5
5
|
"author": "Adobe Systems",
|
|
6
6
|
"license": "Adobe Proprietary",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
37
|
"@adobe/json-formula": "0.1.50",
|
|
38
|
-
"@aemforms/af-formatters": "^0.22.
|
|
38
|
+
"@aemforms/af-formatters": "^0.22.56"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
41
|
"@babel/preset-env": "^7.20.2",
|