mirror of
https://github.com/Nikolay-Shirokov/cc-1c-skills.git
synced 2026-07-29 08:01:02 +03:00
feat(form-decompile,form-compile): формат и формат редактирования (Format/EditFormat)
Ключи format/editFormat на InputField/LabelField/CheckBoxField (1408/958
файлов в корпусе). LocalStringType как inputHint/title: строка или {ru,en} —
переиспользование Emit-MLText (компилятор) и Get-LangText (декомпилятор).
Декомпилятор: хелпер Add-FormatProps в 3 ветках. Зеркало py.
Round-trip чистый (0 остатка на 30 формах с Format/EditFormat). Кейс
input-fields: format/editFormat строкой на input/check + мультиязык-объект
на labelField; снэпшот сертифицирован загрузкой в 1С.
Заодно добавлены забытые ключи (format/editFormat/choiceParameters/
choiceParameterLinks/typeLink) в allowlist knownKeys (ps1+py), чтобы не
сыпать ложный warning «unknown key».
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
d0bb26b068
commit
929d1676bb
@@ -1,5 +1,5 @@
|
||||
#!/usr/bin/env python3
|
||||
# form-compile v1.71 — Compile 1C managed form from JSON or object metadata
|
||||
# form-compile v1.72 — Compile 1C managed form from JSON or object metadata
|
||||
# Source: https://github.com/Nikolay-Shirokov/cc-1c-skills
|
||||
import argparse
|
||||
import copy
|
||||
@@ -1775,6 +1775,7 @@ KNOWN_KEYS = {
|
||||
"wrap", "openButton", "listChoiceMode", "showInHeader", "showInFooter",
|
||||
"extendedEditMultipleValues", "chooseType", "autoCellHeight",
|
||||
"choiceButtonRepresentation", "footerHorizontalAlign", "headerHorizontalAlign",
|
||||
"format", "editFormat", "choiceParameters", "choiceParameterLinks", "typeLink",
|
||||
"hyperlink", "formatted",
|
||||
"showTitle", "united", "collapsed", "behavior",
|
||||
"children", "columns",
|
||||
@@ -3008,6 +3009,12 @@ def emit_input(lines, el, name, eid, indent):
|
||||
if el.get('inputHint'):
|
||||
emit_mltext(lines, inner, 'InputHint', el['inputHint'])
|
||||
|
||||
# Формат / формат редактирования (LocalStringType — строка или {ru,en})
|
||||
if el.get('format'):
|
||||
emit_mltext(lines, inner, 'Format', el['format'])
|
||||
if el.get('editFormat'):
|
||||
emit_mltext(lines, inner, 'EditFormat', el['editFormat'])
|
||||
|
||||
emit_choice_list(lines, el, inner)
|
||||
|
||||
# Связи по типу / связи параметров выбора / параметры выбора
|
||||
@@ -3052,6 +3059,12 @@ def emit_check(lines, el, name, eid, indent):
|
||||
|
||||
emit_layout(lines, el, inner)
|
||||
|
||||
# Формат / формат редактирования (LocalStringType — строка или {ru,en})
|
||||
if el.get('format'):
|
||||
emit_mltext(lines, inner, 'Format', el['format'])
|
||||
if el.get('editFormat'):
|
||||
emit_mltext(lines, inner, 'EditFormat', el['editFormat'])
|
||||
|
||||
# Оформление (цвета/шрифты/граница) — перед компаньонами
|
||||
emit_appearance(lines, el, inner, 'field')
|
||||
|
||||
@@ -3159,6 +3172,12 @@ def emit_label_field(lines, el, name, eid, indent):
|
||||
lines.append(f'{inner}<Hiperlink>true</Hiperlink>')
|
||||
emit_layout(lines, el, inner)
|
||||
|
||||
# Формат / формат редактирования (LocalStringType — строка или {ru,en})
|
||||
if el.get('format'):
|
||||
emit_mltext(lines, inner, 'Format', el['format'])
|
||||
if el.get('editFormat'):
|
||||
emit_mltext(lines, inner, 'EditFormat', el['editFormat'])
|
||||
|
||||
# Оформление (цвета/шрифты/граница + header/footer) — перед компаньонами
|
||||
emit_appearance(lines, el, inner, 'field')
|
||||
|
||||
|
||||
Reference in New Issue
Block a user