utopia-ui 3.0.0-alpha.53 → 3.0.0-alpha.54
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/dist/index.js +11 -9
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
@@ -673,7 +673,6 @@ function AddButton(_a) {
|
|
673
673
|
var setSelectNewItemPosition = _a.setSelectNewItemPosition;
|
674
674
|
var layers = useLayers();
|
675
675
|
var hasUserPermission = useHasUserPermission();
|
676
|
-
useAuth().user;
|
677
676
|
var canAddItems = function () {
|
678
677
|
var canAdd = false;
|
679
678
|
layers.map(function (layer) {
|
@@ -2279,18 +2278,19 @@ var SearchControl = function (_a) {
|
|
2279
2278
|
}));
|
2280
2279
|
setTagsResults(tags.filter(function (tag) { var _a; return (_a = tag.id) === null || _a === void 0 ? void 0 : _a.toLowerCase().includes(value.toLowerCase()); }));
|
2281
2280
|
}, 500, [value]);
|
2281
|
+
var hide = function () { return __awaiter(void 0, void 0, void 0, function () {
|
2282
|
+
return __generator(this, function (_a) {
|
2283
|
+
setTimeout(function () {
|
2284
|
+
setHideSuggestions(true);
|
2285
|
+
}, 200);
|
2286
|
+
return [2 /*return*/];
|
2287
|
+
});
|
2288
|
+
}); };
|
2282
2289
|
var searchInput = useRef(null);
|
2283
2290
|
return (React.createElement(React.Fragment, null, !(windowDimensions.height < 500 && popupOpen) &&
|
2284
2291
|
React.createElement("div", { className: 'tw-w-[calc(100vw-2rem)] tw-max-w-[22rem] ' },
|
2285
2292
|
React.createElement("div", { className: 'flex tw-flex-row' },
|
2286
|
-
React.createElement("input", { type: "text", placeholder: "search ...", autoComplete: "off", value: value, className: "tw-input tw-input-bordered tw-w-full tw-shadow-xl tw-rounded-lg tw-mr-2", ref: searchInput, onChange: function (e) { return setValue(e.target.value); }, onFocus: function () { return setHideSuggestions(false); }, onBlur: function () { return
|
2287
|
-
return __generator(this, function (_a) {
|
2288
|
-
setTimeout(function () {
|
2289
|
-
setHideSuggestions(true);
|
2290
|
-
}, 200);
|
2291
|
-
return [2 /*return*/];
|
2292
|
-
});
|
2293
|
-
}); } }),
|
2293
|
+
React.createElement("input", { type: "text", placeholder: "search ...", autoComplete: "off", value: value, className: "tw-input tw-input-bordered tw-w-full tw-shadow-xl tw-rounded-lg tw-mr-2", ref: searchInput, onChange: function (e) { return setValue(e.target.value); }, onFocus: function () { return setHideSuggestions(false); }, onBlur: function () { return hide(); } }),
|
2294
2294
|
React.createElement(LocateControl, null)),
|
2295
2295
|
value.length > 0 && React.createElement("button", { className: "tw-btn tw-btn-sm tw-btn-circle tw-absolute tw-right-16 tw-top-2", onClick: function () { return setValue(""); } }, "\u2715"),
|
2296
2296
|
hideSuggestions || Array.from(geoResults).length == 0 && itemsResults.length == 0 && tagsResults.length == 0 && !isGeoCoordinate(value) || value.length == 0 ? "" :
|
@@ -2310,10 +2310,12 @@ var SearchControl = function (_a) {
|
|
2310
2310
|
if (filterTags.length > 0) {
|
2311
2311
|
marker !== null && window.history.pushState({}, "", "/".concat(item.layer.name, "/").concat(item.id));
|
2312
2312
|
resetFilterTags();
|
2313
|
+
hide();
|
2313
2314
|
}
|
2314
2315
|
else {
|
2315
2316
|
marker !== null && ((_b = clusterRef === null || clusterRef === void 0 ? void 0 : clusterRef.current) === null || _b === void 0 ? void 0 : _b.zoomToShowLayer(marker, function () {
|
2316
2317
|
marker === null || marker === void 0 ? void 0 : marker.openPopup();
|
2318
|
+
hide();
|
2317
2319
|
}));
|
2318
2320
|
}
|
2319
2321
|
} },
|