diff --git a/.claude/skills/form-compile/scripts/form-compile.ps1 b/.claude/skills/form-compile/scripts/form-compile.ps1 index 9f246900..83d903a0 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.131 — Compile 1C managed form from JSON or object metadata +# form-compile v1.132 — Compile 1C managed form from JSON or object metadata # Source: https://github.com/Nikolay-Shirokov/cc-1c-skills param( [string]$JsonPath, @@ -3531,6 +3531,10 @@ function Emit-Group { # United if ($el.united -eq $false) { X "$innerfalse" } + # Формат значения пути к данным заголовка (; парный к titleDataPath группы) + if ($el.format) { Emit-MLText -tag "Format" -text $el.format -indent $inner } + if ($el.editFormat) { Emit-MLText -tag "EditFormat" -text $el.editFormat -indent $inner } + Emit-CommonFlags -el $el -indent $inner Emit-Layout -el $el -indent $inner @@ -4432,6 +4436,9 @@ function Emit-Page { if ($orientation) { X "$inner$orientation" } } if ($null -ne $el.showTitle) { X "$inner$(if ($el.showTitle){'true'}else{'false'})" } + # Формат значения пути к данным заголовка (; парный к titleDataPath страницы) + if ($el.format) { Emit-MLText -tag "Format" -text $el.format -indent $inner } + if ($el.editFormat) { Emit-MLText -tag "EditFormat" -text $el.editFormat -indent $inner } Emit-Layout -el $el -indent $inner # Оформление страницы (BackColor / TitleTextColor / TitleFont) — после ShowTitle, перед компаньоном diff --git a/.claude/skills/form-compile/scripts/form-compile.py b/.claude/skills/form-compile/scripts/form-compile.py index c1e0e01e..e2e759df 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.131 — Compile 1C managed form from JSON or object metadata +# form-compile v1.132 — Compile 1C managed form from JSON or object metadata # Source: https://github.com/Nikolay-Shirokov/cc-1c-skills import argparse import copy @@ -3625,6 +3625,12 @@ def emit_group(lines, el, name, eid, indent): if el.get('united') is False: lines.append(f'{inner}false') + # Формат значения пути к данным заголовка (; парный к titleDataPath группы) + if el.get('format'): + emit_mltext(lines, inner, 'Format', el['format']) + if el.get('editFormat'): + emit_mltext(lines, inner, 'EditFormat', el['editFormat']) + emit_common_flags(lines, el, inner) emit_layout(lines, el, inner) @@ -4162,6 +4168,11 @@ def emit_page(lines, el, name, eid, indent): lines.append(f'{inner}{orientation}') if el.get('showTitle') is not None: lines.append(f'{inner}{"true" if el["showTitle"] else "false"}') + # Формат значения пути к данным заголовка (; парный к titleDataPath страницы) + if el.get('format'): + emit_mltext(lines, inner, 'Format', el['format']) + if el.get('editFormat'): + emit_mltext(lines, inner, 'EditFormat', el['editFormat']) emit_layout(lines, el, inner) # \u041e\u0444\u043e\u0440\u043c\u043b\u0435\u043d\u0438\u0435 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b (BackColor / TitleTextColor / TitleFont) \u2014 \u043f\u043e\u0441\u043b\u0435 ShowTitle, \u043f\u0435\u0440\u0435\u0434 \u043a\u043e\u043c\u043f\u0430\u043d\u044c\u043e\u043d\u043e\u043c diff --git a/.claude/skills/form-decompile/scripts/form-decompile.ps1 b/.claude/skills/form-decompile/scripts/form-decompile.ps1 index 98879c43..087fef4f 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.105 — Decompile 1C managed Form.xml to JSON DSL (draft) +# form-decompile v0.106 — Decompile 1C managed Form.xml to JSON DSL (draft) # Source: https://github.com/Nikolay-Shirokov/cc-1c-skills # ВНИМАНИЕ: раундтрип не гарантируется. Навык исключён из авто-использования моделью. param( @@ -1612,6 +1612,8 @@ function Decompile-Element { $crt = $node.SelectSingleNode("lf:CollapsedRepresentationTitle", $ns); if ($crt) { $ct = Get-LangText $crt; if ($null -ne $ct -and $ct -ne '') { $obj['collapsedTitle'] = $ct } } if ((Get-Child $node 'United') -eq 'false') { $obj['united'] = $false } if ((Get-Child $node 'Collapsed') -eq 'true') { $obj['collapsed'] = $true } + # Формат значения пути к данным заголовка (; парный к titleDataPath группы) + Add-FormatProps $obj $node $kids = Decompile-Children $node if ($kids) { $obj['children'] = $kids } } @@ -1855,6 +1857,8 @@ function Decompile-Element { # Картинка страницы (иконка вкладки) — конвенция ValuesPicture (дефолт LoadTransparent=false) $pp = Get-PictureRef $node 'Picture'; if ($null -ne $pp) { $obj['picture'] = $pp } $st = Get-Child $node 'ShowTitle'; if ($null -ne $st) { $obj['showTitle'] = ($st -eq 'true') } # факт. значение (явный true тоже) + # Формат значения пути к данным заголовка (; парный к titleDataPath страницы) + Add-FormatProps $obj $node $kids = Decompile-Children $node if ($kids) { $obj['children'] = $kids } } diff --git a/docs/form-dsl-spec.md b/docs/form-dsl-spec.md index 5842831c..01fe2839 100644 --- a/docs/form-dsl-spec.md +++ b/docs/form-dsl-spec.md @@ -364,6 +364,7 @@ companion-панели с собственным контентом. Оба не | `behavior` | string | Поведение (``): `usual`, `collapsible`, `popup`. **Отсутствие = Авто** (дефолт, не эмитится). Свёртываемая/всплывающая несут доп. свойства | | `collapsed` | bool | Свёрнута (у `collapsible`/`popup`) | | `collapsedTitle` | string/object | Заголовок свёрнутого представления (``), мультиязычный текст | +| `format` | string/object | Формат значения динамического заголовка (``, мультиязычный) — парный к `titleDataPath` (доступен и у `page`). Напр. `{ "ru": "БЛ=; БИ=*", "en": "BF=; BT=*" }` для булева пути | | `children` | array | Вложенные элементы | | `showTitle` | bool | Показывать заголовок группы | | `representation` | string | `none`, `normal`, `weak`, `strong` | diff --git a/tests/skills/cases/form-compile/groups.json b/tests/skills/cases/form-compile/groups.json index a7b0848a..72934ebb 100644 --- a/tests/skills/cases/form-compile/groups.json +++ b/tests/skills/cases/form-compile/groups.json @@ -23,7 +23,7 @@ { "input": "Поле2", "path": "Поле2", "title": "Поле 2" }, { "labelField": "Метка", "path": "Поле1", "groupVerticalAlign": "Center" } ]}, - { "group": "vertical", "name": "ГруппаПодвал", "behavior": "collapsible", "collapsed": true, "title": { "ru": "Подвал", "en": "Footer" }, "collapsedTitle": "Развернуть подвал", "showLeftMargin": false, "enableContentChange": false, "verticalSpacing": "None", "displayImportance": "Low", "children": [ + { "group": "vertical", "name": "ГруппаПодвал", "behavior": "collapsible", "collapsed": true, "title": { "ru": "Подвал", "en": "Footer" }, "collapsedTitle": "Развернуть подвал", "titleDataPath": "Изменено", "format": { "ru": "БЛ=; БИ=*", "en": "BF=; BT=*" }, "showLeftMargin": false, "enableContentChange": false, "verticalSpacing": "None", "displayImportance": "Low", "children": [ { "input": "Поле3", "path": "Поле3", "title": "Поле 3" } ]} ], @@ -31,7 +31,8 @@ { "name": "Объект", "type": "DataProcessorObject.СГруппами", "main": true }, { "name": "Поле1", "type": "string" }, { "name": "Поле2", "type": "decimal(15,2)" }, - { "name": "Поле3", "type": "date" } + { "name": "Поле3", "type": "date" }, + { "name": "Изменено", "type": "boolean" } ] } } diff --git a/tests/skills/cases/form-compile/snapshots/groups/DataProcessors/СГруппами/Forms/Форма/Ext/Form.xml b/tests/skills/cases/form-compile/snapshots/groups/DataProcessors/СГруппами/Forms/Форма/Ext/Form.xml index bb11d13d..5ab6e7a8 100644 --- a/tests/skills/cases/form-compile/snapshots/groups/DataProcessors/СГруппами/Forms/Форма/Ext/Form.xml +++ b/tests/skills/cases/form-compile/snapshots/groups/DataProcessors/СГруппами/Forms/Форма/Ext/Form.xml @@ -91,9 +91,20 @@ Развернуть подвал + + + ru + БЛ=; БИ=* + + + en + BF=; BT=* + + false false None + Изменено @@ -162,5 +173,16 @@ + + + <v8:item> + <v8:lang>ru</v8:lang> + <v8:content>Изменено</v8:content> + </v8:item> + + + xs:boolean + +