diff --git a/.claude/skills/form-compile/scripts/form-compile.ps1 b/.claude/skills/form-compile/scripts/form-compile.ps1 index 58b253ff..69f8fbbe 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.36 — Compile 1C managed form from JSON or object metadata +# form-compile v1.37 — Compile 1C managed form from JSON or object metadata # Source: https://github.com/Nikolay-Shirokov/cc-1c-skills param( [string]$JsonPath, @@ -1959,7 +1959,7 @@ function Emit-Element { # radio-specific "radioButtonType"=1;"choiceList"=1;"columnsCount"=1;"checkBoxType"=1;"editMode"=1 # naming & binding - "name"=1;"path"=1;"title"=1;"tooltip"=1 + "name"=1;"path"=1;"title"=1;"tooltip"=1;"tooltipRepresentation"=1 # visibility & state "visible"=1;"hidden"=1;"enabled"=1;"disabled"=1;"readOnly"=1;"userVisible"=1 # events ("events" — основной формат; on/handlers — legacy, принимаются ради совместимости) @@ -2096,6 +2096,8 @@ function Emit-Title { } # ToolTip элемента (всплывающая подсказка) — по схеме сразу после Title. if ($el.tooltip) { Emit-MLText -tag "ToolTip" -text $el.tooltip -indent $indent } + # ToolTipRepresentation — режим показа подсказки (None/Button/ShowBottom/…), после ToolTip. + if ($el.tooltipRepresentation) { X "$indent$($el.tooltipRepresentation)" } } function Map-TitleLoc { @@ -2531,6 +2533,7 @@ function Emit-Label { X "$inner" } if ($el.tooltip) { Emit-MLText -tag "ToolTip" -text $el.tooltip -indent $inner } + if ($el.tooltipRepresentation) { X "$inner$($el.tooltipRepresentation)" } Emit-CommonFlags -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 dc80a973..cdc235dd 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.36 — Compile 1C managed form from JSON or object metadata +# form-compile v1.37 — 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,7 @@ KNOWN_KEYS = { "button", "picture", "picField", "calendar", "cmdBar", "popup", "showInHeader", "radioButtonType", "choiceList", "columnsCount", "checkBoxType", "editMode", - "name", "path", "title", "tooltip", + "name", "path", "title", "tooltip", "tooltipRepresentation", "visible", "hidden", "enabled", "disabled", "readOnly", "userVisible", "events", "on", "handlers", "selectionMode", "showCurrentDate", "widthInMonths", "heightInMonths", "showMonthsPanel", @@ -1678,6 +1678,9 @@ def emit_title(lines, el, name, indent, auto=False): # ToolTip элемента (всплывающая подсказка) — по схеме сразу после Title. if el.get('tooltip'): emit_mltext(lines, indent, 'ToolTip', el['tooltip']) + # ToolTipRepresentation — режим показа подсказки (None/Button/ShowBottom/…), после ToolTip. + if el.get('tooltipRepresentation'): + lines.append(f'{indent}{el["tooltipRepresentation"]}') _TITLE_LOC_MAP = {'none': 'None', 'left': 'Left', 'right': 'Right', 'top': 'Top', 'bottom': 'Bottom', 'auto': 'Auto'} @@ -2180,6 +2183,8 @@ def emit_label(lines, el, name, eid, indent): lines.append(f'{inner}') if el.get('tooltip'): emit_mltext(lines, inner, 'ToolTip', el['tooltip']) + if el.get('tooltipRepresentation'): + lines.append(f'{inner}{el["tooltipRepresentation"]}') emit_common_flags(lines, el, inner) diff --git a/.claude/skills/form-decompile/scripts/form-decompile.ps1 b/.claude/skills/form-decompile/scripts/form-decompile.ps1 index b82c98d6..085578c3 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.16 — Decompile 1C managed Form.xml to JSON DSL (draft) +# form-decompile v0.17 — Decompile 1C managed Form.xml to JSON DSL (draft) # Source: https://github.com/Nikolay-Shirokov/cc-1c-skills # ВНИМАНИЕ: раундтрип не гарантируется. Навык исключён из авто-использования моделью. param( @@ -241,6 +241,7 @@ function Add-CommonProps { } $ttNode = $node.SelectSingleNode("lf:ToolTip", $ns) if ($ttNode) { $tt = Get-LangText $ttNode; if ($null -ne $tt) { $obj['tooltip'] = $tt } } + $ttr = Get-Child $node 'ToolTipRepresentation'; if ($ttr) { $obj['tooltipRepresentation'] = $ttr } $ev = Get-Events $node $elName if ($ev) { $obj['events'] = $ev } } diff --git a/docs/form-dsl-spec.md b/docs/form-dsl-spec.md index 3d86de53..00ad093a 100644 --- a/docs/form-dsl-spec.md +++ b/docs/form-dsl-spec.md @@ -117,6 +117,7 @@ | `events` | object | Обработчики событий: `{ "ИмяСобытия": "ИмяОбработчика" }` — тот же формат, что у событий формы (§3). Значение `null` → имя по конвенции (§4.2). См. §4.2 | | `titleLocation` | string | Расположение заголовка: `none`/`left`/`right`/`top`/`bottom`/`auto`. Эмитится при наличии (input, labelField, picField, table, calendar). У `check`/`radio` — особая семантика с умным дефолтом (см. их разделы) | | `tooltip` | string/object | Всплывающая подсказка элемента (``). Строка → ru, объект `{ "ru": …, "en": … }` → мультиязычный (как `title`). Эмитится сразу после `title` | +| `tooltipRepresentation` | string | Режим показа подсказки (``): `None`, `Button`, `ShowBottom`, `ShowTop`, `ShowLeft`, `ShowRight`, `ShowAuto`, `Balloon`. Эмитится при наличии | ### 4.1a. Общие layout-свойства diff --git a/tests/skills/cases/form-compile/events.json b/tests/skills/cases/form-compile/events.json index 7396e6db..0a4986f2 100644 --- a/tests/skills/cases/form-compile/events.json +++ b/tests/skills/cases/form-compile/events.json @@ -19,7 +19,7 @@ "elements": [ { "input": "Организация", "path": "Организация", "events": { "OnChange": "ОрганизацияПриИзменении", "StartChoice": "ОрганизацияНачалоВыбора" } }, { "input": "Период", "path": "Период", "events": { "OnChange": "ПериодПриИзменении" } }, - { "label": "Подсказка", "title": "Нажмите для перехода", "hyperlink": true, "events": { "Click": null } } + { "label": "Подсказка", "title": "Нажмите для перехода", "hyperlink": true, "tooltipRepresentation": "Button", "events": { "Click": null } } ], "attributes": [ { "name": "Объект", "type": "DataProcessorObject.События", "main": true }, diff --git a/tests/skills/cases/form-compile/input-fields.json b/tests/skills/cases/form-compile/input-fields.json index 2190027a..38d51228 100644 --- a/tests/skills/cases/form-compile/input-fields.json +++ b/tests/skills/cases/form-compile/input-fields.json @@ -16,7 +16,7 @@ "input": { "title": "Поля ввода", "elements": [ - { "input": "ОбычноеПоле", "path": "ОбычноеПоле", "title": "Обычное поле", "tooltip": "Введите значение поля", "editMode": "EnterOnInput" }, + { "input": "ОбычноеПоле", "path": "ОбычноеПоле", "title": "Обычное поле", "tooltip": "Введите значение поля", "tooltipRepresentation": "ShowBottom", "editMode": "EnterOnInput" }, { "labelField": "Ссылка", "path": "ОбычноеПоле", "titleLocation": "left", "hyperlink": true }, { "input": "МногострочноеПоле", "path": "МногострочноеПоле", "multiLine": true, "height": 5, "title": "Комментарий" }, { "input": "ПолеПароля", "path": "ПолеПароля", "passwordMode": true, "title": "Пароль" }, diff --git a/tests/skills/cases/form-compile/snapshots/events/DataProcessors/События/Forms/Форма/Ext/Form.xml b/tests/skills/cases/form-compile/snapshots/events/DataProcessors/События/Forms/Форма/Ext/Form.xml index 8aa8561f..95304b6c 100644 --- a/tests/skills/cases/form-compile/snapshots/events/DataProcessors/События/Forms/Форма/Ext/Form.xml +++ b/tests/skills/cases/form-compile/snapshots/events/DataProcessors/События/Forms/Форма/Ext/Form.xml @@ -37,6 +37,7 @@ Нажмите для перехода + Button true diff --git a/tests/skills/cases/form-compile/snapshots/input-fields/DataProcessors/ПоляВвода/Forms/Форма/Ext/Form.xml b/tests/skills/cases/form-compile/snapshots/input-fields/DataProcessors/ПоляВвода/Forms/Форма/Ext/Form.xml index 2281d3f9..64b87d90 100644 --- a/tests/skills/cases/form-compile/snapshots/input-fields/DataProcessors/ПоляВвода/Forms/Форма/Ext/Form.xml +++ b/tests/skills/cases/form-compile/snapshots/input-fields/DataProcessors/ПоляВвода/Forms/Форма/Ext/Form.xml @@ -23,6 +23,7 @@ Введите значение поля + ShowBottom EnterOnInput