@acorex/cdk 20.4.5 → 20.4.7
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.
|
@@ -710,7 +710,8 @@ class MXValueComponent extends MXInteractiveComponent {
|
|
|
710
710
|
const container = container_classes.some((c) => this.getHostElement().classList.contains(c))
|
|
711
711
|
? this.getHostElement()
|
|
712
712
|
: this.getHostElement().querySelector('.ax-editor-container');
|
|
713
|
-
const formField = container
|
|
713
|
+
const formField = (container || this.getHostElement()).closest('ax-form-field') ||
|
|
714
|
+
container?.closest('ax-checkbox');
|
|
714
715
|
const label = formField?.querySelector('ax-label') || formField?.querySelector('label');
|
|
715
716
|
//
|
|
716
717
|
const rules = this.validationService.ruleFor(this.value);
|
|
@@ -734,7 +735,7 @@ class MXValueComponent extends MXInteractiveComponent {
|
|
|
734
735
|
const container = this.getHostElement().classList.contains('ax-editor-container')
|
|
735
736
|
? this.getHostElement()
|
|
736
737
|
: this.getHostElement().querySelector('.ax-editor-container');
|
|
737
|
-
const formField = container
|
|
738
|
+
const formField = (container || this.getHostElement()).closest('ax-form-field');
|
|
738
739
|
const label = formField?.querySelector('ax-label') || formField?.querySelector('label');
|
|
739
740
|
let target = container || this.getHostElement().firstElementChild;
|
|
740
741
|
if (target?.querySelector('.ax-error-container')) {
|
|
@@ -759,11 +760,14 @@ class MXValueComponent extends MXInteractiveComponent {
|
|
|
759
760
|
break;
|
|
760
761
|
case 'error':
|
|
761
762
|
this.setState('clear');
|
|
762
|
-
if (
|
|
763
|
-
const
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
763
|
+
if (isPlatformBrowser(this.platformID)) {
|
|
764
|
+
const message = args[0] ?? '';
|
|
765
|
+
if (message) {
|
|
766
|
+
const span = this.document.createElement('span');
|
|
767
|
+
span.innerHTML = message;
|
|
768
|
+
span.classList.add('ax-error-message');
|
|
769
|
+
parent.appendChild(span);
|
|
770
|
+
}
|
|
767
771
|
}
|
|
768
772
|
label?.classList.add('ax-state-error');
|
|
769
773
|
target.classList.add('ax-state-error');
|