{"version":3,"file":"angular-confirmation-popover.mjs","sources":["../../../projects/angular-confirmation-popover/src/lib/confirmation-popover-options.provider.ts","../../../projects/angular-confirmation-popover/src/lib/confirmation-popover-window-options.provider.ts","../../../projects/angular-confirmation-popover/src/lib/focus.directive.ts","../../../projects/angular-confirmation-popover/src/lib/confirmation-popover-window.component.ts","../../../projects/angular-confirmation-popover/src/lib/confirmation-popover-window.component.html","../../../projects/angular-confirmation-popover/src/lib/confirmation-popover.directive.ts","../../../projects/angular-confirmation-popover/src/lib/confirmation-popover.module.ts","../../../projects/angular-confirmation-popover/src/public-api.ts","../../../projects/angular-confirmation-popover/src/angular-confirmation-popover.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\n\nexport interface ConfirmationPopoverOptionsInterface {\n  /**\n   * The popover title\n   */\n  popoverTitle?: string;\n\n  /**\n   * The popover message\n   */\n  popoverMessage?: string;\n\n  /**\n   * The popover confirmation button text\n   */\n  confirmText?: string;\n\n  /**\n   * The popover cancel button text\n   */\n  cancelText?: string;\n\n  /**\n   * The popover confirm button type e.g. `success`, `danger` etc\n   */\n  confirmButtonType?: string;\n\n  /**\n   * The popover cancel button type  e.g. `success`, `danger` etc\n   */\n  cancelButtonType?: string;\n\n  /**\n   * The popover placement. Can be `top`, `bottom`, `left`, `right`\n   */\n  placement?: string;\n\n  /**\n   * Which button to cancel. Can be either `confirm` or `cancel`\n   */\n  focusButton?: string;\n\n  /**\n   * Whether to hide the confirmation button\n   */\n  hideConfirmButton?: boolean;\n\n  /**\n   * Whether to hide the cancel button\n   */\n  hideCancelButton?: boolean;\n\n  /**\n   * A custom CSS class to be added to the popover\n   */\n  popoverClass?: string;\n\n  /**\n   * Whether to append the popover to the document body\n   */\n  appendToBody?: boolean;\n\n  /**\n   * Swap the order of the confirm and cancel buttons\n   */\n  reverseButtonOrder?: boolean;\n\n  /**\n   * Whether or not the popover should stay open when clicking outside it\n   */\n  closeOnOutsideClick?: boolean;\n}\n\n@Injectable()\nexport class ConfirmationPopoverOptions\n  implements ConfirmationPopoverOptionsInterface {\n  popoverTitle: string;\n  popoverMessage: string;\n  confirmText: string = 'Confirm';\n  cancelText: string = 'Cancel';\n  confirmButtonType: string = 'success';\n  cancelButtonType: string = 'outline-secondary';\n  placement: string = 'top';\n  focusButton: string;\n  hideConfirmButton: boolean = false;\n  hideCancelButton: boolean = false;\n  popoverClass: string = '';\n  appendToBody: boolean = false;\n  reverseButtonOrder: boolean = false;\n  closeOnOutsideClick: boolean = true;\n}\n","import { ConfirmCancelEvent } from './confirmation-popover.directive';\nimport { Injectable, TemplateRef } from '@angular/core';\nimport { ConfirmationPopoverOptions } from './confirmation-popover-options.provider';\n\n/**\n * @internal\n */\n@Injectable()\nexport class ConfirmationPopoverWindowOptions extends ConfirmationPopoverOptions {\n  onConfirm: (event: ConfirmCancelEvent) => void;\n  onCancel: (event: ConfirmCancelEvent) => void;\n  onAfterViewInit: () => void;\n  customTemplate: TemplateRef<any>;\n}\n","import {\n  Directive,\n  ElementRef,\n  Input,\n  OnChanges,\n  SimpleChanges,\n} from '@angular/core';\n\n/**\n * A helper directive to focus buttons. You will only need this if using a custom template\n */\n@Directive({\n  selector: '[mwlFocus]',\n})\nexport class FocusDirective implements OnChanges {\n  @Input() mwlFocus: boolean;\n\n  constructor(private elm: ElementRef) {}\n\n  ngOnChanges(changes: SimpleChanges): void {\n    if (changes.mwlFocus && this.mwlFocus === true) {\n      this.elm.nativeElement.focus();\n    }\n  }\n}\n","import { Component, AfterViewInit } from '@angular/core';\nimport { ConfirmationPopoverWindowOptions } from './confirmation-popover-window-options.provider';\n\n/**\n * @internal\n */\n@Component({\n  selector: 'mwl-confirmation-popover-window',\n  styleUrls: ['./confirmation-popover-window.component.scss'],\n  templateUrl: './confirmation-popover-window.component.html',\n})\nexport class ConfirmationPopoverWindowComponent implements AfterViewInit {\n  constructor(public options: ConfirmationPopoverWindowOptions) {}\n\n  ngAfterViewInit(): void {\n    this.options.onAfterViewInit();\n  }\n}\n","<ng-template #defaultTemplate let-options=\"options\">\n  <div\n    [ngClass]=\"[\n      'popover',\n      options.placement,\n      'popover-' + options.placement,\n      'bs-popover-' + options.placement,\n      options.popoverClass\n    ]\"\n  >\n    <div class=\"popover-arrow arrow\"></div>\n    <h3\n      class=\"popover-title popover-header\"\n      [innerHTML]=\"options.popoverTitle\"\n    ></h3>\n    <div class=\"popover-content popover-body\">\n      <p [innerHTML]=\"options.popoverMessage\"></p>\n      <div\n        class=\"confirm-btns\"\n        [class.confirm-btns-reversed]=\"options.reverseButtonOrder\"\n      >\n        <div class=\"confirm-btn-container\" *ngIf=\"!options.hideCancelButton\">\n          <button\n            type=\"button\"\n            [mwlFocus]=\"options.focusButton === 'cancel'\"\n            [class]=\"'btn btn-block btn-' + options.cancelButtonType\"\n            (click)=\"options.onCancel({ clickEvent: $event })\"\n            [innerHtml]=\"options.cancelText\"\n          ></button>\n        </div>\n        <div class=\"confirm-btn-container\" *ngIf=\"!options.hideConfirmButton\">\n          <button\n            type=\"button\"\n            [mwlFocus]=\"options.focusButton === 'confirm'\"\n            [class]=\"'btn btn-block btn-' + options.confirmButtonType\"\n            (click)=\"options.onConfirm({ clickEvent: $event })\"\n            [innerHtml]=\"options.confirmText\"\n          ></button>\n        </div>\n      </div>\n    </div>\n  </div>\n</ng-template>\n<ng-template\n  [ngTemplateOutlet]=\"options.customTemplate || defaultTemplate\"\n  [ngTemplateOutletContext]=\"{ options: options }\"\n>\n</ng-template>\n","import {\n  Directive,\n  Input,\n  Output,\n  EventEmitter,\n  HostListener,\n  ViewContainerRef,\n  ComponentRef,\n  OnDestroy,\n  ElementRef,\n  OnChanges,\n  OnInit,\n  Injector,\n  Renderer2,\n  TemplateRef,\n  SimpleChanges,\n} from '@angular/core';\nimport { ConfirmationPopoverWindowComponent } from './confirmation-popover-window.component';\nimport { ConfirmationPopoverOptions } from './confirmation-popover-options.provider';\nimport { ConfirmationPopoverWindowOptions } from './confirmation-popover-window-options.provider';\nimport { positionElements } from 'positioning';\n\n/**\n * @internal\n */\nexport interface ConfirmCancelEvent {\n  clickEvent: MouseEvent;\n}\n\n/**\n All properties can be set on the directive as attributes like so (use `ConfirmationPopoverModule.forRoot()` to configure them globally):\n ```html\n <button\n   class=\"btn btn-outline-secondary\"\n   mwlConfirmationPopover\n   [popoverTitle]=\"popoverTitle\"\n   [popoverMessage]=\"popoverMessage\"\n   placement=\"left\"\n   (confirm)=\"confirmClicked = true\"\n   (cancel)=\"cancelClicked = true\"\n   [(isOpen)]=\"isOpen\">\n    Show confirm popover!\n  </button>\n  ```\n */\n@Directive({\n  selector: '[mwlConfirmationPopover]',\n})\nexport class ConfirmationPopoverDirective\n  implements OnDestroy, OnChanges, OnInit {\n  /**\n   * The title of the popover\n   */\n  @Input() popoverTitle: string;\n\n  /**\n   * The body text of the popover.\n   */\n  @Input() popoverMessage: string;\n\n  /**\n   * The text of the confirm button. Default `Confirm`\n   */\n  @Input() confirmText: string;\n\n  /**\n   * The text of the cancel button. Default `Cancel`\n   */\n  @Input() cancelText: string;\n\n  /**\n   * The placement of the popover. It can be either `top`, `right`, `bottom` or `left`. Default `top`\n   */\n  @Input() placement: string;\n\n  /**\n   * The bootstrap button type of the confirm button. It can be any supported bootstrap color type\n   * e.g. `default`, `warning`, `danger` etc. Default `success`\n   */\n  @Input() confirmButtonType: string;\n\n  /**\n   * The bootstrap button type of the cancel button. It can be any supported bootstrap color type\n   * e.g. `default`, `warning`, `danger` etc. Default `default`\n   */\n  @Input() cancelButtonType: string;\n\n  /**\n   * Set to either `confirm` or `cancel` to focus the confirm or cancel button.\n   * If omitted, by default it will not focus either button.\n   */\n  @Input() focusButton: string;\n\n  /**\n   * Whether to hide the confirm button. Default `false`.\n   */\n  @Input() hideConfirmButton: boolean;\n\n  /**\n   * Whether to hide the cancel button. Default `false`.\n   */\n  @Input() hideCancelButton: boolean;\n\n  /**\n   * Whether to disable showing the popover. Default `false`.\n   */\n  @Input() isDisabled: boolean = false;\n\n  /**\n   * Will open or show the popover when changed.\n   * Can be sugared with `isOpenChange` to emulate 2-way binding like so `[(isOpen)]=\"isOpen\"`\n   */\n  @Input() isOpen: boolean = false;\n\n  /**\n   * A reference to a <ng-template> tag that if set will override the popovers template. Use like so:\n   * ```html\n   * <ng-template #customTemplate let-options=\"options\">\n   *   <div [class]=\"'popover ' + options.placement\" style=\"display: block\">\n   *     My custom template\n   *   </div>\n   * </ng-template>\n   * ```\n   *\n   * Then pass customTemplate to the mwlConfirmationPopover directive like so `[customTemplate]=\"customTemplate\"`\n   */\n  @Input() customTemplate: TemplateRef<any>;\n\n  /**\n   * Will emit when the popover is opened or closed\n   */\n  @Output() isOpenChange: EventEmitter<boolean> = new EventEmitter(true);\n\n  /**\n   * An expression that is called when the confirm button is clicked.\n   */\n  @Output() confirm: EventEmitter<ConfirmCancelEvent> = new EventEmitter();\n\n  /**\n   * An expression that is called when the cancel button is clicked.\n   */\n  @Output() cancel: EventEmitter<ConfirmCancelEvent> = new EventEmitter();\n\n  /**\n   * A custom CSS class to be added to the popover\n   */\n  @Input() popoverClass: string;\n\n  /**\n   * Append the element to the document body rather than the trigger element\n   */\n  @Input() appendToBody: boolean;\n\n  /**\n   * Swap the order of the confirm and cancel buttons\n   */\n  @Input() reverseButtonOrder: boolean;\n\n  /**\n   * Determines whether or not the popover should stay open even when clicking outside of it\n   */\n  @Input() closeOnOutsideClick: boolean;\n\n  /**\n   * @internal\n   */\n  popover?: ComponentRef<ConfirmationPopoverWindowComponent>;\n\n  private eventListeners: (() => void)[] = [];\n\n  /**\n   * @internal\n   */\n  constructor(\n    private viewContainerRef: ViewContainerRef,\n    private elm: ElementRef,\n    private defaultOptions: ConfirmationPopoverOptions,\n    private renderer: Renderer2,\n  ) { }\n\n  /**\n   * @internal\n   */\n  ngOnInit(): void {\n    this.isOpenChange.emit(false);\n  }\n\n  /**\n   * @internal\n   */\n  ngOnChanges(changes: SimpleChanges) {\n    if (changes.isOpen) {\n      if (changes.isOpen.currentValue === true) {\n        this.showPopover();\n      } else {\n        this.hidePopover();\n      }\n    }\n  }\n\n  /**\n   * @internal\n   */\n  ngOnDestroy() {\n    this.hidePopover();\n  }\n\n  /**\n   * @internal\n   */\n  onConfirm(event: ConfirmCancelEvent) {\n    this.confirm.emit(event);\n    this.hidePopover();\n  }\n\n  /**\n   * @internal\n   */\n  onCancel(event: ConfirmCancelEvent) {\n    this.cancel.emit(event);\n    this.hidePopover();\n  }\n\n  /**\n   * @internal\n   */\n  @HostListener('click')\n  togglePopover(): void {\n    if (!this.popover) {\n      this.showPopover();\n    } else {\n      this.hidePopover();\n    }\n  }\n\n  private onDocumentClick(event: Event): void {\n    const closeOnOutsideClick =\n      typeof this.closeOnOutsideClick !== 'undefined'\n        ? this.closeOnOutsideClick\n        : this.defaultOptions.closeOnOutsideClick;\n    if (\n      this.popover &&\n      !this.elm.nativeElement.contains(event.target) &&\n      !this.popover.location.nativeElement.contains(event.target) &&\n      closeOnOutsideClick\n    ) {\n      this.hidePopover();\n    }\n  }\n\n  private showPopover(): void {\n    if (!this.popover && !this.isDisabled) {\n      // work around for https://github.com/mattlewis92/angular-confirmation-popover/issues/65\n      // otherwise the document click event gets fired after the click event\n      // that triggered the popover to open (no idea why this is so)\n      setTimeout(() => {\n        this.eventListeners = [\n          this.renderer.listen('document', 'click', (event: Event) =>\n            this.onDocumentClick(event)\n          ),\n          this.renderer.listen('document', 'touchend', (event: Event) =>\n            this.onDocumentClick(event)\n          ),\n          this.renderer.listen('window', 'resize', () =>\n            this.positionPopover()\n          ),\n        ];\n      });\n\n      const options = new ConfirmationPopoverWindowOptions();\n      Object.assign(options, this.defaultOptions, {\n        onConfirm: (event: ConfirmCancelEvent): void => {\n          this.onConfirm(event);\n        },\n        onCancel: (event: ConfirmCancelEvent): void => {\n          this.onCancel(event);\n        },\n        onAfterViewInit: (): void => {\n          this.positionPopover();\n        },\n      });\n\n      const optionalParams: (keyof ConfirmationPopoverDirective)[] = [\n        'confirmText',\n        'cancelText',\n        'placement',\n        'confirmButtonType',\n        'cancelButtonType',\n        'focusButton',\n        'hideConfirmButton',\n        'hideCancelButton',\n        'popoverClass',\n        'appendToBody',\n        'customTemplate',\n        'reverseButtonOrder',\n        'popoverTitle',\n        'popoverMessage',\n      ];\n      optionalParams.forEach((param) => {\n        if (typeof this[param] !== 'undefined') {\n          (options as any)[param] = this[param];\n        }\n      });\n      const childInjector = Injector.create({\n        providers: [\n          {\n            provide: ConfirmationPopoverWindowOptions,\n            useValue: options,\n          },\n        ],\n      });\n      this.popover = this.viewContainerRef.createComponent(\n        ConfirmationPopoverWindowComponent,\n        { injector: childInjector }\n      );\n      if (options.appendToBody) {\n        document.body.appendChild(this.popover.location.nativeElement);\n      }\n      this.isOpenChange.emit(true);\n    }\n  }\n\n  private positionPopover(): void {\n    if (this.popover) {\n      const popoverElement = this.popover.location.nativeElement.children[0];\n      positionElements(\n        this.elm.nativeElement,\n        popoverElement,\n        this.placement || this.defaultOptions.placement,\n        this.appendToBody || this.defaultOptions.appendToBody\n      );\n    }\n  }\n\n  private hidePopover(): void {\n    if (this.popover) {\n      this.popover.destroy();\n      delete this.popover;\n      this.isOpenChange.emit(false);\n      this.eventListeners.forEach((fn) => fn());\n      this.eventListeners = [];\n    }\n  }\n}\n","import { NgModule, ModuleWithProviders, InjectionToken } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { ConfirmationPopoverDirective } from './confirmation-popover.directive';\nimport { ConfirmationPopoverWindowComponent } from './confirmation-popover-window.component';\nimport { FocusDirective } from './focus.directive';\nimport {\n  ConfirmationPopoverOptions,\n  ConfirmationPopoverOptionsInterface,\n} from './confirmation-popover-options.provider';\n\nexport const USER_OPTIONS: InjectionToken<string> = new InjectionToken(\n  'confirmation popover user options'\n);\n\nexport function optionsFactory(\n  userOptions: ConfirmationPopoverOptions\n): ConfirmationPopoverOptions {\n  const options = new ConfirmationPopoverOptions();\n  Object.assign(options, userOptions);\n  return options;\n}\n\n@NgModule({\n    declarations: [\n        ConfirmationPopoverDirective,\n        ConfirmationPopoverWindowComponent,\n        FocusDirective,\n    ],\n    imports: [CommonModule],\n    exports: [ConfirmationPopoverDirective, FocusDirective]\n})\nexport class ConfirmationPopoverModule {\n  static forRoot(\n    options: ConfirmationPopoverOptionsInterface = {}\n  ): ModuleWithProviders<ConfirmationPopoverModule> {\n    return {\n      ngModule: ConfirmationPopoverModule,\n      providers: [\n        {\n          provide: USER_OPTIONS,\n          useValue: options,\n        },\n        {\n          provide: ConfirmationPopoverOptions,\n          useFactory: optionsFactory,\n          deps: [USER_OPTIONS],\n        },\n      ],\n    };\n  }\n}\n","/*\n * Public API Surface of angular-confirmation-popover\n */\n\nexport { ConfirmationPopoverModule } from './lib/confirmation-popover.module';\nexport { ConfirmationPopoverDirective } from './lib/confirmation-popover.directive';\nexport { FocusDirective } from './lib/focus.directive';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i1.ConfirmationPopoverWindowOptions","i3.FocusDirective","i1.ConfirmationPopoverOptions"],"mappings":";;;;;;MA2Ea,0BAA0B,CAAA;AADvC,IAAA,WAAA,GAAA;QAKE,IAAW,CAAA,WAAA,GAAW,SAAS,CAAC;QAChC,IAAU,CAAA,UAAA,GAAW,QAAQ,CAAC;QAC9B,IAAiB,CAAA,iBAAA,GAAW,SAAS,CAAC;QACtC,IAAgB,CAAA,gBAAA,GAAW,mBAAmB,CAAC;QAC/C,IAAS,CAAA,SAAA,GAAW,KAAK,CAAC;QAE1B,IAAiB,CAAA,iBAAA,GAAY,KAAK,CAAC;QACnC,IAAgB,CAAA,gBAAA,GAAY,KAAK,CAAC;QAClC,IAAY,CAAA,YAAA,GAAW,EAAE,CAAC;QAC1B,IAAY,CAAA,YAAA,GAAY,KAAK,CAAC;QAC9B,IAAkB,CAAA,kBAAA,GAAY,KAAK,CAAC;QACpC,IAAmB,CAAA,mBAAA,GAAY,IAAI,CAAC;AACrC,KAAA;;uHAhBY,0BAA0B,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,C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