diff --git a/.claude/skills/form-compile/scripts/form-compile.ps1 b/.claude/skills/form-compile/scripts/form-compile.ps1 index d5778f16..68a9225e 100644 --- a/.claude/skills/form-compile/scripts/form-compile.ps1 +++ b/.claude/skills/form-compile/scripts/form-compile.ps1 @@ -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$($el.searchStringLocation)" } if ($el.choiceMode -eq $true) { X "$innertrue" } + # Скаляры таблицы (захват «как есть»). Autofill — СВОЁ свойство таблицы (≠ AutoCommandBar autofill = tableAutofill). + if ($null -ne $el.autofill) { X "$inner$(if ($el.autofill){'true'}else{'false'})" } + if ($el.multipleChoice -eq $true) { X "$innertrue" } + if ($el.searchOnInput) { X "$inner$($el.searchOnInput)" } + if ($el.markIncomplete -eq $true) { X "$innertrue" } if ($el.useAlternationRowColor -eq $true) { X "$innertrue" } if ($el.selectionMode) { X "$inner$($el.selectionMode)" } if ($el.rowSelectionMode) { X "$inner$($el.rowSelectionMode)" } @@ -4061,6 +4067,8 @@ function Emit-PictureField { if ($el.editMode) { X "$inner$($el.editMode)" } Emit-ColumnPics -el $el -indent $inner if ($el.titleLocation) { X "$inner$(Map-TitleLoc "$($el.titleLocation)")" } + if ($el.hyperlink -eq $true) { X "$innertrue" } + if ($el.shortcut) { X "$inner$(Esc-Xml "$($el.shortcut)")" } Emit-Layout -el $el -indent $inner diff --git a/.claude/skills/form-compile/scripts/form-compile.py b/.claude/skills/form-compile/scripts/form-compile.py index 239a9da0..4014f929 100644 --- a/.claude/skills/form-compile/scripts/form-compile.py +++ b/.claude/skills/form-compile/scripts/form-compile.py @@ -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}true') + # Скаляры таблицы (захват «как есть»). Autofill — СВОЁ свойство таблицы (≠ AutoCommandBar autofill = tableAutofill). + if el.get('autofill') is not None: + lines.append(f'{inner}{"true" if el["autofill"] else "false"}') + if el.get('multipleChoice') is True: + lines.append(f'{inner}true') + if el.get('searchOnInput'): + lines.append(f'{inner}{el["searchOnInput"]}') + if el.get('markIncomplete') is True: + lines.append(f'{inner}true') if el.get('useAlternationRowColor') is True: lines.append(f'{inner}true') 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}{map_title_loc(el["titleLocation"])}') + if el.get('hyperlink') is True: + lines.append(f'{inner}true') + if el.get('shortcut'): + lines.append(f'{inner}{esc_xml(str(el["shortcut"]))}') emit_layout(lines, el, inner) diff --git a/.claude/skills/form-decompile/scripts/form-decompile.ps1 b/.claude/skills/form-decompile/scripts/form-decompile.ps1 index 440b3671..9732ab67 100644 --- a/.claude/skills/form-decompile/scripts/form-decompile.ps1 +++ b/.claude/skills/form-decompile/scripts/form-decompile.ps1 @@ -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' diff --git a/docs/form-dsl-spec.md b/docs/form-dsl-spec.md index 38d14603..4d21d633 100644 --- a/docs/form-dsl-spec.md +++ b/docs/form-dsl-spec.md @@ -523,6 +523,10 @@ companion-панели с собственным контентом. Оба не | `enableDrag` | bool | Разрешить перетаскивание из таблицы | | `rowFilter` | null | Отбор строк (nil-плейсхолдер ``); значение всегда `null` | | `choiceMode` | bool | Режим выбора | +| `autofill` | bool | Автозаполнение состава колонок из источника (``). Своё свойство таблицы (≠ `tableAutofill` = autofill вложенной командной панели). Дефолт (нет тега) — колонки заданы явно; `true` — таблица генерирует колонки сама (ChildItems пуст). Редко (270 в корпусе, всегда `true`) | +| `multipleChoice` | bool | Множественный выбор (``) | +| `searchOnInput` | string | Поиск при вводе (``): `Auto`, `Use`, `DontUse` | +| `markIncomplete` | bool | Автоотметка незаполненного (``); общий ключ с `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 | Картинка-гиперссылка (`true`) — кликабельная картинка | +| `shortcut` | string | Сочетание клавиш (``, напр. `Ctrl+S`) | #### calendar — CalendarField diff --git a/tests/skills/cases/form-compile/picture-field.json b/tests/skills/cases/form-compile/picture-field.json index c5507cc7..60a4ee4b 100644 --- a/tests/skills/cases/form-compile/picture-field.json +++ b/tests/skills/cases/form-compile/picture-field.json @@ -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 } } ]} ], diff --git a/tests/skills/cases/form-compile/snapshots/picture-field/DataProcessors/КартинкаВСтроке/Forms/Форма/Ext/Form.xml b/tests/skills/cases/form-compile/snapshots/picture-field/DataProcessors/КартинкаВСтроке/Forms/Форма/Ext/Form.xml index 21846689..fbdc88b5 100644 --- a/tests/skills/cases/form-compile/snapshots/picture-field/DataProcessors/КартинкаВСтроке/Forms/Форма/Ext/Form.xml +++ b/tests/skills/cases/form-compile/snapshots/picture-field/DataProcessors/КартинкаВСтроке/Forms/Форма/Ext/Form.xml @@ -52,6 +52,8 @@ false None + true + Ctrl+S StdPicture.FilterCriterion true diff --git a/tests/skills/cases/form-compile/snapshots/table/DataProcessors/Таблица/Forms/Форма/Ext/Form.xml b/tests/skills/cases/form-compile/snapshots/table/DataProcessors/Таблица/Forms/Форма/Ext/Form.xml index 6c2f34f9..500907fc 100644 --- a/tests/skills/cases/form-compile/snapshots/table/DataProcessors/Таблица/Forms/Форма/Ext/Form.xml +++ b/tests/skills/cases/form-compile/snapshots/table/DataProcessors/Таблица/Forms/Форма/Ext/Form.xml @@ -14,6 +14,10 @@ Top true 5 + true + true + Use + true None None 80 diff --git a/tests/skills/cases/form-compile/table.json b/tests/skills/cases/form-compile/table.json index dc487404..f3da9922 100644 --- a/tests/skills/cases/form-compile/table.json +++ b/tests/skills/cases/form-compile/table.json @@ -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": [