const remainder = this.minuteStep - start.minute() % this.minuteStep,
final = Moment(start, this.timezone).add(remainder, 'minutes');
- // Seed time model with current, rounding up to nearest granularity minutes (does roll hour over if needed)
+ // Seed time model with current, rounding up to nearest minuteStep (does roll hour over if needed)
this.timeModel = { hour: final.hour(), minute: final.minute(), second: 0 };
}
}
if (newDate && !isNaN(newDate)) {
- // Set component view value
+ // Set the input field to the current value
this.stringVersion = this.format.transform({value: newDate, datatype: 'timestamp', datePlusTime: true});
// Update form passed in view value
this.onChangeAsMoment.emit(newDate);
}
}
- isDisabled(date: NgbDateStruct, current: { month: number }) {
- return date.month !== current.month;
- }
-
}
</div>
</div>
- <button [disabled]="gridContext.pager.isFirstPage()" type="button"
- class="btn btn-outline-dark mr-1" (click)="gridContext.pager.toFirst()">
- <span title="First Page" i18n-title
+ <ng-container *ngIf="!disablePager">
+ <button [disabled]="gridContext.pager.isFirstPage()" type="button"
+ class="btn btn-outline-dark mr-1" (click)="gridContext.pager.toFirst()">
+ <span title="First Page" i18n-title
class="material-icons mat-icon-in-button">first_page</span>
- </button>
- <button [disabled]="gridContext.pager.isFirstPage()" type="button"
- class="btn btn-outline-dark mr-1" (click)="gridContext.pager.decrement()">
- <span title="Previous Page" i18n-title
+ </button>
+ <button [disabled]="gridContext.pager.isFirstPage()" type="button"
+ class="btn btn-outline-dark mr-1" (click)="gridContext.pager.decrement()">
+ <span title="Previous Page" i18n-title
class="material-icons mat-icon-in-button">keyboard_arrow_left</span>
- </button>
- <button [disabled]="gridContext.pager.isLastPage()" type="button"
- class="btn btn-outline-dark mr-1" (click)="gridContext.pager.increment()">
- <span title="Next Page" i18n-title
+ </button>
+ <button [disabled]="gridContext.pager.isLastPage()" type="button"
+ class="btn btn-outline-dark mr-1" (click)="gridContext.pager.increment()">
+ <span title="Next Page" i18n-title
class="material-icons mat-icon-in-button">keyboard_arrow_right</span>
- </button>
+ </button>
- <!--
- Hiding jump-to-last since there's no analog in the angularjs grid and
- it has limited value since the size of the data set is often unknown.
- <button [disabled]="!gridContext.pager.resultCount || gridContext.pager.isLastPage()"
- type="button" class="btn btn-outline-dark mr-1" (click)="gridContext.pager.toLast()">
- <span title="First Page" i18n-title
+ <!--
+ Hiding jump-to-last since there's no analog in the angularjs grid and
+ it has limited value since the size of the data set is often unknown.
+ <button [disabled]="!gridContext.pager.resultCount || gridContext.pager.isLastPage()"
+ type="button" class="btn btn-outline-dark mr-1" (click)="gridContext.pager.toLast()">
+ <span title="First Page" i18n-title
class="material-icons mat-icon-in-button">last_page</span>
- </button>
- -->
-
- <div ngbDropdown class="mr-1" placement="bottom-right">
- <button ngbDropdownToggle class="btn btn-outline-dark text-button">
- <span title="Select Row Count" i18n-title i18n>
- Rows {{gridContext.pager.limit}}
- </span>
</button>
- <div class="dropdown-menu" ngbDropdownMenu>
- <a class="dropdown-item"
- *ngFor="let count of [5, 10, 25, 50, 100]"
- (click)="gridContext.pager.setLimit(count)">
- <span class="ml-2">{{count}}</span>
- </a>
+ -->
+
+ <div ngbDropdown class="mr-1" placement="bottom-right">
+ <button ngbDropdownToggle class="btn btn-outline-dark text-button">
+ <span title="Select Row Count" i18n-title i18n>
+ Rows {{gridContext.pager.limit}}
+ </span>
+ </button>
+ <div class="dropdown-menu" ngbDropdownMenu>
+ <a class="dropdown-item"
+ *ngFor="let count of [5, 10, 25, 50, 100]"
+ (click)="gridContext.pager.setLimit(count)">
+ <span class="ml-2">{{count}}</span>
+ </a>
+ </div>
</div>
- </div>
+ </ng-container>
<button type="button"
class="btn btn-outline-dark mr-1"
import {FormatService} from '@eg/core/format.service';
import {GridContext, GridColumn, GridDataSource, GridRowFlairEntry} from './grid';
+const MAX_ALL_ROW_COUNT = 10000;
+
/**
* Main grid entry point.
*/
// Prevent selection of multiple rows
@Input() disableMultiSelect: boolean;
+ // Don't display the pager
+ @Input() disablePager: boolean;
+
// Show an extra column in the grid where the caller can apply
// row-specific flair (material icons).
@Input() rowFlairIsEnabled: boolean;
this.context.disableSelect = this.disableSelect === true;
this.context.showLinkSelectors = this.showLinkSelectors === true;
this.context.disableMultiSelect = this.disableMultiSelect === true;
+ this.context.pager.limit = this.disablePager ? MAX_ALL_ROW_COUNT : 10;
this.context.rowFlairIsEnabled = this.rowFlairIsEnabled === true;
this.context.rowFlairCallback = this.rowFlairCallback;
if (this.showFields) {