mirror of
https://github.com/Nikolay-Shirokov/cc-1c-skills.git
synced 2026-06-15 02:14:57 +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'))
|
||||
|
||||
@@ -197,7 +197,7 @@ companion-панели с собственным контентом. Оба не
|
||||
|
||||
### 4.1e. Оформление элемента (цвета / шрифты / граница)
|
||||
|
||||
Прямые свойства оформления элемента. Ключи — англ. camelCase 1:1 с тегами; **принимаются рус. синонимы** (forgiving). Применимо к полям (input/check/radio/labelField), декорациям (label) и кнопкам (button); порядок тегов в XML — по базовому типу (профиль), компилятор расставляет сам.
|
||||
Прямые свойства оформления элемента. Ключи — англ. camelCase 1:1 с тегами; **принимаются рус. синонимы** (forgiving). Применимо к полям (input/check/radio/labelField/picField/calendar), декорациям (label), кнопкам (button), группам (group/columnGroup) и таблицам (table); порядок тегов в XML — по базовому типу (профиль), компилятор расставляет сам. (PictureDecoration пока не поддержан — у него XSD расщепляет оформление вокруг `<Title>`.)
|
||||
|
||||
| Ключ | Тег | Рус. синоним |
|
||||
|------|-----|--------------|
|
||||
|
||||
@@ -38,9 +38,9 @@
|
||||
} }
|
||||
],
|
||||
"elements": [
|
||||
{ "table": "Список", "path": "Список", "columns": [
|
||||
{ "table": "Список", "path": "Список", "backColor": "web:Honeydew", "borderColor": "style:BorderColor", "columns": [
|
||||
{ "input": "Код", "path": "Список.Код" },
|
||||
{ "input": "Наименование", "path": "Список.Наименование" }
|
||||
{ "input": "Наименование", "path": "Список.Наименование", "titleTextColor": "web:FireBrick", "border": { "width": 1, "style": "Single" } }
|
||||
]}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"name": "Оформление элементов — цвета/шрифты/граница на decoration/input/button (профили порядка)",
|
||||
"name": "Оформление элементов — цвета/шрифты/граница на decoration/input/button/group (профили порядка)",
|
||||
"preRun": [
|
||||
{
|
||||
"script": "meta-compile/scripts/meta-compile",
|
||||
@@ -33,7 +33,10 @@
|
||||
{ "button": "ОК", "title": "ОК",
|
||||
"backColor": "web:Honeydew",
|
||||
"borderColor": "style:BorderColor",
|
||||
"font": "style:NormalTextFont" }
|
||||
"font": "style:NormalTextFont" },
|
||||
{ "group": "ГруппаОформление", "backColor": "web:Honeydew", "children": [
|
||||
{ "input": "Цена2", "path": "Объект.Цена", "textColor": "web:DimGray" }
|
||||
]}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
+6
@@ -27,6 +27,8 @@
|
||||
<AllowRootChoice>false</AllowRootChoice>
|
||||
<UpdateOnDataChange>Auto</UpdateOnDataChange>
|
||||
<AllowGettingCurrentRowURL>true</AllowGettingCurrentRowURL>
|
||||
<BackColor>web:Honeydew</BackColor>
|
||||
<BorderColor>style:BorderColor</BorderColor>
|
||||
<ContextMenu name="СписокКонтекстноеМеню" id="2"/>
|
||||
<AutoCommandBar name="СписокКоманднаяПанель" id="3">
|
||||
<Autofill>false</Autofill>
|
||||
@@ -64,6 +66,10 @@
|
||||
</InputField>
|
||||
<InputField name="Наименование" id="17">
|
||||
<DataPath>Список.Наименование</DataPath>
|
||||
<TitleTextColor>web:FireBrick</TitleTextColor>
|
||||
<Border width="1">
|
||||
<v8ui:style xsi:type="v8ui:ControlBorderType">Single</v8ui:style>
|
||||
</Border>
|
||||
<ContextMenu name="НаименованиеКонтекстноеМеню" id="18"/>
|
||||
<ExtendedTooltip name="НаименованиеРасширеннаяПодсказка" id="19"/>
|
||||
</InputField>
|
||||
|
||||
+13
-1
@@ -56,9 +56,21 @@
|
||||
<Font ref="style:NormalTextFont" kind="StyleItem"/>
|
||||
<ExtendedTooltip name="ОКРасширеннаяПодсказка" id="11"/>
|
||||
</Button>
|
||||
<UsualGroup name="ГруппаОформление" id="12">
|
||||
<BackColor>web:Honeydew</BackColor>
|
||||
<ExtendedTooltip name="ГруппаОформлениеРасширеннаяПодсказка" id="13"/>
|
||||
<ChildItems>
|
||||
<InputField name="Цена2" id="14">
|
||||
<DataPath>Объект.Цена</DataPath>
|
||||
<TextColor>web:DimGray</TextColor>
|
||||
<ContextMenu name="Цена2КонтекстноеМеню" id="15"/>
|
||||
<ExtendedTooltip name="Цена2РасширеннаяПодсказка" id="16"/>
|
||||
</InputField>
|
||||
</ChildItems>
|
||||
</UsualGroup>
|
||||
</ChildItems>
|
||||
<Attributes>
|
||||
<Attribute name="Объект" id="12">
|
||||
<Attribute name="Объект" id="17">
|
||||
<Type>
|
||||
<v8:Type>cfg:CatalogObject.Товары</v8:Type>
|
||||
</Type>
|
||||
|
||||
Reference in New Issue
Block a user