ngx-opalbytes-components 1.22.0 → 1.24.0
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/README.md +98 -0
- package/fesm2022/ngx-opalbytes-components.mjs +174 -2
- package/fesm2022/ngx-opalbytes-components.mjs.map +1 -1
- package/package.json +1 -1
- package/src/lib/shared/components/error/error.css +10 -0
- package/src/lib/shared/components/error/error.html +5 -0
- package/src/lib/shared/components/error/error.spec.ts +76 -0
- package/src/lib/shared/components/error/error.stories.ts +61 -0
- package/src/lib/shared/components/error/error.ts +33 -0
- package/src/lib/shared/components/form-field/error-state-matcher.ts +41 -0
- package/src/lib/shared/components/form-field/form-field-control.ts +10 -0
- package/src/lib/shared/components/form-field/form-field.css +154 -0
- package/src/lib/shared/components/form-field/form-field.html +51 -0
- package/src/lib/shared/components/form-field/form-field.spec.ts +114 -0
- package/src/lib/shared/components/form-field/form-field.stories.ts +177 -0
- package/src/lib/shared/components/form-field/form-field.ts +118 -0
- package/src/lib/shared/components/hint/hint.css +10 -0
- package/src/lib/shared/components/hint/hint.html +1 -0
- package/src/lib/shared/components/hint/hint.spec.ts +22 -0
- package/src/lib/shared/components/hint/hint.stories.ts +53 -0
- package/src/lib/shared/components/hint/hint.ts +9 -0
- package/src/lib/shared/components/index.ts +6 -0
- package/types/ngx-opalbytes-components.d.ts +70 -2
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
import { FormControl, ReactiveFormsModule, Validators } from '@angular/forms';
|
|
2
|
+
|
|
3
|
+
import type { Meta, StoryObj } from '@storybook/angular-vite';
|
|
4
|
+
|
|
5
|
+
import { CaoFormField } from './form-field';
|
|
6
|
+
import { CaoBaseInput } from '../base-input/base-input';
|
|
7
|
+
import { CaoError } from '../error/error';
|
|
8
|
+
import { CaoHint } from '../hint/hint';
|
|
9
|
+
|
|
10
|
+
const storyImports = [ReactiveFormsModule, CaoFormField, CaoBaseInput, CaoHint, CaoError];
|
|
11
|
+
|
|
12
|
+
const renderFormField = (inner: string, props: Record<string, unknown> = {}) => ({
|
|
13
|
+
template: `<div style="max-width: 420px;">${inner}</div>`,
|
|
14
|
+
moduleMetadata: { imports: storyImports },
|
|
15
|
+
props,
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
const control = () => new FormControl('', [Validators.required]);
|
|
19
|
+
|
|
20
|
+
const meta: Meta<CaoFormField> = {
|
|
21
|
+
title: 'Componentes/Form Field',
|
|
22
|
+
component: CaoFormField,
|
|
23
|
+
subcomponents: {
|
|
24
|
+
caoBaseInput: CaoBaseInput,
|
|
25
|
+
caoHint: CaoHint,
|
|
26
|
+
caoError: CaoError,
|
|
27
|
+
},
|
|
28
|
+
tags: ['autodocs'],
|
|
29
|
+
argTypes: {
|
|
30
|
+
label: { control: 'text' },
|
|
31
|
+
labelInside: { control: 'boolean' },
|
|
32
|
+
hintLabel: { control: 'text' },
|
|
33
|
+
leadingIcon: { control: 'text' },
|
|
34
|
+
trailingIcon: { control: 'text' },
|
|
35
|
+
inputBackground: { control: 'color' },
|
|
36
|
+
borderColor: { control: 'color' },
|
|
37
|
+
borderWidth: { control: 'text' },
|
|
38
|
+
borderRadius: { control: 'text' },
|
|
39
|
+
errorColor: { control: 'color' },
|
|
40
|
+
labelColor: { control: 'color' },
|
|
41
|
+
hintColor: { control: 'color' },
|
|
42
|
+
textColor: { control: 'color' },
|
|
43
|
+
focusBorderColor: { control: 'color' },
|
|
44
|
+
successBorderColor: { control: 'color' },
|
|
45
|
+
},
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
export default meta;
|
|
49
|
+
type Story = StoryObj<CaoFormField>;
|
|
50
|
+
|
|
51
|
+
export const Padrao: Story = {
|
|
52
|
+
render: () =>
|
|
53
|
+
renderFormField(
|
|
54
|
+
`
|
|
55
|
+
<cao-form-field forId="padrao" [label]="'Nome'" [control]="control">
|
|
56
|
+
<cao-input [control]="control" [placeholder]="'Digite seu nome'"></cao-input>
|
|
57
|
+
</cao-form-field>
|
|
58
|
+
`,
|
|
59
|
+
{ control: control() }
|
|
60
|
+
),
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
export const LabelDentro: Story = {
|
|
64
|
+
render: () =>
|
|
65
|
+
renderFormField(
|
|
66
|
+
`
|
|
67
|
+
<cao-form-field forId="label-dentro" [label]="'Nome'" [labelInside]="true" [control]="control">
|
|
68
|
+
<cao-input [control]="control" [placeholder]="' '"></cao-input>
|
|
69
|
+
</cao-form-field>
|
|
70
|
+
`,
|
|
71
|
+
{ control: control() }
|
|
72
|
+
),
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
export const ComHint: Story = {
|
|
76
|
+
render: () =>
|
|
77
|
+
renderFormField(
|
|
78
|
+
`
|
|
79
|
+
<cao-form-field forId="cep" [label]="'CEP'" [control]="control">
|
|
80
|
+
<cao-input [control]="control" [placeholder]="'00000-000'"></cao-input>
|
|
81
|
+
<cao-hint>Formato: 00000-000</cao-hint>
|
|
82
|
+
</cao-form-field>
|
|
83
|
+
`,
|
|
84
|
+
{ control: control() }
|
|
85
|
+
),
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
export const ComErro: Story = {
|
|
89
|
+
render: () => {
|
|
90
|
+
const erroControl = control();
|
|
91
|
+
erroControl.markAsTouched();
|
|
92
|
+
return renderFormField(
|
|
93
|
+
`
|
|
94
|
+
<cao-form-field forId="email" [label]="'E-mail'" [control]="control">
|
|
95
|
+
<cao-input [control]="control" [placeholder]="'Digite seu e-mail'"></cao-input>
|
|
96
|
+
<cao-error>Campo obrigatório</cao-error>
|
|
97
|
+
</cao-form-field>
|
|
98
|
+
`,
|
|
99
|
+
{ control: erroControl }
|
|
100
|
+
);
|
|
101
|
+
},
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
export const ComIcones: Story = {
|
|
105
|
+
render: () =>
|
|
106
|
+
renderFormField(
|
|
107
|
+
`
|
|
108
|
+
<cao-form-field
|
|
109
|
+
forId="buscar"
|
|
110
|
+
[label]="'Buscar'"
|
|
111
|
+
leadingIcon="Search"
|
|
112
|
+
trailingIcon="SlidersHorizontal"
|
|
113
|
+
iconColor="#4f46e5"
|
|
114
|
+
[control]="control">
|
|
115
|
+
<cao-input [control]="control" [placeholder]="'Pesquisar...'"></cao-input>
|
|
116
|
+
</cao-form-field>
|
|
117
|
+
`,
|
|
118
|
+
{ control: control() }
|
|
119
|
+
),
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
export const ComMascaraCPF: Story = {
|
|
123
|
+
render: () =>
|
|
124
|
+
renderFormField(
|
|
125
|
+
`
|
|
126
|
+
<cao-form-field forId="cpf" [label]="'CPF'" [control]="control">
|
|
127
|
+
<cao-input
|
|
128
|
+
[control]="control"
|
|
129
|
+
[placeholder]="'000.000.000-00'"
|
|
130
|
+
[mask]="'000.000.000-00'"></cao-input>
|
|
131
|
+
</cao-form-field>
|
|
132
|
+
`,
|
|
133
|
+
{ control: control() }
|
|
134
|
+
),
|
|
135
|
+
};
|
|
136
|
+
|
|
137
|
+
export const Desabilitado: Story = {
|
|
138
|
+
render: () =>
|
|
139
|
+
renderFormField(
|
|
140
|
+
`
|
|
141
|
+
<cao-form-field forId="bloqueado" [label]="'Campo bloqueado'" [control]="control">
|
|
142
|
+
<cao-input [control]="control" [isDisabled]="true" [placeholder]="'Valor indisponível'"></cao-input>
|
|
143
|
+
</cao-form-field>
|
|
144
|
+
`,
|
|
145
|
+
{ control: new FormControl({ value: '', disabled: true }) }
|
|
146
|
+
),
|
|
147
|
+
};
|
|
148
|
+
|
|
149
|
+
export const CoresCustomizadas: Story = {
|
|
150
|
+
render: () => {
|
|
151
|
+
const coresControl = control();
|
|
152
|
+
coresControl.markAsTouched();
|
|
153
|
+
return renderFormField(
|
|
154
|
+
`
|
|
155
|
+
<cao-form-field
|
|
156
|
+
forId="cores"
|
|
157
|
+
[label]="'Personalizado'"
|
|
158
|
+
inputBackground="#f8fafc"
|
|
159
|
+
borderColor="#94a3b8"
|
|
160
|
+
borderWidth="2px"
|
|
161
|
+
borderRadius="16px"
|
|
162
|
+
errorColor="#e11d48"
|
|
163
|
+
labelColor="#0f766e"
|
|
164
|
+
hintColor="#64748b"
|
|
165
|
+
textColor="#0f172a"
|
|
166
|
+
focusBorderColor="#0d9488"
|
|
167
|
+
successBorderColor="#16a34a"
|
|
168
|
+
[control]="control">
|
|
169
|
+
<cao-input [control]="control" [placeholder]="'Cores via input'"></cao-input>
|
|
170
|
+
<cao-hint>Hint customizado</cao-hint>
|
|
171
|
+
<cao-error>Erro customizado</cao-error>
|
|
172
|
+
</cao-form-field>
|
|
173
|
+
`,
|
|
174
|
+
{ control: coresControl }
|
|
175
|
+
);
|
|
176
|
+
},
|
|
177
|
+
};
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import { Component, computed, input, Input } from '@angular/core';
|
|
2
|
+
import { AbstractControl, Validators } from '@angular/forms';
|
|
3
|
+
|
|
4
|
+
import { IErrorStateMatcher } from './error-state-matcher';
|
|
5
|
+
import { IFormFieldControl } from './form-field-control';
|
|
6
|
+
import { CaoBaseIcon } from '../base-icon/base-icon';
|
|
7
|
+
|
|
8
|
+
@Component({
|
|
9
|
+
selector: 'cao-form-field',
|
|
10
|
+
imports: [CaoBaseIcon],
|
|
11
|
+
templateUrl: './form-field.html',
|
|
12
|
+
styleUrl: './form-field.css',
|
|
13
|
+
})
|
|
14
|
+
export class CaoFormField extends CaoBaseIcon implements IFormFieldControl {
|
|
15
|
+
inputBackground = input<string>();
|
|
16
|
+
borderColor = input<string>();
|
|
17
|
+
borderWidth = input<string>();
|
|
18
|
+
borderRadius = input<string>();
|
|
19
|
+
errorColor = input<string>();
|
|
20
|
+
labelColor = input<string>();
|
|
21
|
+
hintColor = input<string>();
|
|
22
|
+
textColor = input<string>();
|
|
23
|
+
focusBorderColor = input<string>();
|
|
24
|
+
successBorderColor = input<string>();
|
|
25
|
+
|
|
26
|
+
formFieldStyles = computed(() => {
|
|
27
|
+
const styles: Record<string, string> = {};
|
|
28
|
+
|
|
29
|
+
if (this.inputBackground()) {
|
|
30
|
+
styles['--cao-form-field-bg-background'] = this.inputBackground()!;
|
|
31
|
+
}
|
|
32
|
+
if (this.borderColor()) {
|
|
33
|
+
styles['--cao-form-field-border-color'] = this.borderColor()!;
|
|
34
|
+
}
|
|
35
|
+
if (this.borderWidth()) {
|
|
36
|
+
styles['--cao-form-field-border-width'] = this.borderWidth()!;
|
|
37
|
+
}
|
|
38
|
+
if (this.borderRadius()) {
|
|
39
|
+
styles['--cao-form-field-border-radius'] = this.borderRadius()!;
|
|
40
|
+
}
|
|
41
|
+
if (this.errorColor()) {
|
|
42
|
+
styles['--cao-form-field-color-error'] = this.errorColor()!;
|
|
43
|
+
}
|
|
44
|
+
if (this.labelColor()) {
|
|
45
|
+
styles['--cao-form-field-color-label'] = this.labelColor()!;
|
|
46
|
+
}
|
|
47
|
+
if (this.hintColor()) {
|
|
48
|
+
styles['--cao-form-field-color-hint'] = this.hintColor()!;
|
|
49
|
+
}
|
|
50
|
+
if (this.textColor()) {
|
|
51
|
+
styles['--cao-form-field-color-text'] = this.textColor()!;
|
|
52
|
+
}
|
|
53
|
+
if (this.focusBorderColor()) {
|
|
54
|
+
styles['--cao-form-field-focus-border'] = this.focusBorderColor()!;
|
|
55
|
+
}
|
|
56
|
+
if (this.successBorderColor()) {
|
|
57
|
+
styles['--cao-form-field-success-border'] = this.successBorderColor()!;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
return styles;
|
|
61
|
+
});
|
|
62
|
+
@Input() label = '';
|
|
63
|
+
@Input() labelInside = false;
|
|
64
|
+
@Input() hintLabel = '';
|
|
65
|
+
@Input() control: AbstractControl | null = null;
|
|
66
|
+
@Input() forId = '';
|
|
67
|
+
@Input() errorStateMatcher?: IErrorStateMatcher;
|
|
68
|
+
@Input() leadingIcon?: string;
|
|
69
|
+
@Input() trailingIcon?: string;
|
|
70
|
+
|
|
71
|
+
_isSubmitted = false;
|
|
72
|
+
_focused = false;
|
|
73
|
+
|
|
74
|
+
get id(): string {
|
|
75
|
+
return this.forId;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
get disabled(): boolean {
|
|
79
|
+
return !!this.control?.disabled;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
get required(): boolean {
|
|
83
|
+
if (!this.control) {
|
|
84
|
+
return false;
|
|
85
|
+
}
|
|
86
|
+
const hasValidator =
|
|
87
|
+
typeof this.control.hasValidator === 'function'
|
|
88
|
+
? this.control.hasValidator(Validators.required)
|
|
89
|
+
: false;
|
|
90
|
+
return hasValidator;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
get floating(): boolean {
|
|
94
|
+
return this._focused || !!this.control?.value;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
get errorStateActive(): boolean {
|
|
98
|
+
const control = this.control;
|
|
99
|
+
if (!control) {
|
|
100
|
+
return false;
|
|
101
|
+
}
|
|
102
|
+
const matcher = this.errorStateMatcher;
|
|
103
|
+
return matcher
|
|
104
|
+
? matcher.isErrorState(control, this)
|
|
105
|
+
: !!(control.invalid && (control.touched || control.dirty || this._isSubmitted));
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
onFocusIn(): void {
|
|
109
|
+
this._focused = true;
|
|
110
|
+
if (this.control && !this._isSubmitted) {
|
|
111
|
+
this.control.markAsTouched();
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
onFocusOut(): void {
|
|
116
|
+
this._focused = false;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<span class="cao-hint"><ng-content /></span>
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
|
2
|
+
|
|
3
|
+
import { CaoHint } from './hint';
|
|
4
|
+
|
|
5
|
+
describe('CaoHint', () => {
|
|
6
|
+
let component: CaoHint;
|
|
7
|
+
let fixture: ComponentFixture<CaoHint>;
|
|
8
|
+
|
|
9
|
+
beforeEach(async () => {
|
|
10
|
+
await TestBed.configureTestingModule({
|
|
11
|
+
imports: [CaoHint],
|
|
12
|
+
}).compileComponents();
|
|
13
|
+
|
|
14
|
+
fixture = TestBed.createComponent(CaoHint);
|
|
15
|
+
component = fixture.componentInstance;
|
|
16
|
+
await fixture.whenStable();
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
it('should create', () => {
|
|
20
|
+
expect(component).toBeTruthy();
|
|
21
|
+
});
|
|
22
|
+
});
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { Component } from '@angular/core';
|
|
2
|
+
import { FormControl, ReactiveFormsModule } from '@angular/forms';
|
|
3
|
+
|
|
4
|
+
import type { Meta, StoryObj } from '@storybook/angular-vite';
|
|
5
|
+
|
|
6
|
+
import { CaoHint } from './hint';
|
|
7
|
+
import { CaoBaseInput } from '../base-input/base-input';
|
|
8
|
+
import { CaoFormField } from '../form-field/form-field';
|
|
9
|
+
|
|
10
|
+
@Component({
|
|
11
|
+
selector: 'cao-hint-story',
|
|
12
|
+
imports: [ReactiveFormsModule, CaoFormField, CaoBaseInput, CaoHint],
|
|
13
|
+
template: `
|
|
14
|
+
<div style="max-width: 420px;">
|
|
15
|
+
<cao-form-field [control]="control" label="Usuário">
|
|
16
|
+
<cao-input [control]="control" placeholder="nome.sobrenome"></cao-input>
|
|
17
|
+
<cao-hint>{{ text }}</cao-hint>
|
|
18
|
+
</cao-form-field>
|
|
19
|
+
</div>
|
|
20
|
+
`,
|
|
21
|
+
})
|
|
22
|
+
class CaoHintStoryComponent {
|
|
23
|
+
control = new FormControl('');
|
|
24
|
+
text = 'Use seu nome de usuário ou e-mail';
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
const render = (args: Partial<CaoHintStoryComponent>) => ({
|
|
28
|
+
component: CaoHintStoryComponent,
|
|
29
|
+
props: args,
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
const meta: Meta<CaoHint> = {
|
|
33
|
+
title: 'Componentes/Hint',
|
|
34
|
+
component: CaoHint,
|
|
35
|
+
tags: ['autodocs'],
|
|
36
|
+
argTypes: {
|
|
37
|
+
text: { control: 'text' },
|
|
38
|
+
},
|
|
39
|
+
args: {
|
|
40
|
+
text: 'Use seu nome de usuário ou e-mail',
|
|
41
|
+
},
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
export default meta;
|
|
45
|
+
type Story = StoryObj<CaoHint>;
|
|
46
|
+
|
|
47
|
+
export const Padrao: Story = {
|
|
48
|
+
render: () => render({ text: 'Uma dica para auxiliar o preenchimento' }),
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
export const ComTextoExemplo: Story = {
|
|
52
|
+
render: () => render({ text: 'Formato esperado: 000.000.000-00' }),
|
|
53
|
+
};
|
|
@@ -19,6 +19,12 @@ export * from "./base-icon/base-icon"
|
|
|
19
19
|
export * from "./kpi/kpi"
|
|
20
20
|
export * from "./skeleton/skeleton"
|
|
21
21
|
|
|
22
|
+
export * from "./form-field/form-field"
|
|
23
|
+
export * from "./form-field/form-field-control"
|
|
24
|
+
export * from "./form-field/error-state-matcher"
|
|
25
|
+
export * from "./hint/hint"
|
|
26
|
+
export * from "./error/error"
|
|
27
|
+
|
|
22
28
|
export * from "./card/card.component"
|
|
23
29
|
export * from "./base-toggle/base-toggle.component"
|
|
24
30
|
export * from "./footer/footer"
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { OnInit, EventEmitter, OnChanges, OnDestroy, AfterViewInit, ElementRef, TemplateRef, SimpleChanges, ChangeDetectorRef, Signal, AfterContentInit, QueryList, WritableSignal } from '@angular/core';
|
|
3
|
+
import * as _angular_forms from '@angular/forms';
|
|
3
4
|
import { ControlValueAccessor, AbstractControl, FormControl } from '@angular/forms';
|
|
4
5
|
import { MatDateRangeInput } from '@angular/material/datepicker';
|
|
5
6
|
import * as rxjs from 'rxjs';
|
|
@@ -476,6 +477,73 @@ declare class CaoSkeletonComponent {
|
|
|
476
477
|
static ɵcmp: i0.ɵɵComponentDeclaration<CaoSkeletonComponent, "cao-skeleton", never, { "borderRadius": { "alias": "borderRadius"; "required": false; "isSignal": true; }; "width": { "alias": "width"; "required": false; "isSignal": true; }; "height": { "alias": "height"; "required": false; "isSignal": true; }; "bgColor": { "alias": "bgColor"; "required": false; "isSignal": true; }; "shine": { "alias": "shine"; "required": false; "isSignal": true; }; "variant": { "alias": "variant"; "required": false; "isSignal": true; }; "speed": { "alias": "speed"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "animationDeg": { "alias": "animationDeg"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
477
478
|
}
|
|
478
479
|
|
|
480
|
+
interface IFormFieldControl<T = any> {
|
|
481
|
+
readonly control: AbstractControl<T> | null | undefined;
|
|
482
|
+
readonly id: string;
|
|
483
|
+
readonly label: string;
|
|
484
|
+
readonly labelInside: boolean;
|
|
485
|
+
readonly disabled: boolean;
|
|
486
|
+
readonly required: boolean;
|
|
487
|
+
}
|
|
488
|
+
|
|
489
|
+
interface IErrorStateMatcher {
|
|
490
|
+
isErrorState(control: AbstractControl | null, formFieldControl: IFormFieldControl | null): boolean;
|
|
491
|
+
}
|
|
492
|
+
declare class ErrorStateMatcher implements IErrorStateMatcher {
|
|
493
|
+
isErrorState(control: AbstractControl | null, formFieldControl: IFormFieldControl | null): boolean;
|
|
494
|
+
}
|
|
495
|
+
declare class ShowOnDirtyErrorStateMatcher implements IErrorStateMatcher {
|
|
496
|
+
isErrorState(control: AbstractControl | null, formFieldControl: IFormFieldControl | null): boolean;
|
|
497
|
+
}
|
|
498
|
+
declare const DEFAULT_ERROR_STATE_MATCHER: ErrorStateMatcher;
|
|
499
|
+
|
|
500
|
+
declare class CaoFormField extends CaoBaseIcon implements IFormFieldControl {
|
|
501
|
+
inputBackground: i0.InputSignal<string | undefined>;
|
|
502
|
+
borderColor: i0.InputSignal<string | undefined>;
|
|
503
|
+
borderWidth: i0.InputSignal<string | undefined>;
|
|
504
|
+
borderRadius: i0.InputSignal<string | undefined>;
|
|
505
|
+
errorColor: i0.InputSignal<string | undefined>;
|
|
506
|
+
labelColor: i0.InputSignal<string | undefined>;
|
|
507
|
+
hintColor: i0.InputSignal<string | undefined>;
|
|
508
|
+
textColor: i0.InputSignal<string | undefined>;
|
|
509
|
+
focusBorderColor: i0.InputSignal<string | undefined>;
|
|
510
|
+
successBorderColor: i0.InputSignal<string | undefined>;
|
|
511
|
+
formFieldStyles: i0.Signal<Record<string, string>>;
|
|
512
|
+
label: string;
|
|
513
|
+
labelInside: boolean;
|
|
514
|
+
hintLabel: string;
|
|
515
|
+
control: AbstractControl | null;
|
|
516
|
+
forId: string;
|
|
517
|
+
errorStateMatcher?: IErrorStateMatcher;
|
|
518
|
+
leadingIcon?: string;
|
|
519
|
+
trailingIcon?: string;
|
|
520
|
+
_isSubmitted: boolean;
|
|
521
|
+
_focused: boolean;
|
|
522
|
+
get id(): string;
|
|
523
|
+
get disabled(): boolean;
|
|
524
|
+
get required(): boolean;
|
|
525
|
+
get floating(): boolean;
|
|
526
|
+
get errorStateActive(): boolean;
|
|
527
|
+
onFocusIn(): void;
|
|
528
|
+
onFocusOut(): void;
|
|
529
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CaoFormField, never>;
|
|
530
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<CaoFormField, "cao-form-field", never, { "inputBackground": { "alias": "inputBackground"; "required": false; "isSignal": true; }; "borderColor": { "alias": "borderColor"; "required": false; "isSignal": true; }; "borderWidth": { "alias": "borderWidth"; "required": false; "isSignal": true; }; "borderRadius": { "alias": "borderRadius"; "required": false; "isSignal": true; }; "errorColor": { "alias": "errorColor"; "required": false; "isSignal": true; }; "labelColor": { "alias": "labelColor"; "required": false; "isSignal": true; }; "hintColor": { "alias": "hintColor"; "required": false; "isSignal": true; }; "textColor": { "alias": "textColor"; "required": false; "isSignal": true; }; "focusBorderColor": { "alias": "focusBorderColor"; "required": false; "isSignal": true; }; "successBorderColor": { "alias": "successBorderColor"; "required": false; "isSignal": true; }; "label": { "alias": "label"; "required": false; }; "labelInside": { "alias": "labelInside"; "required": false; }; "hintLabel": { "alias": "hintLabel"; "required": false; }; "control": { "alias": "control"; "required": false; }; "forId": { "alias": "forId"; "required": false; }; "errorStateMatcher": { "alias": "errorStateMatcher"; "required": false; }; "leadingIcon": { "alias": "leadingIcon"; "required": false; }; "trailingIcon": { "alias": "trailingIcon"; "required": false; }; }, {}, never, ["[caoInput]", "cao-input", "input", "select", "textarea", "h2", "*", "cao-hint", "cao-error"], true, never>;
|
|
531
|
+
}
|
|
532
|
+
|
|
533
|
+
declare class CaoHint {
|
|
534
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CaoHint, never>;
|
|
535
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<CaoHint, "cao-hint", never, {}, {}, never, ["*"], true, never>;
|
|
536
|
+
}
|
|
537
|
+
|
|
538
|
+
declare class CaoError {
|
|
539
|
+
errorStateMatcher?: IErrorStateMatcher;
|
|
540
|
+
private readonly formField;
|
|
541
|
+
get control(): _angular_forms.AbstractControl<any, any, any> | null;
|
|
542
|
+
get hasErrorState(): boolean;
|
|
543
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<CaoError, never>;
|
|
544
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<CaoError, "cao-error", never, { "errorStateMatcher": { "alias": "errorStateMatcher"; "required": false; }; }, {}, never, ["*"], true, never>;
|
|
545
|
+
}
|
|
546
|
+
|
|
479
547
|
type CaoCardVariant = "horizontal" | "square";
|
|
480
548
|
interface ICaoCardBadge {
|
|
481
549
|
label: string;
|
|
@@ -960,5 +1028,5 @@ declare class BaseAlertService {
|
|
|
960
1028
|
static ɵprov: i0.ɵɵInjectableDeclaration<BaseAlertService>;
|
|
961
1029
|
}
|
|
962
1030
|
|
|
963
|
-
export { BaseAlert, BaseAlertService, BaseDialog, BaseDialogService, BaseFilterTablePaginatedService, BaseFilterTableService, BaseModal, BaseModalService, BasePaginationService, BaseTable, BaseTablePaginated, BaseTableService, BaseTimeRange, CaoAutocompleteComponent, CaoBaseButtonComponent, CaoBaseIcon, CaoBaseInput, CaoBaseToggleComponent, CaoCardComponent, CaoDropDownComponent, CaoKpi, CaoSkeletonComponent, CaoTabGroup, CaoTabPanel, Footer, LinksButton, Paginator, StepComponent, StepperComponent, TablePaginatedService, TimePicker, getPtBrPaginatorIntlBasePaginated, getPtBrPaginatorIntlBaseTable };
|
|
964
|
-
export type { AlertType, CaoCardVariant, CaoSkeletonVariant, CaoTypeInputs, DialogType, IAlertConfig, ICaoAutoCompleteOption, ICaoCardAvatar, ICaoCardBadge, ICaoCardMeta, ICaoDropDownOption, ICaoImage, ICaoKPI, ICaoTabChangeEvent, IColumnButton, IColumnConfig, IColumnPaginatedButton, IColumnPaginatedConfig, IDialogConfig, IModal, INavContent, INavLink, ITableConfig, ITablePaginatedConfig, ModalType, ModalTypeClass, ModalTypeSize };
|
|
1031
|
+
export { BaseAlert, BaseAlertService, BaseDialog, BaseDialogService, BaseFilterTablePaginatedService, BaseFilterTableService, BaseModal, BaseModalService, BasePaginationService, BaseTable, BaseTablePaginated, BaseTableService, BaseTimeRange, CaoAutocompleteComponent, CaoBaseButtonComponent, CaoBaseIcon, CaoBaseInput, CaoBaseToggleComponent, CaoCardComponent, CaoDropDownComponent, CaoError, CaoFormField, CaoHint, CaoKpi, CaoSkeletonComponent, CaoTabGroup, CaoTabPanel, DEFAULT_ERROR_STATE_MATCHER, ErrorStateMatcher, Footer, LinksButton, Paginator, ShowOnDirtyErrorStateMatcher, StepComponent, StepperComponent, TablePaginatedService, TimePicker, getPtBrPaginatorIntlBasePaginated, getPtBrPaginatorIntlBaseTable };
|
|
1032
|
+
export type { AlertType, CaoCardVariant, CaoSkeletonVariant, CaoTypeInputs, DialogType, IAlertConfig, ICaoAutoCompleteOption, ICaoCardAvatar, ICaoCardBadge, ICaoCardMeta, ICaoDropDownOption, ICaoImage, ICaoKPI, ICaoTabChangeEvent, IColumnButton, IColumnConfig, IColumnPaginatedButton, IColumnPaginatedConfig, IDialogConfig, IErrorStateMatcher, IFormFieldControl, IModal, INavContent, INavLink, ITableConfig, ITablePaginatedConfig, ModalType, ModalTypeClass, ModalTypeSize };
|