How to use the @pebula/ngrid.TablePlugin function in @pebula/ngrid

To help you get started, we’ve selected a few @pebula/ngrid 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 shlomiassaf / ngrid / libs / ngrid / drag / src / lib / column-resize / column-resize.component.ts View on Github external
declare module '@pebula/ngrid/lib/ext/types' {
  interface PblNgridPluginExtension {
    columnResize?: PblNgridDragResizeComponent;
  }
}

export const PLUGIN_KEY: 'columnResize' = 'columnResize';

/** Options that can be used to bind a passive event listener. */
const passiveEventListenerOptions = normalizePassiveListenerOptions({passive: true});

/** Options that can be used to bind an active event listener. */
const activeEventListenerOptions = normalizePassiveListenerOptions({passive: false});

@TablePlugin({ id: PLUGIN_KEY, runOnce: extendGrid })
@Component({
  selector: 'pbl-ngrid-drag-resize', // tslint:disable-line:component-selector
  host: { // tslint:disable-line:use-host-property-decorator
    'class': 'pbl-ngrid-column-resizer',
    '[style.width.px]': 'grabAreaWidth',
  },
  templateUrl: './column-resize.component.html',
  styleUrls: [ './column-resize.component.scss' ],
  changeDetection: ChangeDetectionStrategy.OnPush,
  encapsulation: ViewEncapsulation.None,
})
export class PblNgridDragResizeComponent implements AfterViewInit, OnDestroy {

  // tslint:disable-next-line:no-input-rename
  @Input() set context(value: PblNgridMetaCellContext) {
    if (value) {