feat(form-decompile,form-compile): батч простых хвостов — generic-скаляры, form Scale, CommandBar HL Auto, CheckBox FooterDataPath

Хвост из указанных форм (по 1 в корпусе, кроме CheckBox FooterDataPath):
(1) GENERIC_SCALARS (обе стороны+py): AutoCorrectionOnTextInput (input) /
    CommandUniqueness (button bool) / AllowInputEmptyMultipleValues (input bool) /
    BehaviorOnHorizontalCompression (table).
(2) Форменный <Scale> (масштаб формы) → KNOWN_FORM_PROPS.
(3) CommandBar>HorizontalLocation: компилятор через Get-HLocation скипал Auto
    (умолчание дополнений), но CommandBar хранит его фактически (декомпилятор ловит
    только при наличии) → эмит фактический, включая Auto. Зеркало py.
(4) CheckBoxField>FooterDataPath/FooterText — общие cell-свойства колонки, не ловились
    у check (как раньше расширяли на picField). Захват + эмит (ps1+py).

Выборка 9 форм: match 7/9 (остаток 2 — InputField>MultipleValuesFont структурный font
[отложен] + app:item>Value DesignTimeRef-GUID). ps1==py байт-в-байт. Регресс 43/43. Spec.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Nick Shirokov
2026-06-13 17:25:37 +03:00
co-authored by Claude Opus 4.8
parent 95d8ece309
commit b5e8e1df7a
4 changed files with 42 additions and 8 deletions
@@ -1,4 +1,4 @@
# form-compile v1.167 — Compile 1C managed form from JSON or object metadata
# form-compile v1.168 — Compile 1C managed form from JSON or object metadata
# Source: https://github.com/Nikolay-Shirokov/cc-1c-skills
param(
[string]$JsonPath,
@@ -3269,6 +3269,12 @@ $script:genericScalars = @(
@{ Tag='MultipleValuesBackColor'; Key='multipleValuesBackColor'; Kind='value' }
@{ Tag='MultipleValuePictureShape'; Key='multipleValuePictureShape'; Kind='value' }
@{ Tag='MultipleValuePictureDataPath'; Key='multipleValuePictureDataPath'; Kind='value' }
# Хвост листовых скаляров (по 1 в корпусе): автокоррекция ввода (input) / уникальность команды
# (button) / допуск пустого множ. значения (input) / поведение при гориз. сжатии (table)
@{ Tag='AutoCorrectionOnTextInput'; Key='autoCorrectionOnTextInput'; Kind='value' }
@{ Tag='CommandUniqueness'; Key='commandUniqueness'; Kind='bool' }
@{ Tag='AllowInputEmptyMultipleValues';Key='allowInputEmptyMultipleValues';Kind='bool' }
@{ Tag='BehaviorOnHorizontalCompression'; Key='behaviorOnHorizontalCompression'; Kind='value' }
)
function Emit-GenericScalars {
@@ -3958,6 +3964,9 @@ function Emit-Check {
Emit-Layout -el $el -indent $inner
if ($null -ne $el.warningOnEdit) { Emit-MLText -tag "WarningOnEdit" -text $el.warningOnEdit -indent $inner }
# FooterDataPath / FooterText — общие cell-свойства колонки (как у input/labelField)
if ($el.footerDataPath) { X "$inner<FooterDataPath>$(Esc-Xml "$($el.footerDataPath)")</FooterDataPath>" }
if ($null -ne $el.footerText) { Emit-MLText -tag "FooterText" -text $el.footerText -indent $inner }
# Формат / формат редактирования (LocalStringType — строка или {ru,en})
if ($el.format) { Emit-MLText -tag "Format" -text $el.format -indent $inner }
@@ -5014,7 +5023,12 @@ function Emit-CommandBar {
if ($el.autofill -eq $true) { X "$inner<Autofill>true</Autofill>" }
$hl = Get-HLocation $el; if ($hl) { X "$inner<HorizontalLocation>$hl</HorizontalLocation>" }
# CommandBar хранит HorizontalLocation фактически (включая Auto — декомпилятор ловит только при наличии);
# ≠ дополнениям, где Auto = умолчание-скип (Get-HLocation).
if ($el.horizontalLocation) {
$hlv = switch ("$($el.horizontalLocation)".ToLower()) { 'auto' {'Auto'} 'left' {'Left'} 'right' {'Right'} 'center' {'Center'} default {"$($el.horizontalLocation)"} }
X "$inner<HorizontalLocation>$hlv</HorizontalLocation>"
}
Emit-CommonFlags -el $el -indent $inner
Emit-Layout -el $el -indent $inner
Emit-Companion -tag "ExtendedTooltip" -name "${name}РасширеннаяПодсказка" -indent $inner -content $el.extendedTooltip
@@ -1,5 +1,5 @@
#!/usr/bin/env python3
# form-compile v1.167 — Compile 1C managed form from JSON or object metadata
# form-compile v1.168 — Compile 1C managed form from JSON or object metadata
# Source: https://github.com/Nikolay-Shirokov/cc-1c-skills
import argparse
import copy
@@ -3387,6 +3387,11 @@ GENERIC_SCALARS = [
('MultipleValuesBackColor', 'multipleValuesBackColor', 'value'),
('MultipleValuePictureShape', 'multipleValuePictureShape', 'value'),
('MultipleValuePictureDataPath', 'multipleValuePictureDataPath', 'value'),
# Хвост листовых скаляров (по 1): автокоррекция / уникальность команды / пустое множ.значение / гориз.сжатие
('AutoCorrectionOnTextInput', 'autoCorrectionOnTextInput', 'value'),
('CommandUniqueness', 'commandUniqueness', 'bool'),
('AllowInputEmptyMultipleValues', 'allowInputEmptyMultipleValues', 'bool'),
('BehaviorOnHorizontalCompression', 'behaviorOnHorizontalCompression', 'value'),
]
@@ -4063,6 +4068,11 @@ def emit_check(lines, el, name, eid, indent):
if el.get('warningOnEdit') is not None:
emit_mltext(lines, inner, 'WarningOnEdit', el['warningOnEdit'])
# FooterDataPath / FooterText — общие cell-свойства колонки (как у input/labelField)
if el.get('footerDataPath'):
lines.append(f'{inner}<FooterDataPath>{esc_xml(str(el["footerDataPath"]))}</FooterDataPath>')
if el.get('footerText') is not None:
emit_mltext(lines, inner, 'FooterText', el['footerText'])
# Формат / формат редактирования (LocalStringType — строка или {ru,en})
if el.get('format'):
@@ -4748,9 +4758,10 @@ def emit_command_bar(lines, el, name, eid, indent):
if el.get('autofill') is True:
lines.append(f'{inner}<Autofill>true</Autofill>')
_hl = get_hlocation(el)
if _hl:
lines.append(f'{inner}<HorizontalLocation>{_hl}</HorizontalLocation>')
# CommandBar хранит HorizontalLocation фактически (включая Auto); ≠ дополнениям (Auto=скип)
if el.get('horizontalLocation'):
_hlv = {'auto': 'Auto', 'left': 'Left', 'right': 'Right', 'center': 'Center'}.get(str(el['horizontalLocation']).lower(), str(el['horizontalLocation']))
lines.append(f'{inner}<HorizontalLocation>{_hlv}</HorizontalLocation>')
emit_common_flags(lines, el, inner)
emit_layout(lines, el, inner)
@@ -1,4 +1,4 @@
# form-decompile v0.144 — Decompile 1C managed Form.xml to JSON DSL (draft)
# form-decompile v0.145 — Decompile 1C managed Form.xml to JSON DSL (draft)
# Source: https://github.com/Nikolay-Shirokov/cc-1c-skills
# ВНИМАНИЕ: раундтрип не гарантируется. Навык исключён из авто-использования моделью.
param(
@@ -1638,6 +1638,11 @@ $GENERIC_SCALARS = @(
@{ Tag='MultipleValuesBackColor'; Key='multipleValuesBackColor'; Kind='value' }
@{ Tag='MultipleValuePictureShape'; Key='multipleValuePictureShape'; Kind='value' }
@{ Tag='MultipleValuePictureDataPath'; Key='multipleValuePictureDataPath'; Kind='value' }
# Хвост листовых скаляров (по 1): автокоррекция / уникальность команды / пустое множ.значение / гориз.сжатие
@{ Tag='AutoCorrectionOnTextInput'; Key='autoCorrectionOnTextInput'; Kind='value' }
@{ Tag='CommandUniqueness'; Key='commandUniqueness'; Kind='bool' }
@{ Tag='AllowInputEmptyMultipleValues'; Key='allowInputEmptyMultipleValues'; Kind='bool' }
@{ Tag='BehaviorOnHorizontalCompression'; Key='behaviorOnHorizontalCompression'; Kind='value' }
)
# Захват generic-скаляров. Специфичная обработка (если ключ уже задан) — побеждает.
@@ -1969,6 +1974,9 @@ function Decompile-Element {
elseif ($cbt -ne 'Auto') { $obj['checkBoxType'] = $cbt.Substring(0,1).ToLower() + $cbt.Substring(1) }
Add-TitleLocation $obj $node 'Right'
$woe = $node.SelectSingleNode("lf:WarningOnEdit", $ns); if ($woe) { $t = Get-LangTextWS $woe; if ($null -ne $t) { $obj['warningOnEdit'] = $t } }
# FooterDataPath / FooterText — общие cell-свойства колонки (как у input/labelField)
$fdp = Get-Child $node 'FooterDataPath'; if ($fdp) { $obj['footerDataPath'] = $fdp }
$ftxt = $node.SelectSingleNode("lf:FooterText", $ns); if ($ftxt) { $t = Get-LangTextWS $ftxt; if ($null -ne $t) { $obj['footerText'] = $t } }
Add-FormatProps $obj $node
}
'RadioButtonField' {
@@ -2513,7 +2521,7 @@ $titleNode = $root.SelectSingleNode("lf:Title", $ns)
if ($titleNode) { $t = Get-LangText $titleNode; if ($null -ne $t) { $dsl['title'] = $t } }
# properties (прямые скаляры под <Form>, PascalCase → camelCase)
$KNOWN_FORM_PROPS = @('AutoTitle','ReportResult','DetailsData','ReportFormType','AutoShowState','ReportResultViewMode','ViewModeApplicationOnSetReportResult','WindowOpeningMode','CommandBarLocation','SaveDataInSettings','AutoSaveDataInSettings','AutoTime','UsePostingMode','RepostOnWrite','AutoURL','AutoFillCheck','Customizable','EnterKeyBehavior','VerticalScroll','Width','Height','Group','UseForFoldersAndItems','SaveWindowSettings','ScalingMode','VerticalSpacing','VariantAppearance','ShowCloseButton','HorizontalAlign','ChildrenAlign','ShowTitle','ConversationsRepresentation','CollapseItemsByImportanceVariant','GroupList','ChildItemsWidth','VerticalAlign','HorizontalSpacing','CustomSettingsFolder','SettingsStorage','Enabled')
$KNOWN_FORM_PROPS = @('AutoTitle','ReportResult','DetailsData','ReportFormType','AutoShowState','ReportResultViewMode','ViewModeApplicationOnSetReportResult','WindowOpeningMode','CommandBarLocation','SaveDataInSettings','AutoSaveDataInSettings','AutoTime','UsePostingMode','RepostOnWrite','AutoURL','AutoFillCheck','Customizable','EnterKeyBehavior','VerticalScroll','Width','Height','Group','UseForFoldersAndItems','SaveWindowSettings','ScalingMode','VerticalSpacing','VariantAppearance','ShowCloseButton','HorizontalAlign','ChildrenAlign','ShowTitle','ConversationsRepresentation','CollapseItemsByImportanceVariant','GroupList','ChildItemsWidth','VerticalAlign','HorizontalSpacing','CustomSettingsFolder','SettingsStorage','Enabled','Scale')
$props = [ordered]@{}
foreach ($pn in $KNOWN_FORM_PROPS) {
$v = Get-Child $root $pn
+1
View File
@@ -60,6 +60,7 @@
| `repostOnWrite` | `<RepostOnWrite>` | `true` / `false` |
| `autoURL` | `<AutoURL>` | `true` / `false` |
| `enabled` | `<Enabled>` | `true` / `false` — доступность всей формы (редкое; форма-уровень) |
| `scale` | `<Scale>` | масштаб формы (число, напр. `98`; редкое) |
| `autoFillCheck` | `<AutoFillCheck>` | `true` / `false` |
| `customizable` | `<Customizable>` | `true` / `false` |
| `enterKeyBehavior` | `<EnterKeyBehavior>` | `DefaultButton`, `NewLine` |