Basic bulk editor component

This commit is contained in:
Michael Shamoon
2020-12-14 23:14:19 -08:00
parent 2e42959763
commit 5850daf208
7 changed files with 111 additions and 12 deletions

View File

@@ -0,0 +1,16 @@
<div class="btn-group mr-lg-2" role="group" aria-label="Select">
<button class="btn btn-sm btn-outline-primary" (click)="this.selectPage.next()">Select page</button>
<button class="btn btn-sm btn-outline-primary" (click)="this.selectAll.next()">Select all</button>
<button class="btn btn-sm btn-outline-primary" (click)="this.selectNone.next()">Select none</button>
</div>
<div class="btn-group mr-lg-2" role="group" aria-label="Actions">
<button class="btn btn-sm btn-outline-primary" (click)="this.setCorrespondent.next()">Set correspondent</button>
<button class="btn btn-sm btn-outline-primary" (click)="this.removeCorrespondent.next()">Remove correspondent</button>
<button class="btn btn-sm btn-outline-primary" (click)="this.setDocumentType.next()">Set document type</button>
<button class="btn btn-sm btn-outline-primary" (click)="this.removeDocumentType.next()">Remove document type</button>
<button class="btn btn-sm btn-outline-primary" (click)="this.addTag.next()">Add tag</button>
<button class="btn btn-sm btn-outline-primary" (click)="this.removeTag.next()">Remove tag</button>
</div>
<div class="btn-group mr-lg-2" role="group" aria-label="Delete">
<button class="btn btn-sm btn-outline-primary" (click)="this.delete.next()">Delete</button>
</div>

View File

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

View File

@@ -0,0 +1,46 @@
import { Component, EventEmitter, Input, Output } from '@angular/core';
import { DocumentListViewService } from 'src/app/services/document-list-view.service';
@Component({
selector: 'app-bulk-editor',
templateUrl: './bulk-editor.component.html',
styleUrls: ['./bulk-editor.component.scss']
})
export class BulkEditorComponent {
@Input()
list: DocumentListViewService
@Output()
selectPage = new EventEmitter()
@Output()
selectAll = new EventEmitter()
@Output()
selectNone = new EventEmitter()
@Output()
setCorrespondent = new EventEmitter()
@Output()
removeCorresponden = new EventEmitter()
@Output()
setDocumentType = new EventEmitter()
@Output()
removeDocumentType = new EventEmitter()
@Output()
addTag = new EventEmitter()
@Output()
removeTag = new EventEmitter()
@Output()
delete = new EventEmitter()
constructor( ) { }
}