feat(skd): placement в SelectedItemFolder (selection)

SelectedItemFolder (группа полей с заголовком в selection) имеет
<dcsset:placement> — может быть Auto/Horizontally/Vertically/Special.
Мы захардкоженно эмитили Auto, теряя non-default значения.

decompile: читаем placement, сохраняем если ≠ Auto.
compile: эмитим из item.placement (default Auto для bit-perfect-default).

PS и Py compile синхронизированы.
This commit is contained in:
Nick Shirokov
2026-05-24 15:59:25 +03:00
parent 2ad35f484c
commit fe9d8500dc
3 changed files with 11 additions and 5 deletions
@@ -1,4 +1,4 @@
# skd-compile v1.88 — Compile 1C DCS from JSON
# skd-compile v1.89 — Compile 1C DCS from JSON
# Source: https://github.com/Nikolay-Shirokov/cc-1c-skills
param(
[string]$DefinitionFile,
@@ -1991,7 +1991,8 @@ function Emit-SelectionItem {
foreach ($sub in $item.items) {
Emit-SelectionItem -item $sub -indent "$indent`t"
}
X "$indent`t<dcsset:placement>Auto</dcsset:placement>"
$pl = if ($item.placement) { "$($item.placement)" } else { 'Auto' }
X "$indent`t<dcsset:placement>$(Esc-Xml $pl)</dcsset:placement>"
X "$indent</dcsset:item>"
return
}
@@ -1,5 +1,5 @@
#!/usr/bin/env python3
# skd-compile v1.88 — Compile 1C DCS from JSON
# skd-compile v1.89 — Compile 1C DCS from JSON
# Source: https://github.com/Nikolay-Shirokov/cc-1c-skills
import argparse
import json
@@ -1645,7 +1645,8 @@ def emit_selection_item(lines, item, indent):
emit_mltext(lines, f'{indent}\t', 'dcsset:lwsTitle', item['folder'], no_xsi_type=True)
for sub in (item.get('items') or []):
emit_selection_item(lines, sub, f'{indent}\t')
lines.append(f'{indent}\t<dcsset:placement>Auto</dcsset:placement>')
pl = str(item.get('placement') or 'Auto')
lines.append(f'{indent}\t<dcsset:placement>{esc_xml(pl)}</dcsset:placement>')
lines.append(f'{indent}</dcsset:item>')
return
# field with optional title / use=false / viewMode