feat(meta-edit): структурные свойства MinValue/MaxValue (Фаза 2 Шаг 3a, v1.14)

modify-attribute/-dimension/-resource: типизированные MinValue/MaxValue (порт
Emit-MinMaxValue — nil / xs:string / xs:decimal; xsi уже объявлен в Import-Fragment,
app-namespace не нужен). Хелпер Build-MinMaxValueXml + 2 ветки switch, replace-or-create
через Set-AttrPropertyElement. ps1+py.

Cert: verify-snapshots --case modify-attribute-structural (расширен Number-реквизитом
Сумма с MinValue=0/MaxValue=1000000) — грузится в 1С. meta-edit 14/14 ps1+py, byte-паритет.

Остаток Шага 3 (fillValue явный, choiceParameters/choiceParameterLinks/linkByType) —
тяжёлый порт fill-ref машинерии + фикс namespace app в Import-Fragment; карта
зависимостей в плане.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Nick Shirokov
2026-07-11 22:39:37 +03:00
co-authored by Claude Opus 4.8
parent c31cff5ada
commit caea1b1049
4 changed files with 83 additions and 4 deletions
+18 -1
View File
@@ -1,4 +1,4 @@
# meta-edit v1.13 — Edit existing 1C metadata object XML (inline + complex props + TS ops + modify-ts + create-if-missing + structural attr props Format/EditFormat/ToolTip/ChoiceForm)
# meta-edit v1.14 — Edit existing 1C metadata object XML (+structural attr props Format/EditFormat/ToolTip/ChoiceForm/MinValue/MaxValue)
# Source: https://github.com/Nikolay-Shirokov/cc-1c-skills
param(
[string]$DefinitionFile,
@@ -2260,6 +2260,16 @@ function Modify-ChildElements($modifyDef, [string]$childType) {
Info "Set $xmlTag '$elemName'.ChoiceForm"; $script:modifyCount++
}
}
"MinValue" {
if (Set-AttrPropertyElement $propsEl "MinValue" (Build-MinMaxValueXml "MinValue" $changeValue)) {
Info "Set $xmlTag '$elemName'.MinValue"; $script:modifyCount++
}
}
"MaxValue" {
if (Set-AttrPropertyElement $propsEl "MaxValue" (Build-MinMaxValueXml "MaxValue" $changeValue)) {
Info "Set $xmlTag '$elemName'.MaxValue"; $script:modifyCount++
}
}
default {
# Scalar property change (Indexing, FillChecking, Use, etc.)
$scalarEl = $null
@@ -2420,6 +2430,13 @@ function Set-AttrPropertyElement($propsEl, $propName, $fragmentXml) {
return $true
}
# MinValue/MaxValue — типизированное значение (порт Emit-MinMaxValue): nil / xs:string / xs:decimal.
function Build-MinMaxValueXml([string]$tag, $val) {
if ($null -eq $val -or "$val" -eq '') { return "<$tag xsi:nil=`"true`"/>" }
$t = if ($val -is [string]) { 'xs:string' } else { 'xs:decimal' }
return "<$tag xsi:type=`"$t`">$(Esc-Xml "$val")</$tag>"
}
function Find-PropertyElement([string]$propName) {
foreach ($child in $script:propertiesEl.ChildNodes) {
if ($child.NodeType -eq 'Element' -and $child.LocalName -eq $propName) {