Security News
pnpm 10.0.0 Blocks Lifecycle Scripts by Default
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
ampersand-floatinglabel-input-view
Advanced tools
An extended Ampersand.js input view to provide floating labels on input elements
A simple ampersand input view extension to enable the floating label pattern.
This extension will:
floating
class on the [data-hook="label"]
element for styling a floating label. Overridable by supplying option labelClass: 'your other classes'
It's build right on top of ampersand-input-view so you can use it just like ampersand-input-view.
npm install ampersand-floatinglabel-input-view
var AmpersandView = require( 'ampersand-view' ),
AmpersandForm = require( 'ampersand-form-view' ),
AmpersandInput = require( 'ampersand-floatinglabel-input-view' );
module.exports = AmpersandView.extend({
template: '<div><form method="POST" action="/login" role="form" data-target="form"></form></div>',
render: function() {
'use strict';
this.renderWithTemplate();
this.loginForm = new AmpersandForm({
el: this.queryByHook( 'login-form' ),
submitCallback: function( data ) {
// send data to the server
},
validCallback: function( data ) {
// make the button visible
},
fields: [
new AmpersandInput({
type: 'email',
name: 'email',
label: 'Email',
placeholder: 'Email',
value: '',
tests: [
function( val ) {
if ( val.length < 5 ) {
return 'Your email must be at least 5 characters';
}
}
]
}),
new AmpersandInput({
type: 'password',
name: 'password',
label: 'Password',
placeholder: 'Password',
value: '',
tests: [
function( val ) {
if ( val.length < 8 ) {
return 'Your password must be at least 8 characters';
}
}
]
})
]
});
this.registerSubview( this.loginForm );
}
});
Options are passed into the ViewConstructor
labelClass
- [default: 'floating'], applies 'yourClass' or 'yourClass andYourOtherClassToo' to data-hooked label
element
template
- standard View convention applies. However, if attribute data-hook="label-container"
is found, labelClass
will be applied to it instead of data-hook="label"
See ampersand-input-view for the api reference.
FAQs
An extended Ampersand.js input view to provide floating labels on input elements
The npm package ampersand-floatinglabel-input-view receives a total of 6 weekly downloads. As such, ampersand-floatinglabel-input-view popularity was classified as not popular.
We found that ampersand-floatinglabel-input-view demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
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.
Security News
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.
Research
Security News
Socket researchers have discovered multiple malicious npm packages targeting Solana private keys, abusing Gmail to exfiltrate the data and drain Solana wallets.