mirror of
https://github.com/Nikolay-Shirokov/cc-1c-skills.git
synced 2026-08-03 02:00:22 +03:00
feat(form-compile): оформление групп/таблиц/picField/calendar + декод \u-комментариев (хвост Appearance)
Развёл Emit-Appearance ещё в 5 эмиттеров: UsualGroup/ColumnGroup/Table/PictureField/CalendarField (профиль field; декомпилятор их уже захватывал в Add-CommonProps — теперь компилятор эмитит). Порядок собственного оформления по корпусу: группа TitleTextColor/TitleFont/BackColor; таблица BackColor/BorderColor — укладываются в field-профиль. Зеркало PS+Python. PictureDecoration НЕ разведён намеренно: его XSD расщепляет оформление вокруг <Title> (TextColor/Font до Title, Border после) + позиция <Picture> — отдельный мелкий кластер (2 строки). Сертификация загрузкой в 1С 8.3.24: element-appearance (+ группа с BackColor), dynamic-list-parameters (+ Table backColor/borderColor, колонка titleTextColor/border) — чисто. Регресс 36/36 ps+py. Harness 1177→1146 (−31; весь кластер Appearance 1326→1146 = −180), остаток appearance LOST = PictureDecoration 2, ADDED-регрессий 0. Попутно: декодированы garbled \u-escape в КОММЕНТАРИЯХ form-compile.py (артефакт Edit-инструмента, переэкранирующего кириллицу под ASCII-конвенцию файла; в комментариях \u не интерпретируется). Строковые литералы (имена компаньонов) остаются \u-escaped — там escape функционален. Версия form-compile v1.66.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
# form-compile v1.65 — Compile 1C managed form from JSON or object metadata
|
||||
# form-compile v1.66 — Compile 1C managed form from JSON or object metadata
|
||||
# Source: https://github.com/Nikolay-Shirokov/cc-1c-skills
|
||||
param(
|
||||
[string]$JsonPath,
|
||||
@@ -2830,6 +2830,9 @@ function Emit-Group {
|
||||
Emit-CommonFlags -el $el -indent $inner
|
||||
Emit-Layout -el $el -indent $inner
|
||||
|
||||
# Оформление (цвета/шрифты/граница) — перед компаньоном
|
||||
Emit-Appearance -el $el -indent $inner -profile 'field'
|
||||
|
||||
# Companion: ExtendedTooltip
|
||||
Emit-Companion -tag "ExtendedTooltip" -name "${name}РасширеннаяПодсказка" -indent $inner -content $el.extendedTooltip
|
||||
|
||||
@@ -2869,6 +2872,9 @@ function Emit-ColumnGroup {
|
||||
Emit-CommonFlags -el $el -indent $inner
|
||||
Emit-Layout -el $el -indent $inner
|
||||
|
||||
# Оформление (цвета/шрифты/граница) — перед компаньоном
|
||||
Emit-Appearance -el $el -indent $inner -profile 'field'
|
||||
|
||||
# Companion: ExtendedTooltip
|
||||
Emit-Companion -tag "ExtendedTooltip" -name "${name}РасширеннаяПодсказка" -indent $inner -content $el.extendedTooltip
|
||||
|
||||
@@ -3381,6 +3387,9 @@ function Emit-Table {
|
||||
X "$inner</CommandSet>"
|
||||
}
|
||||
|
||||
# Оформление (цвета/граница таблицы) — перед компаньонами
|
||||
Emit-Appearance -el $el -indent $inner -profile 'field'
|
||||
|
||||
# Companions
|
||||
Emit-CompanionPanel -tag "ContextMenu" -name "${name}КонтекстноеМеню" -indent $inner -panel $el.contextMenu
|
||||
# AutoCommandBar: приоритет commandBar-свойства (контент); иначе tableAutofill-shorthand; иначе пусто.
|
||||
@@ -3598,6 +3607,9 @@ function Emit-PictureDecoration {
|
||||
if ($el.hyperlink -eq $true) { X "$inner<Hyperlink>true</Hyperlink>" }
|
||||
Emit-Layout -el $el -indent $inner
|
||||
|
||||
# Оформление PictureDecoration: XSD расщепляет appearance вокруг Title (Border после Title)
|
||||
# + позиция Picture — отдельный кластер, пока не разводим (декомпилятор захватывает в keys).
|
||||
|
||||
# Companions
|
||||
Emit-CompanionPanel -tag "ContextMenu" -name "${name}КонтекстноеМеню" -indent $inner -panel $el.contextMenu
|
||||
Emit-Companion -tag "ExtendedTooltip" -name "${name}РасширеннаяПодсказка" -indent $inner -content $el.extendedTooltip
|
||||
@@ -3629,6 +3641,9 @@ function Emit-PictureField {
|
||||
# Скаляр (Ref) или объект {src, loadTransparent}; LoadTransparent эмитится всегда.
|
||||
Emit-PictureRef -val $el.valuesPicture -picTag 'ValuesPicture' -indent $inner
|
||||
|
||||
# Оформление (цвета/шрифты/граница) — перед компаньонами
|
||||
Emit-Appearance -el $el -indent $inner -profile 'field'
|
||||
|
||||
# Companions
|
||||
Emit-CompanionPanel -tag "ContextMenu" -name "${name}КонтекстноеМеню" -indent $inner -panel $el.contextMenu
|
||||
Emit-Companion -tag "ExtendedTooltip" -name "${name}РасширеннаяПодсказка" -indent $inner -content $el.extendedTooltip
|
||||
@@ -3671,6 +3686,9 @@ function Emit-Calendar {
|
||||
if ($null -ne $el.heightInMonths) { X "$inner<HeightInMonths>$($el.heightInMonths)</HeightInMonths>" }
|
||||
if ($null -ne $el.showMonthsPanel) { $v = if ($el.showMonthsPanel) { "true" } else { "false" }; X "$inner<ShowMonthsPanel>$v</ShowMonthsPanel>" }
|
||||
|
||||
# Оформление (цвета/шрифты/граница) — перед компаньонами
|
||||
Emit-Appearance -el $el -indent $inner -profile 'field'
|
||||
|
||||
# Companions
|
||||
Emit-CompanionPanel -tag "ContextMenu" -name "${name}КонтекстноеМеню" -indent $inner -panel $el.contextMenu
|
||||
Emit-Companion -tag "ExtendedTooltip" -name "${name}РасширеннаяПодсказка" -indent $inner -content $el.extendedTooltip
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#!/usr/bin/env python3
|
||||
# form-compile v1.65 — Compile 1C managed form from JSON or object metadata
|
||||
# form-compile v1.66 — Compile 1C managed form from JSON or object metadata
|
||||
# Source: https://github.com/Nikolay-Shirokov/cc-1c-skills
|
||||
import argparse
|
||||
import copy
|
||||
@@ -2744,6 +2744,9 @@ def emit_group(lines, el, name, eid, indent):
|
||||
emit_common_flags(lines, el, inner)
|
||||
emit_layout(lines, el, inner)
|
||||
|
||||
# Оформление (цвета/шрифты/граница) — перед компаньоном
|
||||
emit_appearance(lines, el, inner, 'field')
|
||||
|
||||
# Companion: ExtendedTooltip
|
||||
emit_companion(lines, 'ExtendedTooltip', f'{name}\u0420\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u043d\u0430\u044f\u041f\u043e\u0434\u0441\u043a\u0430\u0437\u043a\u0430', inner, el.get('extendedTooltip'))
|
||||
|
||||
@@ -2780,6 +2783,9 @@ def emit_column_group(lines, el, name, eid, indent):
|
||||
emit_common_flags(lines, el, inner)
|
||||
emit_layout(lines, el, inner)
|
||||
|
||||
# Оформление (цвета/шрифты/граница) — перед компаньоном
|
||||
emit_appearance(lines, el, inner, 'field')
|
||||
|
||||
emit_companion(lines, 'ExtendedTooltip', f'{name}РасширеннаяПодсказка', inner, el.get('extendedTooltip'))
|
||||
|
||||
if el.get('children') and len(el['children']) > 0:
|
||||
@@ -3101,6 +3107,9 @@ def emit_table(lines, el, name, eid, indent):
|
||||
lines.append(f'{inner}\t<ExcludedCommand>{cmd}</ExcludedCommand>')
|
||||
lines.append(f'{inner}</CommandSet>')
|
||||
|
||||
# Оформление (цвета/граница таблицы) — перед компаньонами
|
||||
emit_appearance(lines, el, inner, 'field')
|
||||
|
||||
# Companions
|
||||
emit_companion_panel(lines, 'ContextMenu', f'{name}\u041a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u043d\u043e\u0435\u041c\u0435\u043d\u044e', inner, el.get('contextMenu'))
|
||||
# AutoCommandBar — with optional Autofill control
|
||||
@@ -3293,6 +3302,9 @@ def emit_picture_decoration(lines, el, name, eid, indent):
|
||||
lines.append(f'{inner}<Hyperlink>true</Hyperlink>')
|
||||
emit_layout(lines, el, inner)
|
||||
|
||||
# Оформление PictureDecoration: XSD расщепляет appearance вокруг Title (Border после Title)
|
||||
# + позиция Picture — отдельный кластер, пока не разводим (декомпилятор захватывает в keys).
|
||||
|
||||
# Companions
|
||||
emit_companion_panel(lines, 'ContextMenu', f'{name}\u041a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u043d\u043e\u0435\u041c\u0435\u043d\u044e', inner, el.get('contextMenu'))
|
||||
emit_companion(lines, 'ExtendedTooltip', f'{name}\u0420\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u043d\u0430\u044f\u041f\u043e\u0434\u0441\u043a\u0430\u0437\u043a\u0430', inner, el.get('extendedTooltip'))
|
||||
@@ -3325,6 +3337,9 @@ def emit_picture_field(lines, el, name, eid, indent):
|
||||
# Скаляр (Ref) или объект {src, loadTransparent}; LoadTransparent эмитится всегда.
|
||||
emit_picture_ref(lines, el.get('valuesPicture'), 'ValuesPicture', inner)
|
||||
|
||||
# Оформление (цвета/шрифты/граница) — перед компаньонами
|
||||
emit_appearance(lines, el, inner, 'field')
|
||||
|
||||
# Companions
|
||||
emit_companion_panel(lines, 'ContextMenu', f'{name}\u041a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u043d\u043e\u0435\u041c\u0435\u043d\u044e', inner, el.get('contextMenu'))
|
||||
emit_companion(lines, 'ExtendedTooltip', f'{name}\u0420\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u043d\u0430\u044f\u041f\u043e\u0434\u0441\u043a\u0430\u0437\u043a\u0430', inner, el.get('extendedTooltip'))
|
||||
@@ -3363,6 +3378,9 @@ def emit_calendar(lines, el, name, eid, indent):
|
||||
if el.get('showMonthsPanel') is not None:
|
||||
lines.append(f'{inner}<ShowMonthsPanel>{"true" if el["showMonthsPanel"] else "false"}</ShowMonthsPanel>')
|
||||
|
||||
# Оформление (цвета/шрифты/граница) — перед компаньонами
|
||||
emit_appearance(lines, el, inner, 'field')
|
||||
|
||||
# Companions
|
||||
emit_companion_panel(lines, 'ContextMenu', f'{name}\u041a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u043d\u043e\u0435\u041c\u0435\u043d\u044e', inner, el.get('contextMenu'))
|
||||
emit_companion(lines, 'ExtendedTooltip', f'{name}\u0420\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u043d\u0430\u044f\u041f\u043e\u0434\u0441\u043a\u0430\u0437\u043a\u0430', inner, el.get('extendedTooltip'))
|
||||
|
||||
Reference in New Issue
Block a user