mirror of
https://github.com/Nikolay-Shirokov/cc-1c-skills.git
synced 2026-08-01 17:27:45 +03:00
feat(form-decompile,form-compile): табличные скаляры ChoiceMode/SelectionMode/RowSelectionMode/Vertical-HorizontalLines + дегейт UseAlternationRowColor/InitialTreeView/RowPictureDataPath/RowsPicture (кластер Table scalars)
Свойства таблицы, терявшиеся на раундтрипе. Часть была захвачена в декомпиляторе под gate динсписка (<UpdateOnDataChange>) → терялась на обычных ValueTable-таблицах. Новые скаляры (захват + эмиссия, все типы таблиц): - choiceMode (компилятор уже эмитил — добавлен захват), selectionMode (SingleRow/…), rowSelectionMode (Row/…), verticalLines/horizontalLines (явное false). Дегейт (вынесены из блока динсписка в общую обработку Table — ловятся на ЛЮБОЙ таблице): - useAlternationRowColor, initialTreeView, rowsPicture — захват/эмиссия без gate. - rowPictureDataPath — инверсия умного дефолта DefaultPicture осталась дин-список-only; обычные таблицы захватывают/эмитят литерал. Зеркало form-compile.py идентично (py==ps1 проверено). Валидация: все 7 целевых — 0 LOST / 0 ADDED; round-trip на ValueTable-формах (АдреснаяКнига и др.); регресс 33/33 ps+py; harness 8448→8368 (на честной метрике после фикса атрибуции), 0 fail. Остаток по таблицам — companion-контент (ExtendedTooltip/AutoCommandBar/ContextMenu) и цвета/шрифты — отдельные кластеры. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
1b56e7a735
commit
e905d5f576
@@ -1,4 +1,4 @@
|
||||
# form-decompile v0.24 — Decompile 1C managed Form.xml to JSON DSL (draft)
|
||||
# form-decompile v0.25 — Decompile 1C managed Form.xml to JSON DSL (draft)
|
||||
# Source: https://github.com/Nikolay-Shirokov/cc-1c-skills
|
||||
# ВНИМАНИЕ: раундтрип не гарантируется. Навык исключён из авто-использования моделью.
|
||||
param(
|
||||
@@ -986,10 +986,18 @@ function Decompile-Element {
|
||||
$ssl = Get-Child $node 'SearchStringLocation'; if ($ssl) { $obj['searchStringLocation'] = $ssl }
|
||||
$vsl = Get-Child $node 'ViewStatusLocation'; if ($vsl) { $obj['viewStatusLocation'] = $vsl }
|
||||
$scl = Get-Child $node 'SearchControlLocation'; if ($scl) { $obj['searchControlLocation'] = $scl }
|
||||
# --- Блок свойств дин-список-таблицы (признак: дочерний <UpdateOnDataChange>) ---
|
||||
# --- Общие свойства таблицы (любой тип таблицы, не только динсписок) ---
|
||||
if ((Get-Child $node 'ChoiceMode') -eq 'true') { $obj['choiceMode'] = $true }
|
||||
$selm = Get-Child $node 'SelectionMode'; if ($selm) { $obj['selectionMode'] = $selm }
|
||||
$rsm = Get-Child $node 'RowSelectionMode'; if ($rsm) { $obj['rowSelectionMode'] = $rsm }
|
||||
if ((Get-Child $node 'VerticalLines') -eq 'false') { $obj['verticalLines'] = $false }
|
||||
if ((Get-Child $node 'HorizontalLines') -eq 'false') { $obj['horizontalLines'] = $false }
|
||||
if ((Get-Child $node 'UseAlternationRowColor') -eq 'true') { $obj['useAlternationRowColor'] = $true }
|
||||
$itv = Get-Child $node 'InitialTreeView'; if ($itv) { $obj['initialTreeView'] = $itv }
|
||||
$rpRef = $node.SelectSingleNode("lf:RowsPicture/xr:Ref", $ns); if ($rpRef) { $obj['rowsPicture'] = $rpRef.InnerText }
|
||||
$rpdp = Get-Child $node 'RowPictureDataPath'
|
||||
# --- Блок дин-список-таблицы (признак: дочерний <UpdateOnDataChange>) ---
|
||||
if (Has-Child $node 'UpdateOnDataChange') {
|
||||
$listName = Get-Child $node 'DataPath'
|
||||
# Group A (инверсия дефолтов)
|
||||
if ((Get-Child $node 'AutoRefresh') -eq 'true') { $obj['autoRefresh'] = $true }
|
||||
$arp = Get-Child $node 'AutoRefreshPeriod'; if ($arp -and $arp -ne '60') { $obj['autoRefreshPeriod'] = [int]$arp }
|
||||
$cfi = Get-Child $node 'ChoiceFoldersAndItems'; if ($cfi -and $cfi -ne 'Items') { $obj['choiceFoldersAndItems'] = $cfi }
|
||||
@@ -998,17 +1006,11 @@ function Decompile-Element {
|
||||
if ((Get-Child $node 'AllowRootChoice') -eq 'true') { $obj['allowRootChoice'] = $true }
|
||||
$uodc = Get-Child $node 'UpdateOnDataChange'; if ($uodc -and $uodc -ne 'Auto') { $obj['updateOnDataChange'] = $uodc }
|
||||
if ((Get-Child $node 'AllowGettingCurrentRowURL') -eq 'false') { $obj['allowGettingCurrentRowURL'] = $false }
|
||||
# list-таблица: useAlternationRowColor/initialTreeView (defaultItem/enableStartDrag/
|
||||
# fileDragMode — общие, ловятся в Add-Layout)
|
||||
if ((Get-Child $node 'UseAlternationRowColor') -eq 'true') { $obj['useAlternationRowColor'] = $true }
|
||||
$itv = Get-Child $node 'InitialTreeView'; if ($itv) { $obj['initialTreeView'] = $itv }
|
||||
# Group C
|
||||
$rpdp = Get-Child $node 'RowPictureDataPath'
|
||||
# RowPictureDataPath: инверсия умного дефолта <Список>.DefaultPicture
|
||||
if ($null -eq $rpdp) { $obj['rowPictureDataPath'] = '' }
|
||||
elseif ($rpdp -ne "$listName.DefaultPicture") { $obj['rowPictureDataPath'] = $rpdp }
|
||||
$rpRef = $node.SelectSingleNode("lf:RowsPicture/xr:Ref", $ns); if ($rpRef) { $obj['rowsPicture'] = $rpRef.InnerText }
|
||||
elseif ($rpdp -ne "$($obj['path']).DefaultPicture") { $obj['rowPictureDataPath'] = $rpdp }
|
||||
$usg = Get-Child $node 'UserSettingsGroup'; if ($usg) { $obj['userSettingsGroup'] = $usg }
|
||||
}
|
||||
} elseif ($rpdp) { $obj['rowPictureDataPath'] = $rpdp }
|
||||
$csNode = $node.SelectSingleNode("lf:CommandSet", $ns)
|
||||
if ($csNode) {
|
||||
$exc = New-Object System.Collections.ArrayList
|
||||
|
||||
Reference in New Issue
Block a user