utopia-ui 3.0.0-alpha.203 → 3.0.0-alpha.204
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
CHANGED
@@ -789,6 +789,7 @@ function HeaderView(_a) {
|
|
789
789
|
var title = itemNameField ? getValue(item, itemNameField) : ((_e = item.layer) === null || _e === void 0 ? void 0 : _e.itemNameField) && item && getValue(item, (_f = item.layer) === null || _f === void 0 ? void 0 : _f.itemNameField);
|
790
790
|
var subtitle = itemSubnameField ? getValue(item, itemSubnameField) : ((_g = item.layer) === null || _g === void 0 ? void 0 : _g.itemSubnameField) && item && getValue(item, (_h = item.layer) === null || _h === void 0 ? void 0 : _h.itemSubnameField);
|
791
791
|
var _t = React.useState(""), address = _t[0]; _t[1];
|
792
|
+
var params = new URLSearchParams(window.location.search);
|
792
793
|
var openDeleteModal = function (event) { return __awaiter(_this, void 0, void 0, function () {
|
793
794
|
return __generator(this, function (_a) {
|
794
795
|
setModalOpen(true);
|
@@ -799,7 +800,7 @@ function HeaderView(_a) {
|
|
799
800
|
return (jsxs(Fragment, { children: [jsxs("div", __assign({ className: 'tw-flex tw-flex-row' }, { children: [jsx("div", __assign({ className: "tw-grow tw-max-w-[calc(100%-60px)] }" }, { children: jsxs("div", __assign({ className: "flex items-center" }, { children: [avatar && (jsx("div", __assign({ className: "tw-avatar" }, { children: jsx("div", __assign({ className: "".concat(big ? "tw-w-20" : "tw-w-10", " tw-inline tw-items-center tw-justify-center overflow-hidden") }, { children: jsx("img", { className: "tw-w-full tw-h-full tw-object-cover tw-rounded-full", src: avatar, alt: item.name + " logo" }) })) }))), jsxs("div", __assign({ className: "".concat(avatar ? "tw-ml-2" : "", " tw-overflow-hidden") }, { children: [jsx("div", __assign({ className: "".concat(big ? "xl:tw-text-3xl tw-text-2xl" : "tw-text-xl", " tw-font-semibold tw-truncate") }, { children: title })), showAddress && address && !hideSubname && jsx("div", __assign({ className: "tw-text-xs tw-text-gray-500 ".concat(truncateSubname && "tw-truncate") }, { children: address })), subtitle && !hideSubname && jsx("div", __assign({ className: "tw-text-xs tw-text-gray-500 ".concat(truncateSubname && "tw-truncate") }, { children: subtitle }))] }))] })) })), jsx("div", __assign({ onClick: function (e) { return e.stopPropagation(); }, className: "".concat(big ? "tw-mt-5" : "tw-mt-1") }, { children: ((api === null || api === void 0 ? void 0 : api.deleteItem) || ((_k = (_j = item.layer) === null || _j === void 0 ? void 0 : _j.api) === null || _k === void 0 ? void 0 : _k.updateItem))
|
800
801
|
&& (hasUserPermission(api === null || api === void 0 ? void 0 : api.collectionName, "delete", item) || hasUserPermission(api === null || api === void 0 ? void 0 : api.collectionName, "update", item))
|
801
802
|
&& !hideMenu &&
|
802
|
-
jsxs("div", __assign({ className: "tw-dropdown tw-dropdown-bottom" }, { children: [jsx("label", __assign({ tabIndex: 0, className: "tw-bg-base-100 tw-btn tw-m-1 tw-leading-3 tw-border-none tw-min-h-0 tw-h-6" }, { children: jsx("svg", __assign({ xmlns: "http://www.w3.org/2000/svg", className: "tw-h-5 tw-w-5", viewBox: "0 0 20 20", fill: "currentColor" }, { children: jsx("path", { d: "M10 6a2 2 0 110-4 2 2 0 010 4zM10 12a2 2 0 110-4 2 2 0 010 4zM10 18a2 2 0 110-4 2 2 0 010 4z" }) })) })), jsxs("ul", __assign({ tabIndex: 0, className: "tw-dropdown-content tw-menu tw-p-2 tw-shadow tw-bg-base-100 tw-rounded-box tw-z-1000" }, { children: [(((api === null || api === void 0 ? void 0 : api.updateItem) && hasUserPermission(api.collectionName, "update", item)) || ((_l = item.layer) === null || _l === void 0 ? void 0 : _l.customEditLink)) && editCallback && jsx("li", { children: jsx("a", __assign({ className: "!tw-text-base-content tw-cursor-pointer", onClick: function (e) { var _a; return ((_a = item.layer) === null || _a === void 0 ? void 0 : _a.customEditLink) ? navigate("".concat(item.layer.customEditLink).concat(item.layer.customEditParameter ? "/"
|
803
|
+
jsxs("div", __assign({ className: "tw-dropdown tw-dropdown-bottom" }, { children: [jsx("label", __assign({ tabIndex: 0, className: "tw-bg-base-100 tw-btn tw-m-1 tw-leading-3 tw-border-none tw-min-h-0 tw-h-6" }, { children: jsx("svg", __assign({ xmlns: "http://www.w3.org/2000/svg", className: "tw-h-5 tw-w-5", viewBox: "0 0 20 20", fill: "currentColor" }, { children: jsx("path", { d: "M10 6a2 2 0 110-4 2 2 0 010 4zM10 12a2 2 0 110-4 2 2 0 010 4zM10 18a2 2 0 110-4 2 2 0 010 4z" }) })) })), jsxs("ul", __assign({ tabIndex: 0, className: "tw-dropdown-content tw-menu tw-p-2 tw-shadow tw-bg-base-100 tw-rounded-box tw-z-1000" }, { children: [(((api === null || api === void 0 ? void 0 : api.updateItem) && hasUserPermission(api.collectionName, "update", item)) || ((_l = item.layer) === null || _l === void 0 ? void 0 : _l.customEditLink)) && editCallback && jsx("li", { children: jsx("a", __assign({ className: "!tw-text-base-content tw-cursor-pointer", onClick: function (e) { var _a; return ((_a = item.layer) === null || _a === void 0 ? void 0 : _a.customEditLink) ? navigate("".concat(item.layer.customEditLink).concat(item.layer.customEditParameter ? "/".concat(getValue(item, item.layer.customEditParameter)).concat(params && "?" + params) : "", " ")) : editCallback(e); } }, { children: jsx("svg", __assign({ xmlns: "http://www.w3.org/2000/svg", className: "tw-h-5 tw-w-5", viewBox: "0 0 20 20", fill: "currentColor" }, { children: jsx("path", { d: "M13.586 3.586a2 2 0 112.828 2.828l-.793.793-2.828-2.828.793-.793zM11.379 5.793L3 14.172V17h2.828l8.38-8.379-2.83-2.828z" }) })) })) }), (((api === null || api === void 0 ? void 0 : api.updateItem) && hasUserPermission(api.collectionName, "update", item))) && setPositionCallback && jsx("li", { children: jsx("a", __assign({ className: "!tw-text-base-content tw-cursor-pointer", onClick: setPositionCallback }, { children: jsx("svg", __assign({ stroke: "currentColor", fill: "currentColor", strokeWidth: "0", viewBox: "0 0 512 512", className: "tw-w-5 tw-h-5", xmlns: "http://www.w3.org/2000/svg" }, { children: jsx("path", { d: "M256 0c17.7 0 32 14.3 32 32V42.4c93.7 13.9 167.7 88 181.6 181.6H480c17.7 0 32 14.3 32 32s-14.3 32-32 32H469.6c-13.9 93.7-88 167.7-181.6 181.6V480c0 17.7-14.3 32-32 32s-32-14.3-32-32V469.6C130.3 455.7 56.3 381.7 42.4 288H32c-17.7 0-32-14.3-32-32s14.3-32 32-32H42.4C56.3 130.3 130.3 56.3 224 42.4V32c0-17.7 14.3-32 32-32zM107.4 288c12.5 58.3 58.4 104.1 116.6 116.6V384c0-17.7 14.3-32 32-32s32 14.3 32 32v20.6c58.3-12.5 104.1-58.4 116.6-116.6H384c-17.7 0-32-14.3-32-32s14.3-32 32-32h20.6C392.1 165.7 346.3 119.9 288 107.4V128c0 17.7-14.3 32-32 32s-32-14.3-32-32V107.4C165.7 119.9 119.9 165.7 107.4 224H128c17.7 0 32 14.3 32 32s-14.3 32-32 32H107.4zM256 224a32 32 0 1 1 0 64 32 32 0 1 1 0-64z" }) })) })) }), (api === null || api === void 0 ? void 0 : api.deleteItem) && hasUserPermission(api.collectionName, "delete", item) && deleteCallback && jsx("li", { children: jsx("a", __assign({ className: 'tw-cursor-pointer !tw-text-error', onClick: openDeleteModal }, { children: loading ? jsx("span", { className: "tw-loading tw-loading-spinner tw-loading-sm" })
|
803
804
|
:
|
804
805
|
jsx("svg", __assign({ xmlns: "http://www.w3.org/2000/svg", className: "tw-h-5 tw-w-5", viewBox: "0 0 20 20", fill: "currentColor" }, { children: jsx("path", { fillRule: "evenodd", d: "M9 2a1 1 0 00-.894.553L7.382 4H4a1 1 0 000 2v10a2 2 0 002 2h8a2 2 0 002-2V6a1 1 0 100-2h-3.382l-.724-1.447A1 1 0 0011 2H9zM7 8a1 1 0 012 0v6a1 1 0 11-2 0V8zm5-1a1 1 0 00-1 1v6a1 1 0 102 0V8a1 1 0 00-1-1z", clipRule: "evenodd" }) })) })) })] }))] })) }))] })), jsx(DialogModal, __assign({ isOpened: modalOpen, title: "Are you sure?", showCloseButton: false, onClose: function () { return (setModalOpen(false)); } }, { children: jsxs("div", __assign({ onClick: function (e) { return e.stopPropagation(); } }, { children: [jsxs("span", { children: ["Do you want to delete ", jsx("b", { children: item.name }), "?"] }), jsx("div", __assign({ className: "tw-grid" }, { children: jsxs("div", __assign({ className: "tw-flex tw-justify-between" }, { children: [jsx("label", __assign({ className: "tw-btn tw-mt-4 tw-btn-error", onClick: function (e) { deleteCallback(e); setModalOpen(false); } }, { children: "Yes" })), jsx("label", __assign({ className: "tw-btn tw-mt-4", onClick: function () { return setModalOpen(false); } }, { children: "No" }))] })) }))] })) }))] }));
|
805
806
|
}
|
@@ -5121,7 +5122,7 @@ function OverlayItemProfile(_a) {
|
|
5121
5122
|
setTemplate(((_a = item.layer) === null || _a === void 0 ? void 0 : _a.itemType.template) || userType);
|
5122
5123
|
}, [userType, item]);
|
5123
5124
|
return (jsx(Fragment, { children: item &&
|
5124
|
-
jsx(MapOverlayPage, __assign({ className: "".concat(template == "onepager" && '!tw-p-0', " tw-mx-4 tw-mt-4 tw-max-h-[calc(100dvh-96px)] tw-h-[calc(100dvh-96px)] md:tw-w-[calc(50%-32px)] tw-w-[calc(100%-32px)] tw-min-w-80 tw-max-w-3xl !tw-left-0 sm:!tw-left-auto tw-top-0 tw-bottom-0 tw-transition-opacity tw-duration-500 ").concat(!selectPosition ? 'tw-opacity-100 tw-pointer-events-auto' : 'tw-opacity-0 tw-pointer-events-none') }, { children: jsxs(Fragment, { children: [jsxs("div", __assign({ className: "".concat(template == "onepager" && "tw-px-6 tw-pt-6") }, { children: [jsx(HeaderView, { api: (_b = item.layer) === null || _b === void 0 ? void 0 : _b.api, item: item, deleteCallback: handleDelete, editCallback: function () { return navigate("/edit-item/" + item.id); }, setPositionCallback: function () { map.closePopup(); setSelectPosition(item); navigate("/"); }, big: true, truncateSubname: false }), template == "onepager" && jsx(SubHeader, { type: groupTypeText, status: item.status, url:
|
5125
|
+
jsx(MapOverlayPage, __assign({ className: "".concat(template == "onepager" && '!tw-p-0', " tw-mx-4 tw-mt-4 tw-max-h-[calc(100dvh-96px)] tw-h-[calc(100dvh-96px)] md:tw-w-[calc(50%-32px)] tw-w-[calc(100%-32px)] tw-min-w-80 tw-max-w-3xl !tw-left-0 sm:!tw-left-auto tw-top-0 tw-bottom-0 tw-transition-opacity tw-duration-500 ").concat(!selectPosition ? 'tw-opacity-100 tw-pointer-events-auto' : 'tw-opacity-0 tw-pointer-events-none') }, { children: jsxs(Fragment, { children: [jsxs("div", __assign({ className: "".concat(template == "onepager" && "tw-px-6 tw-pt-6") }, { children: [jsx(HeaderView, { api: (_b = item.layer) === null || _b === void 0 ? void 0 : _b.api, item: item, deleteCallback: handleDelete, editCallback: function () { return navigate("/edit-item/" + item.id); }, setPositionCallback: function () { map.closePopup(); setSelectPosition(item); navigate("/"); }, big: true, truncateSubname: false }), template == "onepager" && jsx(SubHeader, { type: groupTypeText, status: item.status, url: "https://www.wuerdekompass.org/aktivitaeten/gruppensuche/#/gruppe/".concat(item.slug), title: item.name })] })), template == "onepager" &&
|
5125
5126
|
jsxs("div", __assign({ className: 'tw-h-full tw-overflow-y-auto fade' }, { children: [item.user_created.first_name && (jsx(ContactInfo, { link: "/item/".concat(profile === null || profile === void 0 ? void 0 : profile.id), name: (profile === null || profile === void 0 ? void 0 : profile.name) ? profile.name : item.user_created.first_name, avatar: (profile === null || profile === void 0 ? void 0 : profile.image) ? profile.image : item.user_created.avatar, email: item.contact, telephone: item.telephone })), jsx("div", __assign({ className: "tw-my-10 tw-mt-2 tw-px-6 tw-text-sm tw-text-gray-600" }, { children: jsx(TextView, { rawText: item.text || 'Keine Beschreibung vorhanden' }) })), item.next_appointment && (jsxs("div", __assign({ className: "tw-my-10 tw-px-6" }, { children: [jsx("h2", __assign({ className: "tw-text-lg tw-font-semibold" }, { children: "N\u00E4chste Termine" })), jsx("div", __assign({ className: "tw-mt-2 tw-text-sm tw-text-gray-600" }, { children: jsx(TextView, { rawText: item.next_appointment }) }))] }))), ";"] })), template == "simple" &&
|
5126
5127
|
jsx("div", __assign({ className: 'tw-mt-8 tw-h-full tw-overflow-y-auto fade' }, { children: jsx(TextView, { item: item }) })), template == "tabs" &&
|
5127
5128
|
jsxs("div", __assign({ role: "tablist", className: "tw-tabs tw-tabs-lifted tw-mt-2 tw-mb-2" }, { children: [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": "Info", checked: activeTab == 1 && true, onChange: function () { return updateActiveTab(1); } }), jsxs("div", __assign({ 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-4 tw-mb-4 tw-overflow-x-hidden" }, { children: [((_c = item.layer) === null || _c === void 0 ? void 0 : _c.itemType.show_start_end) &&
|
@@ -5327,7 +5328,7 @@ function OverlayItemProfileSettings(_a) {
|
|
5327
5328
|
.then(function () { return item && updateItem(__assign(__assign({}, item), changedItem)); })
|
5328
5329
|
.then(function () {
|
5329
5330
|
setLoading(false);
|
5330
|
-
navigate("/item/"
|
5331
|
+
navigate("/item/".concat(item.id).concat(params && "?" + params));
|
5331
5332
|
});
|
5332
5333
|
}
|
5333
5334
|
else {
|
@@ -5344,7 +5345,7 @@ function OverlayItemProfileSettings(_a) {
|
|
5344
5345
|
.then(function () { var _a; return item && addItem(__assign(__assign(__assign({}, item), changedItem), { layer: item.layer, user_created: user, type: (_a = item.layer) === null || _a === void 0 ? void 0 : _a.itemType })); })
|
5345
5346
|
.then(function () {
|
5346
5347
|
setLoading(false);
|
5347
|
-
navigate("/");
|
5348
|
+
navigate("/".concat(params && "?" + params));
|
5348
5349
|
});
|
5349
5350
|
}
|
5350
5351
|
return [2 /*return*/];
|
@@ -5419,6 +5420,7 @@ function OverlayItemProfileSettings(_a) {
|
|
5419
5420
|
var _a;
|
5420
5421
|
setTemplate(((_a = item.layer) === null || _a === void 0 ? void 0 : _a.itemType.template) || userType);
|
5421
5422
|
}, [userType, item]);
|
5423
|
+
var params = new URLSearchParams(window.location.search);
|
5422
5424
|
return (jsx(Fragment, { children: jsx(MapOverlayPage, __assign({ backdrop: true, className: 'tw-mx-4 tw-mt-4 tw-mb-12 tw-overflow-x-hidden tw-max-h-[calc(100dvh-96px)] !tw-h-[calc(100dvh-96px)] tw-w-[calc(100%-32px)] md:tw-w-[calc(50%-32px)] tw-max-w-3xl !tw-left-auto tw-top-0 tw-bottom-0' }, { children: jsxs("div", __assign({ className: 'tw-flex tw-flex-col tw-h-full' }, { children: [jsxs("div", __assign({ className: "tw-flex" }, { children: [jsx(AvatarWidget, { avatar: image, setAvatar: setImage }), jsx(ColorPicker, { color: color, onChange: setColor, className: "-tw-left-6 tw-top-14 -tw-mr-6" }), jsxs("div", __assign({ className: 'tw-grow tw-mr-4' }, { children: [jsx(TextInput, { placeholder: "Name", defaultValue: (item === null || item === void 0 ? void 0 : item.name) ? item.name : "", updateFormValue: function (v) { return setName(v); }, containerStyle: 'tw-grow tw-input-md' }), jsx(TextInput, { placeholder: "Subtitle", defaultValue: (item === null || item === void 0 ? void 0 : item.subname) ? item.subname : "", updateFormValue: function (v) { return setSubname(v); }, containerStyle: 'tw-grow tw-input-sm tw-px-4 tw-mt-1' })] }))] })), template == "onepager" && (jsxs("div", __assign({ className: "tw-space-y-6 tw-mt-6" }, { children: [jsxs("div", __assign({ className: "tw-grid tw-grid-cols-1 md:tw-grid-cols-2 tw-gap-6" }, { children: [jsxs("div", { children: [jsx("label", __assign({ htmlFor: "groupType", className: "tw-block tw-text-sm tw-font-medium tw-text-gray-700 tw-mb-1" }, { children: "Gruppenart:" })), jsx(ComboBoxInput, { id: "groupType", options: typeMapping, value: groupType, onValueChange: function (v) { return setGroupType(v); } })] }), jsxs("div", { children: [jsx("label", __assign({ htmlFor: "status", className: "tw-block tw-text-sm tw-font-medium tw-text-gray-700 tw-mb-1" }, { children: "Gruppenstatus:" })), jsx(ComboBoxInput, { id: "status", options: statusMapping, value: status, onValueChange: function (v) { return setStatus(v); } })] })] })), jsxs("div", { children: [jsx("label", __assign({ htmlFor: "email", className: "tw-block tw-text-sm tw-font-medium tw-text-gray-700 tw-mb-1" }, { children: "Email-Adresse (Kontakt):" })), jsx(TextInput, { placeholder: "Email", defaultValue: contact, updateFormValue: function (v) { return setContact(v); } })] }), jsxs("div", { children: [jsx("label", __assign({ htmlFor: "telephone", className: "tw-block tw-text-sm tw-font-medium tw-text-gray-700 tw-mb-1" }, { children: "Telefonnummer (Kontakt):" })), jsx(TextInput, { placeholder: "Telefonnummer", defaultValue: telephone, updateFormValue: function (v) { return setTelephone(v); } })] }), jsxs("div", { children: [jsx("label", __assign({ htmlFor: "nextAppointment", className: "tw-block tw-text-sm tw-font-medium tw-text-gray-700 tw-mb-1" }, { children: "N\u00E4chste Termine:" })), jsx(TextAreaInput, { placeholder: "N\u00E4chste Termine", defaultValue: nextAppointment, updateFormValue: function (v) { return setNextAppointment(v); }, inputStyle: "tw-h-24" })] }), jsxs("div", { children: [jsx("label", __assign({ htmlFor: "description", className: "tw-block tw-text-sm tw-font-medium tw-text-gray-700 tw-mb-1" }, { children: "Gruppenbeschreibung:" })), jsx(TextAreaInput, { placeholder: "Beschreibung", defaultValue: (_b = item === null || item === void 0 ? void 0 : item.text) !== null && _b !== void 0 ? _b : "", updateFormValue: function (v) { return setText(v); }, inputStyle: "tw-h-48" })] })] }))), template == "simple" &&
|
5423
5425
|
jsx(TextAreaInput, { placeholder: "About me ...", defaultValue: (item === null || item === void 0 ? void 0 : item.text) ? item.text : "", updateFormValue: function (v) { console.log(v); setText(v); }, containerStyle: 'tw-mt-8 tw-h-full', inputStyle: 'tw-h-full' }), template == "tabs" &&
|
5424
5426
|
jsxs("div", __assign({ role: "tablist", className: "tw-tabs tw-tabs-lifted tw-mt-4" }, { children: [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": "Info", checked: activeTab == 1 && true, onChange: function () { return updateActiveTab(1); } }), jsx("div", __assign({ role: "tabpanel", className: "tw-tab-content tw-bg-base-100 tw-border-[var(--fallback-bc,oklch(var(--bc)/0.2))] tw-rounded-box tw-h-[calc(100dvh-332px)] tw-min-h-56 tw-border-none" }, { children: jsx(TextAreaInput, { placeholder: "About me ...", defaultValue: (item === null || item === void 0 ? void 0 : item.text) ? item.text : "", updateFormValue: function (v) { console.log(v); setText(v); }, containerStyle: 'tw-h-full', inputStyle: 'tw-h-full tw-border-t-0 tw-rounded-tl-none' }) })), ((_c = item.layer) === null || _c === void 0 ? void 0 : _c.itemType.offers_and_needs) &&
|