How to use the ng-zorro-antd/core.getElementOffset function in ng-zorro-antd

To help you get started, we’ve selected a few ng-zorro-antd examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github NG-ZORRO / ng-zorro-antd / components / slider / nz-slider.component.ts View on Github external
private getSliderStartPosition(): number {
    if (this.cacheSliderStart !== null) {
      return this.cacheSliderStart;
    }
    const offset = getElementOffset(this.sliderDOM);
    return this.nzVertical ? offset.top : offset.left;
  }
github NG-ZORRO / ng-zorro-antd / components / modal / nz-modal.component.ts View on Github external
private updateTransformOrigin(): void {
    const modalElement = this.modalContainer.nativeElement as HTMLElement;
    if (this.previouslyFocusedElement) {
      const previouslyDOMRect = this.previouslyFocusedElement.getBoundingClientRect();
      const lastPosition = getElementOffset(this.previouslyFocusedElement);
      const x = lastPosition.left + previouslyDOMRect.width / 2;
      const y = lastPosition.top + previouslyDOMRect.height / 2;
      this.transformOrigin = `${x - modalElement.offsetLeft}px ${y - modalElement.offsetTop}px 0px`;
    }
  }