This commit is contained in:
2026-06-07 13:17:28 +02:00
parent 1cfa8033a5
commit 2a1c10ad4e
4 changed files with 246 additions and 4 deletions

View File

@@ -15220,6 +15220,13 @@ function eval_pyson(value){
var group = new Sao.View.Form.Container(
Number(node.getAttribute('col') || 4),
attributes.col_widths);
if (attributes.panel == 'summary') {
group.el.addClass('form-panel-summary-grid');
} else if (attributes.panel == 'sidebar') {
group.el.addClass('form-panel-sidebar-grid');
} else if (attributes.panel == 'card') {
group.el.addClass('form-panel-card-grid');
}
this.view.containers.push(group);
this.parse_child(node, group);
@@ -15969,8 +15976,31 @@ function eval_pyson(value){
this.el = jQuery('<fieldset/>', {
'class': this.class_
});
this._apply_panel_attributes(attributes);
if (attributes.string) {
this.el.append(jQuery('<legend/>').text(attributes.string));
var legend = jQuery('<legend/>');
if (attributes.icon) {
legend.append(Sao.common.ICONFACTORY.get_icon_img(
attributes.icon, {
'class': 'form-panel-icon',
'aria-hidden': true,
}));
}
legend.append(jQuery('<span/>').text(attributes.string));
this.el.append(legend);
}
},
_apply_panel_attributes: function(attributes) {
var panel = attributes.panel || null;
if (!panel) {
return;
}
if (['card', 'summary', 'sidebar', 'plain'].indexOf(panel) < 0) {
panel = 'card';
}
this.el.addClass('form-panel form-panel-' + panel);
if (attributes.sticky == '1' || panel == 'sidebar') {
this.el.addClass('form-panel-sticky');
}
},
add: function(widget) {