feat(form-decompile,form-compile): CommandSet/excludedCommands таблиц (кластер F)

CommandSet встречается на Table (23) и Form (8). Форменный excludedCommands
уже поддержан, табличный — нет.

- compiler PS1+PY: Emit-Table — excludedCommands → <CommandSet>; заодно
  viewStatusLocation/searchControlLocation (из того же блока свойств таблицы).
- decompiler: Table — CommandSet→excludedCommands, searchStringLocation
  (раньше не ловился), viewStatusLocation/searchControlLocation.
- docs/form-dsl-spec: excludedCommands + view/searchControl у таблицы.
- tests: table расширен, сертифицирован в 1С.

ExcludedCommand ушёл из топа LOST. Регресс 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 19:18:17 +03:00
co-authored by Claude Opus 4.8
parent 0941fc717d
commit 9c1ea1662a
6 changed files with 48 additions and 6 deletions
@@ -1,4 +1,4 @@
# form-compile v1.27 — Compile 1C managed form from JSON or object metadata
# form-compile v1.28 — Compile 1C managed form from JSON or object metadata
# Source: https://github.com/Nikolay-Shirokov/cc-1c-skills
param(
[string]$JsonPath,
@@ -1922,7 +1922,8 @@ function Emit-Element {
"children"=1;"columns"=1
# table-specific
"changeRowSet"=1;"changeRowOrder"=1;"header"=1;"footer"=1
"commandBarLocation"=1;"searchStringLocation"=1
"commandBarLocation"=1;"searchStringLocation"=1;"viewStatusLocation"=1;"searchControlLocation"=1
"excludedCommands"=1
"choiceMode"=1;"initialTreeView"=1;"enableDrag"=1;"enableStartDrag"=1
"rowPictureDataPath"=1;"tableAutofill"=1
# pages-specific
@@ -2528,8 +2529,16 @@ function Emit-Table {
if ($el.enableStartDrag -eq $true) { X "$inner<EnableStartDrag>true</EnableStartDrag>" }
if ($el.enableDrag -eq $true) { X "$inner<EnableDrag>true</EnableDrag>" }
if ($el.rowPictureDataPath) { X "$inner<RowPictureDataPath>$($el.rowPictureDataPath)</RowPictureDataPath>" }
if ($el.viewStatusLocation) { X "$inner<ViewStatusLocation>$($el.viewStatusLocation)</ViewStatusLocation>" }
if ($el.searchControlLocation) { X "$inner<SearchControlLocation>$($el.searchControlLocation)</SearchControlLocation>" }
Emit-Layout -el $el -indent $inner -skipHeight
if ($el.excludedCommands -and $el.excludedCommands.Count -gt 0) {
X "$inner<CommandSet>"
foreach ($cmd in $el.excludedCommands) { X "$inner`t<ExcludedCommand>$cmd</ExcludedCommand>" }
X "$inner</CommandSet>"
}
# Companions
Emit-Companion -tag "ContextMenu" -name "${name}КонтекстноеМеню" -indent $inner
# AutoCommandBar — with optional Autofill control
@@ -1,5 +1,5 @@
#!/usr/bin/env python3
# form-compile v1.27 — Compile 1C managed form from JSON or object metadata
# form-compile v1.28 — Compile 1C managed form from JSON or object metadata
# Source: https://github.com/Nikolay-Shirokov/cc-1c-skills
import argparse
import copy
@@ -1356,7 +1356,8 @@ KNOWN_KEYS = {
"showTitle", "united", "collapsed",
"children", "columns",
"changeRowSet", "changeRowOrder", "header", "footer",
"commandBarLocation", "searchStringLocation",
"commandBarLocation", "searchStringLocation", "viewStatusLocation", "searchControlLocation",
"excludedCommands",
"pagesRepresentation",
"type", "command", "stdCommand", "defaultButton", "locationInCommandBar",
"src", "valuesPicture", "loadTransparent",
@@ -2186,8 +2187,18 @@ def emit_table(lines, el, name, eid, indent):
lines.append(f'{inner}<EnableDrag>true</EnableDrag>')
if el.get('rowPictureDataPath'):
lines.append(f'{inner}<RowPictureDataPath>{el["rowPictureDataPath"]}</RowPictureDataPath>')
if el.get('viewStatusLocation'):
lines.append(f'{inner}<ViewStatusLocation>{el["viewStatusLocation"]}</ViewStatusLocation>')
if el.get('searchControlLocation'):
lines.append(f'{inner}<SearchControlLocation>{el["searchControlLocation"]}</SearchControlLocation>')
emit_layout(lines, el, inner, skip_height=True)
if el.get('excludedCommands'):
lines.append(f'{inner}<CommandSet>')
for cmd in el['excludedCommands']:
lines.append(f'{inner}\t<ExcludedCommand>{cmd}</ExcludedCommand>')
lines.append(f'{inner}</CommandSet>')
# Companions
emit_companion(lines, 'ContextMenu', f'{name}\u041a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u043d\u043e\u0435\u041c\u0435\u043d\u044e', inner)
# AutoCommandBar — with optional Autofill control
@@ -1,4 +1,4 @@
# form-decompile v0.6 — Decompile 1C managed Form.xml to JSON DSL (draft)
# form-decompile v0.7 — Decompile 1C managed Form.xml to JSON DSL (draft)
# Source: https://github.com/Nikolay-Shirokov/cc-1c-skills
# ВНИМАНИЕ: раундтрип не гарантируется. Навык исключён из авто-использования моделью.
param(
@@ -450,6 +450,15 @@ function Decompile-Element {
if ((Get-Child $node 'Footer') -eq 'true') { $obj['footer'] = $true }
$htr = Get-Child $node 'HeightInTableRows'; if ($htr) { $obj['height'] = [int]$htr }
$cbl = Get-Child $node 'CommandBarLocation'; if ($cbl) { $obj['commandBarLocation'] = $cbl }
$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 }
$csNode = $node.SelectSingleNode("lf:CommandSet", $ns)
if ($csNode) {
$exc = New-Object System.Collections.ArrayList
foreach ($ec in @($csNode.SelectNodes("lf:ExcludedCommand", $ns))) { [void]$exc.Add($ec.InnerText) }
if ($exc.Count -gt 0) { $obj['excludedCommands'] = @($exc) }
}
$cols = Decompile-Children $node
if ($cols) { $obj['columns'] = $cols }
}
+3
View File
@@ -296,6 +296,9 @@
| `footer` | bool | Показывать подвал |
| `commandBarLocation` | string | `None`, `Top`, `Bottom`, `Auto` |
| `searchStringLocation` | string | `None`, `Top`, `Bottom`, `CommandBar`, `Auto` |
| `viewStatusLocation` | string | `None`, `Top`, `Bottom`, `Auto` |
| `searchControlLocation` | string | `None`, `Top`, `Bottom`, `Auto` |
| `excludedCommands` | string[] | Исключённые стандартные команды таблицы (`Add`, `Delete`, `MoveUp`, `SortListAsc`, …) → `<CommandSet>` |
#### columnGroup — ColumnGroup
@@ -12,6 +12,14 @@
<Table name="Данные" id="1">
<DataPath>Данные</DataPath>
<ChangeRowSet>true</ChangeRowSet>
<ViewStatusLocation>None</ViewStatusLocation>
<SearchControlLocation>None</SearchControlLocation>
<CommandSet>
<ExcludedCommand>Add</ExcludedCommand>
<ExcludedCommand>Delete</ExcludedCommand>
<ExcludedCommand>MoveUp</ExcludedCommand>
<ExcludedCommand>MoveDown</ExcludedCommand>
</CommandSet>
<ContextMenu name="ДанныеКонтекстноеМеню" id="2"/>
<AutoCommandBar name="ДанныеКоманднаяПанель" id="3"/>
<SearchStringAddition name="ДанныеСтрокаПоиска" id="4"/>
+3 -1
View File
@@ -16,7 +16,9 @@
"input": {
"title": "Просмотр данных",
"elements": [
{ "table": "Данные", "path": "Данные", "changeRowSet": true, "columns": [
{ "table": "Данные", "path": "Данные", "changeRowSet": true,
"viewStatusLocation": "None", "searchControlLocation": "None",
"excludedCommands": ["Add", "Delete", "MoveUp", "MoveDown"], "columns": [
{ "input": "Дата", "path": "Данные.Дата" },
{ "input": "Сумма", "path": "Данные.Сумма" },
{ "input": "Комментарий", "path": "Данные.Комментарий" }