utn-cli 2.1.9 → 2.1.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "utn-cli",
3
- "version": "2.1.9",
3
+ "version": "2.1.10",
4
4
  "description": "Herramienta CLI unificada para la gestión de plantillas en SIGU.",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -183,6 +183,22 @@
183
183
  .encabezado {
184
184
  font-size: 18px;
185
185
  }
186
+
187
+ .cabecera2 {
188
+ flex-direction: column;
189
+ align-items: flex-start;
190
+ gap: 10px;
191
+ }
192
+
193
+ .filtro-tarjetas {
194
+ width: 100%;
195
+ box-sizing: border-box;
196
+ }
197
+
198
+ .filtro-input {
199
+ width: 100%;
200
+ min-width: 0;
201
+ }
186
202
  }
187
203
 
188
204
  @media (max-width: 480px) {
@@ -73,7 +73,7 @@
73
73
  @if (esDashboard) {
74
74
  <div class="filtro-tarjetas">
75
75
  <mat-icon class="filtro-icono">search</mat-icon>
76
- <input class="filtro-input" type="text" placeholder="Buscar tarjeta..." [value]="filtro"
76
+ <input #filtroInput class="filtro-input" type="text" placeholder="Buscar tarjeta..." [value]="filtro"
77
77
  (input)="onFiltroChange($event)" aria-label="Buscar tarjeta por nombre" />
78
78
  @if (filtro) {
79
79
  <button class="filtro-limpiar" (click)="limpiarFiltro()" title="Limpiar búsqueda"
@@ -1,5 +1,5 @@
1
1
  import { HttpClient } from '@angular/common/http';
2
- import { Component, OnInit, OnDestroy, NgZone } from '@angular/core';
2
+ import { Component, OnInit, OnDestroy, NgZone, AfterViewChecked, ViewChild, ElementRef } from '@angular/core';
3
3
  import { RouterOutlet, Router } from '@angular/router';
4
4
  import { DatosGlobalesService } from '../../../datos-globales.service';
5
5
  import { Location, CommonModule } from '@angular/common';
@@ -19,7 +19,10 @@ import { MatMenuModule } from '@angular/material/menu';
19
19
  templateUrl: './contenedor-componentes.component.html',
20
20
  styleUrl: './contenedor-componentes.component.css'
21
21
  })
22
- export class ContenedorComponentesComponent implements OnInit, OnDestroy {
22
+ export class ContenedorComponentesComponent implements OnInit, OnDestroy, AfterViewChecked {
23
+ @ViewChild('filtroInput') filtroInput?: ElementRef<HTMLInputElement>;
24
+ private focusDone = false;
25
+
23
26
  public TienePermiso: boolean = false;
24
27
  public Titulo: string = '';
25
28
  public Modulo: string = '';
@@ -208,6 +211,13 @@ export class ContenedorComponentesComponent implements OnInit, OnDestroy {
208
211
  this.router.navigate(['/Actividad']);
209
212
  }
210
213
 
214
+ ngAfterViewChecked() {
215
+ if (!this.focusDone && this.filtroInput?.nativeElement) {
216
+ this.filtroInput.nativeElement.focus();
217
+ this.focusDone = true;
218
+ }
219
+ }
220
+
211
221
  ngOnDestroy() {
212
222
  if (this.intervaloUsuarios) {
213
223
  clearInterval(this.intervaloUsuarios);
@@ -14,6 +14,27 @@
14
14
  box-sizing: border-box;
15
15
  }
16
16
 
17
+ .drag-handle {
18
+ display: flex;
19
+ align-items: center;
20
+ justify-content: center;
21
+ padding: 2px 0;
22
+ color: #bbb;
23
+ cursor: grab;
24
+ touch-action: none;
25
+ }
26
+
27
+ .drag-handle:active {
28
+ cursor: grabbing;
29
+ color: #888;
30
+ }
31
+
32
+ .drag-handle mat-icon {
33
+ font-size: 20px;
34
+ width: 20px;
35
+ height: 20px;
36
+ }
37
+
17
38
  .tarjeta-opaca {
18
39
  opacity: 0.15;
19
40
  filter: grayscale(50%);
@@ -1,6 +1,11 @@
1
1
  <div class="contenido" cdkDropList cdkDropListOrientation="mixed" (cdkDropListDropped)="drop($event)">
2
2
  @for (tarjeta of tarjetas; track tarjeta.titulo) {
3
3
  <div cdkDrag [class.tarjeta-opaca]="esDimmed(tarjeta)">
4
+ @if(isMobile) {
5
+ <div class="drag-handle" cdkDragHandle aria-label="Arrastrar tarjeta">
6
+ <mat-icon>drag_indicator</mat-icon>
7
+ </div>
8
+ }
4
9
  @switch (tarjeta.type) {
5
10
  @case ('single') {
6
11
  <app-tarjeta [rutaASeguir]="$any(tarjeta).rutaASeguir" [titulo]="tarjeta.titulo" [descripcion]="tarjeta.descripcion"
@@ -1,4 +1,4 @@
1
- import { Component, OnInit, OnDestroy } from "@angular/core";
1
+ import { Component, OnInit, OnDestroy, HostListener } from "@angular/core";
2
2
  import { CommonModule } from "@angular/common";
3
3
  import { Subject } from "rxjs";
4
4
  import { takeUntil } from "rxjs/operators";
@@ -6,6 +6,7 @@ import { TarjetaComponent } from "../../Componentes/Nucleo/tarjeta/tarjeta.compo
6
6
  import { TarjetaMultipleComponent } from "../../Componentes/Nucleo/tarjeta-multiple/tarjeta-multiple.component";
7
7
  import { TarjetaReporteComponent } from "../../Componentes/Nucleo/tarjeta-reporte/tarjeta-reporte.component";
8
8
  import { TarjetaPersonalizadaComponent } from "../../Componentes/Nucleo/tarjeta-personalizada/tarjeta-personalizada.component";
9
+ import { MatIconModule } from "@angular/material/icon";
9
10
  import { HttpClient } from "@angular/common/http";
10
11
  import { DatosGlobalesService } from '../../datos-globales.service';
11
12
  import { DragDropModule, CdkDragDrop, moveItemInArray } from '@angular/cdk/drag-drop';
@@ -55,7 +56,7 @@ type AnyTarjetaConfig = TarjetaConfig | TarjetaMultipleConfig | TarjetaReporteCo
55
56
  @Component({
56
57
  selector: "app-contenedor-principal",
57
58
  standalone: true,
58
- imports: [TarjetaComponent, TarjetaMultipleComponent, TarjetaReporteComponent, TarjetaPersonalizadaComponent, CommonModule, DragDropModule],
59
+ imports: [TarjetaComponent, TarjetaMultipleComponent, TarjetaReporteComponent, TarjetaPersonalizadaComponent, CommonModule, DragDropModule, MatIconModule],
59
60
  templateUrl: "./contenedor-principal.component.html",
60
61
  styleUrl: "./contenedor-principal.component.css"
61
62
  })
@@ -65,8 +66,14 @@ export class ContenedorPrincipalComponent implements OnInit, OnDestroy {
65
66
  public cantidadMaxima: number = 0;
66
67
  public tarjetas: AnyTarjetaConfig[] = [];
67
68
  public filtro: string = '';
69
+ public isMobile: boolean = window.innerWidth <= 768;
68
70
  private destroy$ = new Subject<void>();
69
71
 
72
+ @HostListener('window:resize')
73
+ onResize(): void {
74
+ this.isMobile = window.innerWidth <= 768;
75
+ }
76
+
70
77
  constructor(private http: HttpClient, private datosGlobalesService: DatosGlobalesService) {
71
78
  this.cantidad = 0;
72
79
  this.cantidadMaxima = 0;