0.3.2 • Published 2 years ago

@busypixels/ngx-click-out v0.3.2

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

NG(X) Click Out

A more performant way to trigger events when an element is clicked away from. By only initializing event listeners when an element is first interacted with, or whenever you so choose, preformance is greatly improved over other methods.

Installation

NPM:

npm i @busypixels/ngx-click-out

Yarn:

yarn add @busypixels/ngx-click-out

Usage:

Import the Module:

import { NgxClickOutModule } from '@busypixels/ngx-click-out';

@NgModule({
  ...
  imports: [
    ...
    NgxClickOutModule
    ...
  ],
  ...
})
export class AppModule { }

Add the out event.

  <div id="parent">
      <div id="inner-content" click-out (out)="handleClickOut()">
        Inner Content
      </div>
      <div id="outer-content">
        Outer Content
      </div>
  </div>

Inputs

EventTypeDefaultDescription
inEventsstring[]['click']Array of event names that will initialize outEvents
outEventsstring[]['click', 'touchstart', 'focusin']Array of event names that will fire the out event

Events

Eventdescription
inEvent fired when an element is initialized and ready to be clicked out of.
outEvent fired when an initialized element is clicked outside of.

Donate

If my work saves you time feel free to buy me a beer to keep it going. Cheers!

Donate

0.3.2

2 years ago

0.3.1

2 years ago

0.3.0

2 years ago

0.2.3

2 years ago

0.2.2

2 years ago

0.2.1

2 years ago

0.2.0

2 years ago

0.1.0

2 years ago

0.0.6

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago