npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@kinect-pro/ngp-slide-block

v2.0.3

Published

Small switcher / slider for html elements for Angular 8+

Downloads

2

Readme

NgpSlideBlock

This is simple slider-switch for opening and closing HTML elements such as inputs, textarea, links.

|Library version|npm tag|Angular version| |---|:---:|:---:| |1.x|ng8|Angular 8| |2.x|ng9|Angular 9|

Site with demos available here: prettyangular.kinect.pro

Note: If you develop for IE / Edge browser, do not forget include all required polyfills, such as classlist.js and web-animations-js

Installation

How to install

With npm

npm install @kinect-pro/ngp-slide-block

With yarn

yarn add @kinect-pro/ngp-slide-block

How to setup

Add NgpSlideBlockModule to your App module

app.module
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { NgpSlideBlockModule } from '@kinect-pro/ngp-slider-block';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';

@NgModule({
  declarations: [
    AppComponent,
    BaseComponent
  ],
  imports: [
    BrowserModule,
    AppRoutingModule,
    NgpSlideBlockModule
  ],
  providers: [],
  bootstrap: [AppComponent]
})
export class AppModule { }

Simplest example: using one toggling item

app.component.html

Example 1:

<ngp-toggle-block [isOpen]="true">
  <button class="btn btn-primary" ngpTrigger>switch</button>
  <input class="form-control" type="text" value="test" name="text" ngpContent>
</ngp-toggle-block>

Example 2:

<ngp-toggle-block>
  <button class="btn btn-primary" ngpTrigger>Show</button>
  <label class="p-1" ngpLabel  [float]="float.left">Hi, this is some information for user</label>
  <input class="form-control" type="text" value="test" name="text" ngpContent>
</ngp-toggle-block>
  • ngpTrigger - directive for mark the object clicking on which will hide or show content
  • ngpLabel - label block for hiding, non required element
  • ngpContent - content block for hiding

Properties

Methods

You can manipulate slider manually by using @ViewChild()
At this moment available methods:
open(instantly?: boolean) - open slider
close(instantly?: boolean) - close slider

Events

You can subscribe on two event emitters:
animStart: - emit boolean value when animation is started
animFinish: - emit boolean value when animation is finished

ngpToggleGroup

For grouping separate slides you can use ngpToggleGroup

<ngp-toggle-group [animationDuration]="200" [animationEasing]="easing.easeOut" [openLimit]="2">
  <ngp-toggle-block [isOpen]="true">
    <button class="btn btn-primary" ngpTrigger>1</button>
    <input class="form-control" type="text" value="test" name="text1" ngpContent>
  </ngp-toggle-block>

  <ngp-toggle-block [animationDuration]="1000">
    <button class="btn btn-primary" ngpTrigger>2</button>
    <input class="form-control" type="text" value="test" name="text2" ngpContent>
  </ngp-toggle-block>

  <ngp-toggle-block>
    <a class="btn btn-link" ngpTrigger>link</a>
    <input class="form-control" type="text" value="link test" name="text2" ngpContent>
  </ngp-toggle-block>

  <ngp-toggle-block>
    <img height="42" width="42" class="img-fluid" src="..." ngpTrigger>
    <input class="form-control" type="text" value="link test" name="text2" ngpContent>
  </ngp-toggle-block>
</ngp-toggle-group>

Input properties

Methods

You can manipulate slider manually by using @ViewChild()
At this moment available methods: opened() - return array of indexes of opened items
open(index: number, instantly?: boolean) - open one slider
close(index: number, instantly?: boolean) - close one slider closeAll(instantly?: boolean) - close all opened sliders

Events

You can subscribe on two event emitters:
animStart: - emit index (number) of item which animation is started
animFinish: - emit index (number) of item which animation is finished