@acorex/components 16.18.21 → 16.18.22
Sign up to get free protection for your applications and to get access to all the features.
@@ -1,5 +1,5 @@
|
|
1
1
|
import { AXConfig } from '@acorex/core';
|
2
|
-
import { ChangeDetectionStrategy, ChangeDetectorRef, Component, ContentChild, ElementRef, Input, ViewChild, ViewEncapsulation, inject, model, signal, } from '@angular/core';
|
2
|
+
import { ChangeDetectionStrategy, ChangeDetectorRef, Component, ContentChild, ElementRef, Input, ViewChild, ViewEncapsulation, afterNextRender, inject, model, signal, } from '@angular/core';
|
3
3
|
import { AXBaseComponent, AXValidatableComponent, } from '../base/element.class';
|
4
4
|
import * as i0 from "@angular/core";
|
5
5
|
import * as i1 from "@angular/common";
|
@@ -11,8 +11,7 @@ export class AXFormGroupComponent extends AXBaseComponent {
|
|
11
11
|
required = AXConfig.get('form')?.required || false;
|
12
12
|
labelMode = model(AXConfig.get('form')?.labelMode || 'static');
|
13
13
|
isFloatActive = signal(false);
|
14
|
-
|
15
|
-
debugger;
|
14
|
+
#nextRender = afterNextRender(() => {
|
16
15
|
this.required = this.component?.validation?.rules?.some((c) => c.type === 'required');
|
17
16
|
this.div.nativeElement.classList.add(this.size);
|
18
17
|
if (this.required) {
|
@@ -20,13 +19,6 @@ export class AXFormGroupComponent extends AXBaseComponent {
|
|
20
19
|
}
|
21
20
|
const input = this.component.ref.nativeElement.querySelector('input');
|
22
21
|
const textArea = this.component.ref.nativeElement.querySelector('textarea');
|
23
|
-
if ((this.component.value ||
|
24
|
-
this.component.selectedItems?.length > 0) &&
|
25
|
-
this.labelMode() === 'float') {
|
26
|
-
this.labelMode.set('over');
|
27
|
-
this.isFloatActive.set(true);
|
28
|
-
this.crd.detectChanges();
|
29
|
-
}
|
30
22
|
if (input) {
|
31
23
|
input.addEventListener('focus', this.handleFocus.bind(this));
|
32
24
|
input.addEventListener('blur', this.handeleBlur.bind(this));
|
@@ -35,7 +27,16 @@ export class AXFormGroupComponent extends AXBaseComponent {
|
|
35
27
|
textArea.addEventListener('focus', this.handleFocus.bind(this));
|
36
28
|
textArea.addEventListener('blur', this.handeleBlur.bind(this));
|
37
29
|
}
|
38
|
-
|
30
|
+
setTimeout(() => {
|
31
|
+
if ((this.component.value ||
|
32
|
+
this.component.selectedItems?.length > 0) &&
|
33
|
+
this.labelMode() === 'float') {
|
34
|
+
this.labelMode.set('over');
|
35
|
+
this.isFloatActive.set(true);
|
36
|
+
this.crd.detectChanges();
|
37
|
+
}
|
38
|
+
}, 200);
|
39
|
+
});
|
39
40
|
handleFocus() {
|
40
41
|
if (this.labelMode() === 'float') {
|
41
42
|
this.isFloatActive.set(true);
|
@@ -74,4 +75,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.7", ngImpor
|
|
74
75
|
type: ContentChild,
|
75
76
|
args: [AXValidatableComponent]
|
76
77
|
}] } });
|
77
|
-
//# sourceMappingURL=data:application/json;base64,
|
78
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZm9ybS1ncm91cC5jb21wb25lbnQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi9saWJzL2NvbXBvbmVudHMvc3JjL2xpYi9mb3JtLWdyb3VwL2Zvcm0tZ3JvdXAuY29tcG9uZW50LnRzIiwiLi4vLi4vLi4vLi4vLi4vLi4vbGlicy9jb21wb25lbnRzL3NyYy9saWIvZm9ybS1ncm91cC9mb3JtLWdyb3VwLmNvbXBvbmVudC5odG1sIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxRQUFRLEVBQUUsTUFBTSxjQUFjLENBQUM7QUFDeEMsT0FBTyxFQUNMLHVCQUF1QixFQUN2QixpQkFBaUIsRUFDakIsU0FBUyxFQUNULFlBQVksRUFDWixVQUFVLEVBQ1YsS0FBSyxFQUVMLFNBQVMsRUFDVCxpQkFBaUIsRUFDakIsZUFBZSxFQUNmLE1BQU0sRUFDTixLQU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A+XG4gICAgPGRpdiBjbGFzcz1cImF4IGJ1dHRvbnMgc3RhcnQtYnV0dG9uc1wiICNzdGFydEJ1dHRvbnM+XG4gICAgICA8bmctY29udGVudCBzZWxlY3Q9XCJheC1idXR0b25bc3RhcnRdXCI+PC9uZy1jb250ZW50PlxuICAgIDwvZGl2PlxuICAgIDxkaXZcbiAgICAgIFtjbGFzc109XCJsYWJlbE1vZGUoKSA9PT0gJ292ZXInID8gJ2NvbnRlbnQgYXgtb3Zlci1hcHBseScgOiAnY29udGVudCdcIlxuICAgICAgI2NvbnRlbnRcbiAgICA+XG4gICAgICA8bmctY29udGVudD48L25nLWNvbnRlbnQ+XG4gICAgPC9kaXY+XG4gICAgPGRpdiBjbGFzcz1cImF4IGJ1dHRvbnMgZW5kLWJ1dHRvbnNcIiAjZW5kQnV0dG9ucz5cbiAgICAgIDxuZy1jb250ZW50IHNlbGVjdD1cImF4LWJ1dHRvbltlbmRdXCI+PC9uZy1jb250ZW50PlxuICAgICAgPG5nLWNvbnRlbnQgc2VsZWN0PVwiYXgtYnV0dG9uXCI+PC9uZy1jb250ZW50PlxuICAgIDwvZGl2PlxuICA8L2Rpdj5cbjwvZGl2PlxuIl19
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import * as i0 from '@angular/core';
|
2
|
-
import { ElementRef, Component, Inject, Optional, Input, Injectable, EventEmitter, Output, Directive, ViewChild, ContentChild, TemplateRef, ViewEncapsulation, HostListener, NgModule, ChangeDetectionStrategy, Attribute, ContentChildren, ViewChildren, inject, ChangeDetectorRef, model, signal, input, contentChildren,
|
2
|
+
import { ElementRef, Component, Inject, Optional, Input, Injectable, EventEmitter, Output, Directive, ViewChild, ContentChild, TemplateRef, ViewEncapsulation, HostListener, NgModule, ChangeDetectionStrategy, Attribute, ContentChildren, ViewChildren, inject, ChangeDetectorRef, model, signal, afterNextRender, input, contentChildren, NO_ERRORS_SCHEMA, ViewContainerRef, HostBinding } from '@angular/core';
|
3
3
|
import * as i1$2 from '@acorex/core';
|
4
4
|
import { AXTranslator, AXHtmlUtil, AXConfig, AXDateTime, AXDateTimeRange, AXCoreModule, AXTranslatorModule, AXObjectUtil, AXScrollModule, setPropByPath, AXColorUtil } from '@acorex/core';
|
5
5
|
import * as i1 from '@angular/cdk/overlay';
|
@@ -6182,8 +6182,7 @@ class AXFormGroupComponent extends AXBaseComponent {
|
|
6182
6182
|
required = AXConfig.get('form')?.required || false;
|
6183
6183
|
labelMode = model(AXConfig.get('form')?.labelMode || 'static');
|
6184
6184
|
isFloatActive = signal(false);
|
6185
|
-
|
6186
|
-
debugger;
|
6185
|
+
#nextRender = afterNextRender(() => {
|
6187
6186
|
this.required = this.component?.validation?.rules?.some((c) => c.type === 'required');
|
6188
6187
|
this.div.nativeElement.classList.add(this.size);
|
6189
6188
|
if (this.required) {
|
@@ -6191,13 +6190,6 @@ class AXFormGroupComponent extends AXBaseComponent {
|
|
6191
6190
|
}
|
6192
6191
|
const input = this.component.ref.nativeElement.querySelector('input');
|
6193
6192
|
const textArea = this.component.ref.nativeElement.querySelector('textarea');
|
6194
|
-
if ((this.component.value ||
|
6195
|
-
this.component.selectedItems?.length > 0) &&
|
6196
|
-
this.labelMode() === 'float') {
|
6197
|
-
this.labelMode.set('over');
|
6198
|
-
this.isFloatActive.set(true);
|
6199
|
-
this.crd.detectChanges();
|
6200
|
-
}
|
6201
6193
|
if (input) {
|
6202
6194
|
input.addEventListener('focus', this.handleFocus.bind(this));
|
6203
6195
|
input.addEventListener('blur', this.handeleBlur.bind(this));
|
@@ -6206,7 +6198,16 @@ class AXFormGroupComponent extends AXBaseComponent {
|
|
6206
6198
|
textArea.addEventListener('focus', this.handleFocus.bind(this));
|
6207
6199
|
textArea.addEventListener('blur', this.handeleBlur.bind(this));
|
6208
6200
|
}
|
6209
|
-
|
6201
|
+
setTimeout(() => {
|
6202
|
+
if ((this.component.value ||
|
6203
|
+
this.component.selectedItems?.length > 0) &&
|
6204
|
+
this.labelMode() === 'float') {
|
6205
|
+
this.labelMode.set('over');
|
6206
|
+
this.isFloatActive.set(true);
|
6207
|
+
this.crd.detectChanges();
|
6208
|
+
}
|
6209
|
+
}, 200);
|
6210
|
+
});
|
6210
6211
|
handleFocus() {
|
6211
6212
|
if (this.labelMode() === 'float') {
|
6212
6213
|
this.isFloatActive.set(true);
|