From 473a269bedb641e8bd61656c445614408b5eceba Mon Sep 17 00:00:00 2001 From: Angel Capetillo Zavala Date: Wed, 23 Sep 2026 16:39:33 -0600 Subject: [PATCH] Feature: Flujo inicial --- angular.json | 3 +- public/assets/branding/isssteleon-logo.png | Bin 0 -> 13023 bytes src/app/app.html | 25 +- src/app/app.routes.ts | 3 +- src/app/app.scss | 87 +++- src/app/app.spec.ts | 165 ++++++- src/app/app.ts | 7 +- src/app/home.html | 27 ++ src/app/home.scss | 131 ++++++ src/app/home.ts | 27 ++ src/app/information-upload-dialog.html | 105 +++++ src/app/information-upload-dialog.scss | 494 +++++++++++++++++++++ src/app/information-upload-dialog.ts | 129 ++++++ src/index.html | 4 +- src/styles.scss | 46 +- 15 files changed, 1213 insertions(+), 40 deletions(-) create mode 100644 public/assets/branding/isssteleon-logo.png create mode 100644 src/app/home.html create mode 100644 src/app/home.scss create mode 100644 src/app/home.ts create mode 100644 src/app/information-upload-dialog.html create mode 100644 src/app/information-upload-dialog.scss create mode 100644 src/app/information-upload-dialog.ts diff --git a/angular.json b/angular.json index 2b304ca..d3f5a4a 100644 --- a/angular.json +++ b/angular.json @@ -2,7 +2,8 @@ "$schema": "./node_modules/@angular/cli/lib/config/schema.json", "version": 1, "cli": { - "packageManager": "npm" + "packageManager": "npm", + "analytics": false }, "newProjectRoot": "projects", "projects": { diff --git a/public/assets/branding/isssteleon-logo.png b/public/assets/branding/isssteleon-logo.png new file mode 100644 index 0000000000000000000000000000000000000000..df4c1f93561d6a8db96768ad9b46632b53ec6367 GIT binary patch literal 13023 zcmeHu`8(8K__tC@SrUn4NuN-bO4-*?lChNRTavx8WE~ljFeOw(V;}o2+1If~_Amy6 z31y7IU@#cNb9|qF;rZ?P{@^;-b>_U!xzBy>{eF3GsISd>=F%Ak1_oB0hgwe<7*04a zFdTC{%>-sT9*CNPf!Xt+xi=OdGgg)lQQ8V;VN2 zi)VgR@wf1=O6YSB=3^%58H=1|s-fnh&buc}QZpRX|BP{E&>xCRYAd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jYMyvjKYsVp-TW$V*rRuUi60}ksfubpmTCI^axRO2Y?^Gh>WOh ztqle1pg3h7hW5dV{Wlab!T=T1zqa>8O?09HvC||P=`ABrBGQbR-0Pv7L7ujZ2B+Tb zd4v>L`uzc!w>J3%`XrzRa_BGo37qGgV3?a1c)qW1x%z1=2>&X~%5oj|V1Rbp{zNNQ8jSM?NjIa|0>Dk|J0?K$zdNx5(z8-{n`WJnzDP^t-|b6K%2EM~I&wO>;EKJZM6Ietqmd{AT45 zcVH$xEI^MGqY!BAhNZr#2k+XNdEr+-Ay2;m>;azkjv;_X@p43RcwyegQX1dR|CWpE zG7as6YF&m&f*mrf8=JMPfXG~(!@d=~7aiA#CrC7(kPdm*au)ph^_{e`!QWWnIbq=$ znf;;=zE~3*%O0vqnpOvT_>g|BsSwbrewNuGKmnzOK!ArBA1Z6)k2TS@P{mQHjlIM6 z#im^nRRF!L{<`3LJK$weS0(MYTIPXpi$VEJW-`n08KlFW_kaKMDr({mJ2U?s3JHTW zy6aN#K1E+$Ei#%-?`cLjh$n?AUd4` z$Vxx6!?-Mu{KM9kLCXV75olkyv=Tz<95&t3+L1?v3)|WzgD1)8D1_ScCdCCC4*ELdrcLrj9TDsd?k5kJ}ro(tSXkd%MayF*~*5I)?v&h?nxH#L+JxpQF3_#rt zu>&lqPN(DG9POUA<#A+~*(qtV`2M#@AeFxA-f_DW{-1$SYdXd4-w4}WKf%p6;|(Kv zY+yOW8^ZdNhSa}D>}f7m{55-J?8>0Da00GbKi*{Ja;M@ug%9Y6`)xenK4}2P+8u>H9!@uCFeIwr11yYwsRk1tR$-8U}xF=|3sAs9XiFP4O4Dx zV5Yu - {{ title }} - +
+ -
- -
+
+ +
+ +
+ +
+
diff --git a/src/app/app.routes.ts b/src/app/app.routes.ts index dc39edb..9742bb2 100644 --- a/src/app/app.routes.ts +++ b/src/app/app.routes.ts @@ -1,3 +1,4 @@ import { Routes } from '@angular/router'; +import { Home } from './home'; -export const routes: Routes = []; +export const routes: Routes = [{ path: '', component: Home }]; diff --git a/src/app/app.scss b/src/app/app.scss index 8e69d4f..4462be8 100644 --- a/src/app/app.scss +++ b/src/app/app.scss @@ -1,3 +1,86 @@ -main { - padding: 1.5rem; +.app-shell { + display: flex; + flex-direction: column; + min-height: 100vh; + min-height: 100dvh; +} + +.site-header { + background: var(--color-surface); + border-bottom: 1px solid var(--color-border); +} + +.site-header__content { + align-items: center; + display: flex; + justify-content: space-between; + min-height: 88px; + padding: 0 clamp(32px, 3.2vw, 48px); +} + +.brand { + align-items: center; + display: inline-flex; +} + +.brand img { + display: block; + height: auto; + width: clamp(180px, 16vw, 200px); +} + +.site-header__section { + color: var(--color-text); + font-size: 15px; + font-weight: 500; + letter-spacing: 0.01em; +} + +.app-main { + display: flex; + flex: 1; +} + +.site-footer { + background: var(--color-text-secondary); +} + +.site-footer__content { + align-items: center; + display: flex; + justify-content: center; + min-height: 86px; + padding: 0 clamp(32px, 3.2vw, 48px); +} + +.site-footer img { + display: block; + filter: brightness(0) invert(1); + height: auto; + width: clamp(160px, 15vw, 185px); +} + +@media (max-width: 600px) { + .site-header__content { + min-height: 70px; + padding: 0 20px; + } + + .brand img { + width: clamp(132px, 42vw, 170px); + } + + .site-header__section { + font-size: 13px; + text-align: right; + } + + .site-footer__content { + min-height: 76px; + padding: 0 20px; + } + + .site-footer img { + width: 155px; + } } diff --git a/src/app/app.spec.ts b/src/app/app.spec.ts index f1bdf4a..6c32756 100644 --- a/src/app/app.spec.ts +++ b/src/app/app.spec.ts @@ -1,12 +1,15 @@ import { TestBed } from '@angular/core/testing'; +import { provideRouter, Router } from '@angular/router'; +import { MatDialog } from '@angular/material/dialog'; import { App } from './app'; +import { routes } from './app.routes'; describe('App', () => { beforeEach(async () => { await TestBed.configureTestingModule({ imports: [App], - }) - .compileComponents(); + providers: [provideRouter(routes)], + }).compileComponents(); }); it('should create the app', () => { @@ -15,11 +18,165 @@ describe('App', () => { expect(app).toBeTruthy(); }); - it('should render the toolbar title', async () => { + it('should render the ISSSTELEON header and home page', async () => { const fixture = TestBed.createComponent(App); + fixture.detectChanges(); + await TestBed.inject(Router).navigateByUrl('/'); await fixture.whenStable(); fixture.detectChanges(); const compiled = fixture.nativeElement as HTMLElement; - expect(compiled.querySelector('mat-toolbar')?.textContent).toContain('ISSSTELEON'); + expect(compiled.querySelector('.brand img')?.getAttribute('alt')).toBe('ISSSTELEON'); + expect(compiled.querySelector('.site-header__section')?.textContent).toContain( + 'Análisis de información', + ); + expect(compiled.querySelector('h1')?.textContent).toContain('Analiza tu información'); + }); + + it('opens one dialog and keeps it open on backdrop and Escape', async () => { + const fixture = TestBed.createComponent(App); + fixture.detectChanges(); + await TestBed.inject(Router).navigateByUrl('/'); + await fixture.whenStable(); + fixture.detectChanges(); + + fixture.nativeElement.querySelector('.home__action').click(); + fixture.detectChanges(); + await fixture.whenStable(); + + const dialog = TestBed.inject(MatDialog); + expect(dialog.openDialogs).toHaveLength(1); + const overlay = document.querySelector('.cdk-overlay-container')!; + expect(overlay.querySelector('#upload-title')?.textContent).toContain('Cargar información'); + overlay.querySelector('.cdk-overlay-backdrop')?.click(); + document.dispatchEvent(new KeyboardEvent('keydown', { key: 'Escape', bubbles: true })); + expect(dialog.openDialogs).toHaveLength(1); + expect(overlay.querySelector('.upload-dialog__continue')?.hasAttribute('disabled')).toBe(true); + }); + + it('selects either source, continues, returns with selection, and closes explicitly', async () => { + const fixture = TestBed.createComponent(App); + fixture.detectChanges(); + await TestBed.inject(Router).navigateByUrl('/'); + await fixture.whenStable(); + fixture.detectChanges(); + + fixture.nativeElement.querySelector('.home__action').click(); + fixture.detectChanges(); + await fixture.whenStable(); + + const overlay = document.querySelector('.cdk-overlay-container')!; + const cards = () => overlay.querySelectorAll('.source-card'); + const continueButton = overlay.querySelector('.upload-dialog__continue')!; + const detectDialogChanges = () => TestBed.inject(MatDialog).openDialogs[0].componentRef?.changeDetectorRef.detectChanges(); + expect(continueButton.disabled).toBe(true); + overlay.querySelector('.source-card')!.click(); + detectDialogChanges(); + expect(continueButton.disabled).toBe(false); + continueButton.click(); + detectDialogChanges(); + fixture.detectChanges(); + expect(overlay.querySelector('.upload-dialog__description')?.textContent).toContain( + 'Selecciona los archivos que deseas procesar.', + ); + expect(overlay.querySelector('.upload-steps__item--active')?.textContent).toContain( + 'Configuración', + ); + expect(continueButton.disabled).toBe(true); + const fileInput = overlay.querySelector('input[type="file"]')!; + const validFile = new File(['contenido'], 'pacientes.XLSX', { + type: 'application/octet-stream', + }); + const csvFile = new File(['a,b'], 'consultas.csv', { type: 'text/csv' }); + const invalidFile = new File(['x'], 'documento.docx'); + const emptyFile = new File([], 'vacio.csv'); + const selectFiles = (...files: File[]) => { + Object.defineProperty(fileInput, 'files', { configurable: true, value: files }); + fileInput.dispatchEvent(new Event('change', { bubbles: true })); + detectDialogChanges(); + fixture.detectChanges(); + }; + selectFiles(validFile, csvFile, invalidFile, emptyFile); + expect(overlay.querySelectorAll('.file-row')).toHaveLength(2); + expect(overlay.querySelector('.file-messages')?.textContent).toContain( + 'documento.docx no fue agregado. Formato no compatible.', + ); + expect(overlay.querySelector('.file-messages')?.textContent).toContain( + 'vacio.csv no fue agregado. El archivo está vacío.', + ); + expect(continueButton.disabled).toBe(false); + selectFiles(validFile); + expect(overlay.querySelectorAll('.file-row')).toHaveLength(2); + expect(overlay.querySelector('.file-messages')?.textContent).toContain( + 'pacientes.XLSX ya se encuentra seleccionado.', + ); + const jsonFile = new File(['{}'], 'nuevo.json', { type: 'application/json' }); + const dialogComponent = TestBed.inject(MatDialog).openDialogs[0].componentRef! + .instance as import('./information-upload-dialog').InformationUploadDialog; + dialogComponent.onDrop({ + preventDefault: () => undefined, + dataTransfer: { files: [jsonFile] }, + } as unknown as DragEvent); + detectDialogChanges(); + fixture.detectChanges(); + expect(overlay.querySelectorAll('.file-row')).toHaveLength(3); + overlay.querySelector('.file-row__remove')!.click(); + detectDialogChanges(); + fixture.detectChanges(); + expect(overlay.querySelectorAll('.file-row')).toHaveLength(2); + continueButton.click(); + detectDialogChanges(); + fixture.detectChanges(); + expect(overlay.querySelector('h3')?.textContent).toContain('Confirmación'); + expect(overlay.querySelector('.configuration-placeholder p')?.textContent).toContain( + 'La confirmación de los archivos se implementará en la siguiente fase.', + ); + overlay.querySelector('.upload-dialog__back')!.click(); + detectDialogChanges(); + fixture.detectChanges(); + expect(overlay.querySelectorAll('.file-row')).toHaveLength(2); + while (overlay.querySelector('.file-row__remove')) { + overlay.querySelector('.file-row__remove')!.click(); + detectDialogChanges(); + fixture.detectChanges(); + } + expect(overlay.querySelectorAll('.file-row')).toHaveLength(0); + expect(overlay.querySelector('.upload-dialog__continue')?.disabled).toBe(true); + overlay.querySelector('.upload-dialog__back')!.click(); + detectDialogChanges(); + fixture.detectChanges(); + expect(cards()[0].getAttribute('aria-pressed')).toBe('true'); + overlay.querySelectorAll('.source-card')[1].click(); + detectDialogChanges(); + const sqlContinueButton = overlay.querySelector('.upload-dialog__continue')!; + expect(sqlContinueButton.disabled).toBe(false); + sqlContinueButton.click(); + detectDialogChanges(); + fixture.detectChanges(); + expect(overlay.querySelector('h3')?.textContent).toContain('Conexión SQL'); + expect(overlay.querySelector('.upload-dialog__continue')?.disabled).toBe(true); + overlay.querySelector('.upload-dialog__back')!.click(); + detectDialogChanges(); + fixture.detectChanges(); + expect(cards()[1].getAttribute('aria-pressed')).toBe('true'); + overlay.querySelector('.upload-dialog__close')!.click(); + fixture.detectChanges(); + await new Promise((resolve) => setTimeout(resolve, 200)); + expect(TestBed.inject(MatDialog).openDialogs).toHaveLength(0); + + fixture.nativeElement.querySelector('.home__action').click(); + fixture.detectChanges(); + await fixture.whenStable(); + const reopenedOverlay = document.querySelector('.cdk-overlay-container')!; + reopenedOverlay.querySelector('.source-card')!.click(); + const reopenedDialog = TestBed.inject(MatDialog).openDialogs[0].componentRef!; + reopenedDialog.changeDetectorRef.detectChanges(); + reopenedOverlay.querySelector('.upload-dialog__continue')!.click(); + reopenedDialog.changeDetectorRef.detectChanges(); + expect(reopenedOverlay.querySelector('.selected-files')).toBeNull(); + expect(reopenedOverlay.querySelector('.upload-dialog__continue')?.disabled).toBe(true); + reopenedOverlay.querySelector('.upload-dialog__cancel')!.click(); + fixture.detectChanges(); + await new Promise((resolve) => setTimeout(resolve, 200)); + expect(TestBed.inject(MatDialog).openDialogs).toHaveLength(0); }); }); diff --git a/src/app/app.ts b/src/app/app.ts index 71ff325..3e7d97c 100644 --- a/src/app/app.ts +++ b/src/app/app.ts @@ -1,13 +1,10 @@ import { Component } from '@angular/core'; import { RouterOutlet } from '@angular/router'; -import { MatToolbarModule } from '@angular/material/toolbar'; @Component({ - imports: [RouterOutlet, MatToolbarModule], + imports: [RouterOutlet], selector: 'app-root', styleUrl: './app.scss', templateUrl: './app.html', }) -export class App { - protected readonly title = 'ISSSTELEON'; -} +export class App {} diff --git a/src/app/home.html b/src/app/home.html new file mode 100644 index 0000000..5e3b7ca --- /dev/null +++ b/src/app/home.html @@ -0,0 +1,27 @@ +
+
+

ISSSTELEON · Análisis de información

+

Analiza tu información

+

+ Carga tus datos para procesarlos y consultar resultados de forma clara y sencilla. +

+ +
    +
  1. + + Carga información +
  2. +
  3. + + Procesa los datos +
  4. +
  5. + + Consulta resultados +
  6. +
+
+
diff --git a/src/app/home.scss b/src/app/home.scss new file mode 100644 index 0000000..9cabd3c --- /dev/null +++ b/src/app/home.scss @@ -0,0 +1,131 @@ +:host { + display: flex; + flex: 1; + min-width: 0; +} + +.home { + align-items: flex-start; + display: flex; + flex: 1; + justify-content: center; + min-height: inherit; + padding: 72px 32px; + text-align: center; +} + +.home__content { + margin-inline: auto; + max-width: 780px; + width: 100%; +} +.home__eyebrow { + color: var(--color-text-secondary); + font-size: 12px; + font-weight: 500; + letter-spacing: 0.12em; + margin: 0 0 18px; + text-transform: uppercase; +} +h1 { + color: var(--color-primary); + font-family: var(--font-heading); + font-size: clamp(2.75rem, 5.1vw, 3.375rem); + font-weight: 700; + letter-spacing: -0.045em; + line-height: 1.08; + margin: 0; +} +.home__description { + color: var(--color-text-secondary); + font-size: 16px; + line-height: 1.6; + margin: 20px auto 30px; + max-width: 560px; +} +.home__action { + align-items: center; + background: #f8f9fa; + border: 1px solid #e9ecef; + border-radius: 8px; + color: var(--color-text); + cursor: pointer; + display: inline-flex; + font: inherit; + font-weight: 600; + gap: 9px; + min-height: 50px; + padding: 12px 20px; + transition: + background-color 0.2s ease, + border-color 0.2s ease, + color 0.2s ease, + transform 0.2s ease; +} + +.home__action:hover { + background: #e9ecef; + border-color: #5f9ea0; + transform: translateY(-1px); +} + +.home__action:focus-visible { + outline: 3px solid rgb(168 194 67 / 55%); + outline-offset: 3px; +} + +.home__action:active { + transform: translateY(0); +} + +.home__action mat-icon { + color: #5f9ea0; + margin: 0; +} +.steps { + align-items: center; + color: var(--color-text-secondary); + display: flex; + flex-wrap: wrap; + gap: 24px 36px; + justify-content: center; + list-style: none; + margin: 74px 0 0; + padding: 0; +} +.steps__item { + align-items: center; + display: inline-flex; + font-size: 14px; + gap: 10px; +} +.steps__icon { + align-items: center; + background: var(--color-step); + border-radius: 50%; + color: var(--color-primary); + display: inline-flex; + height: 38px; + justify-content: center; + width: 38px; +} + +@media (max-width: 600px) { + .home { + padding: 56px 22px; + } + h1 { + font-size: clamp(2.35rem, 10vw, 2.8rem); + } + .home__description { + font-size: 15px; + margin-top: 16px; + } + .steps { + align-items: flex-start; + flex-direction: column; + gap: 16px; + margin: 52px auto 0; + max-width: 230px; + } +} diff --git a/src/app/home.ts b/src/app/home.ts new file mode 100644 index 0000000..7513f12 --- /dev/null +++ b/src/app/home.ts @@ -0,0 +1,27 @@ +import { Component, inject } from '@angular/core'; +import { MatDialog, MatDialogModule } from '@angular/material/dialog'; +import { MatIconModule } from '@angular/material/icon'; +import { InformationUploadDialog } from './information-upload-dialog'; + +@Component({ + imports: [MatDialogModule, MatIconModule], + selector: 'app-home', + styleUrl: './home.scss', + templateUrl: './home.html', +}) +export class Home { + private readonly dialog = inject(MatDialog); + + openInformationDialog(): void { + if (this.dialog.openDialogs.length > 0) return; + + this.dialog.open(InformationUploadDialog, { + width: '800px', + maxWidth: 'calc(100vw - 32px)', + autoFocus: 'first-tabbable', + restoreFocus: true, + disableClose: true, + panelClass: 'information-upload-dialog-panel', + }); + } +} diff --git a/src/app/information-upload-dialog.html b/src/app/information-upload-dialog.html new file mode 100644 index 0000000..2f13303 --- /dev/null +++ b/src/app/information-upload-dialog.html @@ -0,0 +1,105 @@ +
+
+

Cargar información

+ +
+ +
    +
  1. + Fuente +
  2. +
  3. + Configuración +
  4. +
  5. + Confirmación +
  6. +
+ + @if (step() === 'source') { +

Selecciona cómo deseas proporcionar los datos.

+
+
+ + +
+
+ } @else if (step() === 'configuration' && source() === 'file') { +

Selecciona los archivos que deseas procesar.

+
+
+ +

Arrastra tus archivos aquí

+

Excel · CSV · JSON · PDF

+ + +
+ + @if (fileMessages().length > 0) { +
    + @for (message of fileMessages(); track $index) {
  • {{ message }}
  • } +
+ } + + @if (files().length > 0) { +
+
+

Archivos seleccionados

+ {{ files().length }} +
+
    + @for (file of files(); track file.name + ':' + file.size) { +
  • + + {{ file.name }} + {{ formatFileSize(file.size) }} + +
  • + } +
+
+ } +
+ } @else if (step() === 'configuration') { +

Configura la fuente seleccionada.

+
+ +

Conexión SQL

+

La configuración de la conexión se implementará en la siguiente fase.

+
+ } @else { +

Revisa el siguiente paso de la carga de información.

+
+ +

Confirmación

+

La confirmación de los archivos se implementará en la siguiente fase.

+
+ } + +
+ +
+ @if (step() !== 'source') { + + } + @if (step() !== 'confirmation') { + + } +
+
+
diff --git a/src/app/information-upload-dialog.scss b/src/app/information-upload-dialog.scss new file mode 100644 index 0000000..17bea23 --- /dev/null +++ b/src/app/information-upload-dialog.scss @@ -0,0 +1,494 @@ +:host { + display: block; +} + +.upload-dialog { + background: #fff; + color: #081839; + padding: 28px 32px 24px; +} +.upload-dialog__header { + align-items: flex-start; + display: flex; + gap: 20px; + justify-content: space-between; +} +.upload-dialog__header h2 { + font-family: var(--font-heading); + font-size: 30px; + line-height: 1.15; + margin: 0; +} +.upload-dialog__description { + color: #7a7a7a; + font-size: 15px; + line-height: 1.5; + margin: 14px 0 0; +} +.upload-dialog__close { + color: #596273; + margin: -8px -10px 0 0; +} +.upload-steps { + align-items: center; + border-bottom: 1px solid #e3e7df; + color: #7a7a7a; + display: flex; + justify-content: center; + list-style: none; + margin: 24px 0 0; + padding: 0 0 20px; +} +.upload-steps li { + align-items: center; + display: flex; + font-size: 13px; + gap: 8px; +} +.upload-steps li + li::before { + background: #dfe3dc; + content: ''; + height: 1px; + margin: 0 14px; + width: clamp(20px, 8vw, 70px); +} +.upload-steps__number { + align-items: center; + background: #f0f2ed; + border-radius: 50%; + display: inline-flex; + font-size: 12px; + height: 25px; + justify-content: center; + width: 25px; +} +.upload-steps__number mat-icon { + font-size: 16px; + height: 16px; + width: 16px; +} +.upload-steps__item--active { + color: #081839; + font-weight: 600; +} +.upload-steps__item--active .upload-steps__number { + background: #a8c243; + color: #081839; +} +.upload-steps__item--complete { + color: #71882b; +} +.upload-steps__item--complete .upload-steps__number { + background: #f0f3e8; + color: #71882b; +} +.upload-dialog__content { + padding: 18px 0 28px; +} +.source-options { + display: grid; + gap: 16px; + grid-template-columns: repeat(2, minmax(0, 1fr)); +} +.source-card { + align-items: center; + background: #fff; + border: 1px solid #e3e7df; + border-radius: 9px; + color: #081839; + cursor: pointer; + display: flex; + gap: 16px; + min-height: 126px; + padding: 20px; + position: relative; + text-align: left; + transition: + background-color 0.16s ease, + border-color 0.16s ease; +} +.source-card:hover { + background: #fafbf7; + border-color: #c7d49a; +} +.source-card:focus-visible, +.upload-dialog__close:focus-visible, +.file-row__remove:focus-visible, +.upload-action:focus-visible { + outline: 3px solid rgb(168 194 67 / 65%); + outline-offset: 2px; +} +.source-card--selected { + background: #fbfcf6; + border: 2px solid #a8c243; + padding: 19px; +} +.source-card__icon { + align-items: center; + background: #f0f3e8; + border-radius: 8px; + color: #71882b; + display: inline-flex; + flex: 0 0 46px; + height: 46px; + justify-content: center; +} +.source-card__copy { + display: grid; + gap: 6px; + min-width: 0; +} +.source-card__title { + font-size: 16px; + font-weight: 600; +} +.source-card__description { + color: #7a7a7a; + font-size: 13px; + line-height: 1.45; +} +.source-card__check { + color: #71882b; + margin-left: auto; +} +.configuration-placeholder { + align-items: center; + display: flex; + flex-direction: column; + justify-content: center; + min-height: 164px; + text-align: center; +} +.configuration-placeholder__icon { + align-items: center; + background: #f0f3e8; + border-radius: 50%; + color: #71882b; + display: inline-flex; + height: 48px; + justify-content: center; + width: 48px; +} +.configuration-placeholder h3 { + font-family: var(--font-heading); + font-size: 22px; + margin: 14px 0 6px; +} +.configuration-placeholder p { + color: #7a7a7a; + font-size: 14px; + line-height: 1.55; + margin: 0; + max-width: 460px; +} +.file-configuration { + padding-top: 18px; +} +.dropzone { + align-items: center; + background: #fcfdfb; + border: 1.5px dashed #cbd2c4; + border-radius: 10px; + display: flex; + flex-direction: column; + justify-content: center; + min-height: 244px; + padding: 24px; + text-align: center; + transition: + background-color 0.14s ease, + border-color 0.14s ease; +} +.dropzone--active { + background: #f5f8e9; + border-color: #a8c243; + border-style: solid; +} +.dropzone__icon { + color: #71882b; + font-size: 40px; + height: 40px; + width: 40px; +} +.dropzone__title { + font-size: 16px; + font-weight: 600; + margin: 14px 0 4px; +} +.dropzone__formats { + color: #7a7a7a; + font-size: 13px; + margin: 0 0 16px; +} +.select-files-button { + --mat-button-outlined-label-text-color: #081839; + --mat-button-outlined-outline-color: #d7dccf; + --mat-button-outlined-state-layer-color: transparent; + --mat-button-outlined-ripple-color: transparent; + background: #fff; + border: 1px solid var(--mat-button-outlined-outline-color); + transition: border-color 0.18s ease; +} +.upload-action--outlined:hover { + background: #f3f6e9; + border-color: #a8c243; +} +.upload-action--outlined:active { + background: #e8eed5; +} +.select-files-button mat-icon { + color: #5f9ea0; + margin: 0; +} +.visually-hidden { + clip: rect(0, 0, 0, 0); + clip-path: inset(50%); + height: 1px; + overflow: hidden; + position: absolute; + white-space: nowrap; + width: 1px; +} +.file-messages { + background: #fffaf0; + border: 1px solid #ead8a7; + border-radius: 7px; + color: #634d13; + font-size: 13px; + line-height: 1.45; + list-style: none; + margin: 12px 0 0; + padding: 10px 14px; +} +.file-messages li + li { + margin-top: 4px; +} +.selected-files { + margin-top: 20px; +} +.selected-files__header { + align-items: center; + display: flex; + gap: 10px; + justify-content: space-between; + margin-bottom: 8px; +} +.selected-files__header h3 { + font-size: 15px; + font-weight: 600; + margin: 0; +} +.selected-files__count { + align-items: center; + background: #f0f3e8; + border-radius: 20px; + color: #52651d; + display: inline-flex; + font-size: 12px; + font-weight: 600; + height: 25px; + justify-content: center; + min-width: 25px; + padding: 0 7px; +} +.selected-files__list { + border: 1px solid #e7eae3; + border-radius: 8px; + list-style: none; + margin: 0; + max-height: 220px; + overflow-y: auto; + padding: 0; +} +.file-row { + align-items: center; + display: grid; + gap: 10px; + grid-template-columns: 22px minmax(0, 1fr) auto 40px; + min-height: 54px; + padding: 6px 8px 6px 12px; +} +.file-row + .file-row { + border-top: 1px solid #eef0eb; +} +.file-row__icon { + color: #71882b; + font-size: 20px; + height: 20px; + width: 20px; +} +.file-row__name { + font-size: 13px; + min-width: 0; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} +.file-row__size { + color: #737b6b; + font-size: 12px; + white-space: nowrap; +} +.file-row__remove { + color: #596273; + height: 36px; + line-height: 36px; + width: 36px; +} +.upload-dialog__footer { + align-items: center; + border-top: 1px solid #e3e7df; + display: grid; + gap: 10px; + grid-template-columns: minmax(0, 1fr) auto; + padding-top: 18px; +} +.action-cancel { + justify-self: start; +} +.upload-dialog__navigation { + align-items: center; + display: flex; + gap: 10px; + justify-self: end; +} +.upload-action { + border-radius: 8px; + font: inherit; + font-weight: 600; + min-height: 44px; + padding: 10px 18px; + transition: background-color 0.18s ease; +} +.action-cancel, +.action-back { + --mat-button-text-state-layer-color: transparent; + --mat-button-text-ripple-color: transparent; +} +.action-cancel { + --mat-button-text-label-text-color: #fff; + background: #7a7a7a; +} +.action-cancel:hover { + background: #696969; +} +.action-cancel:active { + background: #5d5d5d; +} +.action-back { + --mat-button-text-label-text-color: #081839; + background: #fff; + border: 1px solid #d7dccf; +} +.action-back:hover { + background: #f3f6e9; + border-color: #a8c243; +} +.action-back:active { + background: #e8eed5; +} +.action-continue { + --mat-button-filled-container-color: #6f821c; + --mat-button-filled-label-text-color: #f7f9ef; + --mat-button-filled-state-layer-color: transparent; + --mat-button-filled-ripple-color: transparent; + min-width: 124px; +} +.action-continue:hover:not(:disabled) { + --mat-button-filled-container-color: #809625; +} +.action-continue:active:not(:disabled) { + --mat-button-filled-container-color: #607216; +} +.action-continue:disabled { + --mat-button-filled-disabled-container-color: #e8ecdf; + --mat-button-filled-disabled-label-text-color: #9da38f; + --mat-button-filled-disabled-state-layer-color: transparent; +} +@media (max-width: 600px) { + .upload-dialog { + padding: 22px 20px 18px; + } + .upload-dialog__header h2 { + font-size: 26px; + } + .upload-dialog__description { + font-size: 14px; + margin-top: 12px; + } + .upload-steps { + display: grid; + grid-template-columns: repeat(3, minmax(0, 1fr)); + } + .upload-steps li { + flex-direction: column; + font-size: 11px; + gap: 4px; + text-align: center; + } + .upload-steps li + li::before { + display: none; + } + .upload-steps__number { + height: 22px; + width: 22px; + } + .source-options { + grid-template-columns: 1fr; + } + .source-card { + min-height: 94px; + padding: 16px; + } + .source-card--selected { + padding: 15px; + } + .upload-dialog__content { + padding: 20px 0; + } + .dropzone { + min-height: 220px; + padding: 20px 12px; + } + .file-row { + gap: 6px; + grid-template-columns: 20px minmax(0, 1fr) auto 36px; + padding-left: 8px; + } + .file-row__name { + font-size: 12px; + } + .file-row__size { + font-size: 11px; + } +} + +@media (max-width: 360px) { + .upload-dialog { + padding-inline: 16px; + } + .upload-steps li { + font-size: 10px; + } + .upload-dialog__footer { + gap: 4px; + } + .upload-dialog__navigation { + gap: 4px; + } + .action-cancel, + .action-back { + min-width: 56px; + padding-inline: 6px; + } + .action-continue { + min-width: 92px; + padding-inline: 10px; + } +} + +@media (max-width: 300px) { + .upload-dialog__footer { + grid-template-columns: minmax(0, 1fr); + } +} diff --git a/src/app/information-upload-dialog.ts b/src/app/information-upload-dialog.ts new file mode 100644 index 0000000..2901f6b --- /dev/null +++ b/src/app/information-upload-dialog.ts @@ -0,0 +1,129 @@ +import { Component, signal } from '@angular/core'; +import { MatButtonModule } from '@angular/material/button'; +import { MatDialogModule, MatDialogRef } from '@angular/material/dialog'; +import { MatIconModule } from '@angular/material/icon'; + +type UploadSource = 'file' | 'sql'; +type UploadStep = 'source' | 'configuration' | 'confirmation'; + +@Component({ + imports: [MatButtonModule, MatDialogModule, MatIconModule], + selector: 'app-information-upload-dialog', + styleUrl: './information-upload-dialog.scss', + templateUrl: './information-upload-dialog.html', +}) +export class InformationUploadDialog { + readonly step = signal('source'); + readonly source = signal(null); + readonly files = signal([]); + readonly fileMessages = signal([]); + readonly isDragOver = signal(false); + + private dragDepth = 0; + private readonly allowedExtensions = new Set(['xlsx', 'csv', 'json', 'pdf']); + + constructor(private readonly dialogRef: MatDialogRef) {} + + selectSource(source: UploadSource): void { + this.source.set(source); + } + + continue(): void { + if (this.step() === 'source' && this.source()) this.step.set('configuration'); + else if (this.step() === 'configuration' && this.source() === 'file' && this.files().length > 0) { + this.step.set('confirmation'); + } + } + + back(): void { + if (this.step() === 'confirmation') this.step.set('configuration'); + else if (this.step() === 'configuration') this.step.set('source'); + } + + close(): void { + this.dialogRef.close(); + } + + onFileSelection(event: Event): void { + const input = event.target as HTMLInputElement; + this.addFiles(input.files ? Array.from(input.files) : []); + input.value = ''; + } + + onDragEnter(event: DragEvent): void { + event.preventDefault(); + this.dragDepth++; + this.isDragOver.set(true); + } + + onDragOver(event: DragEvent): void { + event.preventDefault(); + if (event.dataTransfer) event.dataTransfer.dropEffect = 'copy'; + } + + onDragLeave(event: DragEvent): void { + event.preventDefault(); + this.dragDepth = Math.max(0, this.dragDepth - 1); + if (this.dragDepth === 0) this.isDragOver.set(false); + } + + onDrop(event: DragEvent): void { + event.preventDefault(); + this.dragDepth = 0; + this.isDragOver.set(false); + this.addFiles(event.dataTransfer?.files ? Array.from(event.dataTransfer.files) : []); + } + + removeFile(fileToRemove: File): void { + this.files.update((files) => files.filter((file) => file !== fileToRemove)); + } + + formatFileSize(size: number): string { + if (size < 1024) return `${size} bytes`; + const units = ['KB', 'MB', 'GB']; + let value = size / 1024; + let unit = 0; + while (value >= 1024 && unit < units.length - 1) { + value /= 1024; + unit++; + } + return `${new Intl.NumberFormat('es-MX', { maximumFractionDigits: 1 }).format(value)} ${units[unit]}`; + } + + fileIcon(file: File): string { + const extension = this.extensionOf(file.name); + if (extension === 'pdf') return 'picture_as_pdf'; + if (extension === 'csv' || extension === 'xlsx') return 'table_chart'; + return 'data_object'; + } + + private addFiles(incomingFiles: File[]): void { + const messages: string[] = []; + const accepted = [...this.files()]; + + for (const file of incomingFiles) { + const extension = this.extensionOf(file.name); + if (!this.allowedExtensions.has(extension)) { + messages.push(`${file.name} no fue agregado. Formato no compatible.`); + continue; + } + if (file.size === 0) { + messages.push(`${file.name} no fue agregado. El archivo está vacío.`); + continue; + } + if (accepted.some((existing) => existing.name === file.name && existing.size === file.size)) { + messages.push(`${file.name} ya se encuentra seleccionado.`); + continue; + } + accepted.push(file); + } + + if (accepted.length !== this.files().length) this.files.set(accepted); + this.fileMessages.set(messages); + } + + private extensionOf(fileName: string): string { + const finalDot = fileName.lastIndexOf('.'); + return finalDot >= 0 ? fileName.slice(finalDot + 1).toLowerCase() : ''; + } +} diff --git a/src/index.html b/src/index.html index 5ac61ae..cc672be 100644 --- a/src/index.html +++ b/src/index.html @@ -1,8 +1,8 @@ - + - WebApp + Análisis de información | ISSSTELEON diff --git a/src/styles.scss b/src/styles.scss index 8ba3af6..f91119b 100644 --- a/src/styles.scss +++ b/src/styles.scss @@ -1,10 +1,17 @@ -// Include theming for Angular Material with `mat.theme()`. -// This Sass mixin will define CSS variables that are used for styling Angular Material -// components according to the Material 3 design spec. -// Learn more about theming and how to use it for your application's -// custom components at https://material.angular.dev/guide/theming @use '@angular/material' as mat; +:root { + --color-primary: #a8c243; + --color-text: #081839; + --color-text-secondary: #7a7a7a; + --color-background: #f7f8f6; + --color-surface: #ffffff; + --color-border: #e3e7df; + --color-step: #f0f3e8; + --font-body: 'Roboto', sans-serif; + --font-heading: 'Rajdhani', 'Roboto Condensed', 'Arial Narrow', sans-serif; +} + html { height: 100%; @include mat.theme( @@ -20,20 +27,21 @@ html { } body { - // Default the application to a light color theme. This can be changed to - // `dark` to enable the dark color theme, or to `light dark` to defer to the - // user's system settings. color-scheme: light; - - // Set a default background, font and text colors for the application using - // Angular Material's system-level CSS variables. Learn more about these - // variables at https://material.angular.dev/guide/system-variables - background-color: var(--mat-sys-surface); - color: var(--mat-sys-on-surface); - font: var(--mat-sys-body-medium); - - // Reset the user agent margin. + background: var(--color-background); + color: var(--color-text); + font-family: var(--font-body); margin: 0; - height: 100%; + min-height: 100%; +} + +*, +*::before, +*::after { + box-sizing: border-box; +} + +.information-upload-dialog-panel .mat-mdc-dialog-surface { + border-radius: 12px; + padding: 0; } -/* You can add global styles to this file, and also import other style files */