{"version":3,"file":"ctrl-ngx-headroom.mjs","sources":["../../src/lib/shouldUpdate.ts","../../src/lib/headroom.component.ts","../../src/lib/headroom.module.ts","../../src/lib/ctrl-ngx-headroom.ts"],"sourcesContent":["export default function (\n  lastKnownScrollY = 0,\n  currentScrollY = 0,\n  disable?: boolean,\n  pinStart?: number,\n  downTolerance?: number,\n  upTolerance?: number,\n  state?: string,\n  height?: number,\n) {\n  const scrollDirection = currentScrollY >= lastKnownScrollY ? 'down' : 'up';\n  const distanceScrolled = Math.abs(currentScrollY - lastKnownScrollY);\n\n  // We're disabled\n  if (disable) {\n    return {\n      action: 'none',\n      scrollDirection,\n      distanceScrolled,\n    };\n    // We're at the top and not fixed yet.\n  } else if (currentScrollY <= pinStart && state !== 'unfixed') {\n    return {\n      action: 'unfix',\n      scrollDirection,\n      distanceScrolled,\n    };\n    // We're unfixed and headed down. Carry on.\n  } else if (currentScrollY <= height && scrollDirection === 'down' && state === 'unfixed') {\n    return {\n      action: 'none',\n      scrollDirection,\n      distanceScrolled,\n    };\n    // We're past the header and scrolling down.\n    // We transition to \"unpinned\" if necessary.\n  } else if (\n    scrollDirection === 'down' &&\n    ['pinned', 'unfixed'].indexOf(state) >= 0 &&\n    currentScrollY > height + pinStart &&\n    distanceScrolled > downTolerance\n  ) {\n    return {\n      action: 'unpin',\n      scrollDirection,\n      distanceScrolled,\n    };\n    // We're scrolling up, we transition to \"pinned\"\n  } else if (\n    scrollDirection === 'up' &&\n    distanceScrolled > upTolerance &&\n    ['pinned', 'unfixed'].indexOf(state) < 0\n  ) {\n    return {\n      action: 'pin',\n      scrollDirection,\n      distanceScrolled,\n    };\n    // We're scrolling up, and inside the header.\n    // We transition to pin regardless of upTolerance\n  } else if (\n    scrollDirection === 'up' &&\n    currentScrollY <= height &&\n    ['pinned', 'unfixed'].indexOf(state) < 0\n  ) {\n    return {\n      action: 'pin',\n      scrollDirection,\n      distanceScrolled,\n    };\n  } else {\n    return {\n      action: 'none',\n      scrollDirection,\n      distanceScrolled,\n    };\n  }\n}\n","import { animate, state, style, transition, trigger } from '@angular/animations';\nimport { DOCUMENT } from '@angular/common';\nimport {\n  AfterContentInit,\n  ChangeDetectionStrategy,\n  Component,\n  ElementRef,\n  EventEmitter,\n  HostListener,\n  Inject,\n  Input,\n  OnInit,\n  Output,\n  ViewChild,\n} from '@angular/core';\n\nimport shouldUpdate from './shouldUpdate';\n\n@Component({\n  selector: 'ngx-headroom',\n  template: `\n    <div\n      [ngStyle]=\"wrapperStyle\"\n      class=\"headroom-wrapper {{ wrapperClassName }}\"\n      [style.height.px]=\"wrapperHeight\"\n    >\n      <div\n        #ref\n        [@headroom]=\"{\n          value: state,\n          params: {\n            duration: duration,\n            easing: easing\n          }\n        }\"\n        [ngStyle]=\"innerStyle\"\n        [class]=\"innerClassName\"\n        [class.headroom]=\"true\"\n        [class.headroom--unfixed]=\"state === 'unfixed'\"\n        [class.headroom--unpinned]=\"state === 'unpinned'\"\n        [class.headroom--pinned]=\"state === 'pinned'\"\n        [class.headroom--unfixed]=\"state === 'unfixed'\"\n      >\n        <ng-content></ng-content>\n      </div>\n    </div>\n  `,\n  animations: [\n    trigger('headroom', [\n      state(\n        'unfixed',\n        style({\n          transform: 'translateY(0)',\n        }),\n      ),\n      state(\n        'unpinned',\n        style({\n          transform: 'translateY(-100%)',\n        }),\n      ),\n      state(\n        'pinned',\n        style({\n          transform: 'translateY(0px)',\n        }),\n      ),\n      transition('unpinned <=> pinned', animate('{{ duration }}ms {{ easing }}')),\n    ]),\n  ],\n  preserveWhitespaces: false,\n  changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class HeadroomComponent implements OnInit, AfterContentInit {\n  @Input() wrapperClassName = '';\n  @Input() innerClassName = '';\n  @Input() innerStyle: any = {\n    top: '0',\n    left: '0',\n    right: '0',\n    zIndex: '1',\n    position: 'relative',\n  };\n  /**\n   * pass styles for the wrapper div\n   * (this maintains the components vertical space at the top of the page)\n   */\n  @Input() wrapperStyle: any = {};\n  /** disable pinning and unpinning */\n  @Input() disable = false;\n  /** scroll tolerance in px when scrolling up before component is pinned */\n  @Input() upTolerance = 5;\n  /** scroll tolerance in px when scrolling down before component is pinned */\n  @Input() downTolerance = 0;\n  /**\n   * height in px where the header should start and stop pinning.\n   * Useful when you have another element above Headroom\n   */\n  @Input() pinStart = 0;\n  @Input() calcHeightOnResize = true;\n  /** Duration of animation in ms */\n  @Input() duration = 200;\n  /** Easing of animation */\n  @Input() easing = 'ease-in-out';\n  @Output() pin = new EventEmitter();\n  @Output() unpin = new EventEmitter();\n  @Output() unfix = new EventEmitter();\n  @ViewChild('ref', { static: true }) inner: ElementRef;\n  wrapperHeight = 0;\n  currentScrollY = 0;\n  lastKnownScrollY = 0;\n  scrolled = false;\n  resizeTicking = false;\n  state = 'unfixed';\n  translateY = '0px';\n  height: number;\n  scrollTicking = false;\n  /**\n   * provide a custom 'parent' element for scroll events.\n   * `parent` should be a function which resolves to the desired element.\n   */\n  @Input() parent: () => any;\n  @Input()\n  @HostListener('window:scroll')\n  scroll() {\n    this.handleScroll();\n  }\n  @Input()\n  @HostListener('window:resize')\n  resize() {\n    this.handleResize();\n  }\n\n  constructor(@Inject(DOCUMENT) private document: any) {}\n\n  ngOnInit() {\n    this.innerStyle.transform = `translateY(${this.translateY})`;\n\n    if (this.disable === true) {\n      this.handleUnfix();\n    }\n  }\n  getParent() {\n    if (this.parent) {\n      return this.parent();\n    }\n    if (this.document.documentElement && this.document.documentElement.scrollTop) {\n      return this.document.documentElement;\n    }\n    if (this.document.body && this.document.body.scrollTop) {\n      return this.document.body;\n    }\n    if (this.document.body && this.document.body.parentNode.scrollTop) {\n      return this.document.body.parentNode;\n    }\n    return this.document;\n  }\n  ngAfterContentInit() {\n    this.setHeightOffset();\n    this.wrapperHeight = this.height ? this.height : null;\n  }\n  setHeightOffset() {\n    this.height = null;\n    setTimeout(() => {\n      this.height = this.inner.nativeElement.offsetHeight;\n      this.resizeTicking = false;\n    }, 0);\n  }\n  getScrollY() {\n    if (this.getParent().pageYOffset !== undefined) {\n      return this.getParent().pageYOffset;\n    }\n    return this.getParent().scrollTop || 0;\n  }\n  getViewportHeight() {\n    return (\n      this.getParent().innerHeight ||\n      this.document.documentElement.clientHeight ||\n      this.document.body.clientHeight\n    );\n  }\n  getDocumentHeight() {\n    const body = this.document.body;\n    const documentElement = this.document.documentElement;\n\n    return Math.max(\n      body.scrollHeight,\n      documentElement.scrollHeight,\n      body.offsetHeight,\n      documentElement.offsetHeight,\n      body.clientHeight,\n      documentElement.clientHeight,\n    );\n  }\n  getElementPhysicalHeight(elm: any) {\n    return Math.max(elm.offsetHeight, elm.clientHeight);\n  }\n  getElementHeight(elm: any) {\n    return Math.max(elm.scrollHeight, elm.offsetHeight, elm.clientHeight);\n  }\n  getScrollerPhysicalHeight() {\n    const parent = this.getParent();\n\n    return parent === this.getParent() || parent === this.document.body\n      ? this.getViewportHeight()\n      : this.getElementPhysicalHeight(parent);\n  }\n  getScrollerHeight() {\n    const parent = this.getParent();\n\n    return parent === this.getParent() || parent === this.document.body\n      ? this.getDocumentHeight()\n      : this.getElementHeight(parent);\n  }\n  isOutOfBound(currentScrollY) {\n    const pastTop = currentScrollY < 0;\n\n    const scrollerPhysicalHeight = this.getScrollerPhysicalHeight();\n    const scrollerHeight = this.getScrollerHeight();\n\n    const pastBottom = currentScrollY + scrollerPhysicalHeight > scrollerHeight;\n\n    return pastTop || pastBottom;\n  }\n  handleScroll() {\n    if (this.disable) {\n      return;\n    }\n    if (!this.scrollTicking) {\n      this.scrollTicking = true;\n      this.update();\n    }\n  }\n  handleResize() {\n    if (this.disable || !this.calcHeightOnResize) {\n      return;\n    }\n    if (!this.resizeTicking) {\n      this.resizeTicking = true;\n      this.setHeightOffset();\n    }\n  }\n  handleUnpin() {\n    this.unpin.emit();\n    this.state = 'unpinned';\n    this.innerStyle.position = this.disable || this.state === 'unfixed' ? 'relative' : 'fixed';\n  }\n  handlePin() {\n    this.pin.emit();\n    this.state = 'pinned';\n    this.innerStyle.position = this.disable || this.state === 'unfixed' ? 'relative' : 'fixed';\n  }\n  handleUnfix() {\n    this.unfix.emit();\n    this.state = 'unfixed';\n    this.innerStyle.position = this.disable || this.state === 'unfixed' ? 'relative' : 'fixed';\n  }\n  update() {\n    this.currentScrollY = this.getScrollY();\n\n    if (!this.isOutOfBound(this.currentScrollY)) {\n      const { action } = shouldUpdate(\n        this.lastKnownScrollY,\n        this.currentScrollY,\n        this.disable,\n        this.pinStart,\n        this.downTolerance,\n        this.upTolerance,\n        this.state,\n        this.height,\n      );\n\n      if (action === 'pin') {\n        this.handlePin();\n      } else if (action === 'unpin') {\n        this.handleUnpin();\n      } else if (action === 'unfix') {\n        this.handleUnfix();\n      }\n    }\n\n    this.lastKnownScrollY = this.currentScrollY;\n    this.scrollTicking = false;\n  }\n}\n","import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\n\nimport { HeadroomComponent } from './headroom.component';\n\n@NgModule({\n  imports: [CommonModule],\n  exports: [HeadroomComponent],\n  declarations: [HeadroomComponent],\n})\nexport class HeadroomModule { }\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;uBACE,gBAAgB,GAAG,CAAC,EACpB,cAAc,GAAG,CAAC,EAClB,OAAiB,EACjB,QAAiB,EACjB,aAAsB,EACtB,WAAoB,EACpB,KAAc,EACd,MAAe;IAEf,MAAM,eAAe,GAAG,cAAc,IAAI,gBAAgB,GAAG,MAAM,GAAG,IAAI,CAAC;IAC3E,MAAM,gBAAgB,GAAG,IAAI,CAAC,GAAG,CAAC,cAAc,GAAG,gBAAgB,CAAC,CAAC;;IAGrE,IAAI,OAAO,EAAE;QACX,OAAO;YACL,MAAM,EAAE,MAAM;YACd,eAAe;YACf,gBAAgB;SACjB,CAAC;;KAEH;SAAM,IAAI,cAAc,IAAI,QAAQ,IAAI,KAAK,KAAK,SAAS,EAAE;QAC5D,OAAO;YACL,MAAM,EAAE,OAAO;YACf,eAAe;YACf,gBAAg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