Socket
Socket
Sign inDemoInstall

@react-aria/textfield

Package Overview
Dependencies
Maintainers
2
Versions
752
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@react-aria/textfield - npm Package Compare versions

Comparing version 3.14.4 to 3.14.5

28

dist/useFormattedTextField.main.js

@@ -25,4 +25,4 @@ var $9076f978e02df845$exports = require("./useTextField.main.js");

function $56b68c3dab9bf16c$var$supportsNativeBeforeInputEvent() {
return typeof window !== "undefined" && window.InputEvent && // @ts-ignore
typeof InputEvent.prototype.getTargetRanges === "function";
return typeof window !== 'undefined' && window.InputEvent && // @ts-ignore
typeof InputEvent.prototype.getTargetRanges === 'function';
}

@@ -42,16 +42,16 @@ function $56b68c3dab9bf16c$export$4f384c9210e583c3(props, state, inputRef) {

switch(e.inputType){
case "historyUndo":
case "historyRedo":
case 'historyUndo':
case 'historyRedo':
// Explicitly allow undo/redo. e.data is null in this case, but there's no need to validate,
// because presumably the input would have already been validated previously.
return;
case "insertLineBreak":
case 'insertLineBreak':
// Explicitly allow "insertLineBreak" event, to allow onSubmit for "enter" key. e.data is null in this case.
return;
case "deleteContent":
case "deleteByCut":
case "deleteByDrag":
case 'deleteContent':
case 'deleteByCut':
case 'deleteByDrag':
nextValue = input.value.slice(0, input.selectionStart) + input.value.slice(input.selectionEnd);
break;
case "deleteContentForward":
case 'deleteContentForward':
// This is potentially incorrect, since the browser may actually delete more than a single UTF-16

@@ -63,7 +63,7 @@ // character. In reality, a full Unicode grapheme cluster consisting of multiple UTF-16 characters

break;
case "deleteContentBackward":
case 'deleteContentBackward':
nextValue = input.selectionEnd === input.selectionStart ? input.value.slice(0, input.selectionStart - 1) + input.value.slice(input.selectionStart) : input.value.slice(0, input.selectionStart) + input.value.slice(input.selectionEnd);
break;
case "deleteSoftLineBackward":
case "deleteHardLineBackward":
case 'deleteSoftLineBackward':
case 'deleteHardLineBackward':
nextValue = input.value.slice(input.selectionStart);

@@ -83,5 +83,5 @@ break;

let input = inputRef.current;
input.addEventListener("beforeinput", onBeforeInputFallback, false);
input.addEventListener('beforeinput', onBeforeInputFallback, false);
return ()=>{
input.removeEventListener("beforeinput", onBeforeInputFallback, false);
input.removeEventListener('beforeinput', onBeforeInputFallback, false);
};

@@ -88,0 +88,0 @@ }, [

@@ -19,4 +19,4 @@ import {useTextField as $2d73ec29415bd339$export$712718f7aec83d5} from "./useTextField.module.js";

function $d841c8010a73d545$var$supportsNativeBeforeInputEvent() {
return typeof window !== "undefined" && window.InputEvent && // @ts-ignore
typeof InputEvent.prototype.getTargetRanges === "function";
return typeof window !== 'undefined' && window.InputEvent && // @ts-ignore
typeof InputEvent.prototype.getTargetRanges === 'function';
}

@@ -36,16 +36,16 @@ function $d841c8010a73d545$export$4f384c9210e583c3(props, state, inputRef) {

switch(e.inputType){
case "historyUndo":
case "historyRedo":
case 'historyUndo':
case 'historyRedo':
// Explicitly allow undo/redo. e.data is null in this case, but there's no need to validate,
// because presumably the input would have already been validated previously.
return;
case "insertLineBreak":
case 'insertLineBreak':
// Explicitly allow "insertLineBreak" event, to allow onSubmit for "enter" key. e.data is null in this case.
return;
case "deleteContent":
case "deleteByCut":
case "deleteByDrag":
case 'deleteContent':
case 'deleteByCut':
case 'deleteByDrag':
nextValue = input.value.slice(0, input.selectionStart) + input.value.slice(input.selectionEnd);
break;
case "deleteContentForward":
case 'deleteContentForward':
// This is potentially incorrect, since the browser may actually delete more than a single UTF-16

@@ -57,7 +57,7 @@ // character. In reality, a full Unicode grapheme cluster consisting of multiple UTF-16 characters

break;
case "deleteContentBackward":
case 'deleteContentBackward':
nextValue = input.selectionEnd === input.selectionStart ? input.value.slice(0, input.selectionStart - 1) + input.value.slice(input.selectionStart) : input.value.slice(0, input.selectionStart) + input.value.slice(input.selectionEnd);
break;
case "deleteSoftLineBackward":
case "deleteHardLineBackward":
case 'deleteSoftLineBackward':
case 'deleteHardLineBackward':
nextValue = input.value.slice(input.selectionStart);

@@ -77,5 +77,5 @@ break;

let input = inputRef.current;
input.addEventListener("beforeinput", onBeforeInputFallback, false);
input.addEventListener('beforeinput', onBeforeInputFallback, false);
return ()=>{
input.removeEventListener("beforeinput", onBeforeInputFallback, false);
input.removeEventListener('beforeinput', onBeforeInputFallback, false);
};

@@ -82,0 +82,0 @@ }, [

@@ -33,4 +33,4 @@ var $4Z7CR$react = require("react");

function $9076f978e02df845$export$712718f7aec83d5(props, ref) {
let { inputElementType: inputElementType = "input", isDisabled: isDisabled = false, isRequired: isRequired = false, isReadOnly: isReadOnly = false, type: type = "text", validationBehavior: validationBehavior = "aria" } = props;
let [value, setValue] = (0, $4Z7CR$reactstatelyutils.useControlledState)(props.value, props.defaultValue || "", props.onChange);
let { inputElementType: inputElementType = 'input', isDisabled: isDisabled = false, isRequired: isRequired = false, isReadOnly: isReadOnly = false, type: type = 'text', validationBehavior: validationBehavior = 'aria' } = props;
let [value, setValue] = (0, $4Z7CR$reactstatelyutils.useControlledState)(props.value, props.defaultValue || '', props.onChange);
let { focusableProps: focusableProps } = (0, $4Z7CR$reactariafocus.useFocusable)(props, ref);

@@ -66,3 +66,3 @@ let validationState = (0, $4Z7CR$reactstatelyform.useFormValidationState)({

let input = ref.current;
Object.defineProperty(input, "defaultValue", {
Object.defineProperty(input, 'defaultValue', {
get: ()=>input.value,

@@ -78,12 +78,12 @@ set: ()=>{},

labelProps: labelProps,
inputProps: (0, $4Z7CR$reactariautils.mergeProps)(domProps, inputElementType === "input" && inputOnlyProps, {
inputProps: (0, $4Z7CR$reactariautils.mergeProps)(domProps, inputElementType === 'input' && inputOnlyProps, {
disabled: isDisabled,
readOnly: isReadOnly,
required: isRequired && validationBehavior === "native",
"aria-required": isRequired && validationBehavior === "aria" || undefined,
"aria-invalid": isInvalid || undefined,
"aria-errormessage": props["aria-errormessage"],
"aria-activedescendant": props["aria-activedescendant"],
"aria-autocomplete": props["aria-autocomplete"],
"aria-haspopup": props["aria-haspopup"],
required: isRequired && validationBehavior === 'native',
'aria-required': isRequired && validationBehavior === 'aria' || undefined,
'aria-invalid': isInvalid || undefined,
'aria-errormessage': props['aria-errormessage'],
'aria-activedescendant': props['aria-activedescendant'],
'aria-autocomplete': props['aria-autocomplete'],
'aria-haspopup': props['aria-haspopup'],
value: value,

@@ -90,0 +90,0 @@ onChange: (e)=>setValue(e.target.value),

@@ -27,4 +27,4 @@ import {useEffect as $ig234$useEffect} from "react";

function $2d73ec29415bd339$export$712718f7aec83d5(props, ref) {
let { inputElementType: inputElementType = "input", isDisabled: isDisabled = false, isRequired: isRequired = false, isReadOnly: isReadOnly = false, type: type = "text", validationBehavior: validationBehavior = "aria" } = props;
let [value, setValue] = (0, $ig234$useControlledState)(props.value, props.defaultValue || "", props.onChange);
let { inputElementType: inputElementType = 'input', isDisabled: isDisabled = false, isRequired: isRequired = false, isReadOnly: isReadOnly = false, type: type = 'text', validationBehavior: validationBehavior = 'aria' } = props;
let [value, setValue] = (0, $ig234$useControlledState)(props.value, props.defaultValue || '', props.onChange);
let { focusableProps: focusableProps } = (0, $ig234$useFocusable)(props, ref);

@@ -60,3 +60,3 @@ let validationState = (0, $ig234$useFormValidationState)({

let input = ref.current;
Object.defineProperty(input, "defaultValue", {
Object.defineProperty(input, 'defaultValue', {
get: ()=>input.value,

@@ -72,12 +72,12 @@ set: ()=>{},

labelProps: labelProps,
inputProps: (0, $ig234$mergeProps)(domProps, inputElementType === "input" && inputOnlyProps, {
inputProps: (0, $ig234$mergeProps)(domProps, inputElementType === 'input' && inputOnlyProps, {
disabled: isDisabled,
readOnly: isReadOnly,
required: isRequired && validationBehavior === "native",
"aria-required": isRequired && validationBehavior === "aria" || undefined,
"aria-invalid": isInvalid || undefined,
"aria-errormessage": props["aria-errormessage"],
"aria-activedescendant": props["aria-activedescendant"],
"aria-autocomplete": props["aria-autocomplete"],
"aria-haspopup": props["aria-haspopup"],
required: isRequired && validationBehavior === 'native',
'aria-required': isRequired && validationBehavior === 'aria' || undefined,
'aria-invalid': isInvalid || undefined,
'aria-errormessage': props['aria-errormessage'],
'aria-activedescendant': props['aria-activedescendant'],
'aria-autocomplete': props['aria-autocomplete'],
'aria-haspopup': props['aria-haspopup'],
value: value,

@@ -84,0 +84,0 @@ onChange: (e)=>setValue(e.target.value),

{
"name": "@react-aria/textfield",
"version": "3.14.4",
"version": "3.14.5",
"description": "Spectrum UI components in React",

@@ -25,10 +25,10 @@ "license": "Apache-2.0",

"dependencies": {
"@react-aria/focus": "^3.17.0",
"@react-aria/form": "^3.0.4",
"@react-aria/label": "^3.7.7",
"@react-aria/utils": "^3.24.0",
"@react-stately/form": "^3.0.2",
"@react-stately/utils": "^3.10.0",
"@react-types/shared": "^3.23.0",
"@react-types/textfield": "^3.9.2",
"@react-aria/focus": "^3.17.1",
"@react-aria/form": "^3.0.5",
"@react-aria/label": "^3.7.8",
"@react-aria/utils": "^3.24.1",
"@react-stately/form": "^3.0.3",
"@react-stately/utils": "^3.10.1",
"@react-types/shared": "^3.23.1",
"@react-types/textfield": "^3.9.3",
"@swc/helpers": "^0.5.0"

@@ -42,3 +42,3 @@ },

},
"gitHead": "f645f29edc1322153fd60af4640cbcab1d992dbd"
"gitHead": "b77d7d594dff4dcfb5359bffbcfd18142b146433"
}

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