mirror of
https://github.com/Nikolay-Shirokov/cc-1c-skills.git
synced 2026-06-15 02:14:57 +03:00
feat(form-decompile,form-compile): блок свойств таблицы динамического списка (кластер DynamicList Table)
Таблица формы, привязанная к динамическому списку, несёт блок специфичных свойств, который платформа всегда эмитит (n=5079 на дин-список-таблицах, 0 на ValueTable). Компилятор (ps1+py v1.40): авто-эмиссия блока на дин-список-таблице (Emit-DynListTableBlock): - Group A (дефолт+override): AutoRefresh(false), AutoRefreshPeriod(60), Period(пустой Custom, константа), ChoiceFoldersAndItems(Items), RestoreCurrentRow(false), TopLevelParent(nil, константа), ShowRoot(true), AllowRootChoice(false), UpdateOnDataChange(Auto), AllowGettingCurrentRowURL(true). - Group B (условные): DefaultItem, UseAlternationRowColor, FileDragMode (+ существующие InitialTreeView/EnableStartDrag). - Group C: RowPictureDataPath (умный дефолт <Список>.DefaultPicture + override + suppress-маркер ""; ИСПРАВЛЕН баг — пустая строка больше не перезатирается дефолтом), RowsPicture, UserSettingsGroup. - Эвристика 11b.4 теперь обходит ВСЕ DynamicList-реквизиты (не только main) → блок эмитится и для не-main/вторичных списков. Внутренний маркер _dynList исключён из валидатора ключей. Декомпилятор (v0.22): захват блока с инверсией (gate = наличие <UpdateOnDataChange>): Group A — опускает значения = дефолту; Group B — захват при наличии; RowPictureDataPath — DefaultPicture опускается, кастом захватывается, отсутствие → "". Валидация: дин-блок round-trip CLEAN (мультимножество, GUID-норм.) на простом списке и на форме с кастомным RowPictureDataPath/RowsPicture/UserSettingsGroup; сертификация в 1С PASS; py==ps1 идентичны; регресс 33/33 ps+py; harness 9634→8300 (−14%), 0 fail; группа «67» (AutoRefresh/ShowRoot/UpdateOnDataChange/…) ушла из остатка, residual block-теги 47→5. Spec — раздел «Таблица динамического списка»; тест-кейсы перегенерированы. Хвост и соседний кластер (свойства Table на не-дин-список таблицах) — в BACKLOG. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
# form-compile v1.39 — Compile 1C managed form from JSON or object metadata
|
||||
# form-compile v1.40 — Compile 1C managed form from JSON or object metadata
|
||||
# Source: https://github.com/Nikolay-Shirokov/cc-1c-skills
|
||||
param(
|
||||
[string]$JsonPath,
|
||||
@@ -2342,6 +2342,11 @@ function Emit-Element {
|
||||
"excludedCommands"=1
|
||||
"choiceMode"=1;"initialTreeView"=1;"enableDrag"=1;"enableStartDrag"=1
|
||||
"rowPictureDataPath"=1;"tableAutofill"=1
|
||||
# dynamic-list table block
|
||||
"defaultItem"=1;"useAlternationRowColor"=1;"fileDragMode"=1;"autoRefresh"=1
|
||||
"autoRefreshPeriod"=1;"choiceFoldersAndItems"=1;"restoreCurrentRow"=1;"showRoot"=1
|
||||
"allowRootChoice"=1;"updateOnDataChange"=1;"allowGettingCurrentRowURL"=1
|
||||
"userSettingsGroup"=1;"rowsPicture"=1
|
||||
# calendar-specific
|
||||
"selectionMode"=1;"showCurrentDate"=1;"widthInMonths"=1;"heightInMonths"=1;"showMonthsPanel"=1
|
||||
# pages-specific
|
||||
@@ -2354,6 +2359,7 @@ function Emit-Element {
|
||||
"autofill"=1
|
||||
}
|
||||
foreach ($p in $el.PSObject.Properties) {
|
||||
if ($p.Name -like '_*') { continue } # внутренние маркеры (напр. _dynList)
|
||||
if (-not $knownKeys.ContainsKey($p.Name)) {
|
||||
Write-Warning "Element '$($el.$typeKey)': unknown key '$($p.Name)' — ignored. Check SKILL.md for valid keys."
|
||||
}
|
||||
@@ -2949,6 +2955,41 @@ function Emit-LabelField {
|
||||
X "$indent</LabelField>"
|
||||
}
|
||||
|
||||
# Блок свойств таблицы, привязанной к динамическому списку (Group A defaults + B/C).
|
||||
# Платформа всегда эмитит этот блок на дин-список-таблице; компилятор зеркалит дефолты,
|
||||
# DSL-ключ переопределяет; декомпилятор инвертирует (опускает значения = дефолту).
|
||||
function Emit-DynListTableBlock {
|
||||
param($el, [string]$indent)
|
||||
# Group B (условные опц.): defaultItem / useAlternationRowColor / fileDragMode
|
||||
if ($el.defaultItem -eq $true) { X "$indent<DefaultItem>true</DefaultItem>" }
|
||||
if ($el.useAlternationRowColor -eq $true) { X "$indent<UseAlternationRowColor>true</UseAlternationRowColor>" }
|
||||
if ($el.fileDragMode) { X "$indent<FileDragMode>$($el.fileDragMode)</FileDragMode>" }
|
||||
# Group A (гарант. блок, n=5079): дефолт + override
|
||||
$ar = if ($el.autoRefresh -eq $true) { "true" } else { "false" }
|
||||
X "$indent<AutoRefresh>$ar</AutoRefresh>"
|
||||
$arp = if ($el.PSObject.Properties["autoRefreshPeriod"] -and $null -ne $el.autoRefreshPeriod) { $el.autoRefreshPeriod } else { 60 }
|
||||
X "$indent<AutoRefreshPeriod>$arp</AutoRefreshPeriod>"
|
||||
X "$indent<Period>"
|
||||
X "$indent`t<v8:variant xsi:type=`"v8:StandardPeriodVariant`">Custom</v8:variant>"
|
||||
X "$indent`t<v8:startDate>0001-01-01T00:00:00</v8:startDate>"
|
||||
X "$indent`t<v8:endDate>0001-01-01T00:00:00</v8:endDate>"
|
||||
X "$indent</Period>"
|
||||
$cfi = if ($el.choiceFoldersAndItems) { $el.choiceFoldersAndItems } else { "Items" }
|
||||
X "$indent<ChoiceFoldersAndItems>$cfi</ChoiceFoldersAndItems>"
|
||||
$rcr = if ($el.restoreCurrentRow -eq $true) { "true" } else { "false" }
|
||||
X "$indent<RestoreCurrentRow>$rcr</RestoreCurrentRow>"
|
||||
X "$indent<TopLevelParent xsi:nil=`"true`"/>"
|
||||
$sr = if ($el.showRoot -eq $false) { "false" } else { "true" }
|
||||
X "$indent<ShowRoot>$sr</ShowRoot>"
|
||||
$arc = if ($el.allowRootChoice -eq $true) { "true" } else { "false" }
|
||||
X "$indent<AllowRootChoice>$arc</AllowRootChoice>"
|
||||
$uodc = if ($el.updateOnDataChange) { $el.updateOnDataChange } else { "Auto" }
|
||||
X "$indent<UpdateOnDataChange>$uodc</UpdateOnDataChange>"
|
||||
if ($el.userSettingsGroup) { X "$indent<UserSettingsGroup>$($el.userSettingsGroup)</UserSettingsGroup>" }
|
||||
$agcru = if ($el.allowGettingCurrentRowURL -eq $false) { "false" } else { "true" }
|
||||
X "$indent<AllowGettingCurrentRowURL>$agcru</AllowGettingCurrentRowURL>"
|
||||
}
|
||||
|
||||
function Emit-Table {
|
||||
param($el, [string]$name, [int]$id, [string]$indent)
|
||||
|
||||
@@ -2981,6 +3022,14 @@ function Emit-Table {
|
||||
if ($el.enableStartDrag -eq $true) { X "$inner<EnableStartDrag>true</EnableStartDrag>" }
|
||||
if ($el.enableDrag -eq $true) { X "$inner<EnableDrag>true</EnableDrag>" }
|
||||
if ($el.rowPictureDataPath) { X "$inner<RowPictureDataPath>$($el.rowPictureDataPath)</RowPictureDataPath>" }
|
||||
if ($el.rowsPicture) {
|
||||
X "$inner<RowsPicture>"
|
||||
X "$inner`t<xr:Ref>$($el.rowsPicture)</xr:Ref>"
|
||||
X "$inner`t<xr:LoadTransparent>false</xr:LoadTransparent>"
|
||||
X "$inner</RowsPicture>"
|
||||
}
|
||||
# Блок свойств дин-список-таблицы (помечена эвристикой 11b.4)
|
||||
if ($el.PSObject.Properties["_dynList"] -and $el._dynList) { Emit-DynListTableBlock -el $el -indent $inner }
|
||||
if ($el.viewStatusLocation) { X "$inner<ViewStatusLocation>$($el.viewStatusLocation)</ViewStatusLocation>" }
|
||||
if ($el.searchControlLocation) { X "$inner<SearchControlLocation>$($el.searchControlLocation)</SearchControlLocation>" }
|
||||
Emit-Layout -el $el -indent $inner -skipHeight
|
||||
@@ -3637,14 +3686,17 @@ function ApplyDynamicListTableHeuristic {
|
||||
param($el, [string]$listName, [bool]$hasMainTable)
|
||||
if ($null -eq $el) { return }
|
||||
if ($el.PSObject.Properties["table"] -and $null -ne $el.table -and "$($el.path)" -eq $listName) {
|
||||
# Маркер дин-список-таблицы → Emit-Table эмитит блок свойств (Group A defaults)
|
||||
$el | Add-Member -NotePropertyName "_dynList" -NotePropertyValue $true -Force
|
||||
if ($null -eq $el.PSObject.Properties["tableAutofill"]) {
|
||||
$el | Add-Member -NotePropertyName "tableAutofill" -NotePropertyValue $false -Force
|
||||
}
|
||||
if ($null -eq $el.PSObject.Properties["commandBarLocation"]) {
|
||||
$el | Add-Member -NotePropertyName "commandBarLocation" -NotePropertyValue "None" -Force
|
||||
}
|
||||
# DefaultPicture доступен только если у DynamicList есть основная таблица
|
||||
if ($hasMainTable -and ($null -eq $el.PSObject.Properties["rowPictureDataPath"] -or [string]::IsNullOrEmpty("$($el.rowPictureDataPath)"))) {
|
||||
# RowPictureDataPath: умный дефолт <Список>.DefaultPicture, если ключ ОТСУТСТВУЕТ
|
||||
# и есть основная таблица. Пустая строка (suppress-маркер) НЕ перезатирается.
|
||||
if ($hasMainTable -and ($null -eq $el.PSObject.Properties["rowPictureDataPath"])) {
|
||||
$el | Add-Member -NotePropertyName "rowPictureDataPath" -NotePropertyValue "$listName.DefaultPicture" -Force
|
||||
}
|
||||
}
|
||||
@@ -3731,24 +3783,21 @@ if ($def.attributes) {
|
||||
}
|
||||
}
|
||||
|
||||
# 11b.4: DynamicList → table heuristic
|
||||
# 11b.4: DynamicList → table heuristic (для ВСЕХ DynamicList-реквизитов, не только main)
|
||||
if ($def.attributes -and $def.elements) {
|
||||
$mainAttr = $null
|
||||
foreach ($attr in $def.attributes) {
|
||||
if ($attr.main -eq $true) { $mainAttr = $attr; break }
|
||||
}
|
||||
if ($mainAttr -and "$($mainAttr.type)" -eq "DynamicList") {
|
||||
if ("$($attr.type)" -ne "DynamicList") { continue }
|
||||
$mt = $null
|
||||
if ($mainAttr.PSObject.Properties["settings"] -and $null -ne $mainAttr.settings) {
|
||||
if ($mainAttr.settings -is [hashtable]) {
|
||||
if ($mainAttr.settings.ContainsKey("mainTable")) { $mt = $mainAttr.settings["mainTable"] }
|
||||
} elseif ($mainAttr.settings.PSObject.Properties["mainTable"]) {
|
||||
$mt = $mainAttr.settings.mainTable
|
||||
if ($attr.PSObject.Properties["settings"] -and $null -ne $attr.settings) {
|
||||
if ($attr.settings -is [hashtable]) {
|
||||
if ($attr.settings.ContainsKey("mainTable")) { $mt = $attr.settings["mainTable"] }
|
||||
} elseif ($attr.settings.PSObject.Properties["mainTable"]) {
|
||||
$mt = $attr.settings.mainTable
|
||||
}
|
||||
}
|
||||
$hasMt = -not [string]::IsNullOrEmpty("$mt")
|
||||
foreach ($el in $def.elements) {
|
||||
ApplyDynamicListTableHeuristic $el $mainAttr.name $hasMt
|
||||
ApplyDynamicListTableHeuristic $el $attr.name $hasMt
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#!/usr/bin/env python3
|
||||
# form-compile v1.39 — Compile 1C managed form from JSON or object metadata
|
||||
# form-compile v1.40 — Compile 1C managed form from JSON or object metadata
|
||||
# Source: https://github.com/Nikolay-Shirokov/cc-1c-skills
|
||||
import argparse
|
||||
import copy
|
||||
@@ -1784,6 +1784,11 @@ KNOWN_KEYS = {
|
||||
"autofill",
|
||||
"choiceMode", "initialTreeView", "enableDrag", "enableStartDrag",
|
||||
"rowPictureDataPath", "tableAutofill",
|
||||
# dynamic-list table block
|
||||
"defaultItem", "useAlternationRowColor", "fileDragMode", "autoRefresh",
|
||||
"autoRefreshPeriod", "choiceFoldersAndItems", "restoreCurrentRow", "showRoot",
|
||||
"allowRootChoice", "updateOnDataChange", "allowGettingCurrentRowURL",
|
||||
"userSettingsGroup", "rowsPicture",
|
||||
}
|
||||
|
||||
TYPE_KEYS = ["columnGroup", "buttonGroup", "group", "input", "check", "radio", "label", "labelField", "table", "pages", "page",
|
||||
@@ -2318,8 +2323,10 @@ def emit_element(lines, el, indent, in_cmd_bar=False):
|
||||
print("WARNING: Unknown element type, skipping", file=sys.stderr)
|
||||
return
|
||||
|
||||
# Validate known keys
|
||||
# Validate known keys (внутренние маркеры на _ пропускаем)
|
||||
for p_name in el.keys():
|
||||
if p_name.startswith('_'):
|
||||
continue
|
||||
if p_name not in KNOWN_KEYS:
|
||||
print(f"WARNING: Element '{el.get(type_key, '')}': unknown key '{p_name}' -- ignored. Check SKILL.md for valid keys.", file=sys.stderr)
|
||||
|
||||
@@ -2650,6 +2657,42 @@ def emit_label_field(lines, el, name, eid, indent):
|
||||
lines.append(f'{indent}</LabelField>')
|
||||
|
||||
|
||||
# Блок свойств таблицы, привязанной к динамическому списку (Group A defaults + B/C).
|
||||
def emit_dynlist_table_block(lines, el, indent):
|
||||
# Group B (условные опц.)
|
||||
if el.get('defaultItem') is True:
|
||||
lines.append(f'{indent}<DefaultItem>true</DefaultItem>')
|
||||
if el.get('useAlternationRowColor') is True:
|
||||
lines.append(f'{indent}<UseAlternationRowColor>true</UseAlternationRowColor>')
|
||||
if el.get('fileDragMode'):
|
||||
lines.append(f'{indent}<FileDragMode>{el["fileDragMode"]}</FileDragMode>')
|
||||
# Group A (гарант. блок): дефолт + override
|
||||
ar = 'true' if el.get('autoRefresh') is True else 'false'
|
||||
lines.append(f'{indent}<AutoRefresh>{ar}</AutoRefresh>')
|
||||
arp = el['autoRefreshPeriod'] if el.get('autoRefreshPeriod') is not None else 60
|
||||
lines.append(f'{indent}<AutoRefreshPeriod>{arp}</AutoRefreshPeriod>')
|
||||
lines.append(f'{indent}<Period>')
|
||||
lines.append(f'{indent}\t<v8:variant xsi:type="v8:StandardPeriodVariant">Custom</v8:variant>')
|
||||
lines.append(f'{indent}\t<v8:startDate>0001-01-01T00:00:00</v8:startDate>')
|
||||
lines.append(f'{indent}\t<v8:endDate>0001-01-01T00:00:00</v8:endDate>')
|
||||
lines.append(f'{indent}</Period>')
|
||||
cfi = el.get('choiceFoldersAndItems') or 'Items'
|
||||
lines.append(f'{indent}<ChoiceFoldersAndItems>{cfi}</ChoiceFoldersAndItems>')
|
||||
rcr = 'true' if el.get('restoreCurrentRow') is True else 'false'
|
||||
lines.append(f'{indent}<RestoreCurrentRow>{rcr}</RestoreCurrentRow>')
|
||||
lines.append(f'{indent}<TopLevelParent xsi:nil="true"/>')
|
||||
sr = 'false' if el.get('showRoot') is False else 'true'
|
||||
lines.append(f'{indent}<ShowRoot>{sr}</ShowRoot>')
|
||||
arc = 'true' if el.get('allowRootChoice') is True else 'false'
|
||||
lines.append(f'{indent}<AllowRootChoice>{arc}</AllowRootChoice>')
|
||||
uodc = el.get('updateOnDataChange') or 'Auto'
|
||||
lines.append(f'{indent}<UpdateOnDataChange>{uodc}</UpdateOnDataChange>')
|
||||
if el.get('userSettingsGroup'):
|
||||
lines.append(f'{indent}<UserSettingsGroup>{el["userSettingsGroup"]}</UserSettingsGroup>')
|
||||
agcru = 'false' if el.get('allowGettingCurrentRowURL') is False else 'true'
|
||||
lines.append(f'{indent}<AllowGettingCurrentRowURL>{agcru}</AllowGettingCurrentRowURL>')
|
||||
|
||||
|
||||
def emit_table(lines, el, name, eid, indent):
|
||||
lines.append(f'{indent}<Table name="{name}" id="{eid}">')
|
||||
inner = f'{indent}\t'
|
||||
@@ -2690,6 +2733,14 @@ def emit_table(lines, el, name, eid, indent):
|
||||
lines.append(f'{inner}<EnableDrag>true</EnableDrag>')
|
||||
if el.get('rowPictureDataPath'):
|
||||
lines.append(f'{inner}<RowPictureDataPath>{el["rowPictureDataPath"]}</RowPictureDataPath>')
|
||||
if el.get('rowsPicture'):
|
||||
lines.append(f'{inner}<RowsPicture>')
|
||||
lines.append(f'{inner}\t<xr:Ref>{el["rowsPicture"]}</xr:Ref>')
|
||||
lines.append(f'{inner}\t<xr:LoadTransparent>false</xr:LoadTransparent>')
|
||||
lines.append(f'{inner}</RowsPicture>')
|
||||
# Блок свойств дин-список-таблицы (помечена эвристикой)
|
||||
if el.get('_dynList'):
|
||||
emit_dynlist_table_block(lines, el, inner)
|
||||
if el.get('viewStatusLocation'):
|
||||
lines.append(f'{inner}<ViewStatusLocation>{el["viewStatusLocation"]}</ViewStatusLocation>')
|
||||
if el.get('searchControlLocation'):
|
||||
@@ -3532,12 +3583,15 @@ def main():
|
||||
if not isinstance(el, dict):
|
||||
return
|
||||
if el.get('table') is not None and str(el.get('path', '')) == list_name:
|
||||
# Маркер дин-список-таблицы → emit_table эмитит блок свойств
|
||||
el['_dynList'] = True
|
||||
if 'tableAutofill' not in el:
|
||||
el['tableAutofill'] = False
|
||||
if 'commandBarLocation' not in el:
|
||||
el['commandBarLocation'] = 'None'
|
||||
# DefaultPicture доступен только если у DynamicList есть основная таблица
|
||||
if has_main_table and not el.get('rowPictureDataPath'):
|
||||
# RowPictureDataPath: умный дефолт <Список>.DefaultPicture, если ключ ОТСУТСТВУЕТ
|
||||
# и есть основная таблица. Пустая строка (suppress-маркер) НЕ перезатирается.
|
||||
if has_main_table and 'rowPictureDataPath' not in el:
|
||||
el['rowPictureDataPath'] = f'{list_name}.DefaultPicture'
|
||||
if isinstance(el.get('children'), list):
|
||||
for child in el['children']:
|
||||
@@ -3602,14 +3656,15 @@ def main():
|
||||
names = ', '.join(c.get('name', '') for c in candidates)
|
||||
print(f"[WARN] Multiple main-attribute candidates: {names}; specify \"main\": true explicitly")
|
||||
|
||||
# 1b.4: DynamicList → table heuristic
|
||||
# 1b.4: DynamicList → table heuristic (для ВСЕХ DynamicList-реквизитов, не только main)
|
||||
if isinstance(defn.get('attributes'), list) and isinstance(defn.get('elements'), list):
|
||||
main_attr = next((a for a in defn['attributes'] if isinstance(a, dict) and a.get('main') is True), None)
|
||||
if main_attr and str(main_attr.get('type', '')) == 'DynamicList':
|
||||
settings = main_attr.get('settings') or {}
|
||||
for attr in defn['attributes']:
|
||||
if not isinstance(attr, dict) or str(attr.get('type', '')) != 'DynamicList':
|
||||
continue
|
||||
settings = attr.get('settings') or {}
|
||||
has_mt = bool(isinstance(settings, dict) and settings.get('mainTable'))
|
||||
for el in defn['elements']:
|
||||
_apply_dlist_table_heuristic(el, main_attr.get('name', ''), has_mt)
|
||||
_apply_dlist_table_heuristic(el, attr.get('name', ''), has_mt)
|
||||
|
||||
# 1b.5: Compute main AutoCommandBar Autofill (B3)
|
||||
def _compute_main_acb_autofill():
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# form-decompile v0.21 — Decompile 1C managed Form.xml to JSON DSL (draft)
|
||||
# form-decompile v0.22 — Decompile 1C managed Form.xml to JSON DSL (draft)
|
||||
# Source: https://github.com/Nikolay-Shirokov/cc-1c-skills
|
||||
# ВНИМАНИЕ: раундтрип не гарантируется. Навык исключён из авто-использования моделью.
|
||||
param(
|
||||
@@ -979,6 +979,31 @@ function Decompile-Element {
|
||||
$ssl = Get-Child $node 'SearchStringLocation'; if ($ssl) { $obj['searchStringLocation'] = $ssl }
|
||||
$vsl = Get-Child $node 'ViewStatusLocation'; if ($vsl) { $obj['viewStatusLocation'] = $vsl }
|
||||
$scl = Get-Child $node 'SearchControlLocation'; if ($scl) { $obj['searchControlLocation'] = $scl }
|
||||
# --- Блок свойств дин-список-таблицы (признак: дочерний <UpdateOnDataChange>) ---
|
||||
if (Has-Child $node 'UpdateOnDataChange') {
|
||||
$listName = Get-Child $node 'DataPath'
|
||||
# Group A (инверсия дефолтов)
|
||||
if ((Get-Child $node 'AutoRefresh') -eq 'true') { $obj['autoRefresh'] = $true }
|
||||
$arp = Get-Child $node 'AutoRefreshPeriod'; if ($arp -and $arp -ne '60') { $obj['autoRefreshPeriod'] = [int]$arp }
|
||||
$cfi = Get-Child $node 'ChoiceFoldersAndItems'; if ($cfi -and $cfi -ne 'Items') { $obj['choiceFoldersAndItems'] = $cfi }
|
||||
if ((Get-Child $node 'RestoreCurrentRow') -eq 'true') { $obj['restoreCurrentRow'] = $true }
|
||||
if ((Get-Child $node 'ShowRoot') -eq 'false') { $obj['showRoot'] = $false }
|
||||
if ((Get-Child $node 'AllowRootChoice') -eq 'true') { $obj['allowRootChoice'] = $true }
|
||||
$uodc = Get-Child $node 'UpdateOnDataChange'; if ($uodc -and $uodc -ne 'Auto') { $obj['updateOnDataChange'] = $uodc }
|
||||
if ((Get-Child $node 'AllowGettingCurrentRowURL') -eq 'false') { $obj['allowGettingCurrentRowURL'] = $false }
|
||||
# Group B (захват при наличии)
|
||||
if ((Get-Child $node 'DefaultItem') -eq 'true') { $obj['defaultItem'] = $true }
|
||||
if ((Get-Child $node 'UseAlternationRowColor') -eq 'true') { $obj['useAlternationRowColor'] = $true }
|
||||
$itv = Get-Child $node 'InitialTreeView'; if ($itv) { $obj['initialTreeView'] = $itv }
|
||||
if ((Get-Child $node 'EnableStartDrag') -eq 'true') { $obj['enableStartDrag'] = $true }
|
||||
$fdm = Get-Child $node 'FileDragMode'; if ($fdm) { $obj['fileDragMode'] = $fdm }
|
||||
# Group C
|
||||
$rpdp = Get-Child $node 'RowPictureDataPath'
|
||||
if ($null -eq $rpdp) { $obj['rowPictureDataPath'] = '' }
|
||||
elseif ($rpdp -ne "$listName.DefaultPicture") { $obj['rowPictureDataPath'] = $rpdp }
|
||||
$rpRef = $node.SelectSingleNode("lf:RowsPicture/xr:Ref", $ns); if ($rpRef) { $obj['rowsPicture'] = $rpRef.InnerText }
|
||||
$usg = Get-Child $node 'UserSettingsGroup'; if ($usg) { $obj['userSettingsGroup'] = $usg }
|
||||
}
|
||||
$csNode = $node.SelectSingleNode("lf:CommandSet", $ns)
|
||||
if ($csNode) {
|
||||
$exc = New-Object System.Collections.ArrayList
|
||||
|
||||
@@ -321,6 +321,28 @@
|
||||
| `searchControlLocation` | string | `None`, `Top`, `Bottom`, `Auto` |
|
||||
| `excludedCommands` | string[] | Исключённые стандартные команды таблицы (`Add`, `Delete`, `MoveUp`, `SortListAsc`, …) → `<CommandSet>` |
|
||||
|
||||
##### Таблица динамического списка
|
||||
|
||||
Когда таблица привязана к реквизиту `type: "DynamicList"` (её `path` = имя такого реквизита), платформа эмитит блок специфичных свойств. Компилятор генерирует его автоматически с умолчаниями; в DSL указываются **только отличия** от умолчания (декомпилятор так и поступает). Чистые константы (`Period`, `TopLevelParent`) не настраиваются.
|
||||
|
||||
| Свойство | Тип | Умолчание | Описание |
|
||||
|----------|-----|-----------|----------|
|
||||
| `rowPictureDataPath` | string | `<Список>.DefaultPicture` (если есть осн. таблица) | Путь к картинке строки. `""` — подавить авто-вывод |
|
||||
| `defaultItem` | bool | — | `<DefaultItem>` (элемент по умолчанию) |
|
||||
| `useAlternationRowColor` | bool | — | Чередование цвета строк |
|
||||
| `initialTreeView` | string | — | `ExpandTopLevel`, `ExpandAllLevels`, `NoExpand` |
|
||||
| `enableStartDrag` / `fileDragMode` | bool / string | — | Перетаскивание; `fileDragMode` = `AsFile`/… |
|
||||
| `autoRefresh` | bool | `false` | Автообновление |
|
||||
| `autoRefreshPeriod` | int | `60` | Период автообновления, сек |
|
||||
| `choiceFoldersAndItems` | string | `Items` | `Items`, `Folders`, `FoldersAndItems` |
|
||||
| `restoreCurrentRow` | bool | `false` | Восстанавливать текущую строку |
|
||||
| `showRoot` | bool | `true` | Показывать корень |
|
||||
| `allowRootChoice` | bool | `false` | Разрешить выбор корня |
|
||||
| `updateOnDataChange` | string | `Auto` | `Auto`, `DontUpdate` |
|
||||
| `allowGettingCurrentRowURL` | bool | `true` | Получение URL текущей строки |
|
||||
| `userSettingsGroup` | string | — | Группа пользовательских настроек |
|
||||
| `rowsPicture` | string | — | Картинка строк (`CommonPicture.X`) → `<RowsPicture>` |
|
||||
|
||||
#### columnGroup — ColumnGroup
|
||||
|
||||
Группа колонок таблицы. Используется только внутри `columns` таблицы. Допускается вложение `columnGroup` в `columnGroup`.
|
||||
|
||||
+14
@@ -13,6 +13,20 @@
|
||||
<DataPath>Список</DataPath>
|
||||
<CommandBarLocation>None</CommandBarLocation>
|
||||
<RowPictureDataPath>Список.DefaultPicture</RowPictureDataPath>
|
||||
<AutoRefresh>false</AutoRefresh>
|
||||
<AutoRefreshPeriod>60</AutoRefreshPeriod>
|
||||
<Period>
|
||||
<v8:variant xsi:type="v8:StandardPeriodVariant">Custom</v8:variant>
|
||||
<v8:startDate>0001-01-01T00:00:00</v8:startDate>
|
||||
<v8:endDate>0001-01-01T00:00:00</v8:endDate>
|
||||
</Period>
|
||||
<ChoiceFoldersAndItems>Items</ChoiceFoldersAndItems>
|
||||
<RestoreCurrentRow>false</RestoreCurrentRow>
|
||||
<TopLevelParent xsi:nil="true"/>
|
||||
<ShowRoot>true</ShowRoot>
|
||||
<AllowRootChoice>false</AllowRootChoice>
|
||||
<UpdateOnDataChange>Auto</UpdateOnDataChange>
|
||||
<AllowGettingCurrentRowURL>true</AllowGettingCurrentRowURL>
|
||||
<ContextMenu name="СписокКонтекстноеМеню" id="2"/>
|
||||
<AutoCommandBar name="СписокКоманднаяПанель" id="3">
|
||||
<Autofill>false</Autofill>
|
||||
|
||||
+14
@@ -13,6 +13,20 @@
|
||||
<DataPath>Список</DataPath>
|
||||
<CommandBarLocation>None</CommandBarLocation>
|
||||
<RowPictureDataPath>Список.DefaultPicture</RowPictureDataPath>
|
||||
<AutoRefresh>false</AutoRefresh>
|
||||
<AutoRefreshPeriod>60</AutoRefreshPeriod>
|
||||
<Period>
|
||||
<v8:variant xsi:type="v8:StandardPeriodVariant">Custom</v8:variant>
|
||||
<v8:startDate>0001-01-01T00:00:00</v8:startDate>
|
||||
<v8:endDate>0001-01-01T00:00:00</v8:endDate>
|
||||
</Period>
|
||||
<ChoiceFoldersAndItems>Items</ChoiceFoldersAndItems>
|
||||
<RestoreCurrentRow>false</RestoreCurrentRow>
|
||||
<TopLevelParent xsi:nil="true"/>
|
||||
<ShowRoot>true</ShowRoot>
|
||||
<AllowRootChoice>false</AllowRootChoice>
|
||||
<UpdateOnDataChange>Auto</UpdateOnDataChange>
|
||||
<AllowGettingCurrentRowURL>true</AllowGettingCurrentRowURL>
|
||||
<ContextMenu name="СписокКонтекстноеМеню" id="2"/>
|
||||
<AutoCommandBar name="СписокКоманднаяПанель" id="3">
|
||||
<Autofill>false</Autofill>
|
||||
|
||||
+14
@@ -16,6 +16,20 @@
|
||||
<EnableStartDrag>true</EnableStartDrag>
|
||||
<EnableDrag>true</EnableDrag>
|
||||
<RowPictureDataPath>Список.DefaultPicture</RowPictureDataPath>
|
||||
<AutoRefresh>false</AutoRefresh>
|
||||
<AutoRefreshPeriod>60</AutoRefreshPeriod>
|
||||
<Period>
|
||||
<v8:variant xsi:type="v8:StandardPeriodVariant">Custom</v8:variant>
|
||||
<v8:startDate>0001-01-01T00:00:00</v8:startDate>
|
||||
<v8:endDate>0001-01-01T00:00:00</v8:endDate>
|
||||
</Period>
|
||||
<ChoiceFoldersAndItems>Items</ChoiceFoldersAndItems>
|
||||
<RestoreCurrentRow>false</RestoreCurrentRow>
|
||||
<TopLevelParent xsi:nil="true"/>
|
||||
<ShowRoot>true</ShowRoot>
|
||||
<AllowRootChoice>false</AllowRootChoice>
|
||||
<UpdateOnDataChange>Auto</UpdateOnDataChange>
|
||||
<AllowGettingCurrentRowURL>true</AllowGettingCurrentRowURL>
|
||||
<ContextMenu name="СписокКонтекстноеМеню" id="2"/>
|
||||
<AutoCommandBar name="СписокКоманднаяПанель" id="3">
|
||||
<Autofill>false</Autofill>
|
||||
|
||||
+14
@@ -13,6 +13,20 @@
|
||||
<DataPath>Список</DataPath>
|
||||
<CommandBarLocation>None</CommandBarLocation>
|
||||
<RowPictureDataPath>Список.DefaultPicture</RowPictureDataPath>
|
||||
<AutoRefresh>false</AutoRefresh>
|
||||
<AutoRefreshPeriod>60</AutoRefreshPeriod>
|
||||
<Period>
|
||||
<v8:variant xsi:type="v8:StandardPeriodVariant">Custom</v8:variant>
|
||||
<v8:startDate>0001-01-01T00:00:00</v8:startDate>
|
||||
<v8:endDate>0001-01-01T00:00:00</v8:endDate>
|
||||
</Period>
|
||||
<ChoiceFoldersAndItems>Items</ChoiceFoldersAndItems>
|
||||
<RestoreCurrentRow>false</RestoreCurrentRow>
|
||||
<TopLevelParent xsi:nil="true"/>
|
||||
<ShowRoot>true</ShowRoot>
|
||||
<AllowRootChoice>false</AllowRootChoice>
|
||||
<UpdateOnDataChange>Auto</UpdateOnDataChange>
|
||||
<AllowGettingCurrentRowURL>true</AllowGettingCurrentRowURL>
|
||||
<ContextMenu name="СписокКонтекстноеМеню" id="2"/>
|
||||
<AutoCommandBar name="СписокКоманднаяПанель" id="3">
|
||||
<Autofill>false</Autofill>
|
||||
|
||||
+14
@@ -13,6 +13,20 @@
|
||||
<DataPath>Список</DataPath>
|
||||
<CommandBarLocation>None</CommandBarLocation>
|
||||
<RowPictureDataPath>Список.DefaultPicture</RowPictureDataPath>
|
||||
<AutoRefresh>false</AutoRefresh>
|
||||
<AutoRefreshPeriod>60</AutoRefreshPeriod>
|
||||
<Period>
|
||||
<v8:variant xsi:type="v8:StandardPeriodVariant">Custom</v8:variant>
|
||||
<v8:startDate>0001-01-01T00:00:00</v8:startDate>
|
||||
<v8:endDate>0001-01-01T00:00:00</v8:endDate>
|
||||
</Period>
|
||||
<ChoiceFoldersAndItems>Items</ChoiceFoldersAndItems>
|
||||
<RestoreCurrentRow>false</RestoreCurrentRow>
|
||||
<TopLevelParent xsi:nil="true"/>
|
||||
<ShowRoot>true</ShowRoot>
|
||||
<AllowRootChoice>false</AllowRootChoice>
|
||||
<UpdateOnDataChange>Auto</UpdateOnDataChange>
|
||||
<AllowGettingCurrentRowURL>true</AllowGettingCurrentRowURL>
|
||||
<ContextMenu name="СписокКонтекстноеМеню" id="2"/>
|
||||
<AutoCommandBar name="СписокКоманднаяПанель" id="3">
|
||||
<Autofill>false</Autofill>
|
||||
|
||||
+14
@@ -22,6 +22,20 @@
|
||||
<DataPath>Список</DataPath>
|
||||
<CommandBarLocation>None</CommandBarLocation>
|
||||
<RowPictureDataPath>Список.DefaultPicture</RowPictureDataPath>
|
||||
<AutoRefresh>false</AutoRefresh>
|
||||
<AutoRefreshPeriod>60</AutoRefreshPeriod>
|
||||
<Period>
|
||||
<v8:variant xsi:type="v8:StandardPeriodVariant">Custom</v8:variant>
|
||||
<v8:startDate>0001-01-01T00:00:00</v8:startDate>
|
||||
<v8:endDate>0001-01-01T00:00:00</v8:endDate>
|
||||
</Period>
|
||||
<ChoiceFoldersAndItems>Items</ChoiceFoldersAndItems>
|
||||
<RestoreCurrentRow>false</RestoreCurrentRow>
|
||||
<TopLevelParent xsi:nil="true"/>
|
||||
<ShowRoot>true</ShowRoot>
|
||||
<AllowRootChoice>false</AllowRootChoice>
|
||||
<UpdateOnDataChange>Auto</UpdateOnDataChange>
|
||||
<AllowGettingCurrentRowURL>true</AllowGettingCurrentRowURL>
|
||||
<ContextMenu name="СписокКонтекстноеМеню" id="4"/>
|
||||
<AutoCommandBar name="СписокКоманднаяПанель" id="5">
|
||||
<Autofill>false</Autofill>
|
||||
|
||||
+14
@@ -13,6 +13,20 @@
|
||||
<DataPath>Список</DataPath>
|
||||
<CommandBarLocation>None</CommandBarLocation>
|
||||
<RowPictureDataPath>Список.DefaultPicture</RowPictureDataPath>
|
||||
<AutoRefresh>false</AutoRefresh>
|
||||
<AutoRefreshPeriod>60</AutoRefreshPeriod>
|
||||
<Period>
|
||||
<v8:variant xsi:type="v8:StandardPeriodVariant">Custom</v8:variant>
|
||||
<v8:startDate>0001-01-01T00:00:00</v8:startDate>
|
||||
<v8:endDate>0001-01-01T00:00:00</v8:endDate>
|
||||
</Period>
|
||||
<ChoiceFoldersAndItems>Items</ChoiceFoldersAndItems>
|
||||
<RestoreCurrentRow>false</RestoreCurrentRow>
|
||||
<TopLevelParent xsi:nil="true"/>
|
||||
<ShowRoot>true</ShowRoot>
|
||||
<AllowRootChoice>false</AllowRootChoice>
|
||||
<UpdateOnDataChange>Auto</UpdateOnDataChange>
|
||||
<AllowGettingCurrentRowURL>true</AllowGettingCurrentRowURL>
|
||||
<ContextMenu name="СписокКонтекстноеМеню" id="2"/>
|
||||
<AutoCommandBar name="СписокКоманднаяПанель" id="3">
|
||||
<Autofill>false</Autofill>
|
||||
|
||||
Reference in New Issue
Block a user