mirror of
https://github.com/Nikolay-Shirokov/cc-1c-skills.git
synced 2026-08-05 03:00:22 +03:00
feat(form-decompile,form-compile): хвост раскрытых CommandInterface-форм (TOTAL 95→38)
Добивка длинного хвоста, раскрытого при выводе CommandInterface из ring-3. Generic-скаляры (обе стороны,+py): titleDataPath (Page/Group динамический заголовок, 1723; парный к footerDataPath), extendedEdit (input, 3400), maxRowsCount/autoMaxRowsCount/heightControlVariant (Table высота), editTextUpdate (input enum, 739). ML-текст: warningOnEdit (input, 641), footerText (input, 269), nonselectedPictureText (picField, 265). Фикс markIncomplete → фактическое значение (AutoMarkIncomplete true/false; раньше только true, 1170 false терялись на input+table). Выборка 2.17: TOTAL 95→38, match 197→209, diff 6→4. Остаток (отложено в BACKLOG): dcssch:valueType/name манглинг типов полей дин-списка (отдельная подсистема), LabelDecoration title-пробел, GroupList (не покрываем). Кейсы input-fields/table/pages расширены и сертифицированы в 1С. Регресс 40/40. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
d7dedd4843
commit
e16b23968e
@@ -1,4 +1,4 @@
|
||||
# form-compile v1.98 — Compile 1C managed form from JSON or object metadata
|
||||
# form-compile v1.99 — Compile 1C managed form from JSON or object metadata
|
||||
# Source: https://github.com/Nikolay-Shirokov/cc-1c-skills
|
||||
param(
|
||||
[string]$JsonPath,
|
||||
@@ -2618,6 +2618,9 @@ function Emit-Element {
|
||||
"horizontalSpacing"=1;"representationInContextMenu"=1;"settingsNamedItemDetailedRepresentation"=1
|
||||
# хвост: высота элемента списка / ширина выпадающего списка / картинка кнопки выбора / прозрачный пиксель
|
||||
"itemHeight"=1;"dropListWidth"=1;"choiceButtonPicture"=1;"transparentPixel"=1
|
||||
# хвост CI-форм: динамический заголовок / расширенное редактирование / высота таблицы
|
||||
"titleDataPath"=1;"extendedEdit"=1;"maxRowsCount"=1;"autoMaxRowsCount"=1;"heightControlVariant"=1
|
||||
"warningOnEdit"=1;"nonselectedPictureText"=1;"editTextUpdate"=1;"footerText"=1
|
||||
# columnGroup-specific
|
||||
"showInHeader"=1
|
||||
# radio-specific
|
||||
@@ -2925,6 +2928,13 @@ $script:genericScalars = @(
|
||||
# Хвост: высота элемента списка (radio) / ширина выпадающего списка (input)
|
||||
@{ Tag='ItemHeight'; Key='itemHeight'; Kind='value' }
|
||||
@{ Tag='DropListWidth'; Key='dropListWidth'; Kind='value' }
|
||||
# Хвост CI-форм: динамический заголовок (Page/Group) / расширенное ред. (input) / высота таблицы по строкам
|
||||
@{ Tag='TitleDataPath'; Key='titleDataPath'; Kind='value' }
|
||||
@{ Tag='ExtendedEdit'; Key='extendedEdit'; Kind='bool' }
|
||||
@{ Tag='MaxRowsCount'; Key='maxRowsCount'; Kind='value' }
|
||||
@{ Tag='AutoMaxRowsCount'; Key='autoMaxRowsCount'; Kind='bool' }
|
||||
@{ Tag='HeightControlVariant'; Key='heightControlVariant'; Kind='value' }
|
||||
@{ Tag='EditTextUpdate'; Key='editTextUpdate'; Kind='value' }
|
||||
)
|
||||
|
||||
function Emit-GenericScalars {
|
||||
@@ -3237,7 +3247,7 @@ function Emit-Input {
|
||||
if ($null -ne $el.spinButton) { X "$inner<SpinButton>$(if ($el.spinButton){'true'}else{'false'})</SpinButton>" }
|
||||
if ($null -ne $el.dropListButton) { X "$inner<DropListButton>$(if ($el.dropListButton){'true'}else{'false'})</DropListButton>" }
|
||||
if ($null -ne $el.choiceListButton) { X "$inner<ChoiceListButton>$(if ($el.choiceListButton){'true'}else{'false'})</ChoiceListButton>" }
|
||||
if ($el.markIncomplete -eq $true) { X "$inner<AutoMarkIncomplete>true</AutoMarkIncomplete>" }
|
||||
if ($null -ne $el.markIncomplete) { X "$inner<AutoMarkIncomplete>$(if ($el.markIncomplete){'true'}else{'false'})</AutoMarkIncomplete>" }
|
||||
if ($el.editMode) { X "$inner<EditMode>$($el.editMode)</EditMode>" }
|
||||
Emit-ColumnPics -el $el -indent $inner
|
||||
if ($el.textEdit -eq $false) { X "$inner<TextEdit>false</TextEdit>" }
|
||||
@@ -3270,6 +3280,8 @@ function Emit-Input {
|
||||
if ($el.inputHint) {
|
||||
Emit-MLText -tag "InputHint" -text $el.inputHint -indent $inner
|
||||
}
|
||||
if ($null -ne $el.warningOnEdit) { Emit-MLText -tag "WarningOnEdit" -text $el.warningOnEdit -indent $inner }
|
||||
if ($null -ne $el.footerText) { Emit-MLText -tag "FooterText" -text $el.footerText -indent $inner }
|
||||
|
||||
# Формат / формат редактирования (LocalStringType — строка или {ru,en})
|
||||
if ($el.format) { Emit-MLText -tag "Format" -text $el.format -indent $inner }
|
||||
@@ -3893,7 +3905,7 @@ function Emit-Table {
|
||||
if ($null -ne $el.autofill) { X "$inner<Autofill>$(if ($el.autofill){'true'}else{'false'})</Autofill>" }
|
||||
if ($el.multipleChoice -eq $true) { X "$inner<MultipleChoice>true</MultipleChoice>" }
|
||||
if ($el.searchOnInput) { X "$inner<SearchOnInput>$($el.searchOnInput)</SearchOnInput>" }
|
||||
if ($el.markIncomplete -eq $true) { X "$inner<AutoMarkIncomplete>true</AutoMarkIncomplete>" }
|
||||
if ($null -ne $el.markIncomplete) { X "$inner<AutoMarkIncomplete>$(if ($el.markIncomplete){'true'}else{'false'})</AutoMarkIncomplete>" }
|
||||
if ($el.useAlternationRowColor -eq $true) { X "$inner<UseAlternationRowColor>true</UseAlternationRowColor>" }
|
||||
if ($el.selectionMode) { X "$inner<SelectionMode>$($el.selectionMode)</SelectionMode>" }
|
||||
if ($el.rowSelectionMode) { X "$inner<RowSelectionMode>$($el.rowSelectionMode)</RowSelectionMode>" }
|
||||
@@ -4187,6 +4199,7 @@ function Emit-PictureField {
|
||||
# Required for a Boolean-bound PictureField to actually show an icon.
|
||||
# Скаляр (Ref) или объект {src, loadTransparent}; LoadTransparent эмитится всегда.
|
||||
Emit-PictureRef -val $el.valuesPicture -picTag 'ValuesPicture' -indent $inner
|
||||
if ($null -ne $el.nonselectedPictureText) { Emit-MLText -tag "NonselectedPictureText" -text $el.nonselectedPictureText -indent $inner }
|
||||
|
||||
# Оформление (цвета/шрифты/граница) — перед компаньонами
|
||||
Emit-Appearance -el $el -indent $inner -profile 'field'
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#!/usr/bin/env python3
|
||||
# form-compile v1.98 — Compile 1C managed form from JSON or object metadata
|
||||
# form-compile v1.99 — Compile 1C managed form from JSON or object metadata
|
||||
# Source: https://github.com/Nikolay-Shirokov/cc-1c-skills
|
||||
import argparse
|
||||
import copy
|
||||
@@ -1839,6 +1839,9 @@ KNOWN_KEYS = {
|
||||
"horizontalSpacing", "representationInContextMenu", "settingsNamedItemDetailedRepresentation",
|
||||
# хвост: высота элемента списка / ширина выпадающего списка / картинка кнопки выбора / прозрачный пиксель
|
||||
"itemHeight", "dropListWidth", "choiceButtonPicture", "transparentPixel",
|
||||
# хвост CI-форм: динамический заголовок / расширенное редактирование / высота таблицы
|
||||
"titleDataPath", "extendedEdit", "maxRowsCount", "autoMaxRowsCount", "heightControlVariant",
|
||||
"warningOnEdit", "nonselectedPictureText", "editTextUpdate", "footerText",
|
||||
}
|
||||
|
||||
# picture/picField — НИЗКИЙ приоритет: 'picture' это и тип (PictureDecoration), и свойство-иконка
|
||||
@@ -2752,6 +2755,13 @@ GENERIC_SCALARS = [
|
||||
# Хвост: высота элемента списка (radio) / ширина выпадающего списка (input)
|
||||
('ItemHeight', 'itemHeight', 'value'),
|
||||
('DropListWidth', 'dropListWidth', 'value'),
|
||||
# Хвост CI-форм: динамический заголовок (Page/Group) / расширенное ред. (input) / высота таблицы по строкам
|
||||
('TitleDataPath', 'titleDataPath', 'value'),
|
||||
('ExtendedEdit', 'extendedEdit', 'bool'),
|
||||
('MaxRowsCount', 'maxRowsCount', 'value'),
|
||||
('AutoMaxRowsCount', 'autoMaxRowsCount', 'bool'),
|
||||
('HeightControlVariant', 'heightControlVariant', 'value'),
|
||||
('EditTextUpdate', 'editTextUpdate', 'value'),
|
||||
]
|
||||
|
||||
|
||||
@@ -3299,8 +3309,8 @@ def emit_input(lines, el, name, eid, indent):
|
||||
lines.append(f'{inner}<DropListButton>{"true" if el["dropListButton"] else "false"}</DropListButton>')
|
||||
if el.get('choiceListButton') is not None:
|
||||
lines.append(f'{inner}<ChoiceListButton>{"true" if el["choiceListButton"] else "false"}</ChoiceListButton>')
|
||||
if el.get('markIncomplete') is True:
|
||||
lines.append(f'{inner}<AutoMarkIncomplete>true</AutoMarkIncomplete>')
|
||||
if el.get('markIncomplete') is not None:
|
||||
lines.append(f'{inner}<AutoMarkIncomplete>{"true" if el["markIncomplete"] else "false"}</AutoMarkIncomplete>')
|
||||
if el.get('editMode'):
|
||||
lines.append(f'{inner}<EditMode>{el["editMode"]}</EditMode>')
|
||||
emit_column_pics(lines, el, inner)
|
||||
@@ -3329,6 +3339,10 @@ def emit_input(lines, el, name, eid, indent):
|
||||
|
||||
if el.get('inputHint'):
|
||||
emit_mltext(lines, inner, 'InputHint', el['inputHint'])
|
||||
if el.get('warningOnEdit') is not None:
|
||||
emit_mltext(lines, inner, 'WarningOnEdit', el['warningOnEdit'])
|
||||
if el.get('footerText') is not None:
|
||||
emit_mltext(lines, inner, 'FooterText', el['footerText'])
|
||||
|
||||
# Формат / формат редактирования (LocalStringType — строка или {ru,en})
|
||||
if el.get('format'):
|
||||
@@ -3591,8 +3605,8 @@ def emit_table(lines, el, name, eid, indent):
|
||||
lines.append(f'{inner}<MultipleChoice>true</MultipleChoice>')
|
||||
if el.get('searchOnInput'):
|
||||
lines.append(f'{inner}<SearchOnInput>{el["searchOnInput"]}</SearchOnInput>')
|
||||
if el.get('markIncomplete') is True:
|
||||
lines.append(f'{inner}<AutoMarkIncomplete>true</AutoMarkIncomplete>')
|
||||
if el.get('markIncomplete') is not None:
|
||||
lines.append(f'{inner}<AutoMarkIncomplete>{"true" if el["markIncomplete"] else "false"}</AutoMarkIncomplete>')
|
||||
if el.get('useAlternationRowColor') is True:
|
||||
lines.append(f'{inner}<UseAlternationRowColor>true</UseAlternationRowColor>')
|
||||
if el.get('selectionMode'):
|
||||
@@ -3881,6 +3895,8 @@ def emit_picture_field(lines, el, name, eid, indent):
|
||||
# Required for a Boolean-bound PictureField to actually show an icon.
|
||||
# Скаляр (Ref) или объект {src, loadTransparent}; LoadTransparent эмитится всегда.
|
||||
emit_picture_ref(lines, el.get('valuesPicture'), 'ValuesPicture', inner)
|
||||
if el.get('nonselectedPictureText') is not None:
|
||||
emit_mltext(lines, inner, 'NonselectedPictureText', el['nonselectedPictureText'])
|
||||
|
||||
# Оформление (цвета/шрифты/граница) — перед компаньонами
|
||||
emit_appearance(lines, el, inner, 'field')
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# form-decompile v0.74 — Decompile 1C managed Form.xml to JSON DSL (draft)
|
||||
# form-decompile v0.75 — Decompile 1C managed Form.xml to JSON DSL (draft)
|
||||
# Source: https://github.com/Nikolay-Shirokov/cc-1c-skills
|
||||
# ВНИМАНИЕ: раундтрип не гарантируется. Навык исключён из авто-использования моделью.
|
||||
param(
|
||||
@@ -1226,6 +1226,13 @@ $GENERIC_SCALARS = @(
|
||||
# Хвост: высота элемента списка (radio) / ширина выпадающего списка (input)
|
||||
@{ Tag='ItemHeight'; Key='itemHeight'; Kind='value' }
|
||||
@{ Tag='DropListWidth'; Key='dropListWidth'; Kind='value' }
|
||||
# Хвост CI-форм: динамический заголовок (Page/Group) / расширенное ред. (input) / высота таблицы по строкам
|
||||
@{ Tag='TitleDataPath'; Key='titleDataPath'; Kind='value' }
|
||||
@{ Tag='ExtendedEdit'; Key='extendedEdit'; Kind='bool' }
|
||||
@{ Tag='MaxRowsCount'; Key='maxRowsCount'; Kind='value' }
|
||||
@{ Tag='AutoMaxRowsCount'; Key='autoMaxRowsCount'; Kind='bool' }
|
||||
@{ Tag='HeightControlVariant'; Key='heightControlVariant'; Kind='value' }
|
||||
@{ Tag='EditTextUpdate'; Key='editTextUpdate'; Kind='value' }
|
||||
)
|
||||
|
||||
# Захват generic-скаляров. Специфичная обработка (если ключ уже задан) — побеждает.
|
||||
@@ -1485,10 +1492,12 @@ function Decompile-Element {
|
||||
Add-CommonProps $obj $node $name
|
||||
if ((Get-Child $node 'MultiLine') -eq 'true') { $obj['multiLine'] = $true }
|
||||
if ((Get-Child $node 'PasswordMode') -eq 'true') { $obj['passwordMode'] = $true }
|
||||
if ((Get-Child $node 'AutoMarkIncomplete') -eq 'true') { $obj['markIncomplete'] = $true }
|
||||
$mi = Get-Child $node 'AutoMarkIncomplete'; if ($null -ne $mi) { $obj['markIncomplete'] = ($mi -eq 'true') }
|
||||
$em = Get-Child $node 'EditMode'; if ($em) { $obj['editMode'] = $em }
|
||||
$tl = Get-Child $node 'TitleLocation'; if ($tl) { $obj['titleLocation'] = $tl.ToLower() }
|
||||
$ih = $node.SelectSingleNode("lf:InputHint", $ns); if ($ih) { $t = Get-LangText $ih; if ($t) { $obj['inputHint'] = $t } }
|
||||
$woe = $node.SelectSingleNode("lf:WarningOnEdit", $ns); if ($woe) { $t = Get-LangText $woe; if ($null -ne $t) { $obj['warningOnEdit'] = $t } }
|
||||
$ftxt = $node.SelectSingleNode("lf:FooterText", $ns); if ($ftxt) { $t = Get-LangText $ftxt; if ($null -ne $t) { $obj['footerText'] = $t } }
|
||||
foreach ($p in @('ChoiceButton','ClearButton','SpinButton','DropListButton','ChoiceListButton')) {
|
||||
$v = Get-Child $node $p; if ($null -ne $v) { $obj[($p.Substring(0,1).ToLower()+$p.Substring(1))] = (To-Bool $v) }
|
||||
}
|
||||
@@ -1587,6 +1596,7 @@ function Decompile-Element {
|
||||
if ((Get-Child $node 'Hyperlink') -eq 'true') { $obj['hyperlink'] = $true }
|
||||
$sct = Get-Child $node 'Shortcut'; if ($sct) { $obj['shortcut'] = $sct }
|
||||
$vp = Get-PictureRef $node 'ValuesPicture'; if ($null -ne $vp) { $obj['valuesPicture'] = $vp }
|
||||
$npt = $node.SelectSingleNode("lf:NonselectedPictureText", $ns); if ($npt) { $t = Get-LangText $npt; if ($null -ne $t) { $obj['nonselectedPictureText'] = $t } }
|
||||
}
|
||||
'CalendarField' {
|
||||
$obj[$key] = $name
|
||||
@@ -1635,7 +1645,7 @@ function Decompile-Element {
|
||||
$taf = Get-Child $node 'Autofill'; if ($null -ne $taf) { $obj['autofill'] = ($taf -eq 'true') }
|
||||
if ((Get-Child $node 'MultipleChoice') -eq 'true') { $obj['multipleChoice'] = $true }
|
||||
$soin = Get-Child $node 'SearchOnInput'; if ($soin) { $obj['searchOnInput'] = $soin }
|
||||
if ((Get-Child $node 'AutoMarkIncomplete') -eq 'true') { $obj['markIncomplete'] = $true }
|
||||
$mi = Get-Child $node 'AutoMarkIncomplete'; if ($null -ne $mi) { $obj['markIncomplete'] = ($mi -eq 'true') }
|
||||
$itv = Get-Child $node 'InitialTreeView'; if ($itv) { $obj['initialTreeView'] = $itv }
|
||||
# RowsPicture: src (xr:Ref) + LoadTransparent (дефолт false). При true → объектная форма.
|
||||
$rpRef = $node.SelectSingleNode("lf:RowsPicture/xr:Ref", $ns)
|
||||
|
||||
Reference in New Issue
Block a user