Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(datepicker): allow to change adjustment #2806

Merged
merged 5 commits into from
Aug 6, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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;
yggg marked this conversation as resolved.
Show resolved Hide resolved

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