aurelia / ux

A user experience framework with higher-level capabilities, designed to bring simplicity and elegance to building cross-device, rich experiences.
MIT License
368 stars 55 forks source link

Positioning #254

Closed ben-girardet closed 4 years ago

ben-girardet commented 4 years ago

New positioning package following on #246 discussion.

I've set the constructor to work with Factory.of() and I provide a UxPositioningFactory type for better typescript support. Then usage will be (as can be found in demo):



import { UxPositioning, UxPositioningFactory } from '@aurelia-ux/positioning';

@inject(Factory.of(UxPositioning))
export class SomeElement {

  private anchor: HTMLElement;
  private element: HTMLElement;
  private positioning: UxPositioning;

  constructor(private positioningFactory: UxPositioningFactory) {

  }

  public someMethod() {
    this.positioning = this.positioningFactory(this.anchor, this.element, {
      placement: 'bottom'
    });
  }

}

@bigopon @EisenbergEffect This package is ready for final review. When merged I will immediately use it for the modal package. 
bigopon commented 4 years ago

Looks good to me. Thanks @ben-girardet