feat(form-compile): AutoMaxWidth=false по умолчанию для multiLine InputField

В реальных формах ERP/БП у ~60% многострочных полей ввода явно стоит
АвтоМаксимальнаяШирина=Ложь. Теперь form-compile проставляет это
автоматически при multiLine: true, если пользователь не задал
autoMaxWidth явно.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Nick Shirokov
2026-05-02 19:05:50 +03:00
parent 8ad5d80f7f
commit b4514dc350
5 changed files with 15 additions and 4 deletions
@@ -1,4 +1,4 @@
# form-compile v1.14 — Compile 1C managed form from JSON or object metadata
# form-compile v1.15 — Compile 1C managed form from JSON or object metadata
# Source: https://github.com/Nikolay-Shirokov/cc-1c-skills
param(
[string]$JsonPath,
@@ -2051,7 +2051,12 @@ function Emit-Input {
if ($el.dropListButton -eq $true) { X "$inner<DropListButton>true</DropListButton>" }
if ($el.markIncomplete -eq $true) { X "$inner<AutoMarkIncomplete>true</AutoMarkIncomplete>" }
if ($el.skipOnInput -eq $true) { X "$inner<SkipOnInput>true</SkipOnInput>" }
if ($el.autoMaxWidth -eq $false) { X "$inner<AutoMaxWidth>false</AutoMaxWidth>" }
$hasAmw = $el.PSObject.Properties.Name -contains 'autoMaxWidth'
if ($hasAmw) {
if ($el.autoMaxWidth -eq $false) { X "$inner<AutoMaxWidth>false</AutoMaxWidth>" }
} elseif ($el.multiLine -eq $true) {
X "$inner<AutoMaxWidth>false</AutoMaxWidth>"
}
if ($el.autoMaxHeight -eq $false) { X "$inner<AutoMaxHeight>false</AutoMaxHeight>" }
if ($el.width) { X "$inner<Width>$($el.width)</Width>" }
if ($el.height) { X "$inner<Height>$($el.height)</Height>" }
@@ -1,5 +1,5 @@
#!/usr/bin/env python3
# form-compile v1.14 — Compile 1C managed form from JSON or object metadata
# form-compile v1.15 — Compile 1C managed form from JSON or object metadata
# Source: https://github.com/Nikolay-Shirokov/cc-1c-skills
import argparse
import copy
@@ -1757,7 +1757,10 @@ def emit_input(lines, el, name, eid, indent):
lines.append(f'{inner}<AutoMarkIncomplete>true</AutoMarkIncomplete>')
if el.get('skipOnInput') is True:
lines.append(f'{inner}<SkipOnInput>true</SkipOnInput>')
if el.get('autoMaxWidth') is False:
if 'autoMaxWidth' in el:
if el['autoMaxWidth'] is False:
lines.append(f'{inner}<AutoMaxWidth>false</AutoMaxWidth>')
elif el.get('multiLine') is True:
lines.append(f'{inner}<AutoMaxWidth>false</AutoMaxWidth>')
if el.get('autoMaxHeight') is False:
lines.append(f'{inner}<AutoMaxHeight>false</AutoMaxHeight>')
@@ -28,6 +28,7 @@
<DataPath>Результат</DataPath>
<ReadOnly>true</ReadOnly>
<MultiLine>true</MultiLine>
<AutoMaxWidth>false</AutoMaxWidth>
<Height>8</Height>
<ContextMenu name="РезультатКонтекстноеМеню" id="7"/>
<ExtendedTooltip name="РезультатРасширеннаяПодсказка" id="8"/>
@@ -54,6 +54,7 @@
</Title>
<ReadOnly>true</ReadOnly>
<MultiLine>true</MultiLine>
<AutoMaxWidth>false</AutoMaxWidth>
<Height>8</Height>
<ContextMenu name="РезультатКонтекстноеМеню" id="10"/>
<ExtendedTooltip name="РезультатРасширеннаяПодсказка" id="11"/>
@@ -29,6 +29,7 @@
</v8:item>
</Title>
<MultiLine>true</MultiLine>
<AutoMaxWidth>false</AutoMaxWidth>
<Height>5</Height>
<ContextMenu name="МногострочноеПолеКонтекстноеМеню" id="5"/>
<ExtendedTooltip name="МногострочноеПолеРасширеннаяПодсказка" id="6"/>