@telcomdev/ui 0.0.8 → 0.0.10
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 +34 -0
- package/fesm2022/telcomdev-ui.mjs +305 -72
- package/fesm2022/telcomdev-ui.mjs.map +1 -1
- package/package.json +2 -1
- package/types/telcomdev-ui.d.ts +53 -6
package/README.md
CHANGED
|
@@ -324,6 +324,40 @@ necesario:
|
|
|
324
324
|
tradicional se conserva el comportamiento histórico: `type="number"` continúa
|
|
325
325
|
emitiendo texto mediante CVA para no romper formularios existentes.
|
|
326
326
|
|
|
327
|
+
Cuando el control recibe `maxlength` —de forma directa o mediante la metadata
|
|
328
|
+
`maxLength` de Signal Forms— muestra automáticamente un contador `actual/max`.
|
|
329
|
+
Puede ocultarse sin quitar la validación:
|
|
330
|
+
|
|
331
|
+
```html
|
|
332
|
+
<td-input [maxlength]="100" [(ngModel)]="nombre" />
|
|
333
|
+
<td-input [formField]="fields.descripcion" [showCounter]="false" />
|
|
334
|
+
```
|
|
335
|
+
|
|
336
|
+
`minlength`, `min`, `max` y `pattern` no activan el contador.
|
|
337
|
+
|
|
338
|
+
## Checkbox
|
|
339
|
+
|
|
340
|
+
`TdCheckbox` implementa el contrato `FormCheckboxControl` de Angular y mantiene
|
|
341
|
+
compatibilidad con `ControlValueAccessor`. Su valor siempre es booleano:
|
|
342
|
+
|
|
343
|
+
```html
|
|
344
|
+
<td-checkbox
|
|
345
|
+
label="Establecimiento principal"
|
|
346
|
+
description="Se utilizará como establecimiento predeterminado."
|
|
347
|
+
[formField]="establecimientoForm.esPrincipal"
|
|
348
|
+
/>
|
|
349
|
+
```
|
|
350
|
+
|
|
351
|
+
También funciona con formularios tradicionales:
|
|
352
|
+
|
|
353
|
+
```html
|
|
354
|
+
<td-checkbox label="Activo" [(ngModel)]="activo" />
|
|
355
|
+
<td-checkbox label="Principal" [formControl]="controlPrincipal" />
|
|
356
|
+
```
|
|
357
|
+
|
|
358
|
+
Con Signal Forms no se necesita una variable intermedia ni eventos manuales. El
|
|
359
|
+
modelo debe inicializar el campo como `true` o `false`, nunca como `null`.
|
|
360
|
+
|
|
327
361
|
```ts
|
|
328
362
|
import { signal } from '@angular/core';
|
|
329
363
|
import { form, FormField } from '@angular/forms/signals';
|