diff --git a/.claude/skills/form-compile/SKILL.md b/.claude/skills/form-compile/SKILL.md index 3a2dd1cf..75d068b2 100644 --- a/.claude/skills/form-compile/SKILL.md +++ b/.claude/skills/form-compile/SKILL.md @@ -228,7 +228,7 @@ powershell.exe -NoProfile -File .claude/skills/form-compile/scripts/form-compile | `command` | Имя команды формы → `Form.Command.Имя` | | `stdCommand` | Стандартная команда: `"Close"` → `Form.StandardCommand.Close`; с точкой: `"Товары.Add"` → `Form.Item.Товары.StandardCommand.Add` | | `defaultButton: true` | Кнопка по умолчанию | -| `type` | `"usual"`, `"hyperlink"`, `"commandBar"` | +| `type` | `"usual"`, `"hyperlink"`. По умолчанию `"usual"`. Конкретный XML-вид (UsualButton/Hyperlink/CommandBarButton/CommandBarHyperlink) подставляется автоматически по контексту | | `picture` | Картинка кнопки | | `representation` | `"Auto"`, `"Text"`, `"Picture"`, `"PictureAndText"` | | `locationInCommandBar` | `"Auto"`, `"InCommandBar"`, `"InAdditionalSubmenu"` | @@ -259,6 +259,8 @@ powershell.exe -NoProfile -File .claude/skills/form-compile/scripts/form-compile ]} ``` +Кнопки основных действий формы и подменю размещают здесь, а не в отдельной группе на форме. Отдельной кнопкой в layout — только если она логически привязана к конкретному полю или группе. + ### Выпадающее меню (popup) | Ключ | Описание | @@ -401,9 +403,9 @@ powershell.exe -NoProfile -File .claude/skills/form-compile/scripts/form-compile { "check": "ПерваяСтрокаЗаголовок", "path": "ПерваяСтрокаЗаголовок" } ]}, { "input": "Результат", "path": "Результат", "multiLine": true, "height": 8, "readOnly": true, "title": "Лог" }, - { "group": "horizontal", "name": "ГруппаКнопок", "children": [ + { "autoCmdBar": "ФормаКоманднаяПанель", "children": [ { "button": "Загрузить", "command": "Загрузить", "defaultButton": true }, - { "button": "Закрыть", "stdCommand": "Close" } + { "button": "Закрыть", "stdCommand": "Close" } ]} ], "attributes": [ diff --git a/.claude/skills/form-compile/scripts/form-compile.ps1 b/.claude/skills/form-compile/scripts/form-compile.ps1 index 9e2871ce..975ea90e 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.16 — Compile 1C managed form from JSON or object metadata +# form-compile v1.17 — Compile 1C managed form from JSON or object metadata # Source: https://github.com/Nikolay-Shirokov/cc-1c-skills param( [string]$JsonPath, @@ -1825,7 +1825,7 @@ function Emit-Companion { } function Emit-Element { - param($el, [string]$indent) + param($el, [string]$indent, [bool]$inCmdBar = $false) # Silent synonyms: model often writes XML name or Russian (ПолеПереключателя/RadioButtonField → radio). # Maps any synonym to canonical short DSL key. @@ -1946,7 +1946,7 @@ function Emit-Element { "table" { Emit-Table -el $el -name $name -id $id -indent $indent } "pages" { Emit-Pages -el $el -name $name -id $id -indent $indent } "page" { Emit-Page -el $el -name $name -id $id -indent $indent } - "button" { Emit-Button -el $el -name $name -id $id -indent $indent } + "button" { Emit-Button -el $el -name $name -id $id -indent $indent -inCmdBar $inCmdBar } "picture" { Emit-PictureDecoration -el $el -name $name -id $id -indent $indent } "picField" { Emit-PictureField -el $el -name $name -id $id -indent $indent } "calendar" { Emit-Calendar -el $el -name $name -id $id -indent $indent } @@ -2538,19 +2538,48 @@ function Emit-Page { } function Emit-Button { - param($el, [string]$name, [int]$id, [string]$indent) + param($el, [string]$name, [int]$id, [string]$indent, [bool]$inCmdBar = $false) X "$indent diff --git a/tests/skills/cases/form-compile/snapshots/file-dialog/DataProcessors/ЗагрузкаИзФайла/Forms/Форма/Ext/Form.xml b/tests/skills/cases/form-compile/snapshots/file-dialog/DataProcessors/ЗагрузкаИзФайла/Forms/Форма/Ext/Form.xml index bcfe9ada..e023bcb8 100644 --- a/tests/skills/cases/form-compile/snapshots/file-dialog/DataProcessors/ЗагрузкаИзФайла/Forms/Форма/Ext/Form.xml +++ b/tests/skills/cases/form-compile/snapshots/file-dialog/DataProcessors/ЗагрузкаИзФайла/Forms/Форма/Ext/Form.xml @@ -7,16 +7,30 @@ false - + + + + + + ПриСозданииНаСервере - + Horizontal - + - + ИмяФайла <v8:item> @@ -30,21 +44,21 @@ <v8:content>Выберите файл...</v8:content> </v8:item> </InputHint> - <ContextMenu name="ИмяФайлаКонтекстноеМеню" id="4"/> - <ExtendedTooltip name="ИмяФайлаРасширеннаяПодсказка" id="5"/> + <ContextMenu name="ИмяФайлаКонтекстноеМеню" id="8"/> + <ExtendedTooltip name="ИмяФайлаРасширеннаяПодсказка" id="9"/> <Events> <Event name="StartChoice">ИмяФайлаНачалоВыбора</Event> </Events> </InputField> - <CheckBoxField name="ПерваяСтрокаЗаголовок" id="6"> + <CheckBoxField name="ПерваяСтрокаЗаголовок" id="10"> <DataPath>ПерваяСтрокаЗаголовок</DataPath> <TitleLocation>Right</TitleLocation> - <ContextMenu name="ПерваяСтрокаЗаголовокКонтекстноеМеню" id="7"/> - <ExtendedTooltip name="ПерваяСтрокаЗаголовокРасширеннаяПодсказка" id="8"/> + <ContextMenu name="ПерваяСтрокаЗаголовокКонтекстноеМеню" id="11"/> + <ExtendedTooltip name="ПерваяСтрокаЗаголовокРасширеннаяПодсказка" id="12"/> </CheckBoxField> </ChildItems> </UsualGroup> - <InputField name="Результат" id="9"> + <InputField name="Результат" id="13"> <DataPath>Результат</DataPath> <Title> <v8:item> @@ -56,33 +70,18 @@ <MultiLine>true</MultiLine> <AutoMaxWidth>false</AutoMaxWidth> <Height>8</Height> - <ContextMenu name="РезультатКонтекстноеМеню" id="10"/> - <ExtendedTooltip name="РезультатРасширеннаяПодсказка" id="11"/> + <ContextMenu name="РезультатКонтекстноеМеню" id="14"/> + <ExtendedTooltip name="РезультатРасширеннаяПодсказка" id="15"/> </InputField> - <UsualGroup name="ГруппаКнопок" id="12"> - <Group>Horizontal</Group> - <ExtendedTooltip name="ГруппаКнопокРасширеннаяПодсказка" id="13"/> - <ChildItems> - <Button name="Загрузить" id="14"> - <CommandName>Form.Command.Загрузить</CommandName> - <DefaultButton>true</DefaultButton> - <ExtendedTooltip name="ЗагрузитьРасширеннаяПодсказка" id="15"/> - </Button> - <Button name="Закрыть" id="16"> - <CommandName>Form.StandardCommand.Close</CommandName> - <ExtendedTooltip name="ЗакрытьРасширеннаяПодсказка" id="17"/> - </Button> - </ChildItems> - </UsualGroup> </ChildItems> <Attributes> - <Attribute name="Объект" id="18"> + <Attribute name="Объект" id="16"> <Type> <v8:Type>cfg:DataProcessorObject.ЗагрузкаИзФайла</v8:Type> </Type> <MainAttribute>true</MainAttribute> </Attribute> - <Attribute name="ИмяФайла" id="19"> + <Attribute name="ИмяФайла" id="17"> <Title> <v8:item> <v8:lang>ru</v8:lang> @@ -97,7 +96,7 @@ </v8:StringQualifiers> </Type> </Attribute> - <Attribute name="ПерваяСтрокаЗаголовок" id="20"> + <Attribute name="ПерваяСтрокаЗаголовок" id="18"> <Title> <v8:item> <v8:lang>ru</v8:lang> @@ -108,7 +107,7 @@ <v8:Type>xs:boolean</v8:Type> </Type> </Attribute> - <Attribute name="Результат" id="21"> + <Attribute name="Результат" id="19"> <Title> <v8:item> <v8:lang>ru</v8:lang> @@ -125,7 +124,7 @@ </Attribute> </Attributes> <Commands> - <Command name="Загрузить" id="22"> + <Command name="Загрузить" id="20"> <Title> <v8:item> <v8:lang>ru</v8:lang> diff --git a/tests/skills/cases/form-compile/snapshots/synonyms/DataProcessors/Тест/Forms/Форма/Ext/Form.xml b/tests/skills/cases/form-compile/snapshots/synonyms/DataProcessors/Тест/Forms/Форма/Ext/Form.xml index 3d2e6f3b..7347dec6 100644 --- a/tests/skills/cases/form-compile/snapshots/synonyms/DataProcessors/Тест/Forms/Форма/Ext/Form.xml +++ b/tests/skills/cases/form-compile/snapshots/synonyms/DataProcessors/Тест/Forms/Форма/Ext/Form.xml @@ -10,6 +10,7 @@ <AutoCommandBar name="ФормаКоманднаяПанель" id="-1"> <ChildItems> <Button name="Кн1" id="1"> + <Type>CommandBarButton</Type> <CommandName>Form.Command.Кн1</CommandName> <ExtendedTooltip name="Кн1РасширеннаяПодсказка" id="2"/> </Button> @@ -24,6 +25,7 @@ <CommandBar name="ДопПанель" id="6"> <ChildItems> <Button name="Кн2" id="7"> + <Type>CommandBarButton</Type> <CommandName>Form.Command.Кн2</CommandName> <ExtendedTooltip name="Кн2РасширеннаяПодсказка" id="8"/> </Button>