mirror of
https://github.com/Nikolay-Shirokov/cc-1c-skills.git
synced 2026-07-26 22:51:03 +03:00
feat(form-decompile,form-compile): tooltipRepresentation элемента (кластер ToolTipRepresentation)
<ToolTipRepresentation> (режим показа подсказки: None/Button/ShowBottom/ShowTop/ ShowLeft/ShowRight/ShowAuto/Balloon) — общее свойство элемента (Button 13785, Popup 6417, ButtonGroup, InputField, CheckBoxField, LabelDecoration, группы и др.; None доминирует — 25241). Терялся: декомпилятор не читал, компилятор не эмитил. Введён общий passthrough-ключ tooltipRepresentation: - декомпилятор: захват в Add-CommonProps; - компилятор: эмиссия в Emit-Title (после ToolTip) — покрывает все эмиттеры, зовущие Emit-Title; плюс отдельно в Emit-Label (свой title-блок, не зовёт Emit-Title). Декомпилятор (ps1) + компилятор (ps1+py) + spec §4.1. Покрытие: input-fields (input, ShowBottom), events (label-декорация, Button) — сертифицировано в 1С 8.3.24. Раундтрип БанковскиеСчета/Wildberries: остаток ToolTipRepresentation = 0. Регресс ps+py 33/33. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
22e929ecb3
commit
908af27bf0
@@ -1,4 +1,4 @@
|
||||
# form-compile v1.36 — Compile 1C managed form from JSON or object metadata
|
||||
# form-compile v1.37 — Compile 1C managed form from JSON or object metadata
|
||||
# Source: https://github.com/Nikolay-Shirokov/cc-1c-skills
|
||||
param(
|
||||
[string]$JsonPath,
|
||||
@@ -1959,7 +1959,7 @@ function Emit-Element {
|
||||
# radio-specific
|
||||
"radioButtonType"=1;"choiceList"=1;"columnsCount"=1;"checkBoxType"=1;"editMode"=1
|
||||
# naming & binding
|
||||
"name"=1;"path"=1;"title"=1;"tooltip"=1
|
||||
"name"=1;"path"=1;"title"=1;"tooltip"=1;"tooltipRepresentation"=1
|
||||
# visibility & state
|
||||
"visible"=1;"hidden"=1;"enabled"=1;"disabled"=1;"readOnly"=1;"userVisible"=1
|
||||
# events ("events" — основной формат; on/handlers — legacy, принимаются ради совместимости)
|
||||
@@ -2096,6 +2096,8 @@ function Emit-Title {
|
||||
}
|
||||
# ToolTip элемента (всплывающая подсказка) — по схеме сразу после Title.
|
||||
if ($el.tooltip) { Emit-MLText -tag "ToolTip" -text $el.tooltip -indent $indent }
|
||||
# ToolTipRepresentation — режим показа подсказки (None/Button/ShowBottom/…), после ToolTip.
|
||||
if ($el.tooltipRepresentation) { X "$indent<ToolTipRepresentation>$($el.tooltipRepresentation)</ToolTipRepresentation>" }
|
||||
}
|
||||
|
||||
function Map-TitleLoc {
|
||||
@@ -2531,6 +2533,7 @@ function Emit-Label {
|
||||
X "$inner</Title>"
|
||||
}
|
||||
if ($el.tooltip) { Emit-MLText -tag "ToolTip" -text $el.tooltip -indent $inner }
|
||||
if ($el.tooltipRepresentation) { X "$inner<ToolTipRepresentation>$($el.tooltipRepresentation)</ToolTipRepresentation>" }
|
||||
|
||||
Emit-CommonFlags -el $el -indent $inner
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#!/usr/bin/env python3
|
||||
# form-compile v1.36 — Compile 1C managed form from JSON or object metadata
|
||||
# form-compile v1.37 — Compile 1C managed form from JSON or object metadata
|
||||
# Source: https://github.com/Nikolay-Shirokov/cc-1c-skills
|
||||
import argparse
|
||||
import copy
|
||||
@@ -1356,7 +1356,7 @@ KNOWN_KEYS = {
|
||||
"button", "picture", "picField", "calendar", "cmdBar", "popup",
|
||||
"showInHeader",
|
||||
"radioButtonType", "choiceList", "columnsCount", "checkBoxType", "editMode",
|
||||
"name", "path", "title", "tooltip",
|
||||
"name", "path", "title", "tooltip", "tooltipRepresentation",
|
||||
"visible", "hidden", "enabled", "disabled", "readOnly", "userVisible",
|
||||
"events", "on", "handlers",
|
||||
"selectionMode", "showCurrentDate", "widthInMonths", "heightInMonths", "showMonthsPanel",
|
||||
@@ -1678,6 +1678,9 @@ def emit_title(lines, el, name, indent, auto=False):
|
||||
# ToolTip элемента (всплывающая подсказка) — по схеме сразу после Title.
|
||||
if el.get('tooltip'):
|
||||
emit_mltext(lines, indent, 'ToolTip', el['tooltip'])
|
||||
# ToolTipRepresentation — режим показа подсказки (None/Button/ShowBottom/…), после ToolTip.
|
||||
if el.get('tooltipRepresentation'):
|
||||
lines.append(f'{indent}<ToolTipRepresentation>{el["tooltipRepresentation"]}</ToolTipRepresentation>')
|
||||
|
||||
|
||||
_TITLE_LOC_MAP = {'none': 'None', 'left': 'Left', 'right': 'Right', 'top': 'Top', 'bottom': 'Bottom', 'auto': 'Auto'}
|
||||
@@ -2180,6 +2183,8 @@ def emit_label(lines, el, name, eid, indent):
|
||||
lines.append(f'{inner}</Title>')
|
||||
if el.get('tooltip'):
|
||||
emit_mltext(lines, inner, 'ToolTip', el['tooltip'])
|
||||
if el.get('tooltipRepresentation'):
|
||||
lines.append(f'{inner}<ToolTipRepresentation>{el["tooltipRepresentation"]}</ToolTipRepresentation>')
|
||||
|
||||
emit_common_flags(lines, el, inner)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user