Skip to content

Commit e2c0c97

Browse files
committed
fix: remove unused method
1 parent 7e9ce93 commit e2c0c97

File tree

1 file changed

+33
-70
lines changed

1 file changed

+33
-70
lines changed

src/material/datepicker/datepicker-base.ts

Lines changed: 33 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ import {
1313
Overlay,
1414
OverlayConfig,
1515
OverlayRef,
16-
PositionStrategy,
1716
ScrollStrategy,
1817
FlexibleConnectedPositionStrategy,
1918
} from '@angular/cdk/overlay';
@@ -553,77 +552,41 @@ export abstract class MatDatepickerBase<C extends MatDatepickerControl<D>, S,
553552
}
554553
}
555554

556-
/** Create the popup PositionStrategy. */
557-
private _createPopupPositionStrategy(): PositionStrategy {
558-
return this._overlay.position()
559-
.flexibleConnectedTo(this._datepickerInput.getConnectedOverlayOrigin())
560-
.withTransformOriginOn('.mat-datepicker-content')
561-
.withFlexibleDimensions(false)
562-
.withViewportMargin(8)
563-
.withLockedPosition()
564-
.withPositions([
565-
{
566-
originX: 'start',
567-
originY: 'bottom',
568-
overlayX: 'start',
569-
overlayY: 'top'
570-
},
571-
{
572-
originX: 'start',
573-
originY: 'top',
574-
overlayX: 'start',
575-
overlayY: 'bottom'
576-
},
577-
{
578-
originX: 'end',
579-
originY: 'bottom',
580-
overlayX: 'end',
581-
overlayY: 'top'
582-
},
583-
{
584-
originX: 'end',
585-
originY: 'top',
586-
overlayX: 'end',
587-
overlayY: 'bottom'
588-
}
589-
]);
555+
/** Sets the positions of the datepicker in dropdown mode based on the current configuration. */
556+
private _setConnectedPositions(strategy: FlexibleConnectedPositionStrategy) {
557+
const primaryX = this.xPosition === 'end' ? 'end' : 'start';
558+
const secondaryX = primaryX === 'start' ? 'end' : 'start';
559+
const primaryY = this.yPosition === 'above' ? 'bottom' : 'top';
560+
const secondaryY = primaryY === 'top' ? 'bottom' : 'top';
561+
562+
return strategy.withPositions([
563+
{
564+
originX: primaryX,
565+
originY: secondaryY,
566+
overlayX: primaryX,
567+
overlayY: primaryY
568+
},
569+
{
570+
originX: primaryX,
571+
originY: primaryY,
572+
overlayX: primaryX,
573+
overlayY: secondaryY
574+
},
575+
{
576+
originX: secondaryX,
577+
originY: secondaryY,
578+
overlayX: secondaryX,
579+
overlayY: primaryY
580+
},
581+
{
582+
originX: secondaryX,
583+
originY: primaryY,
584+
overlayX: secondaryX,
585+
overlayY: secondaryY
586+
}
587+
]);
590588
}
591589

592-
/** Sets the positions of the datepicker in dropdown mode based on the current configuration. */
593-
private _setConnectedPositions(strategy: FlexibleConnectedPositionStrategy) {
594-
const primaryX = this.xPosition === 'end' ? 'end' : 'start';
595-
const secondaryX = primaryX === 'start' ? 'end' : 'start';
596-
const primaryY = this.yPosition === 'above' ? 'bottom' : 'top';
597-
const secondaryY = primaryY === 'top' ? 'bottom' : 'top';
598-
599-
return strategy.withPositions([
600-
{
601-
originX: primaryX,
602-
originY: secondaryY,
603-
overlayX: primaryX,
604-
overlayY: primaryY
605-
},
606-
{
607-
originX: primaryX,
608-
originY: primaryY,
609-
overlayX: primaryX,
610-
overlayY: secondaryY
611-
},
612-
{
613-
originX: secondaryX,
614-
originY: secondaryY,
615-
overlayX: secondaryX,
616-
overlayY: primaryY
617-
},
618-
{
619-
originX: secondaryX,
620-
originY: primaryY,
621-
overlayX: secondaryX,
622-
overlayY: secondaryY
623-
}
624-
]);
625-
}
626-
627590
/**
628591
* @param obj The object to check.
629592
* @returns The given object if it is both a date instance and valid, otherwise null.

0 commit comments

Comments
 (0)