@lobehub/ui 1.138.4 → 1.138.5
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/es/SearchBar/index.d.ts +1 -0
- package/es/SearchBar/index.js +5 -3
- package/package.json +1 -1
package/es/SearchBar/index.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ export interface SearchBarProps extends InputProps {
|
|
|
7
7
|
* @default false
|
|
8
8
|
*/
|
|
9
9
|
enableShortKey?: boolean;
|
|
10
|
+
loading?: boolean;
|
|
10
11
|
onInputChange?: (value: string) => void;
|
|
11
12
|
/**
|
|
12
13
|
* @description The shortcut key to focus on the input. Only works if `enableShortKey` is true
|
package/es/SearchBar/index.js
CHANGED
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
4
4
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
5
5
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
6
|
-
var _excluded = ["defaultValue", "spotlight", "className", "value", "onInputChange", "placeholder", "enableShortKey", "shortKey"];
|
|
7
|
-
import { Search } from 'lucide-react';
|
|
6
|
+
var _excluded = ["defaultValue", "spotlight", "className", "value", "onInputChange", "placeholder", "enableShortKey", "shortKey", "loading"];
|
|
7
|
+
import { LucideLoader2, Search } from 'lucide-react';
|
|
8
8
|
import { memo, useEffect, useRef, useState } from 'react';
|
|
9
9
|
import useControlledState from 'use-merge-value';
|
|
10
10
|
import Icon from "../Icon";
|
|
@@ -24,6 +24,7 @@ var SearchBar = /*#__PURE__*/memo(function (_ref) {
|
|
|
24
24
|
enableShortKey = _ref.enableShortKey,
|
|
25
25
|
_ref$shortKey = _ref.shortKey,
|
|
26
26
|
shortKey = _ref$shortKey === void 0 ? 'f' : _ref$shortKey,
|
|
27
|
+
loading = _ref.loading,
|
|
27
28
|
properties = _objectWithoutProperties(_ref, _excluded);
|
|
28
29
|
var _useControlledState = useControlledState(defaultValue, {
|
|
29
30
|
defaultValue: defaultValue,
|
|
@@ -82,8 +83,9 @@ var SearchBar = /*#__PURE__*/memo(function (_ref) {
|
|
|
82
83
|
placeholder: placeholder !== null && placeholder !== void 0 ? placeholder : 'Type keywords...',
|
|
83
84
|
prefix: /*#__PURE__*/_jsx(Icon, {
|
|
84
85
|
className: styles.icon,
|
|
85
|
-
icon: Search,
|
|
86
|
+
icon: loading ? LucideLoader2 : Search,
|
|
86
87
|
size: "small",
|
|
88
|
+
spin: loading,
|
|
87
89
|
style: {
|
|
88
90
|
marginRight: 4
|
|
89
91
|
}
|