mirror of
https://github.com/Nikolay-Shirokov/cc-1c-skills.git
synced 2026-08-02 09:47:45 +03:00
feat(form-decompile,form-compile): батч скаляров (IncompleteChoiceMode/EqualColumnsWidth/ChildrenAlign/ImageScale/Zoomable/Shape/PictureLocation) + форменные ShowCloseButton/HorizontalAlign/ChildrenAlign/ShowTitle + PictureDecoration NonselectedPictureText + ShowTitle factual
Из топа list-iter2 (формы из корпуса): - Generic-скаляры (input/radio/group/picDecoration/button через Emit-Layout): IncompleteChoiceMode, EqualColumnsWidth(bool), ChildrenAlign, ImageScale, Zoomable(bool), Shape, PictureLocation. - Форменные свойства → KNOWN_FORM_PROPS (декомпилятор) + авто-PascalCase Emit-Properties: ShowCloseButton, HorizontalAlign, ChildrenAlign, ShowTitle. - PictureDecoration NonselectedPictureText (ML, как у picField; после Title). - ShowTitle factual у UsualGroup/Page/ColumnGroup — раньше ловили/эмитили только false, явный <ShowTitle>true> терялся (8989 в корпусе); теперь true/false при наличии. ⚠️ Table HeaderHeight/FooterHeight/CurrentRowUse НЕ добавлены: строгий Table-XSD требует точной позиции тегов (Representation→…→HeaderHeight→Footer→…→CurrentRowUse→RowFilter), generic-позиция ломает загрузку (XDTO exception) — отдельная задача по позициям в Emit-Table. Зеркало py. Выборка 82 формы: 0 корневых утечек батч-тегов (остаток — CFE-форма с потерянным контейнером расширения, не связано). Кейсы table/radio-tumbler-strings/groups/element-appearance/ input-fields расширены и сертифицированы в 1С (явный ShowTitle=true, форменные props, picDecoration NPT, button Shape/PictureLocation). Регресс 43/43 (ps1+py). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
330447c95f
commit
6e4fdb443a
@@ -1,4 +1,4 @@
|
||||
# form-compile v1.124 — Compile 1C managed form from JSON or object metadata
|
||||
# form-compile v1.125 — Compile 1C managed form from JSON or object metadata
|
||||
# Source: https://github.com/Nikolay-Shirokov/cc-1c-skills
|
||||
param(
|
||||
[string]$JsonPath,
|
||||
@@ -3024,6 +3024,17 @@ $script:genericScalars = @(
|
||||
@{ Tag='ScrollOnCompress'; Key='scrollOnCompress'; Kind='bool' }
|
||||
# Сочетание клавиш — общее свойство (input/group/radio/page/picField/label/table/check; команда — отд. путь, §7)
|
||||
@{ Tag='Shortcut'; Key='shortcut'; Kind='value' }
|
||||
# Батч простых скаляров (input/radio/group/picDecoration/button): режим выбора незаполненного,
|
||||
# равная ширина колонок, выравнивание детей, масштаб/зум картинки, форма/положение картинки кнопки.
|
||||
# (Table HeaderHeight/FooterHeight/CurrentRowUse — НЕ здесь: строгий Table-XSD требует точной
|
||||
# позиции, generic-позиция ломает загрузку; отдельная задача в Emit-Table.)
|
||||
@{ Tag='IncompleteChoiceMode'; Key='incompleteChoiceMode'; Kind='value' }
|
||||
@{ Tag='EqualColumnsWidth'; Key='equalColumnsWidth'; Kind='bool' }
|
||||
@{ Tag='ChildrenAlign'; Key='childrenAlign'; Kind='value' }
|
||||
@{ Tag='ImageScale'; Key='imageScale'; Kind='value' }
|
||||
@{ Tag='Zoomable'; Key='zoomable'; Kind='bool' }
|
||||
@{ Tag='Shape'; Key='shape'; Kind='value' }
|
||||
@{ Tag='PictureLocation'; Key='pictureLocation'; Kind='value' }
|
||||
)
|
||||
|
||||
function Emit-GenericScalars {
|
||||
@@ -3511,7 +3522,7 @@ function Emit-Group {
|
||||
}
|
||||
|
||||
# ShowTitle
|
||||
if ($el.showTitle -eq $false) { X "$inner<ShowTitle>false</ShowTitle>" }
|
||||
if ($null -ne $el.showTitle) { X "$inner<ShowTitle>$(if ($el.showTitle){'true'}else{'false'})</ShowTitle>" }
|
||||
# Заголовок свёрнутого представления (collapsible/popup) — мультиязычный текст
|
||||
if ($el.collapsedTitle) { Emit-MLText -tag "CollapsedRepresentationTitle" -text $el.collapsedTitle -indent $inner }
|
||||
|
||||
@@ -3557,7 +3568,7 @@ function Emit-ColumnGroup {
|
||||
}
|
||||
if ($orientation) { X "$inner<Group>$orientation</Group>" }
|
||||
|
||||
if ($el.showTitle -eq $false) { X "$inner<ShowTitle>false</ShowTitle>" }
|
||||
if ($null -ne $el.showTitle) { X "$inner<ShowTitle>$(if ($el.showTitle){'true'}else{'false'})</ShowTitle>" }
|
||||
# showInHeader эмитится общим Emit-CommonElementProps (через Emit-Layout)
|
||||
|
||||
Emit-CommonFlags -el $el -indent $inner
|
||||
@@ -4407,7 +4418,7 @@ function Emit-Page {
|
||||
}
|
||||
if ($orientation) { X "$inner<Group>$orientation</Group>" }
|
||||
}
|
||||
if ($el.showTitle -eq $false) { X "$inner<ShowTitle>false</ShowTitle>" }
|
||||
if ($null -ne $el.showTitle) { X "$inner<ShowTitle>$(if ($el.showTitle){'true'}else{'false'})</ShowTitle>" }
|
||||
Emit-Layout -el $el -indent $inner
|
||||
|
||||
# Оформление страницы (BackColor / TitleTextColor / TitleFont) — после ShowTitle, перед компаньоном
|
||||
@@ -4533,6 +4544,8 @@ function Emit-PictureDecoration {
|
||||
$inner = "$indent`t"
|
||||
|
||||
Emit-DecorationTitle -el $el -name $name -indent $inner
|
||||
# Текст при невыбранной картинке (NonselectedPictureText) — после Title (порядок корпуса)
|
||||
if ($null -ne $el.nonselectedPictureText) { Emit-MLText -tag "NonselectedPictureText" -text $el.nonselectedPictureText -indent $inner }
|
||||
Emit-CommonFlags -el $el -indent $inner
|
||||
|
||||
# Источник картинки — ТОЛЬКО $el.src (у PictureDecoration ключ 'picture' = тип/имя элемента, не источник).
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#!/usr/bin/env python3
|
||||
# form-compile v1.124 — Compile 1C managed form from JSON or object metadata
|
||||
# form-compile v1.125 — Compile 1C managed form from JSON or object metadata
|
||||
# Source: https://github.com/Nikolay-Shirokov/cc-1c-skills
|
||||
import argparse
|
||||
import copy
|
||||
@@ -3142,6 +3142,14 @@ GENERIC_SCALARS = [
|
||||
('ScrollOnCompress', 'scrollOnCompress', 'bool'),
|
||||
# Сочетание клавиш — общее свойство (команда — отдельный путь)
|
||||
('Shortcut', 'shortcut', 'value'),
|
||||
# Батч простых скаляров (input/radio/group/picDecoration/button; Table-специфичные — отдельно)
|
||||
('IncompleteChoiceMode', 'incompleteChoiceMode', 'value'),
|
||||
('EqualColumnsWidth', 'equalColumnsWidth', 'bool'),
|
||||
('ChildrenAlign', 'childrenAlign', 'value'),
|
||||
('ImageScale', 'imageScale', 'value'),
|
||||
('Zoomable', 'zoomable', 'bool'),
|
||||
('Shape', 'shape', 'value'),
|
||||
('PictureLocation', 'pictureLocation', 'value'),
|
||||
]
|
||||
|
||||
|
||||
@@ -3606,8 +3614,8 @@ def emit_group(lines, el, name, eid, indent):
|
||||
lines.append(f'{inner}<Representation>{repr_val}</Representation>')
|
||||
|
||||
# ShowTitle
|
||||
if el.get('showTitle') is False:
|
||||
lines.append(f'{inner}<ShowTitle>false</ShowTitle>')
|
||||
if el.get('showTitle') is not None:
|
||||
lines.append(f'{inner}<ShowTitle>{"true" if el["showTitle"] else "false"}</ShowTitle>')
|
||||
# Заголовок свёрнутого представления (collapsible/popup) — мультиязычный текст
|
||||
if el.get('collapsedTitle'):
|
||||
emit_mltext(lines, inner, 'CollapsedRepresentationTitle', el['collapsedTitle'])
|
||||
@@ -3651,8 +3659,8 @@ def emit_column_group(lines, el, name, eid, indent):
|
||||
if orientation:
|
||||
lines.append(f'{inner}<Group>{orientation}</Group>')
|
||||
|
||||
if el.get('showTitle') is False:
|
||||
lines.append(f'{inner}<ShowTitle>false</ShowTitle>')
|
||||
if el.get('showTitle') is not None:
|
||||
lines.append(f'{inner}<ShowTitle>{"true" if el["showTitle"] else "false"}</ShowTitle>')
|
||||
# showInHeader эмитится общим emit_common_element_props (через emit_layout)
|
||||
|
||||
emit_common_flags(lines, el, inner)
|
||||
@@ -4134,8 +4142,8 @@ def emit_page(lines, el, name, eid, indent):
|
||||
orientation = orientation_map.get(str(el['group']))
|
||||
if orientation:
|
||||
lines.append(f'{inner}<Group>{orientation}</Group>')
|
||||
if el.get('showTitle') is False:
|
||||
lines.append(f'{inner}<ShowTitle>false</ShowTitle>')
|
||||
if el.get('showTitle') is not None:
|
||||
lines.append(f'{inner}<ShowTitle>{"true" if el["showTitle"] else "false"}</ShowTitle>')
|
||||
emit_layout(lines, el, inner)
|
||||
|
||||
# \u041e\u0444\u043e\u0440\u043c\u043b\u0435\u043d\u0438\u0435 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b (BackColor / TitleTextColor / TitleFont) \u2014 \u043f\u043e\u0441\u043b\u0435 ShowTitle, \u043f\u0435\u0440\u0435\u0434 \u043a\u043e\u043c\u043f\u0430\u043d\u044c\u043e\u043d\u043e\u043c
|
||||
@@ -4246,6 +4254,9 @@ def emit_picture_decoration(lines, el, name, eid, indent):
|
||||
inner = f'{indent}\t'
|
||||
|
||||
emit_decoration_title(lines, el, name, inner)
|
||||
# Текст при невыбранной картинке (NonselectedPictureText) — после Title (порядок корпуса)
|
||||
if el.get('nonselectedPictureText') is not None:
|
||||
emit_mltext(lines, inner, 'NonselectedPictureText', el['nonselectedPictureText'])
|
||||
emit_common_flags(lines, el, inner)
|
||||
|
||||
# Источник картинки — ТОЛЬКО src (ключ 'picture' = тип/имя элемента, не источник).
|
||||
|
||||
Reference in New Issue
Block a user