mirror of
https://github.com/Nikolay-Shirokov/cc-1c-skills.git
synced 2026-09-03 16:50:52 +03:00
Improve form skills: validation, docs, round-trip consistency
form-compile: warn about unknown DSL keys in element definitions, document stdCommand/command button keys and EPF-specific notes. form-validate: check that form-level Title uses multilingual XML, not plain text (which causes XDTO errors at build time). form-add: warn about duplicate element names, clarify after-not-found message when using into+after together. form-info: show Title in header instead of Properties line, display commands as DSL-friendly format (-> Name [cmd], -> Close [std]) instead of raw Form.Command/Form.StandardCommand paths. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.6
parent
d05199d048
commit
c665800916
@@ -272,6 +272,47 @@ function Emit-Element {
|
||||
return
|
||||
}
|
||||
|
||||
# Validate known keys — warn about typos and unknown properties
|
||||
$knownKeys = @{
|
||||
# type keys
|
||||
"group"=1;"input"=1;"check"=1;"label"=1;"labelField"=1;"table"=1;"pages"=1;"page"=1
|
||||
"button"=1;"picture"=1;"picField"=1;"calendar"=1;"cmdBar"=1;"popup"=1
|
||||
# naming & binding
|
||||
"name"=1;"path"=1;"title"=1
|
||||
# visibility & state
|
||||
"visible"=1;"hidden"=1;"enabled"=1;"disabled"=1;"readOnly"=1
|
||||
# events
|
||||
"on"=1;"handlers"=1
|
||||
# layout
|
||||
"titleLocation"=1;"representation"=1;"width"=1;"height"=1
|
||||
"horizontalStretch"=1;"verticalStretch"=1;"autoMaxWidth"=1;"autoMaxHeight"=1
|
||||
# input-specific
|
||||
"multiLine"=1;"passwordMode"=1;"choiceButton"=1;"clearButton"=1
|
||||
"spinButton"=1;"dropListButton"=1;"markIncomplete"=1;"skipOnInput"=1;"inputHint"=1
|
||||
# label/hyperlink
|
||||
"hyperlink"=1
|
||||
# group-specific
|
||||
"showTitle"=1;"united"=1
|
||||
# hierarchy
|
||||
"children"=1;"columns"=1
|
||||
# table-specific
|
||||
"changeRowSet"=1;"changeRowOrder"=1;"header"=1;"footer"=1
|
||||
"commandBarLocation"=1;"searchStringLocation"=1
|
||||
# pages-specific
|
||||
"pagesRepresentation"=1
|
||||
# button-specific
|
||||
"type"=1;"command"=1;"stdCommand"=1;"defaultButton"=1;"locationInCommandBar"=1
|
||||
# picture/decoration
|
||||
"src"=1
|
||||
# cmdBar-specific
|
||||
"autofill"=1
|
||||
}
|
||||
foreach ($p in $el.PSObject.Properties) {
|
||||
if (-not $knownKeys.ContainsKey($p.Name)) {
|
||||
Write-Warning "Element '$($el.$typeKey)': unknown key '$($p.Name)' — ignored. Check SKILL.md for valid keys."
|
||||
}
|
||||
}
|
||||
|
||||
$name = Get-ElementName -el $el -typeKey $typeKey
|
||||
$id = New-Id
|
||||
|
||||
|
||||
Reference in New Issue
Block a user