feat(form-decompile,form-compile): Table + PictureField leaf-скаляры (autofill/multipleChoice/searchOnInput/markIncomplete/hyperlink/shortcut)

Раундтрип TOTAL 61→57, match 130→135. Захват+эмит «как есть»:

- Table: autofill (<Autofill> — СВОЁ свойство таблицы, ≠ AutoCommandBar autofill
  = tableAutofill; редко, 270 в корпусе, всегда true = автогенерация колонок,
  ChildItems пуст у 93%), multipleChoice, searchOnInput (Auto/Use/DontUse),
  markIncomplete (<AutoMarkIncomplete>, общий ключ с input).
- PictureField: hyperlink (<Hyperlink> — кликабельная картинка), shortcut (<Shortcut>).

Зеркало py. Кейсы table + picture-field расширены, сертифицированы загрузкой
в 1С. Регресс 39/39 в обоих рантаймах.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Nick Shirokov
2026-06-09 11:28:37 +03:00
parent 8bff8d7e05
commit 6807b07681
8 changed files with 46 additions and 5 deletions
@@ -1,4 +1,4 @@
# form-compile v1.88 — Compile 1C managed form from JSON or object metadata
# form-compile v1.89 — Compile 1C managed form from JSON or object metadata
# Source: https://github.com/Nikolay-Shirokov/cc-1c-skills
param(
[string]$JsonPath,
@@ -2604,6 +2604,7 @@ function Emit-Element {
"excludedCommands"=1
"choiceMode"=1;"initialTreeView"=1;"enableDrag"=1;"enableStartDrag"=1
"rowPictureDataPath"=1;"tableAutofill"=1;"heightInTableRows"=1
"multipleChoice"=1;"searchOnInput"=1;"shortcut"=1
"rowSelectionMode"=1;"verticalLines"=1;"horizontalLines"=1
# dynamic-list table block
"defaultItem"=1;"useAlternationRowColor"=1;"fileDragMode"=1;"autoRefresh"=1
@@ -3781,6 +3782,11 @@ function Emit-Table {
X "$inner<SearchStringLocation>$($el.searchStringLocation)</SearchStringLocation>"
}
if ($el.choiceMode -eq $true) { X "$inner<ChoiceMode>true</ChoiceMode>" }
# Скаляры таблицы (захват «как есть»). Autofill — СВОЁ свойство таблицы (≠ AutoCommandBar autofill = tableAutofill).
if ($null -ne $el.autofill) { X "$inner<Autofill>$(if ($el.autofill){'true'}else{'false'})</Autofill>" }
if ($el.multipleChoice -eq $true) { X "$inner<MultipleChoice>true</MultipleChoice>" }
if ($el.searchOnInput) { X "$inner<SearchOnInput>$($el.searchOnInput)</SearchOnInput>" }
if ($el.markIncomplete -eq $true) { X "$inner<AutoMarkIncomplete>true</AutoMarkIncomplete>" }
if ($el.useAlternationRowColor -eq $true) { X "$inner<UseAlternationRowColor>true</UseAlternationRowColor>" }
if ($el.selectionMode) { X "$inner<SelectionMode>$($el.selectionMode)</SelectionMode>" }
if ($el.rowSelectionMode) { X "$inner<RowSelectionMode>$($el.rowSelectionMode)</RowSelectionMode>" }
@@ -4061,6 +4067,8 @@ function Emit-PictureField {
if ($el.editMode) { X "$inner<EditMode>$($el.editMode)</EditMode>" }
Emit-ColumnPics -el $el -indent $inner
if ($el.titleLocation) { X "$inner<TitleLocation>$(Map-TitleLoc "$($el.titleLocation)")</TitleLocation>" }
if ($el.hyperlink -eq $true) { X "$inner<Hyperlink>true</Hyperlink>" }
if ($el.shortcut) { X "$inner<Shortcut>$(Esc-Xml "$($el.shortcut)")</Shortcut>" }
Emit-Layout -el $el -indent $inner
@@ -1,5 +1,5 @@
#!/usr/bin/env python3
# form-compile v1.88 — Compile 1C managed form from JSON or object metadata
# form-compile v1.89 — Compile 1C managed form from JSON or object metadata
# Source: https://github.com/Nikolay-Shirokov/cc-1c-skills
import argparse
import copy
@@ -1803,6 +1803,7 @@ KNOWN_KEYS = {
"choiceMode", "initialTreeView", "enableDrag", "enableStartDrag",
"rowSelectionMode", "verticalLines", "horizontalLines",
"rowPictureDataPath", "tableAutofill", "heightInTableRows",
"multipleChoice", "searchOnInput", "shortcut",
# dynamic-list table block
"defaultItem", "useAlternationRowColor", "fileDragMode", "autoRefresh",
"autoRefreshPeriod", "choiceFoldersAndItems", "restoreCurrentRow", "showRoot",
@@ -3484,6 +3485,15 @@ def emit_table(lines, el, name, eid, indent):
if el.get('choiceMode') is True:
lines.append(f'{inner}<ChoiceMode>true</ChoiceMode>')
# Скаляры таблицы (захват «как есть»). Autofill — СВОЁ свойство таблицы (≠ AutoCommandBar autofill = tableAutofill).
if el.get('autofill') is not None:
lines.append(f'{inner}<Autofill>{"true" if el["autofill"] else "false"}</Autofill>')
if el.get('multipleChoice') is True:
lines.append(f'{inner}<MultipleChoice>true</MultipleChoice>')
if el.get('searchOnInput'):
lines.append(f'{inner}<SearchOnInput>{el["searchOnInput"]}</SearchOnInput>')
if el.get('markIncomplete') is True:
lines.append(f'{inner}<AutoMarkIncomplete>true</AutoMarkIncomplete>')
if el.get('useAlternationRowColor') is True:
lines.append(f'{inner}<UseAlternationRowColor>true</UseAlternationRowColor>')
if el.get('selectionMode'):
@@ -3754,6 +3764,10 @@ def emit_picture_field(lines, el, name, eid, indent):
emit_column_pics(lines, el, inner)
if el.get('titleLocation'):
lines.append(f'{inner}<TitleLocation>{map_title_loc(el["titleLocation"])}</TitleLocation>')
if el.get('hyperlink') is True:
lines.append(f'{inner}<Hyperlink>true</Hyperlink>')
if el.get('shortcut'):
lines.append(f'{inner}<Shortcut>{esc_xml(str(el["shortcut"]))}</Shortcut>')
emit_layout(lines, el, inner)
@@ -1,4 +1,4 @@
# form-decompile v0.64 — Decompile 1C managed Form.xml to JSON DSL (draft)
# form-decompile v0.65 — Decompile 1C managed Form.xml to JSON DSL (draft)
# Source: https://github.com/Nikolay-Shirokov/cc-1c-skills
# ВНИМАНИЕ: раундтрип не гарантируется. Навык исключён из авто-использования моделью.
param(
@@ -1454,6 +1454,8 @@ function Decompile-Element {
Add-CommonProps $obj $node $name
$em = Get-Child $node 'EditMode'; if ($em) { $obj['editMode'] = $em }
$tl = Get-Child $node 'TitleLocation'; if ($tl) { $obj['titleLocation'] = $tl.ToLower() }
if ((Get-Child $node 'Hyperlink') -eq 'true') { $obj['hyperlink'] = $true }
$sct = Get-Child $node 'Shortcut'; if ($sct) { $obj['shortcut'] = $sct }
$vp = Get-PictureRef $node 'ValuesPicture'; if ($null -ne $vp) { $obj['valuesPicture'] = $vp }
}
'CalendarField' {
@@ -1499,6 +1501,11 @@ function Decompile-Element {
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 }
# Скаляры таблицы (захват «как есть»). Autofill — СВОЁ свойство таблицы (≠ AutoCommandBar autofill).
$taf = Get-Child $node 'Autofill'; if ($null -ne $taf) { $obj['autofill'] = ($taf -eq 'true') }
if ((Get-Child $node 'MultipleChoice') -eq 'true') { $obj['multipleChoice'] = $true }
$soin = Get-Child $node 'SearchOnInput'; if ($soin) { $obj['searchOnInput'] = $soin }
if ((Get-Child $node 'AutoMarkIncomplete') -eq 'true') { $obj['markIncomplete'] = $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'
+6
View File
@@ -523,6 +523,10 @@ companion-панели с собственным контентом. Оба не
| `enableDrag` | bool | Разрешить перетаскивание из таблицы |
| `rowFilter` | null | Отбор строк (nil-плейсхолдер `<RowFilter xsi:nil="true"/>`); значение всегда `null` |
| `choiceMode` | bool | Режим выбора |
| `autofill` | bool | Автозаполнение состава колонок из источника (`<Autofill>`). Своё свойство таблицы (≠ `tableAutofill` = autofill вложенной командной панели). Дефолт (нет тега) — колонки заданы явно; `true` — таблица генерирует колонки сама (ChildItems пуст). Редко (270 в корпусе, всегда `true`) |
| `multipleChoice` | bool | Множественный выбор (`<MultipleChoice>`) |
| `searchOnInput` | string | Поиск при вводе (`<SearchOnInput>`): `Auto`, `Use`, `DontUse` |
| `markIncomplete` | bool | Автоотметка незаполненного (`<AutoMarkIncomplete>`); общий ключ с `input` |
| `useAlternationRowColor` | bool | Чередование цвета строк |
| `selectionMode` | string | Режим выделения (`SingleRow`, …) |
| `rowSelectionMode` | string | Режим выделения строки (`Row`, …) |
@@ -674,6 +678,8 @@ Pages поддерживает `pagesRepresentation`: `None`, `TabsOnTop`, `Tabs
|----------|-----|----------|
| `valuesPicture` | string \| object | Картинка значения. Формат картинки-ссылки — см. §4.1 «Картинка-ссылка» |
| `editMode` | string | Режим редактирования колонки (`EnterOnInput` и т.п.) |
| `hyperlink` | bool | Картинка-гиперссылка (`<Hyperlink>true</Hyperlink>`) — кликабельная картинка |
| `shortcut` | string | Сочетание клавиш (`<Shortcut>`, напр. `Ctrl+S`) |
#### calendar — CalendarField
@@ -20,7 +20,7 @@
"on": ["Selection"], "handlers": { "Selection": "ТаблицаДанныхВыбор" },
"columns": [
{ "input": "ТаблицаДанныхНоменклатура", "path": "ТаблицаДанных.Номенклатура" },
{ "picField": "ТаблицаДанныхКартинка", "path": "ТаблицаДанных.Картинка", "titleLocation": "none", "editMode": "EnterOnInput", "headerPicture": "StdPicture.ExecuteTask", "valuesPicture": { "src": "StdPicture.FilterCriterion", "loadTransparent": true } },
{ "picField": "ТаблицаДанныхКартинка", "path": "ТаблицаДанных.Картинка", "titleLocation": "none", "editMode": "EnterOnInput", "hyperlink": true, "shortcut": "Ctrl+S", "headerPicture": "StdPicture.ExecuteTask", "valuesPicture": { "src": "StdPicture.FilterCriterion", "loadTransparent": true } },
{ "check": "ТаблицаДанныхКартинкаФлаг", "path": "ТаблицаДанных.Картинка", "title": "Флаг", "headerPicture": { "src": "StdPicture.ClearFilter", "loadTransparent": true } }
]}
],
@@ -52,6 +52,8 @@
<xr:LoadTransparent>false</xr:LoadTransparent>
</HeaderPicture>
<TitleLocation>None</TitleLocation>
<Hyperlink>true</Hyperlink>
<Shortcut>Ctrl+S</Shortcut>
<ValuesPicture>
<xr:Ref>StdPicture.FilterCriterion</xr:Ref>
<xr:LoadTransparent>true</xr:LoadTransparent>
@@ -14,6 +14,10 @@
<TitleLocation>Top</TitleLocation>
<ChangeRowSet>true</ChangeRowSet>
<HeightInTableRows>5</HeightInTableRows>
<Autofill>true</Autofill>
<MultipleChoice>true</MultipleChoice>
<SearchOnInput>Use</SearchOnInput>
<AutoMarkIncomplete>true</AutoMarkIncomplete>
<ViewStatusLocation>None</ViewStatusLocation>
<SearchControlLocation>None</SearchControlLocation>
<Height>80</Height>
+1 -1
View File
@@ -16,7 +16,7 @@
"input": {
"title": "Просмотр данных",
"elements": [
{ "table": "Данные", "path": "Данные", "changeRowSet": true, "titleLocation": "top", "height": 80, "heightInTableRows": 5,
{ "table": "Данные", "path": "Данные", "changeRowSet": true, "titleLocation": "top", "height": 80, "heightInTableRows": 5, "autofill": true, "multipleChoice": true, "searchOnInput": "Use", "markIncomplete": true,
"viewStatusLocation": "None", "searchControlLocation": "None",
"excludedCommands": ["Add", "Delete", "MoveUp", "MoveDown"],
"commandBar": { "autofill": false, "children": [