react-select-search
Advanced tools
Comparing version 4.1.4 to 4.1.5
@@ -281,3 +281,3 @@ var $a9A1a$reactjsxruntime = require("react/jsx-runtime"); | ||
value, | ||
defaultValue | ||
options | ||
]); | ||
@@ -379,6 +379,8 @@ return [ | ||
const $fdefef8b289dc6d0$var$SelectSearch = /*#__PURE__*/ (0, $a9A1a$react.forwardRef)(({ disabled: disabled , placeholder: placeholder , multiple: multiple , search: search , autoFocus: autoFocus , autoComplete: autoComplete , id: id , closeOnSelect: closeOnSelect , className: className , renderValue: renderValue , renderOption: renderOption , renderGroupHeader: renderGroupHeader , fuzzySearch: fuzzySearch , emptyMessage: emptyMessage , ...hookProps }, ref)=>{ | ||
const $fdefef8b289dc6d0$var$SelectSearch = /*#__PURE__*/ (0, $a9A1a$react.forwardRef)(({ disabled: disabled , placeholder: placeholder , multiple: multiple , search: search , autoFocus: autoFocus , autoComplete: autoComplete , id: id , closeOnSelect: closeOnSelect , className: className , renderValue: renderValue , renderOption: renderOption , renderGroupHeader: renderGroupHeader , fuzzySearch: fuzzySearch , emptyMessage: emptyMessage , value: value , ...hookProps }, ref)=>{ | ||
const selectRef = (0, $a9A1a$react.useRef)(null); | ||
const cls = (classNames)=>(0, $801112dfb0745bfa$export$2e2bcd8739ae039)(classNames, className); | ||
const [controlledValue, setControlledValue] = (0, $a9A1a$react.useState)(value); | ||
const [snapshot, valueProps, optionProps] = (0, $4bbd6d22e42ff57c$export$2e2bcd8739ae039)({ | ||
value: controlledValue, | ||
placeholder: placeholder, | ||
@@ -391,3 +393,3 @@ multiple: multiple, | ||
}); | ||
const { highlighted: highlighted , value: value , fetching: fetching , focus: focus } = snapshot; | ||
const { highlighted: highlighted , value: snapValue , fetching: fetching , focus: focus } = snapshot; | ||
const props = { | ||
@@ -402,3 +404,3 @@ ...valueProps, | ||
if (current) { | ||
const val = Array.isArray(value) ? value[0] : value; | ||
const val = Array.isArray(snapValue) ? snapValue[0] : snapValue; | ||
const selected = current.querySelector(highlighted > -1 ? `[data-index="${highlighted}"]` : `[value="${encodeURIComponent(val)}"]`); | ||
@@ -412,6 +414,9 @@ if (selected) { | ||
}, [ | ||
value, | ||
snapValue, | ||
highlighted, | ||
selectRef.current | ||
]); | ||
(0, $a9A1a$react.useEffect)(()=>setControlledValue(value), [ | ||
value | ||
]); | ||
return /*#__PURE__*/ (0, $a9A1a$reactjsxruntime.jsxs)("div", { | ||
@@ -418,0 +423,0 @@ ref: ref, |
import {jsxs as $6XpKT$jsxs, jsx as $6XpKT$jsx} from "react/jsx-runtime"; | ||
import {forwardRef as $6XpKT$forwardRef, useRef as $6XpKT$useRef, useEffect as $6XpKT$useEffect, memo as $6XpKT$memo, useState as $6XpKT$useState} from "react"; | ||
import {forwardRef as $6XpKT$forwardRef, useRef as $6XpKT$useRef, useState as $6XpKT$useState, useEffect as $6XpKT$useEffect, memo as $6XpKT$memo} from "react"; | ||
import "prop-types"; | ||
@@ -270,3 +270,3 @@ | ||
value, | ||
defaultValue | ||
options | ||
]); | ||
@@ -368,6 +368,8 @@ return [ | ||
const $00d3317695af813e$var$SelectSearch = /*#__PURE__*/ (0, $6XpKT$forwardRef)(({ disabled: disabled , placeholder: placeholder , multiple: multiple , search: search , autoFocus: autoFocus , autoComplete: autoComplete , id: id , closeOnSelect: closeOnSelect , className: className , renderValue: renderValue , renderOption: renderOption , renderGroupHeader: renderGroupHeader , fuzzySearch: fuzzySearch , emptyMessage: emptyMessage , ...hookProps }, ref)=>{ | ||
const $00d3317695af813e$var$SelectSearch = /*#__PURE__*/ (0, $6XpKT$forwardRef)(({ disabled: disabled , placeholder: placeholder , multiple: multiple , search: search , autoFocus: autoFocus , autoComplete: autoComplete , id: id , closeOnSelect: closeOnSelect , className: className , renderValue: renderValue , renderOption: renderOption , renderGroupHeader: renderGroupHeader , fuzzySearch: fuzzySearch , emptyMessage: emptyMessage , value: value , ...hookProps }, ref)=>{ | ||
const selectRef = (0, $6XpKT$useRef)(null); | ||
const cls = (classNames)=>(0, $461fda4bde208857$export$2e2bcd8739ae039)(classNames, className); | ||
const [controlledValue, setControlledValue] = (0, $6XpKT$useState)(value); | ||
const [snapshot, valueProps, optionProps] = (0, $0d0f732c1d5a71da$export$2e2bcd8739ae039)({ | ||
value: controlledValue, | ||
placeholder: placeholder, | ||
@@ -380,3 +382,3 @@ multiple: multiple, | ||
}); | ||
const { highlighted: highlighted , value: value , fetching: fetching , focus: focus } = snapshot; | ||
const { highlighted: highlighted , value: snapValue , fetching: fetching , focus: focus } = snapshot; | ||
const props = { | ||
@@ -391,3 +393,3 @@ ...valueProps, | ||
if (current) { | ||
const val = Array.isArray(value) ? value[0] : value; | ||
const val = Array.isArray(snapValue) ? snapValue[0] : snapValue; | ||
const selected = current.querySelector(highlighted > -1 ? `[data-index="${highlighted}"]` : `[value="${encodeURIComponent(val)}"]`); | ||
@@ -401,6 +403,9 @@ if (selected) { | ||
}, [ | ||
value, | ||
snapValue, | ||
highlighted, | ||
selectRef.current | ||
]); | ||
(0, $6XpKT$useEffect)(()=>setControlledValue(value), [ | ||
value | ||
]); | ||
return /*#__PURE__*/ (0, $6XpKT$jsxs)("div", { | ||
@@ -407,0 +412,0 @@ ref: ref, |
{ | ||
"name": "react-select-search", | ||
"version": "4.1.4", | ||
"version": "4.1.5", | ||
"description": "Lightweight select component for React", | ||
@@ -20,3 +20,3 @@ "source": "src/index.js", | ||
"start": "start-storybook -p 6006", | ||
"build": "parcel build", | ||
"build": "parcel build --no-cache", | ||
"storybook": "start-storybook -p 6006", | ||
@@ -23,0 +23,0 @@ "build-storybook": "build-storybook --output-dir public", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
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
140153
1171