@acorex/components 16.18.31 → 16.18.33
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, afterNextRender, inject, model,
|
2
|
+
import { ChangeDetectionStrategy, ChangeDetectorRef, Component, ContentChild, ElementRef, Input, ViewChild, ViewEncapsulation, afterNextRender, inject, model, } 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";
|
@@ -10,7 +10,6 @@ export class AXFormGroupComponent extends AXBaseComponent {
|
|
10
10
|
component;
|
11
11
|
required = AXConfig.get('form')?.required || false;
|
12
12
|
labelMode = model(AXConfig.get('form')?.labelMode || 'static');
|
13
|
-
inputHeight = signal('auto');
|
14
13
|
#nextRender = afterNextRender(() => {
|
15
14
|
this.required = this.component?.validation?.rules?.some((c) => c.type === 'required' && c.enabled);
|
16
15
|
this.div.nativeElement.classList.add(this.size);
|
@@ -18,35 +17,42 @@ export class AXFormGroupComponent extends AXBaseComponent {
|
|
18
17
|
this.div.nativeElement.classList.add('required-state');
|
19
18
|
}
|
20
19
|
const convertTypeComponent = this.component;
|
21
|
-
if (!convertTypeComponent.componentName) {
|
22
|
-
this.inputHeight.set('2.625rem');
|
23
|
-
}
|
24
20
|
if (this.labelMode() === 'static' || this.labelMode() === 'over')
|
25
21
|
return;
|
26
22
|
if (convertTypeComponent.value ||
|
27
23
|
convertTypeComponent.selectedItems?.length > 0) {
|
28
24
|
this.labelMode.set('over');
|
29
25
|
}
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
26
|
+
switch (convertTypeComponent.componentName) {
|
27
|
+
case 'selectBox':
|
28
|
+
convertTypeComponent.selectedItemsChange.subscribe((e) => {
|
29
|
+
if (e.length > 0) {
|
30
|
+
this.labelMode.set('over');
|
31
|
+
}
|
32
|
+
else {
|
33
|
+
this.labelMode.set('float');
|
34
|
+
}
|
35
|
+
});
|
36
|
+
break;
|
37
|
+
case 'lov':
|
38
|
+
convertTypeComponent.onSelectionChange.subscribe((e) => {
|
39
|
+
if (e.data.length > 0) {
|
40
|
+
this.labelMode.set('over');
|
41
|
+
}
|
42
|
+
else {
|
43
|
+
this.labelMode.set('float');
|
44
|
+
}
|
45
|
+
});
|
46
|
+
break;
|
47
|
+
default:
|
48
|
+
convertTypeComponent.onValueChanged.subscribe((e) => {
|
49
|
+
if (e.value) {
|
50
|
+
this.labelMode.set('over');
|
51
|
+
}
|
52
|
+
else {
|
53
|
+
this.labelMode.set('float');
|
54
|
+
}
|
55
|
+
});
|
50
56
|
}
|
51
57
|
if (convertTypeComponent.componentName === 'textArea') {
|
52
58
|
const textArea = this.component;
|
@@ -58,11 +64,11 @@ export class AXFormGroupComponent extends AXBaseComponent {
|
|
58
64
|
}
|
59
65
|
});
|
60
66
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.7", ngImport: i0, type: AXFormGroupComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
61
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "18.0.7", type: AXFormGroupComponent, selector: "ax-form-group", inputs: { size: { classPropertyName: "size", publicName: "size", isSignal: false, isRequired: false, transformFunction: null }, labelMode: { classPropertyName: "labelMode", publicName: "labelMode", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { labelMode: "labelModeChange" }, host: { styleAttribute: "width: 100%; display:contents;" }, queries: [{ propertyName: "component", first: true, predicate: AXValidatableComponent, descendants: true }], viewQueries: [{ propertyName: "div", first: true, predicate: ["div"], descendants: true }], usesInheritance: true, ngImport: i0, template: "<div\n class=\"ax form-group {{ size }} ax-form-group-container {{\n labelMode() !== 'static' && 'ax-margin-form'\n }}\"\n>\n <div class=\"ax-lable-{{ labelMode() }}\">\n <ng-content select=\"ax-label\"></ng-content>\n </div>\n <div\n
|
67
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "18.0.7", type: AXFormGroupComponent, selector: "ax-form-group", inputs: { size: { classPropertyName: "size", publicName: "size", isSignal: false, isRequired: false, transformFunction: null }, labelMode: { classPropertyName: "labelMode", publicName: "labelMode", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { labelMode: "labelModeChange" }, host: { styleAttribute: "width: 100%; display:contents;" }, queries: [{ propertyName: "component", first: true, predicate: AXValidatableComponent, descendants: true }], viewQueries: [{ propertyName: "div", first: true, predicate: ["div"], descendants: true }], usesInheritance: true, ngImport: i0, template: "<div\n class=\"ax form-group {{ size }} ax-form-group-container {{\n labelMode() !== 'static' && 'ax-margin-form'\n }}\"\n>\n <div class=\"ax-lable-{{ labelMode() }}\">\n <ng-content select=\"ax-label\"></ng-content>\n </div>\n <div\n #div\n class=\"ax form-item {{ size }}\"\n [ngClass]=\"{ 'required-state': required }\"\n >\n <div class=\"ax buttons start-buttons\" #startButtons>\n <ng-content select=\"ax-button[start]\"></ng-content>\n </div>\n <div class=\"content\" #content>\n <ng-content></ng-content>\n </div>\n <div class=\"ax buttons end-buttons\" #endButtons>\n <ng-content select=\"ax-button[end]\"></ng-content>\n <ng-content select=\"ax-button\"></ng-content>\n </div>\n </div>\n</div>\n", styles: [".ax-form-group-container{position:relative}.ax-form-group-container .ax-lable-static{position:static}.ax-form-group-container .ax-lable-float{top:50%;transform:translateY(-50%)}.ax-form-group-container .ax-lable-over{top:-4%}.ax-form-group-container .ax-lable-over,.ax-form-group-container .ax-lable-float{position:absolute;z-index:999;transition:all .15s ease-in-out;inset-inline-start:.3rem}.ax-form-group-container .form-group-label{padding:.1rem .5rem!important;font-size:.7rem!important}.ax-form-group-container.ax-margin-form{margin-bottom:.5rem}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
62
68
|
}
|
63
69
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.7", ngImport: i0, type: AXFormGroupComponent, decorators: [{
|
64
70
|
type: Component,
|
65
|
-
args: [{ selector: 'ax-form-group', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, host: { style: 'width: 100%; display:contents;' }, template: "<div\n class=\"ax form-group {{ size }} ax-form-group-container {{\n labelMode() !== 'static' && 'ax-margin-form'\n }}\"\n>\n <div class=\"ax-lable-{{ labelMode() }}\">\n <ng-content select=\"ax-label\"></ng-content>\n </div>\n <div\n
|
71
|
+
args: [{ selector: 'ax-form-group', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, host: { style: 'width: 100%; display:contents;' }, template: "<div\n class=\"ax form-group {{ size }} ax-form-group-container {{\n labelMode() !== 'static' && 'ax-margin-form'\n }}\"\n>\n <div class=\"ax-lable-{{ labelMode() }}\">\n <ng-content select=\"ax-label\"></ng-content>\n </div>\n <div\n #div\n class=\"ax form-item {{ size }}\"\n [ngClass]=\"{ 'required-state': required }\"\n >\n <div class=\"ax buttons start-buttons\" #startButtons>\n <ng-content select=\"ax-button[start]\"></ng-content>\n </div>\n <div class=\"content\" #content>\n <ng-content></ng-content>\n </div>\n <div class=\"ax buttons end-buttons\" #endButtons>\n <ng-content select=\"ax-button[end]\"></ng-content>\n <ng-content select=\"ax-button\"></ng-content>\n </div>\n </div>\n</div>\n", styles: [".ax-form-group-container{position:relative}.ax-form-group-container .ax-lable-static{position:static}.ax-form-group-container .ax-lable-float{top:50%;transform:translateY(-50%)}.ax-form-group-container .ax-lable-over{top:-4%}.ax-form-group-container .ax-lable-over,.ax-form-group-container .ax-lable-float{position:absolute;z-index:999;transition:all .15s ease-in-out;inset-inline-start:.3rem}.ax-form-group-container .form-group-label{padding:.1rem .5rem!important;font-size:.7rem!important}.ax-form-group-container.ax-margin-form{margin-bottom:.5rem}\n"] }]
|
66
72
|
}], propDecorators: { size: [{
|
67
73
|
type: Input
|
68
74
|
}], div: [{
|
@@ -72,4 +78,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.7", ngImpor
|
|
72
78
|
type: ContentChild,
|
73
79
|
args: [AXValidatableComponent]
|
74
80
|
}] } });
|
75
|
-
//# sourceMappingURL=data:application/json;base64,
|
81
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZm9ybS1ncm91cC5jb21wb25lbnQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi9saWJzL2NvbXBvbmVudHMvc3JjL2xpYi9mb3JtLWdyb3VwL2Zvcm0tZ3JvdXAuY29tcG9uZW50LnRzIiwiLi4vLi4vLi4vLi4vLi4vLi4vbGlicy9jb21wb25lbnRzL3NyYy9saWIvZm9ybS1ncm91cC9mb3JtLWdyb3VwLmNvbXBvbmVudC5odG1sIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxRQUFRLEVBQUUsTUFBTSxjQUFjLENBQUM7QUFDeEMsT0FBTyxFQUNMLHVCQUF1QixFQUN2QixpQkFBaUIsRUFDakIsU0FBUyxFQUNULFlBQVksRUFDWixVQUFVLEVBQ1YsS0FBSyxFQUNMLFNBQVMsRUFDVCxpQkFBaUIsRUFDakIsZUFBZSxFQUNmLE1BQU0sRUFDTixLQUFLLEdBQ04sTUFBTSxlQUFlLENBQUM7QUFDdkIsT0FBTyxFQUNMLGVBQWUsRUFHZixzQkFBc0IsR0FDdkIsTUFBTSx1QkFBdUIsQ0FBQzs7O0FBWS9C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mdpbi1mb3JtJ1xuICB9fVwiXG4+XG4gIDxkaXYgY2xhc3M9XCJheC1sYWJsZS17eyBsYWJlbE1vZGUoKSB9fVwiPlxuICAgIDxuZy1jb250ZW50IHNlbGVjdD1cImF4LWxhYmVsXCI+PC9uZy1jb250ZW50PlxuICA8L2Rpdj5cbiAgPGRpdlxuICAgICNkaXZcbiAgICBjbGFzcz1cImF4IGZvcm0taXRlbSB7eyBzaXplIH19XCJcbiAgICBbbmdDbGFzc109XCJ7ICdyZXF1aXJlZC1zdGF0ZSc6IHJlcXVpcmVkIH1cIlxuICA+XG4gICAgPGRpdiBjbGFzcz1cImF4IGJ1dHRvbnMgc3RhcnQtYnV0dG9uc1wiICNzdGFydEJ1dHRvbnM+XG4gICAgICA8bmctY29udGVudCBzZWxlY3Q9XCJheC1idXR0b25bc3RhcnRdXCI+PC9uZy1jb250ZW50PlxuICAgIDwvZGl2PlxuICAgIDxkaXYgY2xhc3M9XCJjb250ZW50XCIgI2NvbnRlbnQ+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,
|
2
|
+
import { ElementRef, Component, Inject, Optional, Input, Injectable, EventEmitter, Output, Directive, ViewChild, ContentChild, TemplateRef, ViewEncapsulation, HostListener, NgModule, ChangeDetectionStrategy, Attribute, ContentChildren, ViewChildren, inject, ChangeDetectorRef, model, 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';
|
@@ -6185,7 +6185,6 @@ class AXFormGroupComponent extends AXBaseComponent {
|
|
6185
6185
|
component;
|
6186
6186
|
required = AXConfig.get('form')?.required || false;
|
6187
6187
|
labelMode = model(AXConfig.get('form')?.labelMode || 'static');
|
6188
|
-
inputHeight = signal('auto');
|
6189
6188
|
#nextRender = afterNextRender(() => {
|
6190
6189
|
this.required = this.component?.validation?.rules?.some((c) => c.type === 'required' && c.enabled);
|
6191
6190
|
this.div.nativeElement.classList.add(this.size);
|
@@ -6193,35 +6192,42 @@ class AXFormGroupComponent extends AXBaseComponent {
|
|
6193
6192
|
this.div.nativeElement.classList.add('required-state');
|
6194
6193
|
}
|
6195
6194
|
const convertTypeComponent = this.component;
|
6196
|
-
if (!convertTypeComponent.componentName) {
|
6197
|
-
this.inputHeight.set('2.625rem');
|
6198
|
-
}
|
6199
6195
|
if (this.labelMode() === 'static' || this.labelMode() === 'over')
|
6200
6196
|
return;
|
6201
6197
|
if (convertTypeComponent.value ||
|
6202
6198
|
convertTypeComponent.selectedItems?.length > 0) {
|
6203
6199
|
this.labelMode.set('over');
|
6204
6200
|
}
|
6205
|
-
|
6206
|
-
|
6207
|
-
|
6208
|
-
|
6209
|
-
|
6210
|
-
|
6211
|
-
|
6212
|
-
|
6213
|
-
|
6214
|
-
|
6215
|
-
|
6216
|
-
|
6217
|
-
|
6218
|
-
|
6219
|
-
|
6220
|
-
|
6221
|
-
|
6222
|
-
|
6223
|
-
|
6224
|
-
|
6201
|
+
switch (convertTypeComponent.componentName) {
|
6202
|
+
case 'selectBox':
|
6203
|
+
convertTypeComponent.selectedItemsChange.subscribe((e) => {
|
6204
|
+
if (e.length > 0) {
|
6205
|
+
this.labelMode.set('over');
|
6206
|
+
}
|
6207
|
+
else {
|
6208
|
+
this.labelMode.set('float');
|
6209
|
+
}
|
6210
|
+
});
|
6211
|
+
break;
|
6212
|
+
case 'lov':
|
6213
|
+
convertTypeComponent.onSelectionChange.subscribe((e) => {
|
6214
|
+
if (e.data.length > 0) {
|
6215
|
+
this.labelMode.set('over');
|
6216
|
+
}
|
6217
|
+
else {
|
6218
|
+
this.labelMode.set('float');
|
6219
|
+
}
|
6220
|
+
});
|
6221
|
+
break;
|
6222
|
+
default:
|
6223
|
+
convertTypeComponent.onValueChanged.subscribe((e) => {
|
6224
|
+
if (e.value) {
|
6225
|
+
this.labelMode.set('over');
|
6226
|
+
}
|
6227
|
+
else {
|
6228
|
+
this.labelMode.set('float');
|
6229
|
+
}
|
6230
|
+
});
|
6225
6231
|
}
|
6226
6232
|
if (convertTypeComponent.componentName === 'textArea') {
|
6227
6233
|
const textArea = this.component;
|
@@ -6233,11 +6239,11 @@ class AXFormGroupComponent extends AXBaseComponent {
|
|
6233
6239
|
}
|
6234
6240
|
});
|
6235
6241
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.7", ngImport: i0, type: AXFormGroupComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
6236
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "18.0.7", type: AXFormGroupComponent, selector: "ax-form-group", inputs: { size: { classPropertyName: "size", publicName: "size", isSignal: false, isRequired: false, transformFunction: null }, labelMode: { classPropertyName: "labelMode", publicName: "labelMode", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { labelMode: "labelModeChange" }, host: { styleAttribute: "width: 100%; display:contents;" }, queries: [{ propertyName: "component", first: true, predicate: AXValidatableComponent, descendants: true }], viewQueries: [{ propertyName: "div", first: true, predicate: ["div"], descendants: true }], usesInheritance: true, ngImport: i0, template: "<div\n class=\"ax form-group {{ size }} ax-form-group-container {{\n labelMode() !== 'static' && 'ax-margin-form'\n }}\"\n>\n <div class=\"ax-lable-{{ labelMode() }}\">\n <ng-content select=\"ax-label\"></ng-content>\n </div>\n <div\n
|
6242
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "18.0.7", type: AXFormGroupComponent, selector: "ax-form-group", inputs: { size: { classPropertyName: "size", publicName: "size", isSignal: false, isRequired: false, transformFunction: null }, labelMode: { classPropertyName: "labelMode", publicName: "labelMode", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { labelMode: "labelModeChange" }, host: { styleAttribute: "width: 100%; display:contents;" }, queries: [{ propertyName: "component", first: true, predicate: AXValidatableComponent, descendants: true }], viewQueries: [{ propertyName: "div", first: true, predicate: ["div"], descendants: true }], usesInheritance: true, ngImport: i0, template: "<div\n class=\"ax form-group {{ size }} ax-form-group-container {{\n labelMode() !== 'static' && 'ax-margin-form'\n }}\"\n>\n <div class=\"ax-lable-{{ labelMode() }}\">\n <ng-content select=\"ax-label\"></ng-content>\n </div>\n <div\n #div\n class=\"ax form-item {{ size }}\"\n [ngClass]=\"{ 'required-state': required }\"\n >\n <div class=\"ax buttons start-buttons\" #startButtons>\n <ng-content select=\"ax-button[start]\"></ng-content>\n </div>\n <div class=\"content\" #content>\n <ng-content></ng-content>\n </div>\n <div class=\"ax buttons end-buttons\" #endButtons>\n <ng-content select=\"ax-button[end]\"></ng-content>\n <ng-content select=\"ax-button\"></ng-content>\n </div>\n </div>\n</div>\n", styles: [".ax-form-group-container{position:relative}.ax-form-group-container .ax-lable-static{position:static}.ax-form-group-container .ax-lable-float{top:50%;transform:translateY(-50%)}.ax-form-group-container .ax-lable-over{top:-4%}.ax-form-group-container .ax-lable-over,.ax-form-group-container .ax-lable-float{position:absolute;z-index:999;transition:all .15s ease-in-out;inset-inline-start:.3rem}.ax-form-group-container .form-group-label{padding:.1rem .5rem!important;font-size:.7rem!important}.ax-form-group-container.ax-margin-form{margin-bottom:.5rem}\n"], dependencies: [{ kind: "directive", type: i1$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
6237
6243
|
}
|
6238
6244
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.7", ngImport: i0, type: AXFormGroupComponent, decorators: [{
|
6239
6245
|
type: Component,
|
6240
|
-
args: [{ selector: 'ax-form-group', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, host: { style: 'width: 100%; display:contents;' }, template: "<div\n class=\"ax form-group {{ size }} ax-form-group-container {{\n labelMode() !== 'static' && 'ax-margin-form'\n }}\"\n>\n <div class=\"ax-lable-{{ labelMode() }}\">\n <ng-content select=\"ax-label\"></ng-content>\n </div>\n <div\n
|
6246
|
+
args: [{ selector: 'ax-form-group', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, host: { style: 'width: 100%; display:contents;' }, template: "<div\n class=\"ax form-group {{ size }} ax-form-group-container {{\n labelMode() !== 'static' && 'ax-margin-form'\n }}\"\n>\n <div class=\"ax-lable-{{ labelMode() }}\">\n <ng-content select=\"ax-label\"></ng-content>\n </div>\n <div\n #div\n class=\"ax form-item {{ size }}\"\n [ngClass]=\"{ 'required-state': required }\"\n >\n <div class=\"ax buttons start-buttons\" #startButtons>\n <ng-content select=\"ax-button[start]\"></ng-content>\n </div>\n <div class=\"content\" #content>\n <ng-content></ng-content>\n </div>\n <div class=\"ax buttons end-buttons\" #endButtons>\n <ng-content select=\"ax-button[end]\"></ng-content>\n <ng-content select=\"ax-button\"></ng-content>\n </div>\n </div>\n</div>\n", styles: [".ax-form-group-container{position:relative}.ax-form-group-container .ax-lable-static{position:static}.ax-form-group-container .ax-lable-float{top:50%;transform:translateY(-50%)}.ax-form-group-container .ax-lable-over{top:-4%}.ax-form-group-container .ax-lable-over,.ax-form-group-container .ax-lable-float{position:absolute;z-index:999;transition:all .15s ease-in-out;inset-inline-start:.3rem}.ax-form-group-container .form-group-label{padding:.1rem .5rem!important;font-size:.7rem!important}.ax-form-group-container.ax-margin-form{margin-bottom:.5rem}\n"] }]
|
6241
6247
|
}], propDecorators: { size: [{
|
6242
6248
|
type: Input
|
6243
6249
|
}], div: [{
|