diff --git a/.claude/skills/form-compile/scripts/form-compile.ps1 b/.claude/skills/form-compile/scripts/form-compile.ps1 index 6cfcce58..20157c16 100644 --- a/.claude/skills/form-compile/scripts/form-compile.ps1 +++ b/.claude/skills/form-compile/scripts/form-compile.ps1 @@ -1,4 +1,4 @@ -# form-compile v1.112 — Compile 1C managed form from JSON or object metadata +# form-compile v1.113 — Compile 1C managed form from JSON or object metadata # Source: https://github.com/Nikolay-Shirokov/cc-1c-skills param( [string]$JsonPath, @@ -3652,6 +3652,8 @@ function Emit-Check { Emit-Layout -el $el -indent $inner + if ($null -ne $el.warningOnEdit) { Emit-MLText -tag "WarningOnEdit" -text $el.warningOnEdit -indent $inner } + # Формат / формат редактирования (LocalStringType — строка или {ru,en}) if ($el.format) { Emit-MLText -tag "Format" -text $el.format -indent $inner } if ($el.editFormat) { Emit-MLText -tag "EditFormat" -text $el.editFormat -indent $inner } @@ -4061,6 +4063,8 @@ function Emit-Radio { Emit-Layout -el $el -indent $inner + if ($null -ne $el.warningOnEdit) { Emit-MLText -tag "WarningOnEdit" -text $el.warningOnEdit -indent $inner } + # Оформление (цвета/шрифты/граница) — перед компаньонами Emit-Appearance -el $el -indent $inner -profile 'field' @@ -4135,6 +4139,8 @@ function Emit-LabelField { if ($el.hyperlink -eq $true) { X "$innertrue" } Emit-Layout -el $el -indent $inner + if ($null -ne $el.warningOnEdit) { Emit-MLText -tag "WarningOnEdit" -text $el.warningOnEdit -indent $inner } + # Формат / формат редактирования (LocalStringType — строка или {ru,en}) if ($el.format) { Emit-MLText -tag "Format" -text $el.format -indent $inner } if ($el.editFormat) { Emit-MLText -tag "EditFormat" -text $el.editFormat -indent $inner } diff --git a/.claude/skills/form-compile/scripts/form-compile.py b/.claude/skills/form-compile/scripts/form-compile.py index 0aa317f2..0497a18d 100644 --- a/.claude/skills/form-compile/scripts/form-compile.py +++ b/.claude/skills/form-compile/scripts/form-compile.py @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -# form-compile v1.112 — Compile 1C managed form from JSON or object metadata +# form-compile v1.113 — Compile 1C managed form from JSON or object metadata # Source: https://github.com/Nikolay-Shirokov/cc-1c-skills import argparse import copy @@ -3742,6 +3742,9 @@ def emit_check(lines, el, name, eid, indent): emit_layout(lines, el, inner) + if el.get('warningOnEdit') is not None: + emit_mltext(lines, inner, 'WarningOnEdit', el['warningOnEdit']) + # Формат / формат редактирования (LocalStringType — строка или {ru,en}) if el.get('format'): emit_mltext(lines, inner, 'Format', el['format']) @@ -3782,6 +3785,9 @@ def emit_radio_button_field(lines, el, name, eid, indent): emit_layout(lines, el, inner) + if el.get('warningOnEdit') is not None: + emit_mltext(lines, inner, 'WarningOnEdit', el['warningOnEdit']) + # Оформление (цвета/шрифты/граница) — перед компаньонами emit_appearance(lines, el, inner, 'field') @@ -3857,6 +3863,9 @@ def emit_label_field(lines, el, name, eid, indent): lines.append(f'{inner}true') emit_layout(lines, el, inner) + if el.get('warningOnEdit') is not None: + emit_mltext(lines, inner, 'WarningOnEdit', el['warningOnEdit']) + # Формат / формат редактирования (LocalStringType — строка или {ru,en}) if el.get('format'): emit_mltext(lines, inner, 'Format', el['format']) diff --git a/.claude/skills/form-decompile/scripts/form-decompile.ps1 b/.claude/skills/form-decompile/scripts/form-decompile.ps1 index 5c1bfbef..2b518262 100644 --- a/.claude/skills/form-decompile/scripts/form-decompile.ps1 +++ b/.claude/skills/form-decompile/scripts/form-decompile.ps1 @@ -1,4 +1,4 @@ -# form-decompile v0.88 — Decompile 1C managed Form.xml to JSON DSL (draft) +# form-decompile v0.89 — Decompile 1C managed Form.xml to JSON DSL (draft) # Source: https://github.com/Nikolay-Shirokov/cc-1c-skills # ВНИМАНИЕ: раундтрип не гарантируется. Навык исключён из авто-использования моделью. param( @@ -1613,6 +1613,7 @@ function Decompile-Element { if ($null -eq $cbt) { $obj['checkBoxType'] = '' } elseif ($cbt -ne 'Auto') { $obj['checkBoxType'] = $cbt.Substring(0,1).ToLower() + $cbt.Substring(1) } Add-TitleLocation $obj $node 'Right' + $woe = $node.SelectSingleNode("lf:WarningOnEdit", $ns); if ($woe) { $t = Get-LangText $woe; if ($null -ne $t) { $obj['warningOnEdit'] = $t } } Add-FormatProps $obj $node } 'RadioButtonField' { @@ -1622,6 +1623,7 @@ function Decompile-Element { Add-TitleLocation $obj $node 'None' $rbt = Get-Child $node 'RadioButtonType'; if ($rbt) { $obj['radioButtonType'] = $rbt } $cc = Get-Child $node 'ColumnsCount'; if ($cc) { $obj['columnsCount'] = [int]$cc } + $woe = $node.SelectSingleNode("lf:WarningOnEdit", $ns); if ($woe) { $t = Get-LangText $woe; if ($null -ne $t) { $obj['warningOnEdit'] = $t } } $cl = Decompile-ChoiceList $node; if ($cl) { $obj['choiceList'] = $cl } } 'LabelDecoration' { @@ -1642,6 +1644,7 @@ function Decompile-Element { if ((Get-Child $node 'Hiperlink') -eq 'true') { $obj['hyperlink'] = $true } # PasswordMode на LabelField — платформа эмитит явный false (редко); захват факт. значения $pm = Get-Child $node 'PasswordMode'; if ($null -ne $pm) { $obj['passwordMode'] = ($pm -eq 'true') } + $woe = $node.SelectSingleNode("lf:WarningOnEdit", $ns); if ($woe) { $t = Get-LangText $woe; if ($null -ne $t) { $obj['warningOnEdit'] = $t } } Add-FormatProps $obj $node } 'PictureDecoration' { diff --git a/docs/form-dsl-spec.md b/docs/form-dsl-spec.md index 5ee71baf..d7d1d843 100644 --- a/docs/form-dsl-spec.md +++ b/docs/form-dsl-spec.md @@ -381,7 +381,7 @@ companion-панели с собственным контентом. Оба не | `markIncomplete` | bool | Автопометка незаполненных (``, факт. значение true/false) | | `extendedEdit` | bool | Расширенное редактирование (``) | | `editTextUpdate` | string | Обновление текста при редактировании: `Always`, `OnValueChange`, `DontUse` | -| `warningOnEdit` | string/object | Предупреждение при редактировании (``, мультиязычный текст) | +| `warningOnEdit` | string/object | Предупреждение при редактировании (``, мультиязычный текст). Доступно также на `check`/`radio`/`labelField` (не только `input`). Парный enum `warningOnEditRepresentation` (`Show`/`DontShow`) — generic-скаляр на любом поле | | `footerText` | string/object | Текст подвала поля (``, мультиязычный) | | `editMode` | string | Режим редактирования: `EnterOnInput`, `Directly` | | `skipOnInput` | bool | Пропускать при вводе | diff --git a/tests/skills/cases/form-compile/input-fields.json b/tests/skills/cases/form-compile/input-fields.json index ef84b43b..a225912b 100644 --- a/tests/skills/cases/form-compile/input-fields.json +++ b/tests/skills/cases/form-compile/input-fields.json @@ -17,7 +17,7 @@ "title": "Поля ввода", "elements": [ { "input": "ОбычноеПоле", "path": "ОбычноеПоле", "title": "Обычное поле", "tooltip": "Введите значение поля", "tooltipRepresentation": "ShowBottom", "editMode": "EnterOnInput", "horizontalStretch": false, "verticalStretch": false, "format": "ЧДЦ=2", "editFormat": "ЧДЦ=2; ЧН=", "extendedTooltip": { "width": 30, "autoMaxWidth": false, "text": "Расширенная подсказка поля" } }, - { "labelField": "Ссылка", "path": "ОбычноеПоле", "titleLocation": "left", "hyperlink": true, "format": { "ru": "ДЛФ=D", "en": "DLF=D" } }, + { "labelField": "Ссылка", "path": "ОбычноеПоле", "titleLocation": "left", "hyperlink": true, "format": { "ru": "ДЛФ=D", "en": "DLF=D" }, "warningOnEdit": "Поле только для чтения" }, { "input": "МногострочноеПоле", "path": "МногострочноеПоле", "multiLine": true, "height": 5, "title": "Комментарий", "wrap": false, "showInHeader": false, "showInFooter": false, "autoCellHeight": true, "footerHorizontalAlign": "Right", "openButton": false, "chooseType": false }, { "input": "ПолеПароля", "path": "ПолеПароля", "passwordMode": true, "title": "Пароль" }, { "input": "ЧисловоеПоле", "path": "ЧисловоеПоле", "title": "Число", "minValue": 1, "maxValue": 100, "displayImportance": "VeryHigh" }, @@ -47,7 +47,7 @@ "choiceParameterLinks": [ "Отбор.Организация=ОбычноеПоле", "Отбор.Тип=ПолеСписокВыбора:DontChange" ], "typeLink": "ПолеПодсказка" }, - { "check": "Флаг", "path": "Флаг", "title": "Включено", "extendedTooltip": { "width": 45 } }, + { "check": "Флаг", "path": "Флаг", "title": "Включено", "warningOnEdit": { "ru": "Изменение флага требует подтверждения", "en": "Confirm flag change" }, "extendedTooltip": { "width": 45 } }, { "check": "ФлагПлатформенный", "path": "ФлагПлатформенный", "title": "Слева", "titleLocation": "" }, { "check": "ФлагЯвный", "path": "ФлагЯвный", "title": "Сверху", "titleLocation": "top" }, { "check": "ФлагТумблер", "path": "ФлагТумблер", "title": "Тумблер", "checkBoxType": "switcher", "format": "БЛ=Нет; БИ=Да" } diff --git a/tests/skills/cases/form-compile/radio-tumbler-strings.json b/tests/skills/cases/form-compile/radio-tumbler-strings.json index 19accbb6..39005215 100644 --- a/tests/skills/cases/form-compile/radio-tumbler-strings.json +++ b/tests/skills/cases/form-compile/radio-tumbler-strings.json @@ -26,6 +26,7 @@ "radio": "ОтборСтрок", "path": "ОтборСтрок", "radioButtonType": "Tumbler", + "warningOnEdit": "Смена отбора перезагрузит список", "choiceList": [ { "value": "Рекомендуемые" }, { "value": "Все" } diff --git a/tests/skills/cases/form-compile/snapshots/input-fields/DataProcessors/ПоляВвода/Forms/Форма/Ext/Form.xml b/tests/skills/cases/form-compile/snapshots/input-fields/DataProcessors/ПоляВвода/Forms/Форма/Ext/Form.xml index 3092635c..fd815919 100644 --- a/tests/skills/cases/form-compile/snapshots/input-fields/DataProcessors/ПоляВвода/Forms/Форма/Ext/Form.xml +++ b/tests/skills/cases/form-compile/snapshots/input-fields/DataProcessors/ПоляВвода/Forms/Форма/Ext/Form.xml @@ -55,6 +55,12 @@ ОбычноеПоле Left true + + + ru + Поле только для чтения + + ru @@ -355,6 +361,16 @@ Auto Right + + + ru + Изменение флага требует подтверждения + + + en + Confirm flag change + + 45 diff --git a/tests/skills/cases/form-compile/snapshots/radio-tumbler-strings/DataProcessors/ТестТумблер/Forms/Форма/Ext/Form.xml b/tests/skills/cases/form-compile/snapshots/radio-tumbler-strings/DataProcessors/ТестТумблер/Forms/Форма/Ext/Form.xml index f6919e89..7b9c53a3 100644 --- a/tests/skills/cases/form-compile/snapshots/radio-tumbler-strings/DataProcessors/ТестТумблер/Forms/Форма/Ext/Form.xml +++ b/tests/skills/cases/form-compile/snapshots/radio-tumbler-strings/DataProcessors/ТестТумблер/Forms/Форма/Ext/Form.xml @@ -41,6 +41,12 @@ + + + ru + Смена отбора перезагрузит список + +