feat(form-compile): ValuesPicture для PictureField

PictureField, привязанный к булеву/числу, без ValuesPicture не рисует
иконку. Добавлены ключи DSL:
- valuesPicture: ref картинки значения (StdPicture.*, CommonPicture.*)
  → <ValuesPicture><xr:Ref>…</xr:Ref></ValuesPicture>
- loadTransparent: true → <xr:LoadTransparent>true</xr:LoadTransparent>
  (выводится только при true)

Реализовано в обоих портах (ps1 + py, v1.22), добавлены в whitelist
свойств. Регресс: новый кейс picture-field (picField + ValuesPicture +
CheckBoxField + событие Selection), эталон зелёный на ps1 и py, плюс
платформенная form-validate.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Nick Shirokov
2026-05-29 20:10:36 +03:00
co-authored by Claude Opus 4.8
parent f2b8ad741e
commit 96926d65ef
13 changed files with 516 additions and 4 deletions
@@ -1,4 +1,4 @@
# form-compile v1.21 — Compile 1C managed form from JSON or object metadata
# form-compile v1.22 — Compile 1C managed form from JSON or object metadata
# Source: https://github.com/Nikolay-Shirokov/cc-1c-skills
param(
[string]$JsonPath,
@@ -1929,7 +1929,7 @@ function Emit-Element {
# button-specific
"type"=1;"command"=1;"stdCommand"=1;"defaultButton"=1;"locationInCommandBar"=1
# picture/decoration
"src"=1
"src"=1;"valuesPicture"=1;"loadTransparent"=1
# cmdBar-specific
"autofill"=1
}
@@ -2722,6 +2722,16 @@ function Emit-PictureField {
Emit-Title -el $el -name $name -indent $inner
Emit-CommonFlags -el $el -indent $inner
# ValuesPicture — picture (collection) used to render the field's value.
# Required for a Boolean-bound PictureField to actually show an icon.
# loadTransparent emitted only when true (1С default is false).
if ($el.valuesPicture) {
X "$inner<ValuesPicture>"
X "$inner`t<xr:Ref>$($el.valuesPicture)</xr:Ref>"
if ($el.loadTransparent) { X "$inner`t<xr:LoadTransparent>true</xr:LoadTransparent>" }
X "$inner</ValuesPicture>"
}
if ($el.width) { X "$inner<Width>$($el.width)</Width>" }
if ($el.height) { X "$inner<Height>$($el.height)</Height>" }
@@ -1,5 +1,5 @@
#!/usr/bin/env python3
# form-compile v1.21 — Compile 1C managed form from JSON or object metadata
# form-compile v1.22 — Compile 1C managed form from JSON or object metadata
# Source: https://github.com/Nikolay-Shirokov/cc-1c-skills
import argparse
import copy
@@ -1358,7 +1358,7 @@ KNOWN_KEYS = {
"commandBarLocation", "searchStringLocation",
"pagesRepresentation",
"type", "command", "stdCommand", "defaultButton", "locationInCommandBar",
"src",
"src", "valuesPicture", "loadTransparent",
"autofill",
"choiceMode", "initialTreeView", "enableDrag", "enableStartDrag",
"rowPictureDataPath", "tableAutofill",
@@ -2362,6 +2362,16 @@ def emit_picture_field(lines, el, name, eid, indent):
emit_title(lines, el, name, inner)
emit_common_flags(lines, el, inner)
# ValuesPicture \u2014 picture (collection) used to render the field's value.
# Required for a Boolean-bound PictureField to actually show an icon.
# loadTransparent emitted only when true (1\u0421 default is false).
if el.get('valuesPicture'):
lines.append(f'{inner}<ValuesPicture>')
lines.append(f'{inner}\t<xr:Ref>{el["valuesPicture"]}</xr:Ref>')
if el.get('loadTransparent'):
lines.append(f'{inner}\t<xr:LoadTransparent>true</xr:LoadTransparent>')
lines.append(f'{inner}</ValuesPicture>')
if el.get('width'):
lines.append(f'{inner}<Width>{el["width"]}</Width>')
if el.get('height'):