mirror of
https://github.com/Nikolay-Shirokov/cc-1c-skills.git
synced 2026-07-24 05:31:02 +03:00
feat(form-decompile,form-compile): события ExtendedTooltip-компаньона (переиспользование механизма событий элемента)
ExtendedTooltip (companion = LabelDecoration) может нести <Events> (напр. URLProcessing у hyperlink-подсказки — ОбработкаНавигационнойСсылки). Декомпилятор ловил own-content (layout/оформление/флаги/hyperlink), но НЕ события → весь блок Events LOST (топ list-iter: ExtendedTooltip>Events 492 impact). Был отложенный хвост кластера ExtendedTooltip own-content. Переиспользован механизм событий элемента: декомпилятор Get-Events → etObj['events']; компилятор Emit-Events (typeKey 'label', после Title) + 'events' в companionStructKeys (чтобы text+events шёл структурной веткой). Зеркало py. Round-trip формы НастройкиИнтеграцииМаркетплейс/ФормаЭлемента бит-в-бит (3 ExtendedTooltip с URLProcessing). Кейс input-fields (extendedTooltip +hyperlink +events URLProcessing) сертифицирован в 1С. Регресс 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
32273d2be8
commit
9900f8f656
@@ -1,4 +1,4 @@
|
||||
# form-compile v1.120 — Compile 1C managed form from JSON or object metadata
|
||||
# form-compile v1.121 — Compile 1C managed form from JSON or object metadata
|
||||
# Source: https://github.com/Nikolay-Shirokov/cc-1c-skills
|
||||
param(
|
||||
[string]$JsonPath,
|
||||
@@ -2356,7 +2356,7 @@ function Emit-Events {
|
||||
$script:companionStructKeys = @(
|
||||
'width','autoMaxWidth','maxWidth','height','autoMaxHeight','maxHeight','verticalAlign','titleHeight',
|
||||
'horizontalStretch','verticalStretch','horizontalAlign','groupHorizontalAlign','groupVerticalAlign',
|
||||
'visible','hidden','enabled','disabled','hyperlink',
|
||||
'visible','hidden','enabled','disabled','hyperlink','events',
|
||||
'textColor','backColor','borderColor','font','border','цветтекста','цветфона','цветрамки','шрифт','рамка'
|
||||
)
|
||||
function Test-CompanionStructured {
|
||||
@@ -2405,6 +2405,8 @@ function Emit-Companion {
|
||||
Emit-Layout -el $content -indent $inner
|
||||
Emit-Appearance -el $content -indent $inner -profile 'decoration'
|
||||
if ($txtPresent) { Emit-CompanionTitle -content $content -indent $inner }
|
||||
# События компаньона (ExtendedTooltip = LabelDecoration: напр. URLProcessing у hyperlink-подсказки)
|
||||
Emit-Events -el $content -elementName $name -indent $inner -typeKey 'label'
|
||||
} else {
|
||||
Emit-CompanionTitle -content $content -indent $inner
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#!/usr/bin/env python3
|
||||
# form-compile v1.120 — Compile 1C managed form from JSON or object metadata
|
||||
# form-compile v1.121 — Compile 1C managed form from JSON or object metadata
|
||||
# Source: https://github.com/Nikolay-Shirokov/cc-1c-skills
|
||||
import argparse
|
||||
import copy
|
||||
@@ -2391,7 +2391,7 @@ def resolve_ml_formatted(val):
|
||||
COMPANION_STRUCT_KEYS = {
|
||||
'width', 'autoMaxWidth', 'maxWidth', 'height', 'autoMaxHeight', 'maxHeight', 'verticalAlign', 'titleHeight',
|
||||
'horizontalStretch', 'verticalStretch', 'horizontalAlign', 'groupHorizontalAlign', 'groupVerticalAlign',
|
||||
'visible', 'hidden', 'enabled', 'disabled', 'hyperlink',
|
||||
'visible', 'hidden', 'enabled', 'disabled', 'hyperlink', 'events',
|
||||
'textColor', 'backColor', 'borderColor', 'font', 'border', 'цветтекста', 'цветфона', 'цветрамки', 'шрифт', 'рамка',
|
||||
}
|
||||
|
||||
@@ -2420,6 +2420,8 @@ def emit_companion(lines, tag, name, indent, content=None):
|
||||
emit_appearance(lines, content, inner, 'decoration')
|
||||
if 'text' in content:
|
||||
emit_companion_title(lines, content, inner)
|
||||
# События компаньона (ExtendedTooltip = LabelDecoration: напр. URLProcessing у hyperlink-подсказки)
|
||||
emit_events(lines, content, name, inner, 'label')
|
||||
else:
|
||||
emit_companion_title(lines, content, inner)
|
||||
lines.append(f'{indent}</{tag}>')
|
||||
|
||||
Reference in New Issue
Block a user