From 3d80191ca7aada3929794618140b23bd97466183 Mon Sep 17 00:00:00 2001 From: Nick Shirokov Date: Sun, 3 May 2026 19:58:36 +0300 Subject: [PATCH] =?UTF-8?q?feat(form-compile):=20=D0=BF=D0=BE=D0=B4=D0=B4?= =?UTF-8?q?=D0=B5=D1=80=D0=B6=D0=BA=D0=B0=20maxWidth/maxHeight=20=D0=B4?= =?UTF-8?q?=D0=BB=D1=8F=20input=20=D0=B8=20label?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Добавлены численные maxWidth/maxHeight (XML /) — типичный приём для ограничения растяжения поля при autoMaxWidth: false. До этого DSL знал только булев autoMaxWidth, и ограничить ширину числом было невозможно. Co-Authored-By: Claude Opus 4.7 (1M context) --- .claude/skills/form-compile/SKILL.md | 3 ++- .claude/skills/form-compile/scripts/form-compile.ps1 | 7 ++++++- .claude/skills/form-compile/scripts/form-compile.py | 11 ++++++++++- 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/.claude/skills/form-compile/SKILL.md b/.claude/skills/form-compile/SKILL.md index 75d068b2..8ed65552 100644 --- a/.claude/skills/form-compile/SKILL.md +++ b/.claude/skills/form-compile/SKILL.md @@ -126,7 +126,8 @@ powershell.exe -NoProfile -File .claude/skills/form-compile/scripts/form-compile | `skipOnInput: true` | Пропускать при обходе Tab | | | `inputHint` | Подсказка в пустом поле | `"Введите наименование..."` | | `width` / `height` | Размер | числа | -| `autoMaxWidth: false` | Отключить авто-ширину | для фиксированных полей | +| `autoMaxWidth: false` | Снять авто-ограничение ширины (поле растянется) | | +| `maxWidth` / `maxHeight` | Жёсткое ограничение размера | числа; обычно вместе с `autoMaxWidth: false` | | `horizontalStretch: true` | Растягивать по ширине | | ### Чекбокс (check) diff --git a/.claude/skills/form-compile/scripts/form-compile.ps1 b/.claude/skills/form-compile/scripts/form-compile.ps1 index 975ea90e..e745f072 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.17 — Compile 1C managed form from JSON or object metadata +# form-compile v1.18 — Compile 1C managed form from JSON or object metadata # Source: https://github.com/Nikolay-Shirokov/cc-1c-skills param( [string]$JsonPath, @@ -1904,6 +1904,7 @@ function Emit-Element { # layout "titleLocation"=1;"representation"=1;"width"=1;"height"=1 "horizontalStretch"=1;"verticalStretch"=1;"autoMaxWidth"=1;"autoMaxHeight"=1 + "maxWidth"=1;"maxHeight"=1 # input-specific "multiLine"=1;"passwordMode"=1;"choiceButton"=1;"clearButton"=1 "spinButton"=1;"dropListButton"=1;"markIncomplete"=1;"skipOnInput"=1;"inputHint"=1 @@ -2095,7 +2096,9 @@ function Emit-Input { } elseif ($el.multiLine -eq $true) { X "$innerfalse" } + if ($null -ne $el.maxWidth) { X "$inner$($el.maxWidth)" } if ($el.autoMaxHeight -eq $false) { X "$innerfalse" } + if ($null -ne $el.maxHeight) { X "$inner$($el.maxHeight)" } if ($el.width) { X "$inner$($el.width)" } if ($el.height) { X "$inner$($el.height)" } if ($el.horizontalStretch -eq $true) { X "$innertrue" } @@ -2376,7 +2379,9 @@ function Emit-Label { if ($el.hyperlink -eq $true) { X "$innertrue" } if ($el.autoMaxWidth -eq $false) { X "$innerfalse" } + if ($null -ne $el.maxWidth) { X "$inner$($el.maxWidth)" } if ($el.autoMaxHeight -eq $false) { X "$innerfalse" } + if ($null -ne $el.maxHeight) { X "$inner$($el.maxHeight)" } if ($el.width) { X "$inner$($el.width)" } if ($el.height) { X "$inner$($el.height)" } diff --git a/.claude/skills/form-compile/scripts/form-compile.py b/.claude/skills/form-compile/scripts/form-compile.py index 1045fb0b..e94c5da4 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.17 — Compile 1C managed form from JSON or object metadata +# form-compile v1.18 — Compile 1C managed form from JSON or object metadata # Source: https://github.com/Nikolay-Shirokov/cc-1c-skills import argparse import copy @@ -1346,6 +1346,7 @@ KNOWN_KEYS = { "on", "handlers", "titleLocation", "representation", "width", "height", "horizontalStretch", "verticalStretch", "autoMaxWidth", "autoMaxHeight", + "maxWidth", "maxHeight", "multiLine", "passwordMode", "choiceButton", "clearButton", "spinButton", "dropListButton", "markIncomplete", "skipOnInput", "inputHint", "hyperlink", @@ -1903,8 +1904,12 @@ def emit_input(lines, el, name, eid, indent): lines.append(f'{inner}false') elif el.get('multiLine') is True: lines.append(f'{inner}false') + if el.get('maxWidth') is not None: + lines.append(f'{inner}{el["maxWidth"]}') if el.get('autoMaxHeight') is False: lines.append(f'{inner}false') + if el.get('maxHeight') is not None: + lines.append(f'{inner}{el["maxHeight"]}') if el.get('width'): lines.append(f'{inner}{el["width"]}') if el.get('height'): @@ -2031,8 +2036,12 @@ def emit_label(lines, el, name, eid, indent): lines.append(f'{inner}true') if el.get('autoMaxWidth') is False: lines.append(f'{inner}false') + if el.get('maxWidth') is not None: + lines.append(f'{inner}{el["maxWidth"]}') if el.get('autoMaxHeight') is False: lines.append(f'{inner}false') + if el.get('maxHeight') is not None: + lines.append(f'{inner}{el["maxHeight"]}') if el.get('width'): lines.append(f'{inner}{el["width"]}') if el.get('height'):