stimulus-password-visibility
Advanced tools
Comparing version 1.1.1 to 2.0.0
@@ -9,2 +9,10 @@ # Changelog | ||
## [2.0.0] - 2022-01-06 | ||
### Chore | ||
- **Breaking** Upgrading Stimulus to `3.x` and change namespace from `stimulus` to `@hotwired/stimulus`. | ||
- Upgrading dependencies | ||
- Upgrading Node to 16.13.1. | ||
## [1.1.1] - 2021-08-23 | ||
@@ -11,0 +19,0 @@ |
@@ -1,1 +0,16 @@ | ||
import{Controller as s}from"stimulus";class t extends s{connect(){this.hidden="password"===this.inputTarget.type,this.class=this.hasHiddenClass?this.hiddenClass:"hidden"}toggle(s){s.preventDefault(),this.inputTarget.type=this.hidden?"text":"password",this.hidden=!this.hidden,this.iconTargets.forEach((s=>s.classList.toggle(this.class)))}}t.targets=["input","icon"],t.classes=["hidden"];export{t as default}; | ||
import { Controller } from "@hotwired/stimulus"; | ||
class src_default extends Controller { | ||
connect() { | ||
this.hidden = this.inputTarget.type === "password"; | ||
this.class = this.hasHiddenClass ? this.hiddenClass : "hidden"; | ||
} | ||
toggle(e) { | ||
e.preventDefault(); | ||
this.inputTarget.type = this.hidden ? "text" : "password"; | ||
this.hidden = !this.hidden; | ||
this.iconTargets.forEach((icon) => icon.classList.toggle(this.class)); | ||
} | ||
} | ||
src_default.targets = ["input", "icon"]; | ||
src_default.classes = ["hidden"]; | ||
export { src_default as default }; |
@@ -1,1 +0,1 @@ | ||
!function(s,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("stimulus")):"function"==typeof define&&define.amd?define(["stimulus"],t):(s="undefined"!=typeof globalThis?globalThis:s||self)["stimulus-password-visibility"]=t(s.Stimulus)}(this,(function(s){"use strict";class t extends s.Controller{connect(){this.hidden="password"===this.inputTarget.type,this.class=this.hasHiddenClass?this.hiddenClass:"hidden"}toggle(s){s.preventDefault(),this.inputTarget.type=this.hidden?"text":"password",this.hidden=!this.hidden,this.iconTargets.forEach((s=>s.classList.toggle(this.class)))}}return t.targets=["input","icon"],t.classes=["hidden"],t})); | ||
(function(e,s){typeof exports=="object"&&typeof module!="undefined"?module.exports=s(require("@hotwired/stimulus")):typeof define=="function"&&define.amd?define(["@hotwired/stimulus"],s):(e=typeof globalThis!="undefined"?globalThis:e||self,e["stimulus-password-visibility"]=s(e.Stimulus))})(this,function(e){"use strict";class s extends e.Controller{connect(){this.hidden=this.inputTarget.type==="password",this.class=this.hasHiddenClass?this.hiddenClass:"hidden"}toggle(t){t.preventDefault(),this.inputTarget.type=this.hidden?"text":"password",this.hidden=!this.hidden,this.iconTargets.forEach(i=>i.classList.toggle(this.class))}}return s.targets=["input","icon"],s.classes=["hidden"],s}); |
{ | ||
"name": "stimulus-password-visibility", | ||
"version": "1.1.1", | ||
"version": "2.0.0", | ||
"description": "A Stimulus controller to change a password input visibility.", | ||
@@ -33,19 +33,19 @@ "keywords": [ | ||
"devDependencies": { | ||
"@babel/core": "^7.14.0", | ||
"@babel/core": "^7.16.7", | ||
"@babel/polyfill": "^7.12.1", | ||
"@babel/preset-env": "^7.14.1", | ||
"@babel/preset-typescript": "^7.13.0", | ||
"@testing-library/dom": "^8.1.0", | ||
"@types/jest": "^27.0.1", | ||
"babel-jest": "^27.0.6", | ||
"jest": "^27.0.6", | ||
"@babel/preset-env": "^7.16.7", | ||
"@babel/preset-typescript": "^7.16.7", | ||
"@hotwired/stimulus": "^3.0.1", | ||
"@testing-library/dom": "^8.11.1", | ||
"@types/jest": "^27.4.0", | ||
"babel-jest": "^27.4.6", | ||
"jest": "^27.4.7", | ||
"mutationobserver-shim": "^0.3.7", | ||
"np": "^7.5.0", | ||
"np": "^7.6.0", | ||
"prettier-standard": "16.4.1", | ||
"stimulus": "^2.0.0", | ||
"typescript": "^4.2.4", | ||
"vite": "^2.2.4" | ||
"typescript": "^4.5.4", | ||
"vite": "^2.7.10" | ||
}, | ||
"peerDependencies": { | ||
"stimulus": "^2.0.0" | ||
"@hotwired/stimulus": "^3.0.1" | ||
}, | ||
@@ -52,0 +52,0 @@ "jest": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Trivial Package
Supply chain riskPackages less than 10 lines of code are easily copied into your own project and may not warrant the additional supply chain risk of an external dependency.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
6195
19
0