This commit is contained in:
yumoqing 2024-02-22 00:48:58 +08:00
parent 8e1239a8e6
commit 1fff530118
5 changed files with 27 additions and 8 deletions

View File

@ -1,10 +1,10 @@
SOURCES=" factory.js uitypesdef.js utils.js i18n.js widget.js \ SOURCES=" factory.js uitypesdef.js utils.js i18n.js widget.js \
bricks.js image.js \ bricks.js image.js \
jsoncall.js myoperator.js layout.js menu.js modal.js \ jsoncall.js myoperator.js layout.js scroll.js menu.js modal.js \
markdown_viewer.js video.js audio.js toolbar.js tab.js \ markdown_viewer.js video.js audio.js toolbar.js tab.js \
input.js registerfunction.js button.js accordion.js \ input.js registerfunction.js button.js accordion.js \
tree.js multiple_state_image.js form.js message.js \ tree.js multiple_state_image.js form.js message.js \
paging.js scroll.js datagrid.js dataviewer.js \ paging.js datagrid.js dataviewer.js \
miniform.js wterm.js " miniform.js wterm.js "
echo ${SOURCES} echo ${SOURCES}
cat ${SOURCES} > ../dist/bricks.js cat ${SOURCES} > ../dist/bricks.js

View File

@ -21,13 +21,25 @@ bricks.FormBody = class extends bricks.VBox {
opts.width = '100%'; opts.width = '100%';
opts.scrollY = 'scroll'; opts.scrollY = 'scroll';
super(opts); super(opts);
console.log('dxcygvuhbijnokmpl,;lmknjbhvgcfx');
this.name_inputs = {}; this.name_inputs = {};
this.form_body = new bricks.Layout({width:'100%', this.form_body = new bricks.Layout({width:'100%',
overflow:'auto' overflow:'auto'
}); });
this.add_widget(this.form_body); this.add_widget(this.form_body);
this.form_body.set_css('multicolumns'); this.max_item_height = 50;
this.build_fields(); this.build_fields();
console.log('max_item_height=', this.max_item_height);
var v = this.max_item_height + 'px';
console.log('v=', v);
// this.set_style('columnHeight', v);
v = this.opts.input_width || 400 + 'px';
console.log('v=', v);
this.set_style('columnWidth', v);
this.set_style('columnGap', '40px');
this.set_style('overflowX', 'none');
console.log('v=============================', v);
} }
reset_data(){ reset_data(){
for (var name in this.name_inputs){ for (var name in this.name_inputs){
@ -90,6 +102,9 @@ bricks.FormBody = class extends bricks.VBox {
if (w){ if (w){
box.add_widget(w); box.add_widget(w);
this.name_inputs[fields[i].name] = w; this.name_inputs[fields[i].name] = w;
if (this.max_item_height < box.height){
this.max_item_height = box.height;
}
console.log(fields[i].uitype, 'create Input ok'); console.log(fields[i].uitype, 'create Input ok');
} else { } else {
console.log(fields[i], 'createInput failed'); console.log(fields[i], 'createInput failed');

View File

@ -27,7 +27,7 @@ bricks.HScrollPanel = class extends bricks.HBox {
opts.width = '100%'; opts.width = '100%';
opts.height = '100%'; opts.height = '100%';
super(opts); super(opts);
this.set_css('hscroll');
this.min_threshold = opts.min_threshold || 0.02; this.min_threshold = opts.min_threshold || 0.02;
this.max_threshold = opts.max_threshold || 0.95; this.max_threshold = opts.max_threshold || 0.95;
this.bind('scroll', this.scroll_handle.bind(this)) this.bind('scroll', this.scroll_handle.bind(this))
@ -64,6 +64,7 @@ bricks.VScrollPanel = class extends bricks.VBox {
opts.width = '100%'; opts.width = '100%';
opts.height = '100%'; opts.height = '100%';
super(opts); super(opts);
this.set_css('vscroll');
this.min_threshold = opts.min_threshold || 0.02; this.min_threshold = opts.min_threshold || 0.02;
this.max_threshold = opts.max_threshold || 0.95; this.max_threshold = opts.max_threshold || 0.95;
this.bind('scroll', this.scroll_handle.bind(this)) this.bind('scroll', this.scroll_handle.bind(this))

View File

@ -1,5 +1,5 @@
var bricks = window.bricks || {}; var bricks = window.bricks || {};
bricks. TreeNode = class extends bricks.VBox { bricks.TreeNode = class extends bricks.VBox {
constructor(tree, parent, data){ constructor(tree, parent, data){
var opts = { var opts = {
width:'100%', width:'100%',
@ -122,7 +122,7 @@ bricks. TreeNode = class extends bricks.VBox {
} }
} }
bricks. Tree = class extends bricks.VBox { bricks.Tree = class extends bricks.VScrollPanel {
/* /*
{ {
row_height: row_height:
@ -151,12 +151,11 @@ bricks. Tree = class extends bricks.VBox {
*/ */
constructor(options){ constructor(options){
super(options); super(options);
this.set_height('100%');
this.row_height = this.opts.row_height || '35px'; this.row_height = this.opts.row_height || '35px';
this.multitype_tree = this.opts.multitype_tree||false; this.multitype_tree = this.opts.multitype_tree||false;
this.selected_node = null; this.selected_node = null;
this.create_toolbar(); this.create_toolbar();
this.container = new bricks.VScrollPanel({}); this.container = this;
this.add_widget(this.container); this.add_widget(this.container);
this.data_id = null; this.data_id = null;
if (this.opts.dataurl){ if (this.opts.dataurl){

View File

@ -1,6 +1,10 @@
var bricks = window.bricks || {}; var bricks = window.bricks || {};
bricks.isMobile = () => /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent); bricks.isMobile = () => /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);
bricks.is_mobile = function(){
return typeof screen.orientation !== 'undefined';
}
class _TypeIcons { class _TypeIcons {
constructor(){ constructor(){
this.kv = {} this.kv = {}