@codeleap/web 3.10.5 → 3.10.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codeleap/web",
3
- "version": "3.10.5",
3
+ "version": "3.10.6",
4
4
  "main": "src/index.ts",
5
5
  "repository": {
6
6
  "url": "https://github.com/codeleap-uk/internal-libs-monorepo.git",
@@ -14,6 +14,7 @@ export type SearchInputProps = {
14
14
  onTypingChange?: (isTyping: boolean) => void
15
15
  onValueChange?: (search: string) => void
16
16
  onClear?: AnyFunction
17
+ defaultValue?: string
17
18
  } & Partial<TextInputProps>
18
19
 
19
20
  export const SearchInput: ComponentWithDefaultProps<SearchInputProps> = (props) => {
@@ -29,6 +30,7 @@ export const SearchInput: ComponentWithDefaultProps<SearchInputProps> = (props)
29
30
  debounce,
30
31
  value,
31
32
  onValueChange,
33
+ defaultValue,
32
34
  ...rest
33
35
  } = {
34
36
  ...SearchInput.defaultProps,
@@ -37,7 +39,7 @@ export const SearchInput: ComponentWithDefaultProps<SearchInputProps> = (props)
37
39
 
38
40
  const hasStateProps = !TypeGuards.isNil(value) && TypeGuards.isFunction(onValueChange)
39
41
 
40
- const [search, setSearch] = hasStateProps ? [value, onValueChange] : useState('')
42
+ const [search, setSearch] = hasStateProps ? [value, onValueChange] : useState(defaultValue)
41
43
  const setSearchTimeout = React.useRef<NodeJS.Timeout | null>(null)
42
44
 
43
45
  const handleChangeSearch = (value: string) => {