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

rt-tab-carousel

v1.1.1

Published

Angular tab carousel component

Downloads

20

Readme

RT-TAB-CAROUSEL

Install

yarn add rt-tab-carousel

or

npm install rt-tab-carousel

rtCarouselContainer

Use for a ready-made container in which all the items lie

| Option | Default | Type | Description | |----------------------------|---------|-------|------------------------------------------------------------------------------------------------------------------------| | scrollStep | 1 | Input | | | uuidCarousel *required | null | Input | This is a required property that indicates ownership and creates relationships between controls, containers, and items | | activeClass | null | Input | Apply class for styling for the last selected tab | | antiBounce | 5 | Input | Anti bounce for scrolling |

IMPORTANT USE trackBy for *ngFor

rtCarouselTab

| Option | Default | Type | Description | |------------------|----------------|-------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | disabledTab | false | Input | | | uuidCarousel | null *required | Input | This is a required property that indicates ownership and creates relationships between controls, containers, and items. Please, take note, that applying the same UUID to the different carousels will cause a specific behavior: the service will treat them as the same item that will cause arrows to appear on every navigation no matter the real content visibility |

rtCarouselNextButton rtCarouselPreviousButton

| Option | Default | Type | Description | |------------------|-----------------|--------|------------------------------------------------------------------------------------------------------------------------| | activeClass | false | Input | Applies the given class to the active item | | uuidCarousel | null *required | Input | This is a required property that indicates ownership and creates relationships between controls, containers, and items | | autoHide | true | Input | If the content is placed in the container, the button will disappear automatically | | buttonHidden | | Output | boolean |

Button components

<rt-carousel-previous-button></rt-carousel-previous-button>
<rt-carousel-next-button></rt-carousel-next-button>

| Option | Default | Type | Description | |------------------|-----------------|-------|------------------------------------------------------------------------------------------------------------------------| | uuidCarousel | null *required | Input | This is a required property that indicates ownership and creates relationships between controls, containers, and items | | autoHide | true | Input | If the content is placed in the container, the button will disappear automatically |

Service

RtCarouselService

| Option | Input | Output | |-----------------------------------|---------------------|----------------------| | setScrollStep(string, number) | uuidCarousel, value | void | | previousPart(string) | uuidCarousel | void | | nextPart(string) | uuidCarousel | void | | selectedTab(string) | uuidCarousel | Observable<number> | | selectTab(string) | uuidCarousel | void | | lastVisibleIndex(string) | uuidCarousel | Observable<number> | | lastVisibleIndexEnd(string) | uuidCarousel | Observable<number> | | isLastTabVisible(string) | uuidCarousel | Observable<boolean> | | isFirstTabVisible(string) | uuidCarousel | Observable<boolean> |

Usages Directive

rt-carousel-directive-example.ts

import {ChangeDetectionStrategy, Component} from '@angular/core';

@Component({
  selector: 'rt-tab-carousel-directive-example',
  templateUrl: './rt-tab-carousel-root.component.html',
  styleUrls: ['./rt-tab-carousel-root.component.scss'],
  changeDetection: ChangeDetectionStrategy.OnPush
})
export class RtCarouselRootComponent {
  disableTab = false;
  selectedTabIndex: number;

  selectedTab(index: number): void {
    this.selectedTabIndex = index;
  }
}

rt-carousel-directive-example.html


<div class="rt-carousel-directive-example">

  <div
    rtCarouselPreviousButton
    [uuidCarousel]="'first-carousel'"
    [activeClass]="'rt-carousel__shadow-left-array'"
    class="rt-carousel__next-part"
  >
    <img ngSrc="/assets/images/icons/icn_chevron-left.svg" alt="" height="24" width="24">
  </div>

  <nav
    rtCarouselContainer
    [uuidCarousel]="'first-carousel'"
    [scrollStep]="4"
  >

    <div
      *ngFor="let tab of [].constructor(50); let index=index; trackBy: trackByFn"
      class="tab"
      [ngClass]="{'tab__active': selectedTabIndex === index}"
      rtCarouselTab
      [uuidCarousel]="'first-carousel'"
      [disabledTab]="disableTab"
    >
      First {{index + 1}}
    </div>

  </nav>


  <div
    rtCarouselNextButton
    [uuidCarousel]="'first-carousel'"
    [activeClass]="'rt-carousel__shadow-right-array'"
    class="rt-carousel__next-part"
  >
    <img ngSrc="/assets/images/icons/icn_chevron-right.svg" alt="" height="24" width="24">
  </div>

</div>

Note that you can also use ready-made button components


<rt-carousel-previous-button uuidCarousel="carousel-text-book"></rt-carousel-previous-button>
<rt-carousel-next-button uuidCarousel="carousel-text-book"></rt-carousel-next-button>

rt-carousel-directive-example.scss

.rt-carousel-example {
  display: flex;
  flex-direction: column;
  margin: 20px;
}

.rt-carousel-directive-example {
  display: flex;
  align-items: center;
  height: 100px;
  margin: 20px;
}

.tab {
  padding: 10px;
}

.tab__active {
  border-bottom: #6a88d9 solid 2px;
}

.rt-carousel-tab__disabled {
  opacity: .6;
  pointer-events: none;
}

.rt-carousel__next-part {
  cursor: pointer;
  width: 24px;
  align-items: center;
  display: flex;
  z-index: 1;
  transition: box-shadow .3s;
}

.rt-carousel__shadow-left-array {
  box-shadow: 10px 0 10px -10px #000000b5;
  border-right: solid 0.3px;
  border-image: linear-gradient(to bottom, transparent, #0e0e0e, rgb(0 0 0 / 0%)) 0 100%;
  height: 100%;
  align-items: center;
  display: flex;
}

.rt-carousel__shadow-right-array {
  box-shadow: -10px 0 10px -10px #000000b5;
  border-left: solid 0.3px;
  border-image: linear-gradient(to bottom, transparent, #0e0e0e, rgb(0 0 0 / 0%)) 0 100%;
  height: 100%;
  align-items: center;
  display: flex;
}

https://www.regulus.team/