Skip to content

Commit c9257d8

Browse files
committed
refactor(form-control): cleanup readonly / plaintext example
1 parent b625806 commit c9257d8

File tree

2 files changed

+35
-23
lines changed

2 files changed

+35
-23
lines changed

Diff for: src/app/views/forms/form-controls/form-controls.component.html

+17-17
Original file line numberDiff line numberDiff line change
@@ -123,31 +123,31 @@
123123
</p>
124124
<app-docs-example href="forms/form-control#readonly">
125125
<c-row class="mb-3">
126-
<label cLabel class="col-sm-2 col-form-label" for="staticEmail">
126+
<label [sm]="2" cCol cLabel="col" for="staticEmail">
127127
Email
128128
</label>
129-
<div class="col-sm-10">
129+
<c-col sm="10">
130130
<input [plaintext]="true"
131131
cFormControl
132132
id="staticEmail"
133133
readonly
134134
type="text"
135135
136136
/>
137-
</div>
137+
</c-col>
138138
</c-row>
139139
<c-row class="mb-3">
140-
<label cLabel class="col-sm-2 col-form-label" for="inputPassword">
140+
<label [sm]="2" cCol cLabel="col" for="inputPassword">
141141
Password
142142
</label>
143-
<div class="col-sm-10">
143+
<c-col sm="10">
144144
<input cFormControl id="inputPassword" type="password" />
145-
</div>
145+
</c-col>
146146
</c-row>
147147
</app-docs-example>
148148
<app-docs-example href="forms/form-control#readonly">
149-
<form cForm class="row g-3">
150-
<div class="col-auto">
149+
<form cForm [gutter]="3" cRow>
150+
<c-col xs="auto">
151151
<label cLabel class="visually-hidden" for="staticEmail2">
152152
Email
153153
</label>
@@ -158,18 +158,18 @@
158158
type="text"
159159
160160
/>
161-
</div>
162-
<div class="col-auto">
161+
</c-col>
162+
<c-col xs="auto">
163163
<label cLabel class="visually-hidden" for="inputPassword2">
164164
Password
165165
</label>
166166
<input cFormControl id="inputPassword2" placeholder="Password" type="password" />
167-
</div>
168-
<div class="col-auto">
169-
<button cButton class="mb-3" type="submit">
167+
</c-col>
168+
<c-col xs="auto">
169+
<button cButton class="m-0" type="submit">
170170
Confirm identity
171171
</button>
172-
</div>
172+
</c-col>
173173
</form>
174174
</app-docs-example>
175175
</c-card-body>
@@ -228,11 +228,11 @@
228228
<div [ngStyle]="{'backgroundColor': favoriteColor}" class="color-box p-1 m-1"></div>
229229
</c-col>
230230
<c-col xs="auto">
231-
<strong>{{favoriteColor}}</strong>
231+
<strong>{{ favoriteColor }}</strong>
232232
</c-col>
233-
</c-row> </app-docs-example>
233+
</c-row>
234+
</app-docs-example>
234235
</c-card-body>
235236
</c-card>
236237
</c-col>
237238
</c-row>
238-
+18-6
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,31 @@
11
import { Component } from '@angular/core';
22
import { NgStyle } from '@angular/common';
3-
import { ReactiveFormsModule, FormsModule } from '@angular/forms';
3+
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
44
import { DocsExampleComponent } from '@docs-components/public-api';
5-
import { RowComponent, ColComponent, TextColorDirective, CardComponent, CardHeaderComponent, CardBodyComponent, FormDirective, FormLabelDirective, FormControlDirective, ButtonDirective } from '@coreui/angular';
5+
import {
6+
ButtonDirective,
7+
CardBodyComponent,
8+
CardComponent,
9+
CardHeaderComponent,
10+
ColComponent,
11+
ColDirective,
12+
FormControlDirective,
13+
FormDirective,
14+
FormLabelDirective,
15+
GutterDirective,
16+
RowComponent,
17+
RowDirective,
18+
TextColorDirective
19+
} from '@coreui/angular';
620

721
@Component({
822
selector: 'app-form-controls',
923
templateUrl: './form-controls.component.html',
1024
styleUrls: ['./form-controls.component.scss'],
11-
imports: [RowComponent, ColComponent, TextColorDirective, CardComponent, CardHeaderComponent, CardBodyComponent, DocsExampleComponent, ReactiveFormsModule, FormsModule, FormDirective, FormLabelDirective, FormControlDirective, ButtonDirective, NgStyle]
25+
imports: [RowComponent, ColComponent, TextColorDirective, CardComponent, CardHeaderComponent, CardBodyComponent, DocsExampleComponent, ReactiveFormsModule, FormsModule, FormDirective, FormLabelDirective, FormControlDirective, ButtonDirective, NgStyle, RowDirective, GutterDirective, ColDirective]
1226
})
1327
export class FormControlsComponent {
1428

1529
public favoriteColor = '#26ab3c';
16-
17-
constructor() { }
18-
30+
1931
}

0 commit comments

Comments
 (0)