{"version":3,"file":"ngx-img-zoom-viewer.mjs","sources":["../../../projects/ngx-img-zoom-viewer/src/lib/ngx-img-zoom-viewer.component.ts","../../../projects/ngx-img-zoom-viewer/src/lib/ngx-img-zoom-viewer.module.ts","../../../projects/ngx-img-zoom-viewer/src/public-api.ts","../../../projects/ngx-img-zoom-viewer/src/ngx-img-zoom-viewer.ts"],"sourcesContent":["import { DOCUMENT } from '@angular/common';\nimport {\n  Component,\n  ElementRef,\n  HostListener,\n  Input,\n  OnInit,\n  Renderer2,\n  OnChanges,\n  SimpleChanges,\n  Inject,\n} from '@angular/core';\n\nexport interface imgZoomViewerConfig {\n  imgHeight?: number;\n  megnification?: number;\n  priviewBoxSize?: {\n    height?: number;\n  };\n}\n\n@Component({\n  selector: 'ngx-img-zoom-viewer',\n  template: ``,\n  styles: [\n    `\n      .image_container {\n        position: relative;\n        display: inline-block;\n      }\n\n      .image_container img {\n        width: 100%;\n      }\n\n      .cursor {\n        position: absolute;\n        background-color: rgba(255, 255, 255, 0.5);\n      }\n\n      .img_preview {\n        position: fixed;\n        z-index: 1000;\n        top: 10px;\n        right: 10px;\n        overflow: hidden;\n      }\n\n      .img_preview img {\n        position: absolute;\n      }\n    `,\n  ],\n})\nexport class NGXImgZoomViewerComponent implements OnInit, OnChanges {\n  private host: HTMLElement; // Access for Host Element\n  private image!: HTMLImageElement; // Image Element\n  private cursor!: HTMLDivElement; // Cursor Element\n  private img_preview!: HTMLDivElement; // Image Preview Element\n\n  @Input() config?: imgZoomViewerConfig;\n  @Input() set src(srcValue: string) {\n    if (typeof srcValue === 'string') {\n      this._src = srcValue;\n      this.createImage();\n    } else {\n      console.error(\n        'src must be of type string, current type found ' + typeof srcValue\n      );\n    }\n  }\n\n  private providedPreviewBox: {\n    height: number;\n    width: number;\n  } = { height: 350, width: 350 };\n\n  private defaultConfigs = {\n    imgHeight: 500,\n    megnification: 2.5,\n    priviewBoxSize: {\n      height: 350,\n      width: 350,\n    },\n  };\n\n  document: Document;\n\n  private cursorSize: {\n    height: number;\n    width: number;\n  } = { height: 0, width: 0 };\n\n  private _src: string = '';\n\n  private cursorPosition: { x: number; y: number } = { x: 0, y: 0 };\n\n  constructor(\n    private el: ElementRef,\n    private renderer: Renderer2,\n    @Inject(DOCUMENT) document: Document\n  ) {\n    this.host = this.renderer.createElement('div');\n    this.document = document;\n    this.renderer.addClass(this.host, 'image_container');\n    this.renderer.appendChild(el.nativeElement, this.host); // assigning host\n  }\n\n  ngOnChanges(changes: SimpleChanges): void {\n    this.defaultConfigs.imgHeight =\n      this.config?.imgHeight ?? this.defaultConfigs.imgHeight;\n\n    this.defaultConfigs.megnification =\n      this.config?.megnification ?? this.defaultConfigs.megnification;\n\n    this.defaultConfigs.priviewBoxSize.height =\n      this.config?.priviewBoxSize?.height ??\n      this.defaultConfigs.priviewBoxSize.height;\n\n    if (this.defaultConfigs.priviewBoxSize.height + 20 > window.innerHeight) {\n      this.defaultConfigs.priviewBoxSize.height = window.innerHeight - 20;\n    }\n\n    this.defaultConfigs.priviewBoxSize.width =\n      this.defaultConfigs.priviewBoxSize.height;\n    this.providedPreviewBox = { ...this.defaultConfigs.priviewBoxSize };\n    this.createImage();\n  }\n\n  ngOnInit(): void {\n    if (!this._src) console.error('unable to read src attribute');\n  }\n\n  @HostListener('mouseleave', ['$event'])\n  private onMouseLeave(e: MouseEvent) {\n    if (this.cursorSize.width < 50 && this.cursorSize.height > 50) return;\n    this.renderer.removeChild(this.host, this.cursor);\n    this.renderer.removeChild(this.document, this.img_preview);\n  }\n\n  @HostListener('mouseenter', ['$event'])\n  private onMouseEnter(e: MouseEvent) {\n    this.checkwidth();\n    if (this.cursorSize.width < 50 && this.cursorSize.height > 50) return;\n    if (this.host.children.length > 1) {\n      this.onMouseLeave(e);\n    }\n    if (this.document.getElementById('ngx-img-zoom-viewer')) {\n      this.renderer.removeChild(\n        this.document,\n        this.document.getElementById('ngx-img-zoom-viewer')\n      );\n      this.renderer.removeChild(\n        this.document,\n        this.document.getElementById('ngx-img-zoom-cursor')\n      );\n    }\n    this.cursor = this.renderer.createElement('div');\n    this.renderer.addClass(this.cursor, 'cursor');\n    this.renderer.setStyle(\n      this.cursor,\n      `height`,\n      `${this.cursorSize?.height}px`\n    );\n    this.renderer.setStyle(this.cursor, `width`, `${this.cursorSize?.width}px`);\n    this.renderer.setAttribute(this.cursor, 'id', 'ngx-img-zoom-cursor');\n    this.renderer.appendChild(this.host, this.cursor);\n    this.setCursorPosition(e);\n\n    this.img_preview = this.renderer.createElement('div');\n    this.renderer.addClass(this.img_preview, 'img_preview');\n    this.renderer.setStyle(\n      this.img_preview,\n      'height',\n      `${this.defaultConfigs.priviewBoxSize.height}px`\n    );\n    this.renderer.setStyle(\n      this.img_preview,\n      'width',\n      `${this.defaultConfigs.priviewBoxSize.width}px`\n    );\n    this.renderer.setStyle(\n      this.img_preview,\n      'left',\n      `${window.innerWidth - 10 - this.defaultConfigs.priviewBoxSize.width}px`\n    );\n    this.renderer.setAttribute(this.img_preview, 'id', 'ngx-img-zoom-viewer');\n    this.renderer.appendChild(\n      this.host.ownerDocument.lastChild?.lastChild,\n      this.img_preview\n    );\n  }\n  @HostListener('mousemove', ['$event'])\n  private onMouseMove(e: MouseEvent) {\n    if (this.cursorSize.width < 50 && this.cursorSize.height > 50) return;\n    this.setCursorPosition(e);\n    this.setImgPreview(e);\n  }\n  private setCursorPosition(e: MouseEvent) {\n    /* handling Left & top position for cursor box */\n    const imagex = this.image.getBoundingClientRect().x;\n    const imagey = this.image.getBoundingClientRect().y;\n    let cursorPosition = {\n      x:\n        e.pageX - this.cursorSize?.width / 2 - imagex >= 0 // checking if cursor box left is less then 0\n          ? e.pageX - this.cursorSize?.width / 2 - imagex\n          : 0, // making sure if it is then only take 0 not negative value\n      y:\n        e.pageY - this.cursorSize?.height / 2 - imagey >= 0 // checking if cursor box top is less then 0\n          ? e.pageY - this.cursorSize?.height / 2 - imagey\n          : 0, // making sure if it is then only take 0 not negative value\n    };\n\n    /* handling bottom & right position for cursor box */\n    if (cursorPosition.x + this.cursorSize?.width > this.image.offsetWidth) {\n      // checking if cursor left + cursor width is greater then image width\n      // making sure that any single pixel of cursor box can't go out from image respective on width\n      cursorPosition.x = this.image.offsetWidth - this.cursorSize?.width;\n    }\n    if (cursorPosition.y + this.cursorSize?.height > this.image.offsetHeight) {\n      // making sure that any single pixel of cursor box can't go out from image respective on height\n      cursorPosition.y = this.image.offsetHeight - this.cursorSize?.height;\n    }\n\n    /* setting final value */\n    this.renderer.setStyle(this.cursor, 'top', `${cursorPosition.y}px`); // setting cursor box position for y axis\n    this.renderer.setStyle(this.cursor, 'left', `${cursorPosition.x}px`); // setting cursor box position for x axis\n\n    this.cursorPosition = cursorPosition; // saving data to global variable\n  }\n  private setImgPreview(e: MouseEvent) {\n    const zoomedImage = this.renderer.createElement('img'); // created new local image element\n    this.renderer.setAttribute(zoomedImage, 'src', this._src); // setting src for local image element\n    this.renderer.setStyle(\n      zoomedImage,\n      'height',\n      `${this.image.offsetHeight * this.defaultConfigs.megnification}px`\n    ); // changed zoomed image height based on real image\n    this.renderer.setStyle(\n      zoomedImage,\n      'width',\n      `${this.image.offsetWidth * this.defaultConfigs.megnification}px`\n    ); // changed zoomed image width based on real image\n    this.renderer.setStyle(\n      zoomedImage,\n      'top',\n      `-${this.cursorPosition.y * this.defaultConfigs.megnification}px`\n    ); // changed zoomed image position based on cursor position\n    this.renderer.setStyle(\n      zoomedImage,\n      'left',\n      `-${this.cursorPosition.x * this.defaultConfigs.megnification}px`\n    ); // changed zoomed image position based on cursor position\n    this.img_preview.innerHTML = '';\n    this.renderer.appendChild(this.img_preview, zoomedImage); // added image into img_preview box\n  }\n\n  private createImage() {\n    this.host.innerHTML = '';\n    this.image = this.renderer.createElement('img');\n    this.renderer.setAttribute(this.image, 'src', this._src);\n    this.renderer.addClass(this.image, 'main_image');\n    this.renderer.setStyle(\n      this.image,\n      'max-height',\n      this.defaultConfigs.imgHeight + 'px'\n    );\n    this.renderer.appendChild(this.host, this.image);\n  }\n\n  private checkwidth() {\n    this.defaultConfigs.priviewBoxSize.width = this.providedPreviewBox.width;\n    const def =\n      this.image.getBoundingClientRect().x +\n      this.image.width +\n      this.defaultConfigs.priviewBoxSize.width +\n      20 -\n      window.innerWidth;\n\n    if (def >= 0) {\n      this.defaultConfigs.priviewBoxSize.width =\n        this.defaultConfigs.priviewBoxSize.width - def - 30;\n    }\n\n    this.cursorSize.height =\n      this.defaultConfigs.priviewBoxSize.height /\n      this.defaultConfigs.megnification;\n\n    this.cursorSize.width =\n      this.defaultConfigs.priviewBoxSize.width /\n      this.defaultConfigs.megnification;\n  }\n}\n","import { NgModule } from '@angular/core';\nimport { NGXImgZoomViewerComponent } from './ngx-img-zoom-viewer.component';\n\n\n\n@NgModule({\n  declarations: [\n    NGXImgZoomViewerComponent\n  ],\n  imports: [\n  ],\n  exports: [\n    NGXImgZoomViewerComponent\n  ]\n})\nexport class NGXImgZoomViewerModule { }\n","/*\n * Public API Surface of ngx-img-zoom-viewer\n */\n\nexport * from './lib/ngx-img-zoom-viewer.component';\nexport * from './lib/ngx-img-zoom-viewer.module';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;MAsDa,yBAAyB,CAAA;AA2CpC,IAAA,WAAA,CACU,EAAc,EACd,QAAmB,EACT,QAAkB,EAAA;AAF5B,QAAA,IAAE,CAAA,EAAA,GAAF,EAAE,CAAY;AACd,QAAA,IAAQ,CAAA,QAAA,GAAR,QAAQ,CAAW;AA3BrB,QAAA,IAAkB,CAAA,kBAAA,GAGtB,EAAE,MAAM,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC;QAExB,IAAA,CAAA,cAAc,GAAG;AACvB,YAAA,SAAS,EAAE,GAAG;AACd,YAAA,aAAa,EAAE,GAAG;AAClB,YAAA,cAAc,EAAE;AACd,gBAAA,MAAM,EAAE,GAAG;AACX,gBAAA,KAAK,EAAE,GAAG;AACX,aAAA;SACF,CAAC;AAIM,Q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