@angular/cdk/overlay#ConnectionPositionPair TypeScript Examples

The following examples show how to use @angular/cdk/overlay#ConnectionPositionPair. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: with-full-config.stories.ts    From angular-component-library with BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
withFullConfig = (): any => ({
    template: `
        <blui-user-menu 
            [(open)]="open"
            [avatarValue]="avatarValue" 
            [menuTitle]="menuTitle" 
            [menuSubtitle]="menuSubtitle"
            [positions]="createPositions(originX, originY, overlayX, overlayY)">>
            <mat-nav-list blui-menu-body [style.paddingTop.px]="0">
                <blui-info-list-item *ngFor="let item of items" [dense]="true" 
                    (click)="open=false; item.onSelect();">
                    <mat-icon blui-icon [style.transform]="invertRTL()">{{item.icon}}</mat-icon>
                    <div blui-title>{{item.title}}</div>
                </blui-info-list-item>
            </mat-nav-list>
    </blui-user-menu> 
    `,
    props: {
        open: false,
        items: items,
        avatarValue: text('avatarValue', 'AV'),
        menuTitle: text('menuTitle', 'Sample Title'),
        menuSubtitle: text('menuSubtitle', 'Sample subtitle'),
        originX: select('positions.originX', ['start', 'center', 'end'], 'start'),
        originY: select('positions.originY', ['top', 'center', 'bottom'], 'top'),
        overlayX: select('positions.overlayX', ['start', 'center', 'end'], 'start'),
        overlayY: select('positions.overlayY', ['top', 'center', 'bottom'], 'top'),
        invertRTL: invertRTL,
        createPositions: (originX, originY, overlayX, overlayY): ConnectionPositionPair[] => [
            new ConnectionPositionPair({ originX, originY }, { overlayX, overlayY }),
        ],
    },
})
Example #2
Source File: with-menu-placement-options.stories.ts    From angular-component-library with BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
withMenuPlacement = (): any => ({
    template: `
        <blui-user-menu 
            [(open)]="open"
            avatarValue="AV" 
            menuTitle="Sample Title" 
            menuSubtitle="Sample subtitle"
            [positions]="createPositions(originX, originY, overlayX, overlayY)">
            <mat-nav-list blui-menu-body [style.paddingTop.px]="0">
                <blui-info-list-item *ngFor="let item of items" [dense]="true" 
                    (click)="open=false; item.onSelect();">
                    <mat-icon blui-icon [style.transform]="invertRTL()">{{item.icon}}</mat-icon>
                    <div blui-title>{{item.title}}</div>
                </blui-info-list-item>
            </mat-nav-list>
    </blui-user-menu> 
    `,
    props: {
        open: false,
        items: items,
        originX: select('positions.originX', ['start', 'center', 'end'], 'start'),
        originY: select('positions.originY', ['top', 'center', 'bottom'], 'top'),
        overlayX: select('positions.overlayX', ['start', 'center', 'end'], 'start'),
        overlayY: select('positions.overlayY', ['top', 'center', 'bottom'], 'top'),
        invertRTL: invertRTL,
        createPositions: (originX, originY, overlayX, overlayY): ConnectionPositionPair[] => [
            new ConnectionPositionPair({ originX, originY }, { overlayX, overlayY }),
        ],
    },
})
Example #3
Source File: tutorial-trigger.directive.ts    From bdc-walkthrough with MIT License 5 votes vote down vote up
private _lastPosition: ConnectionPositionPair;
Example #4
Source File: user-menu.component.ts    From angular-component-library with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
/** Where to render the menu relative to the avatar */
    @Input() positions = [
        new ConnectionPositionPair({ originX: 'start', originY: 'top' }, { overlayX: 'start', overlayY: 'top' }),
    ];