0.0.2 • Published 6 years ago

lib-psv v0.0.2

Weekly downloads
9
License
-
Repository
-
Last release
6 years ago

lib-psv(demo)

Superb password strength visualization for Angular 7.

Demo

This is a Angular 7 directive used as port of an awesome Codrops Article by Mary Lou (original source).

Install

npm i --save lib-psv

Usage

Check out the Demo to see it in action.

import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { NgxPSVModule } from "lib-psv";
import { AppRoutes, routes } from './routes';
import { Demo1Component } from './demo1.component';
import { Demo2Component } from './demo2.component';
import { AppComponent } from './app.component';

@NgModule({
  declarations: [
    AppComponent, 
    Demo1Component,
    Demo2Component
  ],
  imports: [
    BrowserModule,
    NgxPSVModule,
    AppRoutes.forRoot(routes)
  ],
  providers: [],
  bootstrap: [AppComponent]
})
export class AppModule { }
<input lib-psv 
  [psvOptions]="obj" 
  [psvFeedbackModel]="{ '0': 'Worst', '1': 'Bad', '2': 'Weak', '3': 'Good', '4': 'Strong' }"
  (psvScoreChanged)="onPsvStrengthChanged($event)"
  [psvCanvasWrapper]="canvaswrap"
  [psvCanvas]="canvas"
  [psvPoster]="poster"
  [psvFeedback]="feedback"
>
	

Changing the psvDirection string property to NORMAL (default is NORMAL) will typically result in a cleaner progressive image when a key down event occurred. If psvDirection changes to REVERSE, will typically result in a blurred progressive image when a key up event occurred.

Props

PropertyTypeDefaultDescription
psvDirectionstring'NORMAL'|'REVERSE'Whether image should turn progressively clear or blurred when a key down event occurred
psvFeedbackModelany{ '0': 'Worst', '1': 'Bad', '2': 'Weak', '3': 'Good', '4': 'Strong' }Feedback model is the object that contains the keys and values that correspond used to display in the element under the input.
(psvScoreChanged)EventEmitter\EventEmitterEmitted when the password score changes
(psvPxFactorChanged)EventEmitter\EventEmitterEmitterd when the pxFactor used to change the image is changed
psvCanvasWrapperHTMLElementnullThe parent HTML element of the psvCanvas element.
psvCanvasHTMLCanvasElementnullThe canvas in which the image is drawn to
psvPosterHTMLElementnullThe HTMLElement that needs to have a style property defined containing background-image with a valid value
psvFeedbackHTMLElementnullThe HTMLElement which property innerHTML will be changed when if the psvFeedbackModel is set
psvOptionsobjectnullObject containing all the properties that are used to initialize lib-psv

I've tried to keep the properties and behavior exactly the same as in the original codrops version.

Related

Development

This module was bootstrapped with angular-cli so it's using the common build/test/lint commands from angular-cli.

Library

  • Build: ng build lib-psv
  • Test: ng test lib-psv
  • Lint: ng lint lib-psv

Project

  • See it in action: ng serve

Misc

Follow Codrops: Twitter, Facebook, Google+, GitHub, Pinterest, Instagram

License

This resource can be used freely if integrated or build upon in personal or commercial projects such as websites, web apps and web templates intended for sale. It is not allowed to take the resource "as-is" and sell it, redistribute, re-publish it, or sell "pluginized" versions of it. Free plugins built using this resource should have a visible mention and link to the original work. Always consider the licenses of all included libraries, scripts and images used. MIT © danielpdev

0.0.2

6 years ago

0.0.1

6 years ago