feat(10.1-02): mount plugin widget elements and run their actions from the form

- pluginAssets loads controller scripts and stylesheets from {base}/assets/ only, once per URL
- WidgetField mounts the custom element with attributes only and posts summer-action through the typed client
- Only declared fill keys returned by the server are patched; the form turns dirty and nothing saves
- widget is a registered valueless type rendered on create and update, labelled as a group
- backend::lang.extension strings in en and pl; embedded dist rebuilt
This commit is contained in:
Jakub Zych
2026-09-29 02:04:34 +02:00
parent c3b76b1afb
commit 107d820109
19 changed files with 789 additions and 14 deletions

View File

@@ -0,0 +1,68 @@
{
"data": {
"name": "Widget",
"fields": [
{
"name": "name",
"label": "Name",
"type": "text",
"span": "left",
"required": true
},
{
"name": "color",
"label": "Colour",
"type": "text",
"span": "right"
},
{
"name": "lookup",
"label": "Catalogue",
"type": "widget",
"comment": "Fills in the name. Save to keep it.",
"widget": "acme-demo-lookup",
"action": "lookup",
"actionLabel": "Look up",
"fill": ["name"]
}
],
"messages": {
"create": {
"other": "New widget"
},
"update": {
"other": "Editing widget"
},
"saved": {
"other": "Widget „:name” saved"
},
"deleteConfirm": {
"other": "Delete this widget?"
},
"deleted": {
"other": "Widget deleted"
}
},
"meta": {
"locale": "en"
},
"assets": {
"scripts": ["/admin-test/assets/acme/demo/js/lookup.js?v=abc"],
"styles": []
},
"redirects": {
"create": {
"redirect": "acme/demo/widgets/update/:id",
"redirectClose": "acme/demo/widgets"
},
"update": {
"redirect": "acme/demo/widgets",
"redirectClose": "acme/demo/widgets"
},
"default": "acme/demo/widgets"
}
},
"meta": {
"locale": "en"
}
}