Socket
Socket
Sign inDemoInstall

@react-aria/searchfield

Package Overview
Dependencies
Maintainers
2
Versions
743
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@react-aria/searchfield - npm Package Compare versions

Comparing version 3.7.3 to 3.7.4

dist/intlStrings.main.js

185

dist/main.js

@@ -1,38 +0,2 @@

var $bd6662502a469b02$exports = require("./ar-AE.main.js");
var $360cd10b99b1ec90$exports = require("./bg-BG.main.js");
var $ffecf95c9ab0a601$exports = require("./cs-CZ.main.js");
var $a8c1807afa0c6ad0$exports = require("./da-DK.main.js");
var $0e885ea91b94ae2b$exports = require("./de-DE.main.js");
var $a313361aefc92d6a$exports = require("./el-GR.main.js");
var $aca1149af311369c$exports = require("./en-US.main.js");
var $fcf49eac878c2dd4$exports = require("./es-ES.main.js");
var $a4cc5fda0ae4bc39$exports = require("./et-EE.main.js");
var $3490cbf44d66e748$exports = require("./fi-FI.main.js");
var $7139336f2276b57b$exports = require("./fr-FR.main.js");
var $2cfd40eac86ffaf9$exports = require("./he-IL.main.js");
var $ad5cd81fb4b71e02$exports = require("./hr-HR.main.js");
var $efa4f2797ecc2e40$exports = require("./hu-HU.main.js");
var $7d0d440111d7eb6f$exports = require("./it-IT.main.js");
var $15bb9dd1255c87e0$exports = require("./ja-JP.main.js");
var $662038034d042bc2$exports = require("./ko-KR.main.js");
var $469701bdc0ecd008$exports = require("./lt-LT.main.js");
var $bddb04e2df050d62$exports = require("./lv-LV.main.js");
var $a295a578d307d4b5$exports = require("./nb-NO.main.js");
var $e0731003f5c0bbc3$exports = require("./nl-NL.main.js");
var $9acaf16c6e495332$exports = require("./pl-PL.main.js");
var $1087013ecb748501$exports = require("./pt-BR.main.js");
var $71e9e5edc2bbe98a$exports = require("./pt-PT.main.js");
var $a4bd32ef01b4a9e1$exports = require("./ro-RO.main.js");
var $0807874c8146beee$exports = require("./ru-RU.main.js");
var $3ed5a8cd509d389e$exports = require("./sk-SK.main.js");
var $1cc960210efc0d20$exports = require("./sl-SI.main.js");
var $18a26c027bd07b1a$exports = require("./sr-SP.main.js");
var $2ca3577ce1438e9b$exports = require("./sv-SE.main.js");
var $ced44bcac3738390$exports = require("./tr-TR.main.js");
var $abd2f08b465610a9$exports = require("./uk-UA.main.js");
var $becec37c237a6c53$exports = require("./zh-CN.main.js");
var $f7dff162f8d4dac5$exports = require("./zh-TW.main.js");
var $9UOFb$reactariautils = require("@react-aria/utils");
var $9UOFb$reactariai18n = require("@react-aria/i18n");
var $9UOFb$reactariatextfield = require("@react-aria/textfield");
var $ccae92a71d96d51a$exports = require("./useSearchField.main.js");

@@ -44,7 +8,3 @@

function $parcel$interopDefault(a) {
return a && a.__esModule ? a.default : a;
}
$parcel$export(module.exports, "useSearchField", () => $ccae92a71d96d51a$export$9bb30bbe003b82e0);
$parcel$export(module.exports, "useSearchField", () => $ccae92a71d96d51a$exports.useSearchField);
/*

@@ -60,146 +20,5 @@ * Copyright 2020 Adobe. All rights reserved.

* governing permissions and limitations under the License.
*/ /*
* Copyright 2020 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
var $8e80a08ea739bb00$exports = {};
$8e80a08ea739bb00$exports = {
"ar-AE": $bd6662502a469b02$exports,
"bg-BG": $360cd10b99b1ec90$exports,
"cs-CZ": $ffecf95c9ab0a601$exports,
"da-DK": $a8c1807afa0c6ad0$exports,
"de-DE": $0e885ea91b94ae2b$exports,
"el-GR": $a313361aefc92d6a$exports,
"en-US": $aca1149af311369c$exports,
"es-ES": $fcf49eac878c2dd4$exports,
"et-EE": $a4cc5fda0ae4bc39$exports,
"fi-FI": $3490cbf44d66e748$exports,
"fr-FR": $7139336f2276b57b$exports,
"he-IL": $2cfd40eac86ffaf9$exports,
"hr-HR": $ad5cd81fb4b71e02$exports,
"hu-HU": $efa4f2797ecc2e40$exports,
"it-IT": $7d0d440111d7eb6f$exports,
"ja-JP": $15bb9dd1255c87e0$exports,
"ko-KR": $662038034d042bc2$exports,
"lt-LT": $469701bdc0ecd008$exports,
"lv-LV": $bddb04e2df050d62$exports,
"nb-NO": $a295a578d307d4b5$exports,
"nl-NL": $e0731003f5c0bbc3$exports,
"pl-PL": $9acaf16c6e495332$exports,
"pt-BR": $1087013ecb748501$exports,
"pt-PT": $71e9e5edc2bbe98a$exports,
"ro-RO": $a4bd32ef01b4a9e1$exports,
"ru-RU": $0807874c8146beee$exports,
"sk-SK": $3ed5a8cd509d389e$exports,
"sl-SI": $1cc960210efc0d20$exports,
"sr-SP": $18a26c027bd07b1a$exports,
"sv-SE": $2ca3577ce1438e9b$exports,
"tr-TR": $ced44bcac3738390$exports,
"uk-UA": $abd2f08b465610a9$exports,
"zh-CN": $becec37c237a6c53$exports,
"zh-TW": $f7dff162f8d4dac5$exports
};
function $ccae92a71d96d51a$export$9bb30bbe003b82e0(props, state, inputRef) {
let stringFormatter = (0, $9UOFb$reactariai18n.useLocalizedStringFormatter)((0, (/*@__PURE__*/$parcel$interopDefault($8e80a08ea739bb00$exports))), "@react-aria/searchfield");
let { isDisabled: isDisabled, isReadOnly: isReadOnly, onSubmit: onSubmit = ()=>{}, onClear: onClear, type: type = "search" } = props;
let onKeyDown = (e)=>{
const key = e.key;
if (key === "Enter") e.preventDefault();
if (isDisabled || isReadOnly) return;
if (key === "Enter") onSubmit(state.value);
if (key === "Escape") {
if (state.value === "") e.continuePropagation();
else {
state.setValue("");
if (onClear) onClear();
}
}
};
let onClearButtonClick = ()=>{
state.setValue("");
if (onClear) onClear();
};
let onPressStart = ()=>{
var // this is in PressStart for mobile so that touching the clear button doesn't remove focus from
// the input and close the keyboard
_inputRef_current;
(_inputRef_current = inputRef.current) === null || _inputRef_current === void 0 ? void 0 : _inputRef_current.focus();
};
let { labelProps: labelProps, inputProps: inputProps, descriptionProps: descriptionProps, errorMessageProps: errorMessageProps, ...validation } = (0, $9UOFb$reactariatextfield.useTextField)({
...props,
value: state.value,
onChange: state.setValue,
onKeyDown: !isReadOnly ? (0, $9UOFb$reactariautils.chain)(onKeyDown, props.onKeyDown) : props.onKeyDown,
type: type
}, inputRef);
return {
labelProps: labelProps,
inputProps: {
...inputProps,
// already handled by useSearchFieldState
defaultValue: undefined
},
clearButtonProps: {
"aria-label": stringFormatter.format("Clear search"),
excludeFromTabOrder: true,
// @ts-ignore
preventFocusOnPress: true,
isDisabled: isDisabled || isReadOnly,
onPress: onClearButtonClick,
onPressStart: onPressStart
},
descriptionProps: descriptionProps,
errorMessageProps: errorMessageProps,
...validation
};
}
//# sourceMappingURL=main.js.map

@@ -1,43 +0,3 @@

import $03c9a1a10de12f06$exports from "./ar-AE.module.js";
import $4da0c2ffa4ba4159$exports from "./bg-BG.module.js";
import $8c59fd0c2c96821b$exports from "./cs-CZ.module.js";
import $0a371f9c1df8120f$exports from "./da-DK.module.js";
import $67f4d0b0de9f8a52$exports from "./de-DE.module.js";
import $72a312d948f0214b$exports from "./el-GR.module.js";
import $5012d21d933388c1$exports from "./en-US.module.js";
import $0159854399308e2e$exports from "./es-ES.module.js";
import $390613981d970276$exports from "./et-EE.module.js";
import $961ae0833f811705$exports from "./fi-FI.module.js";
import $26d76742decfd829$exports from "./fr-FR.module.js";
import $92ef254c82a5c769$exports from "./he-IL.module.js";
import $e0321b43bdefb8b3$exports from "./hr-HR.module.js";
import $0c1ee0b8d50940d9$exports from "./hu-HU.module.js";
import $b09198915a38946f$exports from "./it-IT.module.js";
import $3a9a3d180c3145c0$exports from "./ja-JP.module.js";
import $b7a611726449f4a3$exports from "./ko-KR.module.js";
import $d9a3d49db610dd5c$exports from "./lt-LT.module.js";
import $3ab64b73ea27c23a$exports from "./lv-LV.module.js";
import $bf5cce1b47d23baf$exports from "./nb-NO.module.js";
import $4e0c9a9a010e4598$exports from "./nl-NL.module.js";
import $63cf4a75ec270508$exports from "./pl-PL.module.js";
import $083b0cad27fdbd06$exports from "./pt-BR.module.js";
import $1b7f0864d830ba6d$exports from "./pt-PT.module.js";
import $d6d2588377fc9718$exports from "./ro-RO.module.js";
import $701c918a4653e946$exports from "./ru-RU.module.js";
import $7cacc29a1e5f4fbe$exports from "./sk-SK.module.js";
import $c63231bcc300d0df$exports from "./sl-SI.module.js";
import $b61510478bc0e6f6$exports from "./sr-SP.module.js";
import $ce325e6dd3f9c37a$exports from "./sv-SE.module.js";
import $1f7e1cf2285af2b2$exports from "./tr-TR.module.js";
import $2d999353ca652e34$exports from "./uk-UA.module.js";
import $117b536bfb1ae554$exports from "./zh-CN.module.js";
import $525f6fa4ac26e278$exports from "./zh-TW.module.js";
import {chain as $2Ol32$chain} from "@react-aria/utils";
import {useLocalizedStringFormatter as $2Ol32$useLocalizedStringFormatter} from "@react-aria/i18n";
import {useTextField as $2Ol32$useTextField} from "@react-aria/textfield";
import {useSearchField as $4d52238874b24f86$export$9bb30bbe003b82e0} from "./useSearchField.module.js";
function $parcel$interopDefault(a) {
return a && a.__esModule ? a.default : a;
}
/*

@@ -53,147 +13,6 @@ * Copyright 2020 Adobe. All rights reserved.

* governing permissions and limitations under the License.
*/ /*
* Copyright 2020 Adobe. All rights reserved.
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. You may obtain a copy
* of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
*/
var $8112f8b883c0272d$exports = {};
$8112f8b883c0272d$exports = {
"ar-AE": $03c9a1a10de12f06$exports,
"bg-BG": $4da0c2ffa4ba4159$exports,
"cs-CZ": $8c59fd0c2c96821b$exports,
"da-DK": $0a371f9c1df8120f$exports,
"de-DE": $67f4d0b0de9f8a52$exports,
"el-GR": $72a312d948f0214b$exports,
"en-US": $5012d21d933388c1$exports,
"es-ES": $0159854399308e2e$exports,
"et-EE": $390613981d970276$exports,
"fi-FI": $961ae0833f811705$exports,
"fr-FR": $26d76742decfd829$exports,
"he-IL": $92ef254c82a5c769$exports,
"hr-HR": $e0321b43bdefb8b3$exports,
"hu-HU": $0c1ee0b8d50940d9$exports,
"it-IT": $b09198915a38946f$exports,
"ja-JP": $3a9a3d180c3145c0$exports,
"ko-KR": $b7a611726449f4a3$exports,
"lt-LT": $d9a3d49db610dd5c$exports,
"lv-LV": $3ab64b73ea27c23a$exports,
"nb-NO": $bf5cce1b47d23baf$exports,
"nl-NL": $4e0c9a9a010e4598$exports,
"pl-PL": $63cf4a75ec270508$exports,
"pt-BR": $083b0cad27fdbd06$exports,
"pt-PT": $1b7f0864d830ba6d$exports,
"ro-RO": $d6d2588377fc9718$exports,
"ru-RU": $701c918a4653e946$exports,
"sk-SK": $7cacc29a1e5f4fbe$exports,
"sl-SI": $c63231bcc300d0df$exports,
"sr-SP": $b61510478bc0e6f6$exports,
"sv-SE": $ce325e6dd3f9c37a$exports,
"tr-TR": $1f7e1cf2285af2b2$exports,
"uk-UA": $2d999353ca652e34$exports,
"zh-CN": $117b536bfb1ae554$exports,
"zh-TW": $525f6fa4ac26e278$exports
};
function $4d52238874b24f86$export$9bb30bbe003b82e0(props, state, inputRef) {
let stringFormatter = (0, $2Ol32$useLocalizedStringFormatter)((0, (/*@__PURE__*/$parcel$interopDefault($8112f8b883c0272d$exports))), "@react-aria/searchfield");
let { isDisabled: isDisabled, isReadOnly: isReadOnly, onSubmit: onSubmit = ()=>{}, onClear: onClear, type: type = "search" } = props;
let onKeyDown = (e)=>{
const key = e.key;
if (key === "Enter") e.preventDefault();
if (isDisabled || isReadOnly) return;
if (key === "Enter") onSubmit(state.value);
if (key === "Escape") {
if (state.value === "") e.continuePropagation();
else {
state.setValue("");
if (onClear) onClear();
}
}
};
let onClearButtonClick = ()=>{
state.setValue("");
if (onClear) onClear();
};
let onPressStart = ()=>{
var // this is in PressStart for mobile so that touching the clear button doesn't remove focus from
// the input and close the keyboard
_inputRef_current;
(_inputRef_current = inputRef.current) === null || _inputRef_current === void 0 ? void 0 : _inputRef_current.focus();
};
let { labelProps: labelProps, inputProps: inputProps, descriptionProps: descriptionProps, errorMessageProps: errorMessageProps, ...validation } = (0, $2Ol32$useTextField)({
...props,
value: state.value,
onChange: state.setValue,
onKeyDown: !isReadOnly ? (0, $2Ol32$chain)(onKeyDown, props.onKeyDown) : props.onKeyDown,
type: type
}, inputRef);
return {
labelProps: labelProps,
inputProps: {
...inputProps,
// already handled by useSearchFieldState
defaultValue: undefined
},
clearButtonProps: {
"aria-label": stringFormatter.format("Clear search"),
excludeFromTabOrder: true,
// @ts-ignore
preventFocusOnPress: true,
isDisabled: isDisabled || isReadOnly,
onPress: onClearButtonClick,
onPressStart: onPressStart
},
descriptionProps: descriptionProps,
errorMessageProps: errorMessageProps,
...validation
};
}
export {$4d52238874b24f86$export$9bb30bbe003b82e0 as useSearchField};
//# sourceMappingURL=module.js.map
{
"name": "@react-aria/searchfield",
"version": "3.7.3",
"version": "3.7.4",
"description": "Spectrum UI components in React",

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

"dependencies": {
"@react-aria/i18n": "^3.10.2",
"@react-aria/textfield": "^3.14.3",
"@react-aria/utils": "^3.23.2",
"@react-stately/searchfield": "^3.5.1",
"@react-types/button": "^3.9.2",
"@react-types/searchfield": "^3.5.3",
"@react-types/shared": "^3.22.1",
"@react-aria/i18n": "^3.11.0",
"@react-aria/textfield": "^3.14.4",
"@react-aria/utils": "^3.24.0",
"@react-stately/searchfield": "^3.5.2",
"@react-types/button": "^3.9.3",
"@react-types/searchfield": "^3.5.4",
"@react-types/shared": "^3.23.0",
"@swc/helpers": "^0.5.0"

@@ -41,3 +41,3 @@ },

},
"gitHead": "de9f84a22583fc741c29b341d14cd35ef4cca161"
"gitHead": "f645f29edc1322153fd60af4640cbcab1d992dbd"
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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