diff --git a/.claude/skills/form-compile/scripts/form-compile.ps1 b/.claude/skills/form-compile/scripts/form-compile.ps1 index d661686f..2f20ae0b 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.136 — Compile 1C managed form from JSON or object metadata +# form-compile v1.137 — Compile 1C managed form from JSON or object metadata # Source: https://github.com/Nikolay-Shirokov/cc-1c-skills param( [string]$JsonPath, @@ -3053,6 +3053,9 @@ $script:genericScalars = @( @{ Tag='Zoomable'; Key='zoomable'; Kind='bool' } @{ Tag='Shape'; Key='shape'; Kind='value' } @{ Tag='PictureLocation'; Key='pictureLocation'; Kind='value' } + # Равная ширина элементов (check/radio) / высота заголовка пункта (radio) + @{ Tag='EqualItemsWidth'; Key='equalItemsWidth'; Kind='bool' } + @{ Tag='ItemTitleHeight'; Key='itemTitleHeight'; Kind='value' } ) function Emit-GenericScalars { diff --git a/.claude/skills/form-compile/scripts/form-compile.py b/.claude/skills/form-compile/scripts/form-compile.py index 4494b029..6e7cc287 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.136 — Compile 1C managed form from JSON or object metadata +# form-compile v1.137 — Compile 1C managed form from JSON or object metadata # Source: https://github.com/Nikolay-Shirokov/cc-1c-skills import argparse import copy @@ -3166,6 +3166,9 @@ GENERIC_SCALARS = [ ('Zoomable', 'zoomable', 'bool'), ('Shape', 'shape', 'value'), ('PictureLocation', 'pictureLocation', 'value'), + # Равная ширина элементов (check/radio) / высота заголовка пункта (radio) + ('EqualItemsWidth', 'equalItemsWidth', 'bool'), + ('ItemTitleHeight', 'itemTitleHeight', 'value'), ] diff --git a/.claude/skills/form-decompile/scripts/form-decompile.ps1 b/.claude/skills/form-decompile/scripts/form-decompile.ps1 index f597d911..d77a43eb 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.109 — Decompile 1C managed Form.xml to JSON DSL (draft) +# form-decompile v0.110 — Decompile 1C managed Form.xml to JSON DSL (draft) # Source: https://github.com/Nikolay-Shirokov/cc-1c-skills # ВНИМАНИЕ: раундтрип не гарантируется. Навык исключён из авто-использования моделью. param( @@ -1413,6 +1413,9 @@ $GENERIC_SCALARS = @( @{ Tag='Zoomable'; Key='zoomable'; Kind='bool' } @{ Tag='Shape'; Key='shape'; Kind='value' } @{ Tag='PictureLocation'; Key='pictureLocation'; Kind='value' } + # Равная ширина элементов (check/radio) / высота заголовка пункта (radio) + @{ Tag='EqualItemsWidth'; Key='equalItemsWidth'; Kind='bool' } + @{ Tag='ItemTitleHeight'; Key='itemTitleHeight'; Kind='value' } ) # Захват generic-скаляров. Специфичная обработка (если ключ уже задан) — побеждает. @@ -2259,7 +2262,7 @@ $titleNode = $root.SelectSingleNode("lf:Title", $ns) if ($titleNode) { $t = Get-LangText $titleNode; if ($null -ne $t) { $dsl['title'] = $t } } # properties (прямые скаляры под
, PascalCase → camelCase) -$KNOWN_FORM_PROPS = @('AutoTitle','ReportResult','DetailsData','ReportFormType','AutoShowState','ReportResultViewMode','ViewModeApplicationOnSetReportResult','WindowOpeningMode','CommandBarLocation','SaveDataInSettings','AutoSaveDataInSettings','AutoTime','UsePostingMode','RepostOnWrite','AutoURL','AutoFillCheck','Customizable','EnterKeyBehavior','VerticalScroll','Width','Height','Group','UseForFoldersAndItems','SaveWindowSettings','ScalingMode','VerticalSpacing','VariantAppearance','ShowCloseButton','HorizontalAlign','ChildrenAlign','ShowTitle','ConversationsRepresentation','CollapseItemsByImportanceVariant','GroupList') +$KNOWN_FORM_PROPS = @('AutoTitle','ReportResult','DetailsData','ReportFormType','AutoShowState','ReportResultViewMode','ViewModeApplicationOnSetReportResult','WindowOpeningMode','CommandBarLocation','SaveDataInSettings','AutoSaveDataInSettings','AutoTime','UsePostingMode','RepostOnWrite','AutoURL','AutoFillCheck','Customizable','EnterKeyBehavior','VerticalScroll','Width','Height','Group','UseForFoldersAndItems','SaveWindowSettings','ScalingMode','VerticalSpacing','VariantAppearance','ShowCloseButton','HorizontalAlign','ChildrenAlign','ShowTitle','ConversationsRepresentation','CollapseItemsByImportanceVariant','GroupList','ChildItemsWidth','VerticalAlign','HorizontalSpacing') $props = [ordered]@{} foreach ($pn in $KNOWN_FORM_PROPS) { $v = Get-Child $root $pn diff --git a/docs/form-dsl-spec.md b/docs/form-dsl-spec.md index a84b5baa..853eedb2 100644 --- a/docs/form-dsl-spec.md +++ b/docs/form-dsl-spec.md @@ -77,6 +77,9 @@ | `showCloseButton` | `` | `true` / `false` — показывать кнопку закрытия | | `horizontalAlign` | `` | `Left`, `Center`, `Right` — горизонтальное выравнивание формы | | `childrenAlign` | `` | Выравнивание элементов/заголовков (`ItemsLeftTitlesLeft`, `ItemsRightTitlesLeft`, `None`, …) | +| `childItemsWidth` | `` | Ширина дочерних элементов формы (`Equal`, `LeftWide`, `LeftNarrow`, …) | +| `verticalAlign` | `` | Вертикальное выравнивание (`Top`/`Center`/`Bottom`) | +| `horizontalSpacing` | `` | Горизонтальный интервал между элементами (`Single`/`Double`/`None`/…) | | `showTitle` | `` | `true` / `false` — показывать заголовок формы | | `conversationsRepresentation` | `` | `Auto`, `Show`, `DontShow` — отображение панели обсуждений; pass-through (редкое) | | `collapseItemsByImportanceVariant` | `` | `DontUse`, `Use` — сворачивание элементов по важности; pass-through (редкое) | @@ -491,6 +494,8 @@ companion-панели с собственным контентом. Оба не | `path` | string | DataPath | | `radioButtonType` | string | `Auto` (по умолчанию), `RadioButtons`, `Tumbler` | | `columnsCount` | int | Число колонок раскладки | +| `itemTitleHeight` | int | Высота заголовка пункта (``) | +| `equalItemsWidth` | bool | Равная ширина пунктов (``); общий с `check` | | `titleLocation` | string | Расположение заголовка. **Нет ключа** → умный дефолт `None`. **`""`** → не выводить тег (платформа применит своё умолчание). Значение → как указано | | `choiceList` | array | Варианты выбора: массив `{ value, presentation }` | diff --git a/tests/skills/cases/form-compile/groups.json b/tests/skills/cases/form-compile/groups.json index 72934ebb..bece1f62 100644 --- a/tests/skills/cases/form-compile/groups.json +++ b/tests/skills/cases/form-compile/groups.json @@ -15,7 +15,7 @@ "validatePath": "DataProcessors/СГруппами/Forms/Форма/Ext/Form.xml", "input": { "title": "Группы", - "properties": { "showCloseButton": false, "horizontalAlign": "Left", "childrenAlign": "ItemsLeftTitlesLeft" }, + "properties": { "showCloseButton": false, "horizontalAlign": "Left", "childrenAlign": "ItemsLeftTitlesLeft", "childItemsWidth": "Equal", "verticalAlign": "Top", "horizontalSpacing": "Double" }, "elements": [ { "cmdBar": "КоманднаяПанель", "autofill": true }, { "group": "horizontal", "name": "ГруппаШапка", "behavior": "usual", "showTitle": true, "title": "Шапка", "shortcut": "Ctrl+G", "childrenAlign": "ItemsRightTitlesLeft", "horizontalStretch": true, "groupHorizontalAlign": "Right", "throughAlign": "Use", "verticalAlign": "Top", "childItemsWidth": "Equal", "horizontalSpacing": "None", "children": [ diff --git a/tests/skills/cases/form-compile/radio-auto-enum.json b/tests/skills/cases/form-compile/radio-auto-enum.json index 3cf34518..8f0be2b5 100644 --- a/tests/skills/cases/form-compile/radio-auto-enum.json +++ b/tests/skills/cases/form-compile/radio-auto-enum.json @@ -35,6 +35,8 @@ "title": "Способ курса", "radioButtonType": "Auto", "columnsCount": 1, + "itemTitleHeight": 1, + "equalItemsWidth": false, "choiceList": [ { "value": "Enum.СпособыКурса.EnumValue.Авто", "presentation": { "ru": "Автоматически", "en": "Automatic" } }, { "value": "Enum.СпособыКурса.EnumValue.Ручной", "presentation": "вручную" }, 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 5ab6e7a8..da625478 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 @@ -10,6 +10,9 @@ false Left ItemsLeftTitlesLeft + Equal + Top + Double false diff --git a/tests/skills/cases/form-compile/snapshots/radio-auto-enum/DataProcessors/ТестРадио/Forms/Форма/Ext/Form.xml b/tests/skills/cases/form-compile/snapshots/radio-auto-enum/DataProcessors/ТестРадио/Forms/Форма/Ext/Form.xml index 7473dd47..b048c34e 100644 --- a/tests/skills/cases/form-compile/snapshots/radio-auto-enum/DataProcessors/ТестРадио/Forms/Форма/Ext/Form.xml +++ b/tests/skills/cases/form-compile/snapshots/radio-auto-enum/DataProcessors/ТестРадио/Forms/Форма/Ext/Form.xml @@ -65,6 +65,8 @@ + false + 1