feat(form-decompile,form-compile): листовые свойства полей + фикс Hiperlink (кластер L)

БАГ: у LabelField платформенный тег <Hiperlink> (опечатка 1С), компилятор
эмитил <Hyperlink> — гиперссылка не работала и не роундтрипилась. Проверено
по корпусу: LabelField→Hiperlink во всех версиях формата (2.17 и 2.20).

- compiler PS1+PY: LabelField <Hiperlink>; EditMode (input/check/labelField);
  CheckBoxType (check, умный дефолт Auto + suppress как radioButtonType).
- decompiler: editMode, checkBoxType (Auto→опустить), markIncomplete (раньше не ловился),
  labelField читает <Hiperlink>.
- docs/form-dsl-spec: editMode, checkBoxType, примечание про Hiperlink.
- tests: input-fields расширен (editMode/checkBoxType/labelField+hyperlink), сертифицирован.

Регресс 32/32 PS1+PY, churn по флажкам обновлён и сертифицирован.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Nick Shirokov
2026-06-04 20:29:31 +03:00
co-authored by Claude Opus 4.8
parent f27a17139a
commit b4fc9bf42c
8 changed files with 121 additions and 42 deletions
@@ -1,4 +1,4 @@
# form-compile v1.29 — Compile 1C managed form from JSON or object metadata
# form-compile v1.30 — Compile 1C managed form from JSON or object metadata
# Source: https://github.com/Nikolay-Shirokov/cc-1c-skills
param(
[string]$JsonPath,
@@ -1914,7 +1914,7 @@ function Emit-Element {
# columnGroup-specific
"showInHeader"=1
# radio-specific
"radioButtonType"=1;"choiceList"=1;"columnsCount"=1
"radioButtonType"=1;"choiceList"=1;"columnsCount"=1;"checkBoxType"=1;"editMode"=1
# naming & binding
"name"=1;"path"=1;"title"=1
# visibility & state
@@ -2210,6 +2210,7 @@ function Emit-Input {
if ($el.spinButton -eq $true) { X "$inner<SpinButton>true</SpinButton>" }
if ($el.dropListButton -eq $true) { X "$inner<DropListButton>true</DropListButton>" }
if ($el.markIncomplete -eq $true) { X "$inner<AutoMarkIncomplete>true</AutoMarkIncomplete>" }
if ($el.editMode) { X "$inner<EditMode>$($el.editMode)</EditMode>" }
if ($el.textEdit -eq $false) { X "$inner<TextEdit>false</TextEdit>" }
Emit-Layout -el $el -indent $inner -multiLineDefault ([bool]($el.multiLine -eq $true))
@@ -2237,6 +2238,15 @@ function Emit-Check {
Emit-Title -el $el -name $name -indent $inner -auto:(-not $el.path)
Emit-CommonFlags -el $el -indent $inner
if ($el.editMode) { X "$inner<EditMode>$($el.editMode)</EditMode>" }
# CheckBoxType: нет ключа → умный дефолт Auto; "" → подавить; значение → маппинг
if ($null -ne $el.PSObject.Properties['checkBoxType']) {
if ($el.checkBoxType) {
$cbt = switch ("$($el.checkBoxType)".ToLower()) { 'auto' {'Auto'} 'checkbox' {'CheckBox'} 'switcher' {'Switcher'} 'tumbler' {'Tumbler'} default {"$($el.checkBoxType)"} }
X "$inner<CheckBoxType>$cbt</CheckBoxType>"
}
} else { X "$inner<CheckBoxType>Auto</CheckBoxType>" }
Emit-TitleLocation -el $el -indent $inner -smartDefault "Right"
Emit-Layout -el $el -indent $inner
@@ -2502,7 +2512,9 @@ function Emit-LabelField {
Emit-Title -el $el -name $name -indent $inner -auto:(-not $el.path)
Emit-CommonFlags -el $el -indent $inner
if ($el.hyperlink -eq $true) { X "$inner<Hyperlink>true</Hyperlink>" }
if ($el.editMode) { X "$inner<EditMode>$($el.editMode)</EditMode>" }
# ВНИМАНИЕ: у LabelField платформенный тег именно <Hiperlink> (опечатка 1С), не <Hyperlink>.
if ($el.hyperlink -eq $true) { X "$inner<Hiperlink>true</Hiperlink>" }
Emit-Layout -el $el -indent $inner
# Companions