Socket
Socket
Sign inDemoInstall

text-fields

Package Overview
Dependencies
Maintainers
1
Versions
42
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

text-fields - npm Package Compare versions

Comparing version 2.1.0 to 2.2.0

22

dist/index.js

@@ -59,2 +59,13 @@

}
function $3a21e1140688247a$var$filled(field, container, fieldType) {
if (field.value.trim().length > 0) container.classList.add(fieldType ? "textarea--filled" : "input--filled");
else container.classList.remove(fieldType ? "textarea--filled" : "input--filled");
}
function $3a21e1140688247a$var$textareaResizeable(field, container, fieldType) {
if (fieldType && container.classList.contains("textarea--auto-resizeable")) {
const currentField = field;
currentField.style.height = "auto";
currentField.style.height = `${currentField.scrollHeight}px`;
}
}
function $3a21e1140688247a$var$listeners(field, container, notch, fieldType) {

@@ -72,10 +83,7 @@ const eventType = fieldType ? "input" : "change";

field.addEventListener(eventType, ()=>{
if (field.value.trim().length > 0) container.classList.add(fieldType ? "textarea--filled" : "input--filled");
else container.classList.remove(fieldType ? "textarea--filled" : "input--filled");
if (fieldType && container.classList.contains("textarea--auto-resizeable")) {
const currentField = field;
currentField.style.height = "auto";
currentField.style.height = `${currentField.scrollHeight}px`;
}
$3a21e1140688247a$var$filled(field, container, fieldType);
$3a21e1140688247a$var$textareaResizeable(field, container, fieldType);
});
$3a21e1140688247a$var$filled(field, container, fieldType);
notchStyle.width = $3a21e1140688247a$var$getNotchWidth(notch);
}

@@ -82,0 +90,0 @@ var $3a21e1140688247a$export$2e2bcd8739ae039 = $3a21e1140688247a$var$listeners;

@@ -47,2 +47,13 @@ function $85068ae01dc596ad$var$notched() {

}
function $8290bb03cd88138a$var$filled(field, container, fieldType) {
if (field.value.trim().length > 0) container.classList.add(fieldType ? "textarea--filled" : "input--filled");
else container.classList.remove(fieldType ? "textarea--filled" : "input--filled");
}
function $8290bb03cd88138a$var$textareaResizeable(field, container, fieldType) {
if (fieldType && container.classList.contains("textarea--auto-resizeable")) {
const currentField = field;
currentField.style.height = "auto";
currentField.style.height = `${currentField.scrollHeight}px`;
}
}
function $8290bb03cd88138a$var$listeners(field, container, notch, fieldType) {

@@ -60,10 +71,7 @@ const eventType = fieldType ? "input" : "change";

field.addEventListener(eventType, ()=>{
if (field.value.trim().length > 0) container.classList.add(fieldType ? "textarea--filled" : "input--filled");
else container.classList.remove(fieldType ? "textarea--filled" : "input--filled");
if (fieldType && container.classList.contains("textarea--auto-resizeable")) {
const currentField = field;
currentField.style.height = "auto";
currentField.style.height = `${currentField.scrollHeight}px`;
}
$8290bb03cd88138a$var$filled(field, container, fieldType);
$8290bb03cd88138a$var$textareaResizeable(field, container, fieldType);
});
$8290bb03cd88138a$var$filled(field, container, fieldType);
notchStyle.width = $8290bb03cd88138a$var$getNotchWidth(notch);
}

@@ -70,0 +78,0 @@ var $8290bb03cd88138a$export$2e2bcd8739ae039 = $8290bb03cd88138a$var$listeners;

{
"name": "text-fields",
"version": "2.1.0",
"version": "2.2.0",
"description": "Input, textarea, material",

@@ -5,0 +5,0 @@ "author": "ux-ui.pro",

@@ -6,2 +6,19 @@ function getNotchWidth(notch) {

function filled(field, container, fieldType) {
if (field.value.trim().length > 0) {
container.classList.add(fieldType ? 'textarea--filled' : 'input--filled');
} else {
container.classList.remove(fieldType ? 'textarea--filled' : 'input--filled');
}
}
function textareaResizeable(field, container, fieldType) {
if (fieldType && container.classList.contains('textarea--auto-resizeable')) {
const currentField = field;
currentField.style.height = 'auto';
currentField.style.height = `${currentField.scrollHeight}px`;
}
}
function listeners(field, container, notch, fieldType) {

@@ -25,17 +42,11 @@ const eventType = fieldType ? 'input' : 'change';

field.addEventListener(eventType, () => {
if (field.value.trim().length > 0) {
container.classList.add(fieldType ? 'textarea--filled' : 'input--filled');
} else {
container.classList.remove(fieldType ? 'textarea--filled' : 'input--filled');
}
filled(field, container, fieldType);
textareaResizeable(field, container, fieldType);
});
if (fieldType && container.classList.contains('textarea--auto-resizeable')) {
const currentField = field;
filled(field, container, fieldType);
currentField.style.height = 'auto';
currentField.style.height = `${currentField.scrollHeight}px`;
}
});
notchStyle.width = getNotchWidth(notch);
}
export default listeners;

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc