diff --git a/.claude/skills/form-compile/SKILL.md b/.claude/skills/form-compile/SKILL.md index 991fc706..78323214 100644 --- a/.claude/skills/form-compile/SKILL.md +++ b/.claude/skills/form-compile/SKILL.md @@ -240,6 +240,15 @@ powershell.exe -NoProfile -File "${CLAUDE_SKILL_DIR}/scripts/form-compile.ps1" - ]} ``` +### Картинка-поле (picField) + +PictureField, привязанный к булеву/числу, рисует иконку только при заданном `valuesPicture`: + +| Ключ | Описание | +|------|----------| +| `valuesPicture` | Ref картинки значения: `"StdPicture.Favorites"`, `"CommonPicture.X"` | +| `loadTransparent: true` | Скрыть кадр «нет значения» | + ### Страницы (pages + page) | Ключ (pages) | Описание | diff --git a/.claude/skills/form-compile/scripts/form-compile.ps1 b/.claude/skills/form-compile/scripts/form-compile.ps1 index 242cd62a..87c802d2 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.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" + X "$inner`t$($el.valuesPicture)" + if ($el.loadTransparent) { X "$inner`ttrue" } + X "$inner" + } + if ($el.width) { X "$inner$($el.width)" } if ($el.height) { X "$inner$($el.height)" } diff --git a/.claude/skills/form-compile/scripts/form-compile.py b/.claude/skills/form-compile/scripts/form-compile.py index 97a48a31..4c4a1ad2 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.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}') + lines.append(f'{inner}\t{el["valuesPicture"]}') + if el.get('loadTransparent'): + lines.append(f'{inner}\ttrue') + lines.append(f'{inner}') + if el.get('width'): lines.append(f'{inner}{el["width"]}') if el.get('height'): diff --git a/tests/skills/cases/form-compile/picture-field.json b/tests/skills/cases/form-compile/picture-field.json new file mode 100644 index 00000000..1352ed49 --- /dev/null +++ b/tests/skills/cases/form-compile/picture-field.json @@ -0,0 +1,35 @@ +{ + "name": "Таблица с колонкой-картинкой (PictureField + ValuesPicture + Selection)", + "preRun": [ + { + "script": "meta-compile/scripts/meta-compile", + "input": { "type": "DataProcessor", "name": "КартинкаВСтроке" }, + "args": { "-JsonPath": "{inputFile}", "-OutputDir": "{workDir}" } + }, + { + "script": "form-add/scripts/form-add", + "args": { "-ObjectPath": "{workDir}/DataProcessors/КартинкаВСтроке.xml", "-FormName": "Форма" } + } + ], + "params": { "outputPath": "DataProcessors/КартинкаВСтроке/Forms/Форма/Ext/Form.xml" }, + "validatePath": "DataProcessors/КартинкаВСтроке/Forms/Форма/Ext/Form.xml", + "input": { + "title": "Картинка в строке", + "elements": [ + { "table": "ТаблицаДанных", "path": "ТаблицаДанных", + "on": ["Selection"], "handlers": { "Selection": "ТаблицаДанныхВыбор" }, + "columns": [ + { "input": "ТаблицаДанныхНоменклатура", "path": "ТаблицаДанных.Номенклатура" }, + { "picField": "ТаблицаДанныхКартинка", "path": "ТаблицаДанных.Картинка", "valuesPicture": "StdPicture.Favorites", "loadTransparent": true }, + { "check": "ТаблицаДанныхКартинкаФлаг", "path": "ТаблицаДанных.Картинка", "title": "Флаг" } + ]} + ], + "attributes": [ + { "name": "Объект", "type": "DataProcessorObject.КартинкаВСтроке", "main": true }, + { "name": "ТаблицаДанных", "type": "ValueTable", "title": "Таблица данных", "columns": [ + { "name": "Номенклатура", "type": "string(10)" }, + { "name": "Картинка", "type": "boolean" } + ]} + ] + } +} diff --git a/tests/skills/cases/form-compile/snapshots/picture-field/Configuration.xml b/tests/skills/cases/form-compile/snapshots/picture-field/Configuration.xml new file mode 100644 index 00000000..9de4f506 --- /dev/null +++ b/tests/skills/cases/form-compile/snapshots/picture-field/Configuration.xml @@ -0,0 +1,252 @@ + + + + + + UUID-002 + UUID-003 + + + UUID-004 + UUID-005 + + + UUID-006 + UUID-007 + + + UUID-008 + UUID-009 + + + UUID-010 + UUID-011 + + + UUID-012 + UUID-013 + + + UUID-014 + UUID-015 + + + + TestConfig + + + ru + TestConfig + + + + + Version8_3_24 + ManagedApplication + + PlatformApplication + + Russian + + + + + false + false + false + + + + + + + + + + + + + + + + + + + + + + Biometrics + true + + + Location + false + + + BackgroundLocation + false + + + BluetoothPrinters + false + + + WiFiPrinters + false + + + Contacts + false + + + Calendars + false + + + PushNotifications + false + + + LocalNotifications + false + + + InAppPurchases + false + + + PersonalComputerFileExchange + false + + + Ads + false + + + NumberDialing + false + + + CallProcessing + false + + + CallLog + false + + + AutoSendSMS + false + + + ReceiveSMS + false + + + SMSLog + false + + + Camera + false + + + Microphone + false + + + MusicLibrary + false + + + PictureAndVideoLibraries + false + + + AudioPlaybackAndVibration + false + + + BackgroundAudioPlaybackAndVibration + false + + + InstallPackages + false + + + OSBackup + true + + + ApplicationUsageStatistics + false + + + BarcodeScanning + false + + + BackgroundAudioRecording + false + + + AllFilesAccess + false + + + Videoconferences + false + + + NFC + false + + + DocumentScanning + false + + + SpeechToText + false + + + Geofences + false + + + IncomingShareRequests + false + + + AllIncomingShareRequestsTypesProcessing + false + + + + + + Normal + + + Language.Русский + + + + + + Managed + NotAutoFree + DontUse + DontUse + TaxiEnableVersion8_2 + DontUse + Version8_3_24 + + + + Русский + КартинкаВСтроке + + + \ No newline at end of file diff --git a/tests/skills/cases/form-compile/snapshots/picture-field/DataProcessors/КартинкаВСтроке.xml b/tests/skills/cases/form-compile/snapshots/picture-field/DataProcessors/КартинкаВСтроке.xml new file mode 100644 index 00000000..e37b50b1 --- /dev/null +++ b/tests/skills/cases/form-compile/snapshots/picture-field/DataProcessors/КартинкаВСтроке.xml @@ -0,0 +1,34 @@ + + + + + + UUID-002 + UUID-003 + + + UUID-004 + UUID-005 + + + + КартинкаВСтроке + + + ru + Картинка встроке + + + + false + DataProcessor.КартинкаВСтроке.Form.Форма + + false + + + + +
Форма
+
+
+
diff --git a/tests/skills/cases/form-compile/snapshots/picture-field/DataProcessors/КартинкаВСтроке/Ext/ManagerModule.bsl b/tests/skills/cases/form-compile/snapshots/picture-field/DataProcessors/КартинкаВСтроке/Ext/ManagerModule.bsl new file mode 100644 index 00000000..e69de29b diff --git a/tests/skills/cases/form-compile/snapshots/picture-field/DataProcessors/КартинкаВСтроке/Ext/ObjectModule.bsl b/tests/skills/cases/form-compile/snapshots/picture-field/DataProcessors/КартинкаВСтроке/Ext/ObjectModule.bsl new file mode 100644 index 00000000..e69de29b diff --git a/tests/skills/cases/form-compile/snapshots/picture-field/DataProcessors/КартинкаВСтроке/Forms/Форма.xml b/tests/skills/cases/form-compile/snapshots/picture-field/DataProcessors/КартинкаВСтроке/Forms/Форма.xml new file mode 100644 index 00000000..dffeea01 --- /dev/null +++ b/tests/skills/cases/form-compile/snapshots/picture-field/DataProcessors/КартинкаВСтроке/Forms/Форма.xml @@ -0,0 +1,22 @@ + + +
+ + Форма + + + ru + Форма + + + + Managed + false + + PlatformApplication + MobilePlatformApplication + + + +
+
\ No newline at end of file diff --git a/tests/skills/cases/form-compile/snapshots/picture-field/DataProcessors/КартинкаВСтроке/Forms/Форма/Ext/Form.xml b/tests/skills/cases/form-compile/snapshots/picture-field/DataProcessors/КартинкаВСтроке/Forms/Форма/Ext/Form.xml new file mode 100644 index 00000000..567dcbaa --- /dev/null +++ b/tests/skills/cases/form-compile/snapshots/picture-field/DataProcessors/КартинкаВСтроке/Forms/Форма/Ext/Form.xml @@ -0,0 +1,87 @@ + +
+ + <v8:item> + <v8:lang>ru</v8:lang> + <v8:content>Картинка в строке</v8:content> + </v8:item> + + false + + + + ТаблицаДанных + + + + + + + + ТаблицаДанных.Номенклатура + + + + + ТаблицаДанных.Картинка + + StdPicture.Favorites + true + + + + + + ТаблицаДанных.Картинка + + <v8:item> + <v8:lang>ru</v8:lang> + <v8:content>Флаг</v8:content> + </v8:item> + + Right + + + + + + ТаблицаДанныхВыбор + +
+
+ + + + cfg:DataProcessorObject.КартинкаВСтроке + + true + + + + <v8:item> + <v8:lang>ru</v8:lang> + <v8:content>Таблица данных</v8:content> + </v8:item> + + + v8:ValueTable + + + + + xs:string + + 10 + Variable + + + + + + xs:boolean + + + + + + diff --git a/tests/skills/cases/form-compile/snapshots/picture-field/DataProcessors/КартинкаВСтроке/Forms/Форма/Ext/Form/Module.bsl b/tests/skills/cases/form-compile/snapshots/picture-field/DataProcessors/КартинкаВСтроке/Forms/Форма/Ext/Form/Module.bsl new file mode 100644 index 00000000..8ead4cec --- /dev/null +++ b/tests/skills/cases/form-compile/snapshots/picture-field/DataProcessors/КартинкаВСтроке/Forms/Форма/Ext/Form/Module.bsl @@ -0,0 +1,19 @@ +#Область ОбработчикиСобытийФормы + +#КонецОбласти + +#Область ОбработчикиСобытийЭлементовФормы + +#КонецОбласти + +#Область ОбработчикиКомандФормы + +#КонецОбласти + +#Область ОбработчикиОповещений + +#КонецОбласти + +#Область СлужебныеПроцедурыИФункции + +#КонецОбласти \ No newline at end of file diff --git a/tests/skills/cases/form-compile/snapshots/picture-field/Ext/ClientApplicationInterface.xml b/tests/skills/cases/form-compile/snapshots/picture-field/Ext/ClientApplicationInterface.xml new file mode 100644 index 00000000..3c1161b2 --- /dev/null +++ b/tests/skills/cases/form-compile/snapshots/picture-field/Ext/ClientApplicationInterface.xml @@ -0,0 +1,18 @@ + + + + + UUID-002 + + + + + UUID-004 + + + + + + + + \ No newline at end of file diff --git a/tests/skills/cases/form-compile/snapshots/picture-field/Languages/Русский.xml b/tests/skills/cases/form-compile/snapshots/picture-field/Languages/Русский.xml new file mode 100644 index 00000000..37c60d78 --- /dev/null +++ b/tests/skills/cases/form-compile/snapshots/picture-field/Languages/Русский.xml @@ -0,0 +1,16 @@ + + + + + Русский + + + ru + Русский + + + + ru + + + \ No newline at end of file