Socket
Socket
Sign inDemoInstall

stepper-control

Package Overview
Dependencies
10
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    stepper-control

This Angular Module is a stepper controller


Version published
Weekly downloads
0
Maintainers
1
Created
Weekly downloads
 

Readme

Source

Stepper Control

This Angular Module (Component) allows you to have a control (+ -) for incresing or decreasing value control.

You can use the component as a formControl or respond to change event

Installation

npm install stepper-control

Scaffolding

Import the module into your project under imports

imports: [
    BrowserModule,
    AppRoutingModule,
    StepperModule
  ],

Use

To use in your component, use the following tag for a basic setup

<wav-stepper-control></wav-stepper-control>

Here is the component with all input controls

<wav-stepper-control 
  formControlName="account" 
  [vertical]="true" 
  [padding]="3" 
  [incrementBy]=".5"
  [min]="10" 
  [max]="20" 
  (change)="onStepChange($event)"
></wav-stepper-control>

Inputs

The following Inputs are available

InputTypeDefautDescription
verticalBOOLENFALSEcontrols the display type (vertical
paddingNUMBER0pads the resulting value
incrementByNUMBER1increment value by
minNUMBERNULLmin value
maxNUMBERNULLmax value

Outputs

The following Inputs are available

EventTypeDescription
changeSTRINGcurrent value padded

Form Control setup

define a formGroup control

stepper = this.fb.group({
  value: [10]
})

then onInit() specify the form change event

this.stepper.get('value')?.valueChanges.subscribe(data => {
  console.log('VALUE:', data)
})

Then implement the component

<div [formGroup]="privateForm">
  <wav-stepper-control 
    formControlName="value" 
    [min]="10" 
    [max]="20" 
  ></wav-stepper-control>
</div>

Change Event setup

Then implement the component

<div [formGroup]="privateForm">
  <wav-stepper-control 
    [min]="10" 
    [max]="20" 
    (change)="onStepChange($event)"
  ></wav-stepper-control>
</div>

then create the function to catch the reponse to the change

 onStepChange(data: string) {
    console.log(data)
  }

Keywords

FAQs

Last updated on 08 Apr 2022

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc