feat: InlineForm支持wrap折行,搜索表单默认开启多行布局
This commit is contained in:
parent
1e33a70627
commit
17d7e946e8
@ -119,6 +119,7 @@ bricks.DataViewer = class extends bricks.VBox {
|
|||||||
form_opts.show_label = sf.show_label !== undefined ? sf.show_label : false;
|
form_opts.show_label = sf.show_label !== undefined ? sf.show_label : false;
|
||||||
form_opts.submit_label = sf.submit_label || '搜索';
|
form_opts.submit_label = sf.submit_label || '搜索';
|
||||||
form_opts.submit_css = sf.submit_css || 'primary';
|
form_opts.submit_css = sf.submit_css || 'primary';
|
||||||
|
form_opts.wrap = sf.wrap !== undefined ? sf.wrap : true;
|
||||||
this.search_form_w = new bricks.InlineForm(form_opts);
|
this.search_form_w = new bricks.InlineForm(form_opts);
|
||||||
this.search_form_w.bind('submit', this.search_form_submited.bind(this));
|
this.search_form_w.bind('submit', this.search_form_submited.bind(this));
|
||||||
this.add_widget(this.search_form_w);
|
this.add_widget(this.search_form_w);
|
||||||
|
|||||||
@ -453,7 +453,7 @@ bricks.FormBase = class extends bricks.Layout {
|
|||||||
|
|
||||||
bricks.InlineForm = class extends bricks.HBox {
|
bricks.InlineForm = class extends bricks.HBox {
|
||||||
/*
|
/*
|
||||||
Horizontal inline form — all fields in one row.
|
Horizontal inline form — all fields in one row (or wrap to multiple rows).
|
||||||
Options:
|
Options:
|
||||||
fields: [{name, label, uitype, placeholder, ...}]
|
fields: [{name, label, uitype, placeholder, ...}]
|
||||||
submit_label: "搜索" (button text, default "Submit")
|
submit_label: "搜索" (button text, default "Submit")
|
||||||
@ -462,6 +462,7 @@ bricks.InlineForm = class extends bricks.HBox {
|
|||||||
submit_bgcolor: "#xxx" (background color)
|
submit_bgcolor: "#xxx" (background color)
|
||||||
gap: "0.5" (gap between items in charsize)
|
gap: "0.5" (gap between items in charsize)
|
||||||
show_label: true/false (show label before input, default true)
|
show_label: true/false (show label before input, default true)
|
||||||
|
wrap: true/false (allow fields to wrap to next line, default false)
|
||||||
Events:
|
Events:
|
||||||
submit: dispatched with form data on button click
|
submit: dispatched with form data on button click
|
||||||
*/
|
*/
|
||||||
@ -471,6 +472,7 @@ bricks.InlineForm = class extends bricks.HBox {
|
|||||||
opts.overflow = 'none';
|
opts.overflow = 'none';
|
||||||
opts.alignItems = 'center';
|
opts.alignItems = 'center';
|
||||||
opts.gap = opts.gap || '0.5';
|
opts.gap = opts.gap || '0.5';
|
||||||
|
if (opts.wrap) opts.flexWrap = 'wrap';
|
||||||
super(opts);
|
super(opts);
|
||||||
this.name_inputs = {};
|
this.name_inputs = {};
|
||||||
this.build_fields();
|
this.build_fields();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user