utopia-ui 3.0.0-alpha.110 → 3.0.0-alpha.111
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 +12 -11
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2685,8 +2685,8 @@ var SearchControl = function () {
|
|
|
2685
2685
|
var items = useItems();
|
|
2686
2686
|
var leafletRefs = useLeafletRefs();
|
|
2687
2687
|
var addFilterTag = useAddFilterTag();
|
|
2688
|
-
useResetFilterTags();
|
|
2689
|
-
useFilterTags();
|
|
2688
|
+
var resetFilterTags = useResetFilterTags();
|
|
2689
|
+
var filterTags = useFilterTags();
|
|
2690
2690
|
useClusterRef();
|
|
2691
2691
|
useMapEvents({
|
|
2692
2692
|
popupopen: function () {
|
|
@@ -2754,7 +2754,8 @@ var SearchControl = function () {
|
|
|
2754
2754
|
} }, { children: jsxs("b", { children: ["#", decodeTag(tag.name)] }) }), tag.name)); }) })), itemsResults.length > 0 && tagsResults.length > 0 && jsx("hr", { className: 'tw-opacity-50' }), itemsResults.slice(0, 5).map(function (item) { return (jsx("div", __assign({ className: 'tw-cursor-pointer hover:tw-font-bold', onClick: function () {
|
|
2755
2755
|
var _a;
|
|
2756
2756
|
var marker = (_a = Object.entries(leafletRefs).find(function (r) { return r[1].item == item; })) === null || _a === void 0 ? void 0 : _a[1].marker;
|
|
2757
|
-
|
|
2757
|
+
resetFilterTags();
|
|
2758
|
+
if (marker && filterTags.length == 0) {
|
|
2758
2759
|
navigate("/".concat(item.layer.name, "/").concat(item.id));
|
|
2759
2760
|
}
|
|
2760
2761
|
else {
|
|
@@ -4447,7 +4448,6 @@ function OverlayItemProfile() {
|
|
|
4447
4448
|
var updateItem = useUpdateItem();
|
|
4448
4449
|
var _g = useState({}), item = _g[0], setItem = _g[1];
|
|
4449
4450
|
var map = useMap();
|
|
4450
|
-
useWindowDimensions();
|
|
4451
4451
|
var layers = useLayers();
|
|
4452
4452
|
var selectPosition = useSelectPosition();
|
|
4453
4453
|
var removeItem = useRemoveItem();
|
|
@@ -4455,7 +4455,7 @@ function OverlayItemProfile() {
|
|
|
4455
4455
|
var navigate = useNavigate();
|
|
4456
4456
|
var addTag = useAddTag();
|
|
4457
4457
|
var resetFilterTags = useResetFilterTags();
|
|
4458
|
-
|
|
4458
|
+
useFilterTags();
|
|
4459
4459
|
var addItem = useAddItem();
|
|
4460
4460
|
var user = useAuth().user;
|
|
4461
4461
|
var hasUserPermission = useHasUserPermission();
|
|
@@ -4479,12 +4479,13 @@ function OverlayItemProfile() {
|
|
|
4479
4479
|
window.history.pushState('', '', "?" + params.toString());
|
|
4480
4480
|
};
|
|
4481
4481
|
useEffect(function () {
|
|
4482
|
-
var _a, _b;
|
|
4483
4482
|
var itemId = location.pathname.split("/")[2];
|
|
4484
4483
|
var item = items.find(function (i) { return i.id === itemId; });
|
|
4485
4484
|
item && setItem(item);
|
|
4486
|
-
|
|
4487
|
-
|
|
4485
|
+
}, [items, location]);
|
|
4486
|
+
useEffect(function () {
|
|
4487
|
+
var _a, _b;
|
|
4488
|
+
if (item) {
|
|
4488
4489
|
if (item.position) {
|
|
4489
4490
|
var marker = (_a = Object.entries(leafletRefs).find(function (r) { return r[1].item == item; })) === null || _a === void 0 ? void 0 : _a[1].marker;
|
|
4490
4491
|
marker && (clusterRef === null || clusterRef === void 0 ? void 0 : clusterRef.zoomToShowLayer(marker, function () {
|
|
@@ -4505,7 +4506,7 @@ function OverlayItemProfile() {
|
|
|
4505
4506
|
}));
|
|
4506
4507
|
}
|
|
4507
4508
|
}
|
|
4508
|
-
}, [
|
|
4509
|
+
}, [item]);
|
|
4509
4510
|
useEffect(function () {
|
|
4510
4511
|
var params = new URLSearchParams(location.search);
|
|
4511
4512
|
var urlTab = params.get("tab");
|
|
@@ -4518,7 +4519,7 @@ function OverlayItemProfile() {
|
|
|
4518
4519
|
var item = items.find(function (i) { return i.id == r.related_items_id; });
|
|
4519
4520
|
item && setRelations(function (current) { return __spreadArray(__spreadArray([], current, true), [item], false); });
|
|
4520
4521
|
});
|
|
4521
|
-
}, [item
|
|
4522
|
+
}, [item]);
|
|
4522
4523
|
useEffect(function () {
|
|
4523
4524
|
item && item.user_created && hasUserPermission("items", "update", item) && setUpdatePermission(true);
|
|
4524
4525
|
}, [item]);
|
|
@@ -4691,7 +4692,7 @@ function OverlayItemProfile() {
|
|
|
4691
4692
|
}), addItemPopupType == "event" ?
|
|
4692
4693
|
jsx("form", __assign({ autoComplete: 'off', onSubmit: function (e) { return submitNewItem(e, addItemPopupType); } }, { children: jsxs("div", __assign({ className: 'tw-cursor-pointer tw-card tw-border-[1px] tw-border-base-300 tw-card-body tw-shadow-xl tw-bg-base-100 tw-text-base-content tw-mx-4 tw-p-4 tw-mb-4' }, { children: [jsx("label", __assign({ className: "tw-btn tw-btn-sm tw-rounded-2xl tw-btn-circle tw-btn-ghost hover:tw-bg-transparent tw-absolute tw-right-0 tw-top-0 tw-text-gray-600", onClick: function () {
|
|
4693
4694
|
setAddItemPopupType("");
|
|
4694
|
-
} }, { children: jsx("p", __assign({ className: 'tw-text-center ' }, { children: "\u2715" })) })), jsx(TextInput, { type: "text", placeholder: "Name", dataField: "name", defaultValue: "", inputStyle: '' }), jsx(PopupStartEndInput, {}), jsx(TextAreaInput, { placeholder: "Text", dataField: "text", defaultValue: "", inputStyle: 'tw-h-40 tw-mt-5' }), jsx("div", __assign({ className: 'tw-flex tw-justify-center' }, { children: jsx("button", __assign({ className: loading ? 'tw-btn tw-btn-disabled tw-mt-5 tw-place-self-center' : 'tw-btn tw-mt-5 tw-place-self-center', type: 'submit' }, { children: loading ? jsx("span", { className: "tw-loading tw-loading-spinner" }) : 'Save' })) }))] })) })) : jsx(Fragment, {}), updatePermission && jsx(ActionButton, { collection: "items", item: item, existingRelations: relations, itemType: "event", triggerItemSelected: linkItem, triggerAddButton: function () { setAddItemPopupType("event"); scroll(); }, color: item.color })] })) })) })), jsx("input", { type: "radio", name: "my_tabs_2", role: "tab", className: "tw-tab [--tab-border-color:var(--fallback-bc,oklch(var(--bc)/0.2))]", "aria-label": "Friends", checked: activeTab == 4 && true, onChange: function () { return updateActiveTab(4); } }), jsx("div", { role: "tabpanel", className: "tw-tab-content tw-bg-base-100 tw-rounded-box tw-h-[calc(100dvh-280px)] tw-overflow-y-auto fade tw-pt-2 tw-pb-1 tw-overflow-x-hidden" })] })) }))] }) })) }));
|
|
4695
|
+
} }, { children: jsx("p", __assign({ className: 'tw-text-center ' }, { children: "\u2715" })) })), jsx(TextInput, { type: "text", placeholder: "Name", dataField: "name", defaultValue: "", inputStyle: '' }), jsx(PopupStartEndInput, {}), jsx(TextAreaInput, { placeholder: "Text", dataField: "text", defaultValue: "", inputStyle: 'tw-h-40 tw-mt-5' }), jsx("div", __assign({ className: 'tw-flex tw-justify-center' }, { children: jsx("button", __assign({ className: loading ? 'tw-btn tw-btn-disabled tw-mt-5 tw-place-self-center' : 'tw-btn tw-mt-5 tw-place-self-center', type: 'submit' }, { children: loading ? jsx("span", { className: "tw-loading tw-loading-spinner" }) : 'Save' })) }))] })) })) : jsx(Fragment, {}), updatePermission && jsx(ActionButton, { collection: "items", item: item, existingRelations: relations, itemType: "event", triggerItemSelected: linkItem, triggerAddButton: function () { setAddItemPopupType("event"); scroll(); }, color: item.color })] })) })) })), jsx("input", { type: "radio", name: "my_tabs_2", role: "tab", className: "tw-tab [--tab-border-color:var(--fallback-bc,oklch(var(--bc)/0.2))]", "aria-label": "Friends", checked: activeTab == 4 && true, onChange: function () { return updateActiveTab(4); } }), jsx("div", { role: "tabpanel", className: "tw-tab-content tw-bg-base-100 tw-rounded-box tw-h-[calc(100dvh-280px)] tw-overflow-y-auto fade tw-pt-2 tw-pb-1 tw-overflow-x-hidden" })] })) }))] }) }), item.id) }));
|
|
4695
4696
|
}
|
|
4696
4697
|
|
|
4697
4698
|
function OverlayItemProfileSettings() {
|