Add task displaying in active list component.

This commit is contained in:
2022-03-04 22:08:13 +01:00
parent 86fcdd4d12
commit 21bd3826e6
9 changed files with 183 additions and 4 deletions

View File

@@ -1 +1,7 @@
<p>active-list-tasks works!</p>
<div class="container">
<app-task-display class="task" *ngFor="let i of [0,1,2,3,4,5,6,7,8,9]" class="task"></app-task-display>
<div class="task new">
<mat-icon>add</mat-icon>
<input />
</div>
</div>

View File

@@ -0,0 +1,32 @@
.container {
max-width: 50rem;
width: 90%;
margin: 0 auto;
.task {
position: relative;
width: 100%;
height: 2.5rem;
display: flex;
align-items: center;
margin: .5rem 0;
input {
width: 100%;
height: 100%;
padding: 0 3rem;
border-radius: .1rem;
border-style: none;
background-color: #444;
}
&.new {
margin-top: 1rem;
mat-icon {
position: absolute;
left: 1rem;
}
}
}
}

View File

@@ -0,0 +1,12 @@
<div class="task">
<div class="header">
<mat-icon class="drag-n-drop">drag_handle</mat-icon>
<mat-checkbox class="example-margin"></mat-checkbox>
<div class="input-container">
<input type="text" [formControl]="taskNameControl" />
</div>
<button mat-button type="button" class="expand">
<mat-icon>expand_more</mat-icon>
</button>
</div>
</div>

View File

@@ -0,0 +1,83 @@
.task {
position: relative;
width: 100%;
height: 2.5rem;
display: flex;
align-items: center;
margin: .5rem 0;
.header {
border-radius: .1rem;
height: 2.5rem;
background-color: #444;
width: 100%;
display: flex;
align-items: center;
.drag-n-drop {
padding: 0 1rem;
&:hover {
cursor: grab;
}
}
mat-checkbox {
// padding: 0 .5rem;
}
.input-container {
display: flex;
flex-grow: 1;
input {
border-style: none;
height: 1.8rem;
padding: 0 .8rem;
margin: 0 .8rem;
background-color: #444;
border-style: solid;
border-width: .1rem;
border-color: rgba(0,0,0, 0);
border-radius: .2rem;
width: 100%;
transition: background-color .2s ease-out,
border-color .2s ease-out;
&:hover {
border-color: rgb(53, 53, 53);
}
}
}
.expand {
display: flex;
justify-content: end;
display: flex;
justify-content: center;
align-items: center;
padding: 0;
margin-right: .5rem;
border-style: solid;
border-width: .1rem;
border-color: rgba(0,0,0, 0);
width: 2rem;
height: 2rem;
min-width: 2rem;
min-height: 2rem;
transition: background-color .2s ease-out,
border-color .2s ease-out;
&:hover {
background-color: #666;
border-color: rgb(53, 53, 53);
}
}
}
}

View File

@@ -0,0 +1,25 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { TaskDisplayComponent } from './task-display.component';
describe('TaskDisplayComponent', () => {
let component: TaskDisplayComponent;
let fixture: ComponentFixture<TaskDisplayComponent>;
beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [ TaskDisplayComponent ]
})
.compileComponents();
});
beforeEach(() => {
fixture = TestBed.createComponent(TaskDisplayComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});

View File

@@ -0,0 +1,16 @@
import { Component, OnInit, ViewChild } from '@angular/core';
import { FormControl, Validators } from '@angular/forms';
@Component({
selector: 'app-task-display',
templateUrl: './task-display.component.html',
styleUrls: ['./task-display.component.scss']
})
export class TaskDisplayComponent implements OnInit {
taskNameControl = new FormControl(undefined);
constructor() { }
ngOnInit(): void {
}
}