dumi 2.3.0-alpha.3 → 2.3.0-alpha.4
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.
|
@@ -26,9 +26,7 @@ if (typeof window !== 'undefined') {
|
|
|
26
26
|
}
|
|
27
27
|
export var useSiteSearch = function useSiteSearch() {
|
|
28
28
|
var debounceTimer = useRef();
|
|
29
|
-
|
|
30
|
-
// const { demos } = useSiteData();
|
|
31
|
-
var _useState = useState(false),
|
|
29
|
+
var _useState = useState(true),
|
|
32
30
|
_useState2 = _slicedToArray(_useState, 2),
|
|
33
31
|
loading = _useState2[0],
|
|
34
32
|
setLoading = _useState2[1];
|
package/package.json
CHANGED
|
@@ -98,6 +98,15 @@ var SearchResult = function SearchResult(props) {
|
|
|
98
98
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
99
99
|
activeIndex = _useState4[0],
|
|
100
100
|
setActiveIndex = _useState4[1];
|
|
101
|
+
var _useState5 = useState(props.loading),
|
|
102
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
103
|
+
loading = _useState6[0],
|
|
104
|
+
setLoading = _useState6[1];
|
|
105
|
+
useEffect(function () {
|
|
106
|
+
if (!props.loading) {
|
|
107
|
+
setLoading(false);
|
|
108
|
+
}
|
|
109
|
+
}, [props.loading]);
|
|
101
110
|
useEffect(function () {
|
|
102
111
|
var handler = function handler(ev) {
|
|
103
112
|
// TODO: scroll into view for invisible items
|
|
@@ -124,7 +133,7 @@ var SearchResult = function SearchResult(props) {
|
|
|
124
133
|
};
|
|
125
134
|
});
|
|
126
135
|
var returnNode = null;
|
|
127
|
-
if (
|
|
136
|
+
if (loading) {
|
|
128
137
|
returnNode = /*#__PURE__*/React.createElement("div", {
|
|
129
138
|
className: "dumi-default-search-empty"
|
|
130
139
|
}, /*#__PURE__*/React.createElement(IconInbox, null), /*#__PURE__*/React.createElement(FormattedMessage, {
|