Skip to content

Commit

Permalink
feat(datepicker): allow to change adjustment (#2806)
Browse files Browse the repository at this point in the history
  • Loading branch information
evtkhvch authored Aug 6, 2021
1 parent 73a6b5a commit a3b5ae5
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import { NbComponentPortal, NbOverlayRef } from '../cdk/overlay/mapping';
import {
NbAdjustableConnectedPositionStrategy,
NbAdjustment,
NbAdjustmentValues,
NbPosition,
NbPositionBuilderService,
} from '../cdk/overlay/overlay-position';
Expand Down Expand Up @@ -179,6 +180,8 @@ export abstract class NbBasePicker<D, T, P> extends NbDatepicker<T> {

protected overlayOffset = 8;

protected adjustment: NbAdjustment = NbAdjustment.COUNTERCLOCKWISE;

protected destroy$ = new Subject<void>();

/**
Expand Down Expand Up @@ -294,7 +297,7 @@ export abstract class NbBasePicker<D, T, P> extends NbDatepicker<T> {
.connectedTo(this.hostRef)
.position(NbPosition.BOTTOM)
.offset(this.overlayOffset)
.adjustment(NbAdjustment.COUNTERCLOCKWISE);
.adjustment(this.adjustment);
}

protected subscribeOnPositionChange() {
Expand Down Expand Up @@ -466,6 +469,9 @@ export class NbBasePickerComponent<D, T, P> extends NbBasePicker<D, T, P>
* */
@Input() overlayOffset = 8;

@Input() adjustment: NbAdjustment = NbAdjustment.COUNTERCLOCKWISE;
static ngAcceptInputType_adjustment: NbAdjustmentValues;

constructor(@Inject(NB_DOCUMENT) document,
positionBuilder: NbPositionBuilderService,
triggerStrategyBuilder: NbTriggerStrategyBuilderService,
Expand Down

0 comments on commit a3b5ae5

Please sign in to comment.