{"version":3,"file":"pebula-ngrid-target-events.mjs","sources":["../../../../libs/ngrid/target-events/src/lib/target-events/utils.ts","../../../../libs/ngrid/target-events/src/lib/target-events/focus-and-selection.ts","../../../../libs/ngrid/target-events/src/lib/target-events/target-events-plugin.ts","../../../../libs/ngrid/target-events/src/lib/target-events/cell-edit.directive.ts","../../../../libs/ngrid/target-events/src/lib/target-events.module.ts","../../../../libs/ngrid/target-events/src/pebula-ngrid-target-events.ts"],"sourcesContent":["import { ViewContainerRef, EmbeddedViewRef } from '@angular/core';\nimport { PblNgridContextApi, GridDataPoint, GridRowType } from '@pebula/ngrid';\nimport { PblNgridMatrixRow, PblNgridRowEvent, PblNgridCellEvent, PblNgridDataCellEvent } from './events';\n\nexport function isCellEvent<T, TEvent extends Event = MouseEvent | KeyboardEvent>(event: PblNgridRowEvent<T> | PblNgridCellEvent<T, TEvent>): event is PblNgridCellEvent<T, TEvent> {\n  return !!(event as  PblNgridCellEvent<T>).cellTarget;\n}\n\nexport function isDataCellEvent<T, TEvent extends Event = MouseEvent | KeyboardEvent>(event: PblNgridRowEvent<T> | PblNgridCellEvent<T, TEvent>): event is PblNgridDataCellEvent<T, TEvent> {\n  return isCellEvent(event) && !!(event as  PblNgridDataCellEvent<T, TEvent>).context;\n}\n\n/**\n * Returns true if the element is a row element (`pbl-ngrid-row`, `cdk-row`).\n *\n * This function works under the following assumptions:\n *\n *   - A row element MUST contain a \"role\" attribute with the value \"row\"\n */\nexport function isRowContainer(element: HTMLElement): boolean {\n  return element.getAttribute('role') === 'row';\n}\n\n/**\n * Find the cell element that is or wraps the provided element.\n * The element can be a table cell element (any type of) OR a nested element (any level) of a table cell element.\n *\n * This function works under the following assumptions:\n *\n *   - The parent of a cell element is a row element.\n *   - Each row element MUST contain a \"role\" attribute with the value \"row\"\n */\nexport function findParentCell(element: HTMLElement): HTMLElement | undefined {\n  while (element.parentElement) {\n    if (isRowContainer(element.parentElement)) {\n      return element;\n    }\n    element = element.parentElement;\n  }\n}\n\n/**\n * Returns the position (index) of the cell (element) among it's siblings.\n */\nexport function findCellRenderIndex(cell: Element): number {\n  let colIndex = 0;\n  while (cell = cell.previousElementSibling) {\n    colIndex++;\n  }\n  return colIndex;\n}\n\n/**\n * Returns table metadata for a given ROW element.\n * This function works under the following assumptions:\n *\n *   - Each row element MUST contain a \"role\" attribute with the value \"row\"\n *   - Each row element MUST contains the type identifier attribute \"data-rowtype\" (except \"data\" rows)\n *   - Allowed values for \"data-rowtype\" are: 'header' | 'meta-header' | 'footer' | 'meta-footer' | 'data'\n *   - Row's representing data items (data-rowtype=\"data\") can omit the type attribute and the function will infer it.\n *\n * NOTE that this function DOES NOT identify subType of `meta-group` (`PblNgridMatrixRow<'header' | 'footer', 'meta-group'>`), it will return it as\n * 'meta`, you need to handle this case specifically.\n *\n * Because detection is based on DOM element position finding the original row index when multiple row containers are set (fixed/style/row) will not work.\n * The rowIndex will be relative to the container, and not the entire table.\n */\nexport function matrixRowFromRow(row: Element,\n                                 vcRef: ViewContainerRef): PblNgridMatrixRow<'data'> | PblNgridMatrixRow<'header' | 'footer'> | PblNgridMatrixRow<'header' | 'footer', 'meta'> | undefined  {\n  const rowAttrType: GridRowType = row.getAttribute('data-rowtype') as any || 'data';\n\n  // TODO: Error if rowAttrType is not one of the allowed values!\n\n  let rowIndex = 0;\n  switch (rowAttrType) {\n    case 'data':\n      const sourceRow = row;\n      while (row.previousElementSibling) {\n        rowIndex++;\n        row = row.previousElementSibling;\n      }\n      rowIndex = Math.min(rowIndex, vcRef.length - 1);\n      while (rowIndex > -1) {\n        if ((vcRef.get(rowIndex) as EmbeddedViewRef<any>).rootNodes[0] === sourceRow) {\n          return {\n            type: 'data',\n            subType: 'data',\n            rowIndex,\n          } as { rowIndex: number } & PblNgridMatrixRow<'data'>;\n        }\n        rowIndex--;\n      }\n      return;\n    case 'header':\n    case 'footer':\n     return {\n        type: rowAttrType,\n        subType: 'data',\n        rowIndex,\n      } as PblNgridMatrixRow<'header' | 'footer'>;\n    default:\n      while (row.previousElementSibling && row.previousElementSibling.getAttribute('data-rowtype') === rowAttrType) {\n        rowIndex++;\n        row = row.previousElementSibling;\n      }\n      return {\n        type: rowAttrType === 'meta-footer' ? 'footer' : 'header',\n        subType: 'meta',\n        rowIndex,\n      } as PblNgridMatrixRow<'header' | 'footer', 'meta'>;\n  }\n}\n\n/**\n * Given a list of cells stacked vertically (yAxis) and a list of cells stacked horizontally (xAxis) return all the cells inside (without the provided axis cells).\n *\n * In the following example, all [Yn] cells are provided in the yAxis param and all [Xn] cell in the xAxis params, the returned value will be an array\n * with all cells marked with Z.\n *    Y5  Z  Z  Z\n *    Y4  Z  Z  Z\n *    Y3  Z  Z  Z\n *    Y2  Z  Z  Z\n *    XY1 X2 X3 X4\n * @param contextApi\n * @param xAxis\n * @param yAxis\n */\nexport function getInnerCellsInRect(contextApi: PblNgridContextApi<any>, xAxis: GridDataPoint[], yAxis: GridDataPoint[]): GridDataPoint[] {\n  const spaceInside: GridDataPoint[] = [ ];\n  for (const vCell of yAxis) {\n    for (const hCell of xAxis) {\n      const vhContext = contextApi.findRowInCache(vCell.rowIdent).cells[hCell.colIndex];\n      if (vhContext) {\n        spaceInside.push({ rowIdent: vCell.rowIdent, colIndex: hCell.colIndex });\n      }\n    }\n  }\n  return spaceInside;\n}\n\nexport function rangeBetween(n1: number, n2: number): number[] {\n  const min = Math.min(n1, n2);\n  const max = min === n1 ? n2 : n1;\n\n  const result: number[] = [];\n  for (let i = min + 1; i < max; i++) {\n    result.push(i);\n  }\n  return result;\n}\n","import { takeUntil, switchMap, filter, tap } from 'rxjs/operators';\nimport { LEFT_ARROW, UP_ARROW, RIGHT_ARROW, DOWN_ARROW } from '@angular/cdk/keycodes';\n\nimport { GridDataPoint } from '@pebula/ngrid';\nimport { PblNgridRowEvent, PblNgridCellEvent, PblNgridDataCellEvent } from './events';\nimport { PblNgridTargetEventsPlugin } from './target-events-plugin';\nimport { isCellEvent, isDataCellEvent, rangeBetween, getInnerCellsInRect } from './utils';\n\nconst isOsx = /^mac/.test(navigator.platform.toLowerCase())\nconst isMainMouseButtonClick = (event: PblNgridDataCellEvent<any, MouseEvent>) => event.source.button === 0;\n\nexport function handleFocusAndSelection(targetEvents: PblNgridTargetEventsPlugin) {\n  const isCellFocusMode = () => targetEvents.grid.focusMode === 'cell';\n\n  const handlers = createHandlers(targetEvents);\n\n  // Handle array keys move (with shift for selection, without for cell focus change)\n  targetEvents.keyDown\n    .pipe(filter(isCellFocusMode))\n    .subscribe(handlers.handleKeyDown);\n\n  // Handle mouse down on cell (focus) and then moving for selection.\n  targetEvents.mouseDown\n    .pipe(\n      filter(isCellFocusMode),\n      filter(isDataCellEvent),\n      filter(isMainMouseButtonClick),\n      tap( event => {\n        event.source.stopPropagation();\n        event.source.preventDefault();\n      }),\n      tap(handlers.handleMouseDown), // handle mouse down focus\n      switchMap( () => targetEvents.cellEnter.pipe(takeUntil(targetEvents.mouseUp)) ),\n      filter(isDataCellEvent),\n      filter(isMainMouseButtonClick)\n    )\n    .subscribe(handlers.handleSelectionChangeByMouseClickAndMove); // now handle movements until mouseup\n\n}\n\nfunction createHandlers(targetEvents: PblNgridTargetEventsPlugin) {\n  const { contextApi } = targetEvents.grid;\n\n  function focusCell(rowIdent: any, colIndex: number, markForCheck?: boolean): void {\n    contextApi.focusCell({ rowIdent, colIndex });\n  }\n\n  function handleMouseDown(event: PblNgridDataCellEvent<any, MouseEvent>): void {\n    if (contextApi.focusedCell && event.source.shiftKey) {\n      handleSelectionChangeByMouseClickAndMove(event);\n    } else if (isOsx ? event.source.metaKey : event.source.ctrlKey) {\n      if (event.context.selected) {\n        contextApi.unselectCells([ event.context ]);\n      } else {\n        contextApi.selectCells([ event.context ]);\n      }\n    } else {\n      focusCell(event.context.rowContext.identity, event.context.index);\n    }\n  }\n\n  function handleKeyDown(event: PblNgridRowEvent | PblNgridCellEvent): void {\n    const source: KeyboardEvent = event.source as any;\n    if (isCellEvent(event)) {\n      const sourceCell = event.cellTarget;\n\n      let coeff: 1 | -1 = 1;\n      let isHorizontal = false;\n\n      switch (source.keyCode) {\n        case UP_ARROW:\n          coeff = -1;\n        case DOWN_ARROW: // tslint:disable-line: no-switch-case-fall-through\n          break;\n        case LEFT_ARROW:\n          coeff = -1;\n        case RIGHT_ARROW: // tslint:disable-line: no-switch-case-fall-through\n          isHorizontal = true;\n          break;\n        default:\n          return;\n      }\n\n      event.source.preventDefault();\n      event.source.stopPropagation();\n\n\n      let activeFocus: GridDataPoint = contextApi.focusedCell;\n      if (!activeFocus) {\n        const cellContext = contextApi.getCell(sourceCell);\n        activeFocus = {\n          rowIdent: cellContext.rowContext.identity,\n          colIndex: cellContext.index,\n        };\n      }\n\n      if (!!source.shiftKey) {\n        handleSelectionChangeByArrows(activeFocus, isHorizontal ? [coeff, 0] : [0, coeff]);\n      } else {\n        handleSingleItemFocus(activeFocus, isHorizontal ? [coeff, 0] : [0, coeff])\n      }\n    }\n  }\n\n  /**\n   * Handle selection changes caused ONLY by the use of the arrow keys with SHIFT key.\n   *\n   * The implementation is NOT incremental, it will re-calculate the selected cell on every arrow key press (every call to this function).\n   *\n   * First. A simple adjacent cell detection is performed to determine the direction of the current selected cells relative to the\n   * source cell (usually the focused cell). We only care about 4 cells, adjacent to the source Cell: Top, Left, Bottom, Right\n   *\n   *    │ T │\n   * ───┼───┼───\n   *  R │ C │ L\n   * ───┼───┼───\n   *    │ B │\n   *\n   * We can only have 1 quarter selection with Arrow selection so it TL, TR, BR or BL, any other setup will clear the selection and start from scratch.\n   *\n   * > Note that the logic in this function is for use with arrow keys + SHIFT key, other selection logic\n   * does not fit this scenario (e.g. MOUSE selection or ARROW KEYS + CTRL KEY selection)\n   *\n   * @param sourceCellRef A point reference to the source cell the direction is relative to\n   * @param direction The direction of the new cell.\n   * [1 | -1, 0] -> HORIZONTAL\n   * [0, 1 | -1] -> VERTICAL\n   */\n  function handleSelectionChangeByArrows(sourceCellRef: GridDataPoint, direction: [0, 1 | -1] | [1 | -1, 0]) {\n    const { rowIdent, colIndex } = sourceCellRef;\n    const sourceCellState = contextApi.findRowInCache(rowIdent);\n    const [moveH, moveV] = direction;\n\n    const hAdj = [ sourceCellState.cells[colIndex - 1], sourceCellState.cells[colIndex + 1] ];\n    const vAdj = [ contextApi.findRowInCache(rowIdent, -1, true), contextApi.findRowInCache(rowIdent, 1, true) ];\n\n    let h = (hAdj[0] && hAdj[0].selected ? -1 : 0) + (hAdj[1] && hAdj[1].selected ? 1 : 0);\n    let v = (vAdj[0] && vAdj[0].cells[colIndex].selected ? -1 : 0) + (vAdj[1] && vAdj[1].cells[colIndex].selected ? 1 : 0);\n\n    if (h === 0) {\n      h += moveH;\n    }\n    if (v === 0) {\n      v += moveV;\n    }\n\n    const hCells: GridDataPoint[] = [];\n    if (h !== 0) {\n      let hContextIndex = colIndex;\n      let hContext = sourceCellState.cells[colIndex];\n      while (hContext && hContext.selected) {\n        hCells.push({ rowIdent, colIndex: hContextIndex });\n        hContextIndex += h;\n        hContext = sourceCellState.cells[hContextIndex];\n      }\n\n      if (moveH) {\n        if (h === moveH) {\n          if (hContext) {\n            hCells.push({ rowIdent, colIndex: hContextIndex });\n          }\n        } else {\n          hCells.pop();\n        }\n      }\n    }\n\n    const vCells: GridDataPoint[] = [ ];\n    if (v !== 0) {\n      let vContextIdent = rowIdent;\n      let vContext = contextApi.findRowInCache(vContextIdent, v, true);\n      while (vContext && vContext.cells[colIndex].selected) {\n        vContextIdent = vContext.identity;\n        vCells.push({ rowIdent: vContextIdent, colIndex });\n        vContext = contextApi.findRowInCache(vContextIdent, v, true);\n      }\n\n      if (moveV) {\n        if (v === moveV) {\n          if (vContext) {\n            vCells.push({ rowIdent: vContext.identity, colIndex });\n          }\n        } else {\n          vCells.pop();\n        }\n      }\n\n    }\n\n    const innerCells = getInnerCellsInRect(contextApi, hCells, vCells);\n    contextApi.selectCells([ sourceCellRef, ...hCells, ...vCells, ...innerCells ], true);\n  }\n\n  function handleSelectionChangeByMouseClickAndMove(event: PblNgridDataCellEvent<any, MouseEvent>) {\n    const cellContext = event.context;\n    const activeFocus = contextApi.focusedCell || {\n      rowIdent: cellContext.rowContext.identity,\n      colIndex: cellContext.index,\n    };\n    const focusedRowState = contextApi.findRowInCache(activeFocus.rowIdent);\n\n    const hCells: GridDataPoint[] = [];\n    const vCells: GridDataPoint[] = [];\n\n    for (const i of rangeBetween(activeFocus.colIndex, cellContext.index)) {\n      hCells.push({ rowIdent: activeFocus.rowIdent, colIndex: i });\n    }\n    hCells.push({ rowIdent: activeFocus.rowIdent, colIndex: cellContext.index });\n\n    const rowHeight = Math.abs(cellContext.rowContext.dsIndex - focusedRowState.dsIndex);\n    const dir = focusedRowState.dsIndex > cellContext.rowContext.dsIndex ? -1 : 1;\n    for (let i = 1; i <= rowHeight; i++) {\n      const state = contextApi.findRowInCache(activeFocus.rowIdent, dir * i, true);\n      vCells.push({ rowIdent: state.identity, colIndex: activeFocus.colIndex });\n    }\n    const innerCells = getInnerCellsInRect(contextApi, hCells, vCells);\n    contextApi.selectCells([ activeFocus, ...hCells, ...vCells, ...innerCells ], true);\n  }\n\n  /**\n   * Swap the focus from the source cell to a straight adjacent cell (not diagonal).\n   * @param sourceCellRef A point reference to the source cell the direction is relative to\n   * @param direction The direction of the new cell.\n   * [1 | -1, 0] -> HORIZONTAL\n   * [0, 1 | -1] -> VERTICAL\n   */\n  function handleSingleItemFocus(sourceCellRef: GridDataPoint, direction: [0, 1 | -1] | [1 | -1, 0]) {\n    const rowState = contextApi.findRowInCache(sourceCellRef.rowIdent, direction[1], true);\n    if (rowState) {\n      contextApi.focusCell({ rowIdent: rowState.identity, colIndex: sourceCellRef.colIndex + direction[0] });\n    }\n  }\n\n  return {\n    handleMouseDown,\n    handleKeyDown,\n    handleSelectionChangeByMouseClickAndMove\n  }\n}\n\n","import { fromEvent, timer, Observer, ReplaySubject } from 'rxjs';\nimport { bufferWhen, debounce, map, filter, takeUntil } from 'rxjs/operators';\nimport { Directive, EventEmitter, OnDestroy, Injector } from '@angular/core';\n\nimport { PblNgridComponent, PblNgridPluginController, PblColumn } from '@pebula/ngrid';\n\nimport * as Events from './events';\nimport { matrixRowFromRow, isRowContainer, findCellRenderIndex, findParentCell } from './utils';\nimport { handleFocusAndSelection } from './focus-and-selection';\n\ndeclare module '@pebula/ngrid/core/lib/configuration/type' {\n  interface PblNgridConfig {\n    targetEvents?: {\n      /** When set to true will enable the target events plugin on all table instances by default. */\n      autoEnable?: boolean;\n    };\n  }\n}\n\ndeclare module '@pebula/ngrid/lib/ext/types' {\n  interface PblNgridPluginExtension {\n    targetEvents?: PblNgridTargetEventsPlugin;\n  }\n  interface PblNgridPluginExtensionFactories {\n    targetEvents: keyof typeof PblNgridTargetEventsPlugin;\n  }\n}\n\nexport const PLUGIN_KEY: 'targetEvents' = 'targetEvents';\n\nfunction hasListeners(source: { observers: Observer<any>[] }): boolean {\n  return source.observers.length > 0;\n}\n\nfunction findEventSource(source: Event): { type: 'row' | 'cell', target: HTMLElement } | undefined {\n  const cellTarget = findParentCell(source.target as any);\n  if (cellTarget) {\n    return { type: 'cell', target: cellTarget };\n  } else if (isRowContainer(source.target as any)) {\n    return { type: 'cell', target: source.target as any };\n  }\n}\n\nexport function runOnce(): void {\n  PblColumn.extendProperty('editable');\n}\n\nexport class PblNgridTargetEventsPlugin<T = any> {\n  rowClick = new EventEmitter<Events.PblNgridRowEvent<T>>();\n  rowDblClick = new EventEmitter<Events.PblNgridRowEvent<T>>();\n  rowEnter = new EventEmitter<Events.PblNgridRowEvent<T>>();\n  rowLeave = new EventEmitter<Events.PblNgridRowEvent<T>>();\n\n  cellClick = new EventEmitter<Events.PblNgridCellEvent<T, MouseEvent>>();\n  cellDblClick = new EventEmitter<Events.PblNgridCellEvent<T, MouseEvent>>();\n  cellEnter = new EventEmitter<Events.PblNgridCellEvent<T, MouseEvent>>();\n  cellLeave = new EventEmitter<Events.PblNgridCellEvent<T, MouseEvent>>();\n\n  mouseDown = new EventEmitter<Events.PblNgridCellEvent<T, MouseEvent> | Events.PblNgridRowEvent<T>>();\n  mouseUp = new EventEmitter<Events.PblNgridCellEvent<T, MouseEvent> | Events.PblNgridRowEvent<T>>();\n  keyUp = new EventEmitter<Events.PblNgridCellEvent<T, KeyboardEvent> | Events.PblNgridRowEvent<T>>();\n  keyDown = new EventEmitter<Events.PblNgridCellEvent<T, KeyboardEvent> | Events.PblNgridRowEvent<T>>();\n\n  protected readonly destroyed = new ReplaySubject<void>();\n\n  private _removePlugin: (table: PblNgridComponent<any>) => void;\n\n  constructor(public readonly grid: PblNgridComponent<any>,\n              protected injector: Injector,\n              protected pluginCtrl: PblNgridPluginController) {\n    this._removePlugin = pluginCtrl.setPlugin(PLUGIN_KEY, this);\n    pluginCtrl.onInit().subscribe( () => this.init() );\n  }\n\n  static create<T = any>(table: PblNgridComponent<any>, injector: Injector): PblNgridTargetEventsPlugin<T> {\n    const pluginCtrl = PblNgridPluginController.find(table);\n    return new PblNgridTargetEventsPlugin<T>(table, injector, pluginCtrl);\n  }\n\n  private init(): void {\n    this.setupDomEvents();\n    handleFocusAndSelection(this);\n  }\n\n  private setupDomEvents(): void {\n    const grid = this.grid;\n    const cdkTable = this.pluginCtrl.extApi.cdkTable;\n    const cdkTableElement = cdkTable._element;\n\n    const createCellEvent = <TEvent extends Event>(cellTarget: HTMLElement, source: TEvent): Events.PblNgridCellEvent<T, TEvent> | undefined => {\n      const rowTarget = cellTarget.parentElement;\n      const matrixPoint = matrixRowFromRow(rowTarget, cdkTable._rowOutlet.viewContainer);\n      if (matrixPoint) {\n        const event: Events.PblNgridCellEvent<T, TEvent> = { ...matrixPoint, source, cellTarget, rowTarget } as any;\n        if (matrixPoint.type === 'data') {\n          (event as Events.PblNgridDataMatrixPoint<T>).row = grid.ds.renderedData[matrixPoint.rowIndex];\n        } else if (event.subType === 'meta') {\n          // When multiple containers exists (fixed/sticky/row) the rowIndex we get is the one relative to the container..\n          // We need to find the rowIndex relative to the definitions:\n          const { metaRowService } = this.pluginCtrl.extApi.rowsApi;\n          const db = event.type === 'header' ? metaRowService.header : metaRowService.footer;\n\n          for (const coll of [db.fixed, db.row, db.sticky]) {\n            const result = coll.find( item => item.el === event.rowTarget );\n            if (result) {\n              event.rowIndex = result.index;\n              break;\n            }\n          }\n        }\n\n        /* `metadataFromElement()` does not provide column information nor the column itself. This will extend functionality to add the columnIndex and column.\n            The simple case is when `subType === 'data'`, in this case the column is always the data column for all types (header, data and footer)\n\n            If `subType !== 'data'` we need to get the proper column based type (type can only be `header` or `footer` at this point).\n            But that's not all, because `metadataFromElement()` does not handle `meta-group` subType we need to do it here...\n        */\n        event.colIndex = findCellRenderIndex(cellTarget);\n        if (matrixPoint.subType === 'data') {\n          const column = this.grid.columnApi.findColumnAt(event.colIndex);\n          const columnIndex = this.grid.columnApi.indexOf(column);\n          event.column = column;\n          (event as Events.PblNgridDataMatrixPoint<T>).context = this.pluginCtrl.extApi.contextApi.getCell(event.rowIndex, columnIndex);\n          if (!(event as Events.PblNgridDataMatrixPoint<T>).context) {\n            this.pluginCtrl.extApi.contextApi.clear(true);\n            (event as Events.PblNgridDataMatrixPoint<T>).context = this.pluginCtrl.extApi.contextApi.getCell(event.rowIndex, columnIndex);\n          }\n        } else {\n          const store = this.pluginCtrl.extApi.columnStore;\n          const rowInfo = (matrixPoint.type === 'header' ? store.metaHeaderRows : store.metaFooterRows)[event.rowIndex];\n          const record = store.find(rowInfo.keys[event.colIndex]);\n          if (rowInfo.isGroup) {\n            event.subType = 'meta-group';\n            event.column = matrixPoint.type === 'header' ? record.headerGroup : record.footerGroup;\n          } else {\n            event.column = matrixPoint.type === 'header' ? record.header : record.footer;\n          }\n        }\n        return event;\n      }\n    }\n\n    const createRowEvent = <TEvent extends Event>(rowTarget: HTMLElement, source: TEvent, root?: Events.PblNgridCellEvent<T, TEvent>): Events.PblNgridRowEvent<T> | undefined => {\n      if (root) {\n        const event: Events.PblNgridRowEvent<T> = {\n          source,\n          rowTarget,\n          type: root.type,\n          subType: root.subType,\n          rowIndex: root.rowIndex,\n          root\n        } as any;\n        if (root.type === 'data') {\n          (event as Events.PblNgridDataMatrixRow<T>).row = root.row;\n          (event as Events.PblNgridDataMatrixRow<T>).context = root.context.rowContext;\n        }\n        return event;\n      } else {\n        const matrixPoint = matrixRowFromRow(rowTarget, cdkTable._rowOutlet.viewContainer);\n        if (matrixPoint) {\n          const event: Events.PblNgridRowEvent<T> = { ...matrixPoint, source, rowTarget } as any;\n          if (matrixPoint.type === 'data') {\n            const row = this.pluginCtrl.extApi.contextApi.getRow(matrixPoint.rowIndex);\n            if (!row) {\n              return undefined;\n            }\n            (event as Events.PblNgridDataMatrixRow<T>).context = row;\n            (event as Events.PblNgridDataMatrixRow<T>).row = row.$implicit;\n          }\n\n          /*  If `subType !== 'data'` it can only be `meta` because `metadataFromElement()` does not handle `meta-group` subType.\n              We need to extend this missing part, we don't have columns here so we will try to infer it using the first column.\n\n              It's similar to how it's handled in cell clicks, but here we don't need to extends the column info.\n              We only need to change the `subType` when the row is a group row, getting a specific column is irrelevant.\n              We just need A column because group columns don't mix with regular meta columns.\n\n              NOTE: When subType is not 'data' the ype can only be `header` or `footer`.\n          */\n          if (matrixPoint.subType !== 'data') {\n            const store = this.pluginCtrl.extApi.columnStore;\n\n            const rowInfo = (matrixPoint.type === 'header' ? store.metaHeaderRows : store.metaFooterRows)[event.rowIndex];\n            if (rowInfo.isGroup) {\n              event.subType = 'meta-group';\n            }\n          }\n          return event;\n        }\n      }\n    }\n\n    let lastCellEnterEvent: Events.PblNgridCellEvent<T, MouseEvent>;\n    let lastRowEnterEvent: Events.PblNgridRowEvent<T>;\n    const emitCellLeave = (source: MouseEvent): Events.PblNgridCellEvent<T> | undefined => {\n      if (lastCellEnterEvent) {\n        const lastCellEnterEventTemp = lastCellEnterEvent;\n        this.cellLeave.emit(Object.assign({}, lastCellEnterEventTemp, { source }));\n        lastCellEnterEvent = undefined;\n        return lastCellEnterEventTemp;\n      }\n    }\n    const emitRowLeave = (source: MouseEvent): Events.PblNgridRowEvent<T> | undefined => {\n      if (lastRowEnterEvent) {\n        const lastRowEnterEventTemp = lastRowEnterEvent;\n        this.rowLeave.emit(Object.assign({}, lastRowEnterEventTemp, { source }));\n        lastRowEnterEvent = undefined;\n        return lastRowEnterEventTemp;\n      }\n    }\n\n    const processEvent = <TEvent extends Event>(e: TEvent) => {\n      const result = findEventSource(e);\n      if (result) {\n        if (result.type === 'cell') {\n          const event = createCellEvent<TEvent>(result.target, e);\n          if (event) {\n            return {\n              type: result.type,\n              event,\n              waitTime: hasListeners(this.cellDblClick) ? 250 : 1,\n            };\n          }\n        } else if (result.type === 'row') {\n          const event = createRowEvent(result.target, e);\n          if (event) {\n            return {\n              type: result.type,\n              event,\n              waitTime: hasListeners(this.rowDblClick) ? 250 : 1,\n            };\n          }\n        }\n      }\n    };\n\n    /** Split the result of processEvent into cell and row events, if type is row only row event is returned, if cell then cell is returned and row is created along side. */\n    const splitProcessedEvent = <TEvent extends Event>(event: ReturnType<typeof processEvent>) => {\n      const cellEvent = event.type === 'cell' ? event.event as Events.PblNgridCellEvent<T, TEvent> : undefined;\n      const rowEvent = cellEvent\n        ? createRowEvent<TEvent>(cellEvent.rowTarget, cellEvent.source, cellEvent)\n        : event.event as Events.PblNgridRowEvent<T>\n      ;\n      return { cellEvent, rowEvent };\n    };\n\n    const registerUpDownEvents = <TEvent extends Event>(eventName: string, emitter: EventEmitter<Events.PblNgridCellEvent<T, TEvent> | Events.PblNgridRowEvent<T>>) => {\n      fromEvent(cdkTableElement, eventName)\n        .pipe(\n          takeUntil(this.destroyed),\n          filter( source => hasListeners(emitter) ),\n          map(processEvent),\n          filter( result => !!result ),\n        )\n        .subscribe( result => {\n          const { cellEvent, rowEvent } = splitProcessedEvent<TEvent>(result);\n          emitter.emit(cellEvent || rowEvent);\n          this.syncRow(cellEvent || rowEvent);\n        });\n    }\n\n    registerUpDownEvents<MouseEvent>('mouseup', this.mouseUp);\n    registerUpDownEvents<MouseEvent>('mousedown', this.mouseDown);\n    registerUpDownEvents<KeyboardEvent>('keyup', this.keyUp);\n    registerUpDownEvents<KeyboardEvent>('keydown', this.keyDown);\n\n    /*\n      Handling click stream for both click and double click events.\n      We want to detect double clicks and clicks with minimal delays\n      We check if a double click has listeners, if not we won't delay the click...\n      TODO: on double click, don't wait the whole 250 ms if 2 clicks happen.\n    */\n    const clickStream = fromEvent(cdkTableElement, 'click').pipe(\n      takeUntil(this.destroyed),\n      filter( source => hasListeners(this.cellClick) || hasListeners(this.cellDblClick) || hasListeners(this.rowClick) || hasListeners(this.rowDblClick) ),\n      map(processEvent),\n      filter( result => !!result ),\n    );\n\n    clickStream\n      .pipe(\n        bufferWhen( () => clickStream.pipe( debounce( e => timer(e.waitTime) ) ) ),\n        filter( events => events.length > 0 ),\n      )\n      .subscribe( events => {\n        const event = events.shift();\n        const isDoubleClick = events.length === 1; // if we have 2 events its double click, otherwise single.\n        const { cellEvent, rowEvent } = splitProcessedEvent<MouseEvent>(event);\n        if (isDoubleClick) {\n          if (cellEvent) {\n            this.cellDblClick.emit(cellEvent);\n          }\n          this.rowDblClick.emit(rowEvent);\n        } else {\n          if (cellEvent) {\n            this.cellClick.emit(cellEvent);\n          }\n          this.rowClick.emit(rowEvent);\n        }\n        this.syncRow(cellEvent || rowEvent);\n      });\n\n\n    fromEvent(cdkTableElement, 'mouseleave')\n      .pipe(\n        takeUntil(this.destroyed),\n      )\n      .subscribe( (source: MouseEvent) => {\n        let lastEvent: Events.PblNgridRowEvent<T> | Events.PblNgridCellEvent<T> = emitCellLeave(source);\n        lastEvent = emitRowLeave(source) || lastEvent;\n        if (lastEvent) {\n          this.syncRow(lastEvent);\n        }\n      });\n\n    fromEvent(cdkTableElement, 'mousemove')\n      .pipe(\n        takeUntil(this.destroyed),\n      )\n      .subscribe( (source: MouseEvent) => {\n        const cellTarget: HTMLElement = findParentCell(source.target as any);\n        const lastCellTarget = lastCellEnterEvent && lastCellEnterEvent.cellTarget;\n        const lastRowTarget = lastRowEnterEvent && lastRowEnterEvent.rowTarget;\n\n        let cellEvent: Events.PblNgridCellEvent<T, MouseEvent>;\n        let lastEvent: Events.PblNgridRowEvent<T> | Events.PblNgridCellEvent<T>;\n\n        if (lastCellTarget !== cellTarget) {\n          lastEvent = emitCellLeave(source) || lastEvent;\n        }\n\n        if (cellTarget) {\n          if (lastCellTarget !== cellTarget) {\n            cellEvent = createCellEvent(cellTarget, source);\n            if (cellEvent) {\n              this.cellEnter.emit(lastCellEnterEvent = cellEvent);\n            }\n          } else {\n            return;\n          }\n        }\n\n        const rowTarget = (cellEvent && cellEvent.rowTarget) || (isRowContainer(source.target as any) && source.target as any);\n\n        if (lastRowTarget !== rowTarget) {\n          lastEvent = emitRowLeave(source) || lastEvent;\n        }\n\n        if (rowTarget) {\n          if (lastRowTarget !== rowTarget) {\n            const rowEvent = createRowEvent(rowTarget, source, cellEvent);\n            if (rowEvent) {\n              this.rowEnter.emit(lastRowEnterEvent = rowEvent);\n            }\n          }\n        }\n\n        if (lastEvent) {\n          this.syncRow(lastEvent);\n        }\n      });\n  }\n\n  destroy(): void {\n    this.destroyed.next();\n    this.destroyed.complete();\n    this._removePlugin(this.grid);\n  }\n\n  private syncRow<TEvent extends Event>(event: Events.PblNgridRowEvent<T> | Events.PblNgridCellEvent<T, TEvent>): void {\n    this.grid.rowsApi.syncRows(event.type, event.rowIndex);\n  }\n}\n\n@Directive({\n  // tslint:disable-next-line:directive-selector\n  selector: 'pbl-ngrid[targetEvents], pbl-ngrid[mouseDown], pbl-ngrid[mouseUp], pbl-ngrid[rowClick], pbl-ngrid[rowDblClick], pbl-ngrid[rowEnter], pbl-ngrid[rowLeave], pbl-ngrid[cellClick], pbl-ngrid[cellDblClick], pbl-ngrid[cellEnter], pbl-ngrid[cellLeave], pbl-ngrid[keyDown], pbl-ngrid[keyUp]',\n  // tslint:disable-next-line:use-output-property-decorator\n  outputs: [ 'mouseDown', 'mouseUp', 'rowClick', 'rowDblClick', 'rowEnter', 'rowLeave', 'cellClick', 'cellDblClick', 'cellEnter', 'cellLeave', 'keyDown', 'keyUp' ]\n})\nexport class PblNgridTargetEventsPluginDirective<T> extends PblNgridTargetEventsPlugin<T> implements OnDestroy {\n\n  constructor(table: PblNgridComponent<any>, injector: Injector, pluginCtrl: PblNgridPluginController) {\n    super(table, injector, pluginCtrl);\n  }\n\n  ngOnDestroy() {\n    this.destroy();\n  }\n\n}\n","import { Directive, Input, Injector, OnDestroy } from '@angular/core';\nimport { BooleanInput, coerceBooleanProperty } from '@angular/cdk/coercion';\n\nimport { unrx } from '@pebula/ngrid/core';\nimport { PblNgridComponent, PblNgridPluginController } from '@pebula/ngrid';\nimport { PblNgridTargetEventsPlugin } from './target-events-plugin';\n\n@Directive({\n  // tslint:disable-next-line:directive-selector\n  selector: 'pbl-ngrid[cellEditClick], pbl-ngrid[cellEditDblClick]',\n})\nexport class PblNgridCellEditDirective<T> implements OnDestroy {\n  @Input() set cellEditClick(value: boolean) {\n    value = coerceBooleanProperty(value);\n    if (this._click !== value) {\n      this._click = value;\n      this.update();\n    }\n  }\n  @Input() set cellEditDblClick(value: boolean) {\n    value = coerceBooleanProperty(value);\n    if (this._dblClick !== value) {\n      this._dblClick = value;\n      this.update();\n    }\n  }\n\n  private _click = false;\n  private _dblClick = false;\n  private targetEventsPlugin: PblNgridTargetEventsPlugin<T>;\n\n  constructor(grid: PblNgridComponent<any>, injector: Injector, pluginCtrl: PblNgridPluginController) {\n    pluginCtrl.onInit()\n      .subscribe( () => {\n        this.targetEventsPlugin = pluginCtrl.getPlugin('targetEvents') || pluginCtrl.createPlugin('targetEvents');\n        this.update();\n      });\n  }\n\n  ngOnDestroy(): void {\n    unrx.kill(this);\n  }\n\n  private update(): void {\n    if (this.targetEventsPlugin) {\n      unrx.kill(this, this.targetEventsPlugin);\n      if (this._click) {\n        this.targetEventsPlugin.cellClick\n          .pipe(unrx(this, this.targetEventsPlugin))\n          .subscribe( event => {\n            if (event.type === 'data' && event.column.editable) {\n              event.context.startEdit(true);\n            }\n          });\n      }\n\n      if (this._dblClick) {\n        this.targetEventsPlugin.cellDblClick\n          .pipe(unrx(this, this.targetEventsPlugin))\n          .subscribe( event => {\n            if (event.type === 'data' && event.column.editable) {\n              event.context.startEdit(true);\n            }\n          });\n      }\n    }\n  }\n\n  static ngAcceptInputType_cellEditClick: BooleanInput;\n  static ngAcceptInputType_cellEditDblClick: BooleanInput;\n}\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { CdkTableModule } from '@angular/cdk/table';\nimport { PblNgridConfigService } from '@pebula/ngrid/core';\nimport { PblNgridModule, PblNgridPluginController, ngridPlugin } from '@pebula/ngrid';\nimport { PblNgridTargetEventsPlugin, PblNgridTargetEventsPluginDirective, PLUGIN_KEY, runOnce } from './target-events/target-events-plugin';\nimport { PblNgridCellEditDirective } from './target-events/cell-edit.directive';\n\n@NgModule({\n  imports: [ CommonModule, CdkTableModule, PblNgridModule ],\n  declarations: [ PblNgridTargetEventsPluginDirective, PblNgridCellEditDirective ],\n  exports: [ PblNgridTargetEventsPluginDirective, PblNgridCellEditDirective  ]\n})\nexport class PblNgridTargetEventsModule {\n\n  static readonly NGRID_PLUGIN = ngridPlugin({ id: PLUGIN_KEY, factory: 'create', runOnce }, PblNgridTargetEventsPlugin );\n\n  constructor(configService: PblNgridConfigService) {\n    PblNgridPluginController.onCreatedSafe(\n      PblNgridTargetEventsModule,\n      (grid, controller) => {\n        const targetEventsConfig = configService.get(PLUGIN_KEY);\n        if (targetEventsConfig && targetEventsConfig.autoEnable === true) {\n          controller.onInit()\n            .subscribe(() => {\n              if (!controller.hasPlugin(PLUGIN_KEY)) {\n                controller.createPlugin(PLUGIN_KEY);\n              }\n            });\n        }\n      },\n    );\n  }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i1"],"mappings":";;;;;;;;;;;;;AAIM,SAAU,WAAW,CAAuD,KAAyD,EAAA;AACzI,IAAA,OAAO,CAAC,CAAE,KAA+B,CAAC,UAAU,CAAC;AACvD,CAAC;AAEK,SAAU,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