334 lines
32 KiB
JavaScript
334 lines
32 KiB
JavaScript
import { defineComponent, useSSRContext, computed, ref, reactive, createVNode, resolveDynamicComponent } from "vue";
|
||
import { ssrRenderAttrs, ssrRenderClass, ssrIncludeBooleanAttr, ssrInterpolate, ssrRenderList, ssrRenderComponent, ssrRenderVNode, ssrRenderAttr, ssrLooseContain } from "vue/server-renderer";
|
||
import { useRoute, useRouter } from "vue-router";
|
||
import "/app/node_modules/klona/dist/index.mjs";
|
||
import "/app/node_modules/hookable/dist/index.mjs";
|
||
import "../server.mjs";
|
||
import { _ as _export_sfc } from "./_plugin-vue_export-helper-1tPrXgE0.js";
|
||
import "/app/node_modules/ofetch/dist/node.mjs";
|
||
import "#internal/nuxt/paths";
|
||
import "/app/node_modules/unctx/dist/index.mjs";
|
||
import "/app/node_modules/h3/dist/index.mjs";
|
||
import "pinia";
|
||
import "/app/node_modules/defu/dist/defu.mjs";
|
||
import "/app/node_modules/ufo/dist/index.mjs";
|
||
import "/app/node_modules/cookie-es/dist/index.mjs";
|
||
import "/app/node_modules/destr/dist/index.mjs";
|
||
import "/app/node_modules/ohash/dist/index.mjs";
|
||
import "/app/node_modules/@unhead/vue/dist/index.mjs";
|
||
import "@vue/devtools-api";
|
||
const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
||
__name: "TreeNode",
|
||
__ssrInlineRender: true,
|
||
props: {
|
||
node: {},
|
||
selectedIds: {},
|
||
expandedIds: {}
|
||
},
|
||
emits: ["toggle", "toggle-expand"],
|
||
setup(__props) {
|
||
return (_ctx, _push, _parent, _attrs) => {
|
||
const _component_TreeNode = _sfc_main$1;
|
||
_push(`<div${ssrRenderAttrs(_attrs)}><div class="flex items-center gap-2 py-1"><button class="text-slate-500 hover:text-slate-300 transition w-4 h-4 flex items-center justify-center"><svg class="${ssrRenderClass([__props.expandedIds.has(__props.node.id) ? "rotate-90" : "", "w-3 h-3 transition-transform"])}" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5l7 7-7 7"></path></svg></button><label class="flex items-center gap-2 cursor-pointer flex-1"><input type="checkbox"${ssrIncludeBooleanAttr(__props.selectedIds.includes(__props.node.id)) ? " checked" : ""} class="w-4 h-4 rounded border-slate-500 bg-slate-700 text-indigo-500 focus:ring-indigo-500/50"><span class="text-sm text-slate-300">${ssrInterpolate(__props.node.name_hu || __props.node.name_en || __props.node.key)}</span><span class="text-xs text-slate-500">(Szint ${ssrInterpolate(__props.node.level)})</span></label></div>`);
|
||
if (__props.expandedIds.has(__props.node.id) && __props.node.children?.length) {
|
||
_push(`<div class="ml-6 border-l border-slate-700 pl-3"><!--[-->`);
|
||
ssrRenderList(__props.node.children, (child) => {
|
||
_push(`<div>`);
|
||
_push(ssrRenderComponent(_component_TreeNode, {
|
||
node: child,
|
||
"selected-ids": __props.selectedIds,
|
||
"expanded-ids": __props.expandedIds,
|
||
onToggle: (id) => _ctx.$emit("toggle", id),
|
||
onToggleExpand: (id) => _ctx.$emit("toggle-expand", id)
|
||
}, null, _parent));
|
||
_push(`</div>`);
|
||
});
|
||
_push(`<!--]--></div>`);
|
||
} else {
|
||
_push(`<!---->`);
|
||
}
|
||
_push(`</div>`);
|
||
};
|
||
}
|
||
});
|
||
const _sfc_setup$1 = _sfc_main$1.setup;
|
||
_sfc_main$1.setup = (props, ctx) => {
|
||
const ssrContext = useSSRContext();
|
||
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("components/TreeNode.vue");
|
||
return _sfc_setup$1 ? _sfc_setup$1(props, ctx) : void 0;
|
||
};
|
||
const _sfc_main = /* @__PURE__ */ defineComponent({
|
||
__name: "edit",
|
||
__ssrInlineRender: true,
|
||
setup(__props) {
|
||
const VEHICLE_CLASSES = [
|
||
{ key: "car", label: "Személyautó" },
|
||
{ key: "motorcycle", label: "Motorkerékpár" },
|
||
{ key: "truck", label: "Teherautó" },
|
||
{ key: "hgv", label: "Nehézgépjármű (HGV)" },
|
||
{ key: "light_commercial", label: "Kishaszonjármű" },
|
||
{ key: "personal", label: "Személyes" },
|
||
{ key: "boat", label: "Csónak/Vízi" },
|
||
{ key: "other", label: "Egyéb" }
|
||
];
|
||
const route = useRoute();
|
||
useRouter();
|
||
computed(() => Number(route.params.id));
|
||
const loading = ref(true);
|
||
const error = ref(false);
|
||
const provider = ref(null);
|
||
const saveLoading = ref(false);
|
||
const toast = ref(null);
|
||
const activeTab = ref("basic");
|
||
const tabs = [
|
||
{ key: "basic", label: "Alapadatok & Kapcsolat", icon: "svg" },
|
||
{ key: "matrix", label: "Szolgáltatások & Járművek", icon: "svg" },
|
||
{ key: "location", label: "Helyszín & Lokáció", icon: "svg" },
|
||
{ key: "hours", label: "Nyitvatartás", icon: "svg" }
|
||
];
|
||
const categoryTree = ref([]);
|
||
const treeLoading = ref(false);
|
||
const expandedNodes = ref(/* @__PURE__ */ new Set());
|
||
const brandInput = ref("");
|
||
const propulsionInput = ref("");
|
||
const form = reactive({
|
||
name: "",
|
||
address: "",
|
||
city: "",
|
||
address_zip: "",
|
||
address_street_name: "",
|
||
address_street_type: "",
|
||
address_house_number: "",
|
||
plus_code: "",
|
||
contact_phone: "",
|
||
contact_email: "",
|
||
website: "",
|
||
category: "",
|
||
category_ids: [],
|
||
supported_vehicle_classes: [],
|
||
specializations: {
|
||
brands: [],
|
||
propulsion: []
|
||
},
|
||
opening_hours: {},
|
||
is_always_open: false
|
||
});
|
||
const hasChanges = computed(() => {
|
||
if (!provider.value) return false;
|
||
const p = provider.value;
|
||
if (form.name !== (p.name || "")) return true;
|
||
if (form.address !== (p.address || "")) return true;
|
||
if (form.city !== (p.city || "")) return true;
|
||
if (form.address_zip !== (p.address_zip || "")) return true;
|
||
if (form.address_street_name !== (p.address_street_name || "")) return true;
|
||
if (form.address_street_type !== (p.address_street_type || "")) return true;
|
||
if (form.address_house_number !== (p.address_house_number || "")) return true;
|
||
if (form.plus_code !== (p.plus_code || "")) return true;
|
||
if (form.contact_phone !== (p.contact_phone || "")) return true;
|
||
if (form.contact_email !== (p.contact_email || "")) return true;
|
||
if (form.website !== (p.website || "")) return true;
|
||
if (form.category !== (p.category || "")) return true;
|
||
const sortedFormCategories = [...form.category_ids].sort();
|
||
const sortedOrigCategories = [...p.category_ids || []].sort();
|
||
if (JSON.stringify(sortedFormCategories) !== JSON.stringify(sortedOrigCategories)) return true;
|
||
const sortedFormClasses = [...form.supported_vehicle_classes].sort();
|
||
const sortedOrigClasses = [...p.supported_vehicle_classes || []].sort();
|
||
if (JSON.stringify(sortedFormClasses) !== JSON.stringify(sortedOrigClasses)) return true;
|
||
const normalizeSpec = (spec) => ({
|
||
brands: Array.isArray(spec?.brands) ? [...spec.brands].sort() : [],
|
||
propulsion: Array.isArray(spec?.propulsion) ? [...spec.propulsion].sort() : []
|
||
});
|
||
if (JSON.stringify(normalizeSpec(form.specializations)) !== JSON.stringify(normalizeSpec(p.specializations))) return true;
|
||
const DAYS2 = ["monday", "tuesday", "wednesday", "thursday", "friday", "saturday", "sunday"];
|
||
const normalizeHours = (hours) => {
|
||
const result = {};
|
||
const daysSource = hours?.days || hours;
|
||
for (const day of DAYS2) {
|
||
const slot = daysSource?.[day];
|
||
if (slot && typeof slot === "object" && slot.open && slot.close) {
|
||
result[day] = { open: slot.open, close: slot.close };
|
||
} else {
|
||
result[day] = null;
|
||
}
|
||
}
|
||
return result;
|
||
};
|
||
if (JSON.stringify(normalizeHours(form.opening_hours)) !== JSON.stringify(normalizeHours(p.opening_hours))) return true;
|
||
if (form.is_always_open !== (p.opening_hours?.always_open === true)) return true;
|
||
return false;
|
||
});
|
||
function findCategoryById(id, nodes) {
|
||
for (const node of nodes) {
|
||
if (node.id === id) return node;
|
||
if (node.children?.length) {
|
||
const found = findCategoryById(id, node.children);
|
||
if (found) return found;
|
||
}
|
||
}
|
||
return null;
|
||
}
|
||
function getCategoryName(id) {
|
||
const node = findCategoryById(id, categoryTree.value);
|
||
if (!node) return `#${id}`;
|
||
return node.name_hu || node.name_en || node.key;
|
||
}
|
||
function toggleCategory(id) {
|
||
const idx = form.category_ids.indexOf(id);
|
||
if (idx >= 0) {
|
||
form.category_ids.splice(idx, 1);
|
||
} else {
|
||
form.category_ids.push(id);
|
||
}
|
||
}
|
||
function toggleTreeNode(id) {
|
||
const newSet = new Set(expandedNodes.value);
|
||
if (newSet.has(id)) {
|
||
newSet.delete(id);
|
||
} else {
|
||
newSet.add(id);
|
||
}
|
||
expandedNodes.value = newSet;
|
||
}
|
||
function isCategorySelected(id) {
|
||
return form.category_ids.includes(id);
|
||
}
|
||
const DAYS = [
|
||
{ key: "monday", label: "Hétfő" },
|
||
{ key: "tuesday", label: "Kedd" },
|
||
{ key: "wednesday", label: "Szerda" },
|
||
{ key: "thursday", label: "Csütörtök" },
|
||
{ key: "friday", label: "Péntek" },
|
||
{ key: "saturday", label: "Szombat" },
|
||
{ key: "sunday", label: "Vasárnap" }
|
||
];
|
||
return (_ctx, _push, _parent, _attrs) => {
|
||
const _component_TreeNode = _sfc_main$1;
|
||
_push(`<div${ssrRenderAttrs(_attrs)} data-v-4a0954df><div class="mb-8" data-v-4a0954df><button class="inline-flex items-center gap-1.5 text-sm text-slate-400 hover:text-white transition mb-4" data-v-4a0954df><svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24" data-v-4a0954df><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 19l-7-7 7-7" data-v-4a0954df></path></svg> Vissza a szolgáltatóhoz </button><h1 class="text-2xl font-bold text-white" data-v-4a0954df>Szolgáltató szerkesztése</h1><p class="text-slate-400 mt-1" data-v-4a0954df>Szolgáltató #${ssrInterpolate(_ctx.$route.params.id)}</p></div>`);
|
||
if (loading.value) {
|
||
_push(`<div class="flex items-center justify-center py-20" data-v-4a0954df><div class="text-slate-400 flex items-center gap-3" data-v-4a0954df><svg class="w-5 h-5 animate-spin" fill="none" stroke="currentColor" viewBox="0 0 24 24" data-v-4a0954df><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15" data-v-4a0954df></path></svg><span data-v-4a0954df>Szolgáltató betöltése...</span></div></div>`);
|
||
} else if (error.value) {
|
||
_push(`<div class="bg-rose-500/10 border border-rose-500/30 rounded-xl p-6 mb-8" data-v-4a0954df><p class="text-rose-400" data-v-4a0954df>Hiba történt a szolgáltató betöltése közben.</p><button class="mt-3 text-sm text-rose-300 hover:text-rose-200 underline" data-v-4a0954df>Újrapróbálkozás</button></div>`);
|
||
} else if (!provider.value) {
|
||
_push(`<div class="bg-slate-800 rounded-xl border border-slate-700 p-6" data-v-4a0954df><p class="text-slate-400 text-center py-12" data-v-4a0954df>A szolgáltató nem található.</p></div>`);
|
||
} else {
|
||
_push(`<!--[--><div class="border-b border-slate-700 mb-6" data-v-4a0954df><nav class="flex gap-6 -mb-px" data-v-4a0954df><!--[-->`);
|
||
ssrRenderList(tabs, (tab) => {
|
||
_push(`<button class="${ssrRenderClass([activeTab.value === tab.key ? "text-indigo-400 border-indigo-400" : "text-slate-400 border-transparent hover:text-slate-300", "pb-3 text-sm font-medium border-b-2 transition flex items-center gap-2"])}" data-v-4a0954df>`);
|
||
ssrRenderVNode(_push, createVNode(resolveDynamicComponent(tab.icon), { class: "w-4 h-4" }, null), _parent);
|
||
_push(` ${ssrInterpolate(tab.label)}</button>`);
|
||
});
|
||
_push(`<!--]--></nav></div>`);
|
||
if (activeTab.value === "basic") {
|
||
_push(`<div class="max-w-3xl" data-v-4a0954df><form data-v-4a0954df><div class="bg-slate-800 rounded-xl border border-slate-700 p-6 mb-6" data-v-4a0954df><h2 class="text-lg font-semibold text-white mb-4" data-v-4a0954df>Alapadatok</h2><div class="grid grid-cols-1 md:grid-cols-2 gap-4" data-v-4a0954df><div class="md:col-span-2" data-v-4a0954df><label class="block text-sm font-medium text-slate-300 mb-1" data-v-4a0954df>Név *</label><input${ssrRenderAttr("value", form.name)} required class="w-full px-3 py-2 bg-slate-700 border border-slate-600 rounded-lg text-white placeholder-slate-500 focus:outline-none focus:ring-2 focus:ring-indigo-500/50 focus:border-indigo-500 text-sm" data-v-4a0954df></div><div data-v-4a0954df><label class="block text-sm font-medium text-slate-300 mb-1" data-v-4a0954df>Kategória</label><input${ssrRenderAttr("value", form.category)} placeholder="pl. Autószerviz, Gumiszerviz" class="w-full px-3 py-2 bg-slate-700 border border-slate-600 rounded-lg text-white placeholder-slate-500 focus:outline-none focus:ring-2 focus:ring-indigo-500/50 focus:border-indigo-500 text-sm" data-v-4a0954df></div><div data-v-4a0954df><label class="block text-sm font-medium text-slate-300 mb-1" data-v-4a0954df>Forrás</label><div class="w-full px-3 py-2 bg-slate-700/50 border border-slate-600 rounded-lg text-slate-400 text-sm" data-v-4a0954df>${ssrInterpolate(provider.value.source)}</div></div></div></div><div class="bg-slate-800 rounded-xl border border-slate-700 p-6 mb-6" data-v-4a0954df><h2 class="text-lg font-semibold text-white mb-4" data-v-4a0954df>Elérhetőség</h2><div class="grid grid-cols-1 md:grid-cols-2 gap-4" data-v-4a0954df><div data-v-4a0954df><label class="block text-sm font-medium text-slate-300 mb-1" data-v-4a0954df>Telefon</label><input${ssrRenderAttr("value", form.contact_phone)} placeholder="+36 30 123 4567" class="w-full px-3 py-2 bg-slate-700 border border-slate-600 rounded-lg text-white placeholder-slate-500 focus:outline-none focus:ring-2 focus:ring-indigo-500/50 focus:border-indigo-500 text-sm" data-v-4a0954df></div><div data-v-4a0954df><label class="block text-sm font-medium text-slate-300 mb-1" data-v-4a0954df>Email</label><input${ssrRenderAttr("value", form.contact_email)} type="email" placeholder="info@example.com" class="w-full px-3 py-2 bg-slate-700 border border-slate-600 rounded-lg text-white placeholder-slate-500 focus:outline-none focus:ring-2 focus:ring-indigo-500/50 focus:border-indigo-500 text-sm" data-v-4a0954df></div><div class="md:col-span-2" data-v-4a0954df><label class="block text-sm font-medium text-slate-300 mb-1" data-v-4a0954df>Weboldal</label><input${ssrRenderAttr("value", form.website)} placeholder="https://..." class="w-full px-3 py-2 bg-slate-700 border border-slate-600 rounded-lg text-white placeholder-slate-500 focus:outline-none focus:ring-2 focus:ring-indigo-500/50 focus:border-indigo-500 text-sm" data-v-4a0954df></div></div></div></form></div>`);
|
||
} else {
|
||
_push(`<!---->`);
|
||
}
|
||
if (activeTab.value === "matrix") {
|
||
_push(`<div class="max-w-4xl" data-v-4a0954df><div class="bg-slate-800 rounded-xl border border-slate-700 p-6 mb-6" data-v-4a0954df><h2 class="text-lg font-semibold text-white mb-2" data-v-4a0954df>3D Képesség Mátrix</h2><p class="text-sm text-slate-400 mb-6" data-v-4a0954df> Állítsd be, hogy a szolgáltató milyen járműosztályokhoz, szolgáltatási kategóriákhoz és specializációkhoz tartozik. </p><div class="mb-8" data-v-4a0954df><h3 class="text-md font-medium text-white mb-3 flex items-center gap-2" data-v-4a0954df><span class="w-6 h-6 rounded-full bg-indigo-500/20 text-indigo-400 flex items-center justify-center text-xs font-bold" data-v-4a0954df>A</span> Járműosztályok (Vehicle Classes) </h3><p class="text-xs text-slate-500 mb-3" data-v-4a0954df>Mely járműtípusokat szervizeli a szolgáltató?</p><div class="grid grid-cols-2 md:grid-cols-4 gap-3" data-v-4a0954df><!--[-->`);
|
||
ssrRenderList(VEHICLE_CLASSES, (vc) => {
|
||
_push(`<label class="${ssrRenderClass([form.supported_vehicle_classes.includes(vc.key) ? "bg-indigo-500/10 border-indigo-500/40 text-indigo-300" : "bg-slate-700/50 border-slate-600 hover:border-slate-500 text-slate-300", "flex items-center gap-3 p-3 rounded-lg border cursor-pointer transition"])}" data-v-4a0954df><input type="checkbox"${ssrRenderAttr("value", vc.key)}${ssrIncludeBooleanAttr(form.supported_vehicle_classes.includes(vc.key)) ? " checked" : ""} class="w-4 h-4 rounded border-slate-500 bg-slate-700 text-indigo-500 focus:ring-indigo-500/50" data-v-4a0954df><span class="text-sm" data-v-4a0954df>${ssrInterpolate(vc.label)}</span></label>`);
|
||
});
|
||
_push(`<!--]--></div></div><div class="mb-8" data-v-4a0954df><h3 class="text-md font-medium text-white mb-3 flex items-center gap-2" data-v-4a0954df><span class="w-6 h-6 rounded-full bg-emerald-500/20 text-emerald-400 flex items-center justify-center text-xs font-bold" data-v-4a0954df>B</span> Szolgáltatási Kategóriák (Expertise Tags) </h3><p class="text-xs text-slate-500 mb-3" data-v-4a0954df>Válaszd ki a szolgáltatóhoz tartozó kategóriákat a hierarchikus fából.</p>`);
|
||
if (treeLoading.value) {
|
||
_push(`<div class="flex items-center gap-2 text-sm text-slate-400 py-4" data-v-4a0954df><svg class="w-4 h-4 animate-spin" fill="none" stroke="currentColor" viewBox="0 0 24 24" data-v-4a0954df><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15" data-v-4a0954df></path></svg><span data-v-4a0954df>Kategóriák betöltése...</span></div>`);
|
||
} else {
|
||
_push(`<div class="space-y-1 max-h-96 overflow-y-auto pr-2" data-v-4a0954df><!--[-->`);
|
||
ssrRenderList(categoryTree.value, (node) => {
|
||
_push(`<div class="ml-0" data-v-4a0954df><div class="flex items-center gap-2 py-1" data-v-4a0954df><button class="text-slate-500 hover:text-slate-300 transition w-4 h-4 flex items-center justify-center" data-v-4a0954df><svg class="${ssrRenderClass([expandedNodes.value.has(node.id) ? "rotate-90" : "", "w-3 h-3 transition-transform"])}" fill="none" stroke="currentColor" viewBox="0 0 24 24" data-v-4a0954df><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5l7 7-7 7" data-v-4a0954df></path></svg></button><label class="flex items-center gap-2 cursor-pointer flex-1" data-v-4a0954df><input type="checkbox"${ssrIncludeBooleanAttr(isCategorySelected(node.id)) ? " checked" : ""} class="w-4 h-4 rounded border-slate-500 bg-slate-700 text-indigo-500 focus:ring-indigo-500/50" data-v-4a0954df><span class="text-sm font-medium text-white" data-v-4a0954df>${ssrInterpolate(node.name_hu || node.name_en || node.key)}</span><span class="text-xs text-slate-500" data-v-4a0954df>(Szint ${ssrInterpolate(node.level)})</span></label></div>`);
|
||
if (expandedNodes.value.has(node.id) && node.children?.length) {
|
||
_push(`<div class="ml-6 border-l border-slate-700 pl-3" data-v-4a0954df><!--[-->`);
|
||
ssrRenderList(node.children, (child) => {
|
||
_push(`<div data-v-4a0954df>`);
|
||
_push(ssrRenderComponent(_component_TreeNode, {
|
||
node: child,
|
||
"selected-ids": form.category_ids,
|
||
"expanded-ids": expandedNodes.value,
|
||
onToggle: toggleCategory,
|
||
onToggleExpand: toggleTreeNode
|
||
}, null, _parent));
|
||
_push(`</div>`);
|
||
});
|
||
_push(`<!--]--></div>`);
|
||
} else {
|
||
_push(`<!---->`);
|
||
}
|
||
_push(`</div>`);
|
||
});
|
||
_push(`<!--]--></div>`);
|
||
}
|
||
if (form.category_ids.length > 0) {
|
||
_push(`<div class="mt-4 flex flex-wrap gap-2" data-v-4a0954df><!--[-->`);
|
||
ssrRenderList(form.category_ids, (id) => {
|
||
_push(`<span class="inline-flex items-center gap-1 px-2 py-1 bg-indigo-500/10 text-indigo-300 rounded-full text-xs" data-v-4a0954df>${ssrInterpolate(getCategoryName(id))} <button class="hover:text-white transition" data-v-4a0954df><svg class="w-3 h-3" fill="none" stroke="currentColor" viewBox="0 0 24 24" data-v-4a0954df><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12" data-v-4a0954df></path></svg></button></span>`);
|
||
});
|
||
_push(`<!--]--></div>`);
|
||
} else {
|
||
_push(`<!---->`);
|
||
}
|
||
_push(`</div><div class="mb-4" data-v-4a0954df><h3 class="text-md font-medium text-white mb-3 flex items-center gap-2" data-v-4a0954df><span class="w-6 h-6 rounded-full bg-amber-500/20 text-amber-400 flex items-center justify-center text-xs font-bold" data-v-4a0954df>C</span> Specializációk </h3><p class="text-xs text-slate-500 mb-3" data-v-4a0954df>Adj meg speciális márkákat, hajtáslánc típusokat vagy egyéb címkéket.</p><div class="grid grid-cols-1 md:grid-cols-2 gap-6" data-v-4a0954df><div data-v-4a0954df><label class="block text-sm font-medium text-slate-300 mb-1" data-v-4a0954df>Márkák (Brands)</label><div class="flex flex-wrap gap-2 mb-2" data-v-4a0954df><!--[-->`);
|
||
ssrRenderList(form.specializations.brands, (brand, idx) => {
|
||
_push(`<span class="inline-flex items-center gap-1 px-2 py-1 bg-amber-500/10 text-amber-300 rounded-full text-xs" data-v-4a0954df>${ssrInterpolate(brand)} <button class="hover:text-white transition" data-v-4a0954df><svg class="w-3 h-3" fill="none" stroke="currentColor" viewBox="0 0 24 24" data-v-4a0954df><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12" data-v-4a0954df></path></svg></button></span>`);
|
||
});
|
||
_push(`<!--]--></div><div class="flex gap-2" data-v-4a0954df><input${ssrRenderAttr("value", brandInput.value)} placeholder="pl. Volvo, Scania" class="flex-1 px-3 py-2 bg-slate-700 border border-slate-600 rounded-lg text-white placeholder-slate-500 focus:outline-none focus:ring-2 focus:ring-indigo-500/50 focus:border-indigo-500 text-sm" data-v-4a0954df><button${ssrIncludeBooleanAttr(!brandInput.value.trim()) ? " disabled" : ""} class="px-3 py-2 bg-indigo-600 hover:bg-indigo-500 disabled:bg-indigo-600/50 text-white rounded-lg text-sm transition" data-v-4a0954df> Hozzáad </button></div></div><div data-v-4a0954df><label class="block text-sm font-medium text-slate-300 mb-1" data-v-4a0954df>Hajtáslánc (Propulsion)</label><div class="flex flex-wrap gap-2 mb-2" data-v-4a0954df><!--[-->`);
|
||
ssrRenderList(form.specializations.propulsion, (prop, idx) => {
|
||
_push(`<span class="inline-flex items-center gap-1 px-2 py-1 bg-emerald-500/10 text-emerald-300 rounded-full text-xs" data-v-4a0954df>${ssrInterpolate(prop)} <button class="hover:text-white transition" data-v-4a0954df><svg class="w-3 h-3" fill="none" stroke="currentColor" viewBox="0 0 24 24" data-v-4a0954df><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12" data-v-4a0954df></path></svg></button></span>`);
|
||
});
|
||
_push(`<!--]--></div><div class="flex gap-2" data-v-4a0954df><input${ssrRenderAttr("value", propulsionInput.value)} placeholder="pl. EV, Hybrid, Diesel" class="flex-1 px-3 py-2 bg-slate-700 border border-slate-600 rounded-lg text-white placeholder-slate-500 focus:outline-none focus:ring-2 focus:ring-indigo-500/50 focus:border-indigo-500 text-sm" data-v-4a0954df><button${ssrIncludeBooleanAttr(!propulsionInput.value.trim()) ? " disabled" : ""} class="px-3 py-2 bg-indigo-600 hover:bg-indigo-500 disabled:bg-indigo-600/50 text-white rounded-lg text-sm transition" data-v-4a0954df> Hozzáad </button></div></div></div></div></div></div>`);
|
||
} else {
|
||
_push(`<!---->`);
|
||
}
|
||
if (activeTab.value === "location") {
|
||
_push(`<div class="max-w-3xl" data-v-4a0954df><form data-v-4a0954df><div class="bg-slate-800 rounded-xl border border-slate-700 p-6 mb-6" data-v-4a0954df><h2 class="text-lg font-semibold text-white mb-4" data-v-4a0954df>Cím adatok</h2><div class="grid grid-cols-1 md:grid-cols-2 gap-4" data-v-4a0954df><div class="md:col-span-2" data-v-4a0954df><label class="block text-sm font-medium text-slate-300 mb-1" data-v-4a0954df>Teljes cím</label><input${ssrRenderAttr("value", form.address)} placeholder="Teljes cím szövege" class="w-full px-3 py-2 bg-slate-700 border border-slate-600 rounded-lg text-white placeholder-slate-500 focus:outline-none focus:ring-2 focus:ring-indigo-500/50 focus:border-indigo-500 text-sm" data-v-4a0954df></div><div data-v-4a0954df><label class="block text-sm font-medium text-slate-300 mb-1" data-v-4a0954df>Város</label><input${ssrRenderAttr("value", form.city)} placeholder="Budapest" class="w-full px-3 py-2 bg-slate-700 border border-slate-600 rounded-lg text-white placeholder-slate-500 focus:outline-none focus:ring-2 focus:ring-indigo-500/50 focus:border-indigo-500 text-sm" data-v-4a0954df></div><div data-v-4a0954df><label class="block text-sm font-medium text-slate-300 mb-1" data-v-4a0954df>Irányítószám</label><input${ssrRenderAttr("value", form.address_zip)} placeholder="1011" class="w-full px-3 py-2 bg-slate-700 border border-slate-600 rounded-lg text-white placeholder-slate-500 focus:outline-none focus:ring-2 focus:ring-indigo-500/50 focus:border-indigo-500 text-sm" data-v-4a0954df></div><div data-v-4a0954df><label class="block text-sm font-medium text-slate-300 mb-1" data-v-4a0954df>Utca</label><input${ssrRenderAttr("value", form.address_street_name)} placeholder="Egressy" class="w-full px-3 py-2 bg-slate-700 border border-slate-600 rounded-lg text-white placeholder-slate-500 focus:outline-none focus:ring-2 focus:ring-indigo-500/50 focus:border-indigo-500 text-sm" data-v-4a0954df></div><div data-v-4a0954df><label class="block text-sm font-medium text-slate-300 mb-1" data-v-4a0954df>Házszám</label><input${ssrRenderAttr("value", form.address_house_number)} placeholder="4/b" class="w-full px-3 py-2 bg-slate-700 border border-slate-600 rounded-lg text-white placeholder-slate-500 focus:outline-none focus:ring-2 focus:ring-indigo-500/50 focus:border-indigo-500 text-sm" data-v-4a0954df></div><div class="md:col-span-2" data-v-4a0954df><label class="block text-sm font-medium text-slate-300 mb-1" data-v-4a0954df>Plus Code</label><input${ssrRenderAttr("value", form.plus_code)} placeholder="8FVC9X8V+XV" class="w-full px-3 py-2 bg-slate-700 border border-slate-600 rounded-lg text-white placeholder-slate-500 focus:outline-none focus:ring-2 focus:ring-indigo-500/50 focus:border-indigo-500 text-sm" data-v-4a0954df></div></div></div></form></div>`);
|
||
} else {
|
||
_push(`<!---->`);
|
||
}
|
||
if (activeTab.value === "hours") {
|
||
_push(`<div class="max-w-3xl" data-v-4a0954df><div class="bg-slate-800 rounded-xl border border-slate-700 p-6 mb-6" data-v-4a0954df><h2 class="text-lg font-semibold text-white mb-2" data-v-4a0954df>Nyitvatartás</h2><p class="text-sm text-slate-400 mb-6" data-v-4a0954df> Állítsd be a szolgáltató nyitvatartási idejét napokra bontva. </p><div class="mb-6 p-4 rounded-lg border bg-indigo-500/5 border-indigo-500/20" data-v-4a0954df><label class="flex items-center gap-3 cursor-pointer" data-v-4a0954df><input type="checkbox"${ssrIncludeBooleanAttr(Array.isArray(form.is_always_open) ? ssrLooseContain(form.is_always_open, null) : form.is_always_open) ? " checked" : ""} class="w-5 h-5 rounded border-slate-500 bg-slate-700 text-indigo-500 focus:ring-indigo-500/50" data-v-4a0954df><div data-v-4a0954df><span class="text-sm font-medium text-white" data-v-4a0954df>Folyamatos (0-24) nyitvatartás</span><p class="text-xs text-slate-400 mt-0.5" data-v-4a0954df>A szolgáltató a hét minden napján 0-24 óráig nyitva van</p></div></label></div><div class="${ssrRenderClass([{ "opacity-50 pointer-events-none": form.is_always_open }, "flex flex-wrap gap-2 mb-6"])}" data-v-4a0954df><button class="px-3 py-1.5 text-xs font-medium rounded-lg border border-emerald-600/30 text-emerald-400 hover:bg-emerald-600/10 transition" data-v-4a0954df> 24/7 Folyamatos nyitvatartás </button><button class="px-3 py-1.5 text-xs font-medium rounded-lg border border-indigo-600/30 text-indigo-400 hover:bg-indigo-600/10" data-v-4a0954df> Hétköznapok másolása (Hétfő → K-P) </button><button class="px-3 py-1.5 text-xs font-medium rounded-lg border border-rose-600/30 text-rose-400 hover:bg-rose-600/10" data-v-4a0954df> Összes törlése </button></div><div class="${ssrRenderClass([{ "opacity-50 pointer-events-none": form.is_always_open }, "space-y-3"])}" data-v-4a0954df><!--[-->`);
|
||
ssrRenderList(DAYS, (day) => {
|
||
_push(`<div class="${ssrRenderClass([form.opening_hours[day.key] ? "bg-indigo-500/5 border-indigo-500/20" : "bg-slate-700/30 border-slate-600", "flex items-center gap-4 p-4 rounded-lg border"])}" data-v-4a0954df><label class="flex items-center gap-2 w-36 flex-shrink-0 cursor-pointer" data-v-4a0954df><input type="checkbox"${ssrIncludeBooleanAttr(!!form.opening_hours[day.key]) ? " checked" : ""}${ssrIncludeBooleanAttr(form.is_always_open) ? " disabled" : ""} class="w-4 h-4 rounded border-slate-500 bg-slate-700 text-indigo-500 focus:ring-indigo-500/50" data-v-4a0954df><span class="text-sm font-medium text-white" data-v-4a0954df>${ssrInterpolate(day.label)}</span></label>`);
|
||
if (form.opening_hours[day.key]) {
|
||
_push(`<div class="flex items-center gap-2" data-v-4a0954df><input type="time"${ssrRenderAttr("value", form.opening_hours[day.key]?.open || "08:00")}${ssrIncludeBooleanAttr(form.is_always_open) ? " disabled" : ""} class="w-28 px-2 py-1.5 bg-slate-700 border border-slate-600 rounded-lg text-white text-sm focus:outline-none focus:ring-2 focus:ring-indigo-500/50 focus:border-indigo-500 disabled:opacity-50" data-v-4a0954df><span class="text-slate-500 text-sm" data-v-4a0954df>–</span><input type="time"${ssrRenderAttr("value", form.opening_hours[day.key]?.close || "17:00")}${ssrIncludeBooleanAttr(form.is_always_open) ? " disabled" : ""} class="w-28 px-2 py-1.5 bg-slate-700 border border-slate-600 rounded-lg text-white text-sm focus:outline-none focus:ring-2 focus:ring-indigo-500/50 focus:border-indigo-500 disabled:opacity-50" data-v-4a0954df></div>`);
|
||
} else {
|
||
_push(`<span class="text-sm text-slate-500 italic" data-v-4a0954df>Zárva</span>`);
|
||
}
|
||
_push(`</div>`);
|
||
});
|
||
_push(`<!--]--></div></div></div>`);
|
||
} else {
|
||
_push(`<!---->`);
|
||
}
|
||
_push(`<div class="sticky bottom-0 bg-slate-900/90 backdrop-blur-sm border-t border-slate-700 -mx-6 px-6 py-4 mt-8" data-v-4a0954df><div class="flex items-center justify-between max-w-4xl" data-v-4a0954df><div class="text-sm text-slate-400" data-v-4a0954df>`);
|
||
if (hasChanges.value) {
|
||
_push(`<span class="text-amber-400" data-v-4a0954df>● Módosítások el nem mentve</span>`);
|
||
} else {
|
||
_push(`<span class="text-slate-500" data-v-4a0954df>Nincs változás</span>`);
|
||
}
|
||
_push(`</div><div class="flex gap-3" data-v-4a0954df><button class="px-4 py-2 text-sm text-slate-400 hover:text-white transition" data-v-4a0954df> Mégse </button><button${ssrIncludeBooleanAttr(saveLoading.value || !hasChanges.value) ? " disabled" : ""} class="px-6 py-2 bg-indigo-600 hover:bg-indigo-500 disabled:bg-indigo-600/50 text-white rounded-lg text-sm font-medium transition flex items-center gap-2" data-v-4a0954df>`);
|
||
if (saveLoading.value) {
|
||
_push(`<svg class="w-4 h-4 animate-spin" fill="none" stroke="currentColor" viewBox="0 0 24 24" data-v-4a0954df><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15" data-v-4a0954df></path></svg>`);
|
||
} else {
|
||
_push(`<svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24" data-v-4a0954df><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 13l4 4L19 7" data-v-4a0954df></path></svg>`);
|
||
}
|
||
_push(` Mentés </button></div></div></div><!--]-->`);
|
||
}
|
||
if (toast.value) {
|
||
_push(`<div class="${ssrRenderClass([toast.value.type === "success" ? "bg-emerald-600 text-white" : "bg-rose-600 text-white", "fixed top-4 right-4 z-50 px-4 py-3 rounded-lg shadow-xl text-sm font-medium transition-all duration-300"])}" data-v-4a0954df>${ssrInterpolate(toast.value.message)}</div>`);
|
||
} else {
|
||
_push(`<!---->`);
|
||
}
|
||
_push(`</div>`);
|
||
};
|
||
}
|
||
});
|
||
const _sfc_setup = _sfc_main.setup;
|
||
_sfc_main.setup = (props, ctx) => {
|
||
const ssrContext = useSSRContext();
|
||
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("pages/providers/[id]/edit.vue");
|
||
return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
|
||
};
|
||
const edit = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-4a0954df"]]);
|
||
export {
|
||
edit as default
|
||
};
|
||
//# sourceMappingURL=edit-DQMBygGu.js.map
|