add limit by

This commit is contained in:
2019-10-19 08:48:21 +02:00
parent a3099d4981
commit 24bf7c98e3
15 changed files with 286 additions and 110 deletions

View File

@@ -0,0 +1,22 @@
<mat-form-field id="limitBy">
<mat-label>Limit By:</mat-label>
<mat-select [(value)]="limitBy">
<mat-option value="NO_LIMIT">no limit</mat-option>
<mat-option value="MOST_VALUES">most values</mat-option>
<mat-option value="FEWEST_VALUES">fewest values</mat-option>
<mat-option value="MAX_VALUE">max value</mat-option>
<mat-option value="MIN_VALUE">min value</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field id="limit"
*ngIf="limitBy !== 'NO_LIMIT'">
<input
matInput
type="number"
placeholder="Limit"
min="1"
value="{{limit}}"
>
</mat-form-field>

View File

@@ -0,0 +1,9 @@
#limitBy {
width: 10em;
margin-right: 1ex;
}
#limit {
width: 5em;
margin-right: 0ex;
}

View File

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

View File

@@ -0,0 +1,18 @@
import { Component, OnInit, Input} from '@angular/core';
@Component({
selector: 'pdb-limit-by',
templateUrl: './limit-by.component.html',
styleUrls: ['./limit-by.component.scss']
})
export class LimitByComponent implements OnInit {
@Input() limit: number;
@Input() limitBy: string;
constructor() { }
ngOnInit() {
}
}