fix: iç içe akordeonlarda ok yönü (named group) + form alan sıralaması
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Fable 5
parent
b3a3a4b450
commit
1bc276147d
@@ -47,13 +47,13 @@
|
|||||||
<!-- Nesne öğeler: açılır-kapanır kart -->
|
<!-- Nesne öğeler: açılır-kapanır kart -->
|
||||||
<details
|
<details
|
||||||
v-if="item !== null && typeof item === 'object'"
|
v-if="item !== null && typeof item === 'object'"
|
||||||
class="border border-gray-200 rounded-xl bg-[#fafbfc] group"
|
class="border border-gray-200 rounded-xl bg-[#fafbfc] group/acc"
|
||||||
>
|
>
|
||||||
<summary
|
<summary
|
||||||
class="flex items-center gap-1.5 px-3 py-2 text-xs text-gray-600 cursor-pointer select-none list-none"
|
class="flex items-center gap-1.5 px-3 py-2 text-xs text-gray-600 cursor-pointer select-none list-none"
|
||||||
>
|
>
|
||||||
<span
|
<span
|
||||||
class="text-gray-400 transition-transform group-open:rotate-90 shrink-0"
|
class="text-gray-400 transition-transform group-open/acc:rotate-90 shrink-0"
|
||||||
>▶</span
|
>▶</span
|
||||||
>
|
>
|
||||||
<span class="font-semibold truncate text-[13px]">{{
|
<span class="font-semibold truncate text-[13px]">{{
|
||||||
@@ -241,10 +241,37 @@ const displayLabel = computed(() => {
|
|||||||
.replace(/^./, (c) => c.toUpperCase());
|
.replace(/^./, (c) => c.toUpperCase());
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Öncelikli metin alanları — formda en üstte görünsün
|
||||||
|
const KEY_ORDER = [
|
||||||
|
"title",
|
||||||
|
"name",
|
||||||
|
"label",
|
||||||
|
"fullName",
|
||||||
|
"subtitle",
|
||||||
|
"price",
|
||||||
|
"discount",
|
||||||
|
"excerpt",
|
||||||
|
"description",
|
||||||
|
"text",
|
||||||
|
"content",
|
||||||
|
"startDate",
|
||||||
|
"endDate",
|
||||||
|
"enabled",
|
||||||
|
];
|
||||||
|
|
||||||
const objectKeys = computed(() => {
|
const objectKeys = computed(() => {
|
||||||
const keys = Object.keys(value.value).filter((k) => k !== "__component");
|
const obj = value.value;
|
||||||
// Meta/SEO en sona
|
const weight = (k: string) => {
|
||||||
return keys.sort((a, b) => (a === "meta" ? 1 : b === "meta" ? -1 : 0));
|
if (k === "meta") return 100; // SEO her zaman en sonda
|
||||||
|
const v = obj[k];
|
||||||
|
if (Array.isArray(v)) return 50; // listeler (öğeler vb.) en altta
|
||||||
|
if (v !== null && typeof v === "object") return 40; // görsel gibi nesneler
|
||||||
|
const i = KEY_ORDER.indexOf(k);
|
||||||
|
return i === -1 ? 30 : i; // bilinen metinler önce, kalan primitifler sonra
|
||||||
|
};
|
||||||
|
return Object.keys(obj)
|
||||||
|
.filter((k) => k !== "__component")
|
||||||
|
.sort((a, b) => weight(a) - weight(b));
|
||||||
});
|
});
|
||||||
|
|
||||||
function stripHtml(s: string) {
|
function stripHtml(s: string) {
|
||||||
|
|||||||
Reference in New Issue
Block a user