diff --git a/src/client/widgets/basics/file.js b/src/client/widgets/basics/file.js index b195711f..ffc760f3 100644 --- a/src/client/widgets/basics/file.js +++ b/src/client/widgets/basics/file.js @@ -14,7 +14,7 @@ module.exports = class File extends Widget { return super.defaults({ - _class_specific: 'input', + _class_specific: 'file', align: {type: 'string', value: 'center', choices: ['center', 'left', 'right'], help: 'Set to `left` or `right` to change text alignment (otherwise center)'}, directory: {type: 'string', value: 'auto', help: 'Default browsing directory'}, diff --git a/src/client/widgets/containers/modal.js b/src/client/widgets/containers/modal.js index 6baa40cb..3e607638 100644 --- a/src/client/widgets/containers/modal.js +++ b/src/client/widgets/containers/modal.js @@ -27,6 +27,7 @@ class Modal extends Panel { ]}, doubleTap: {type: 'boolean', value: false, help: 'Set to `true` to make the modal require a double tap to open instead of a single tap'}, variables: {type: '*', value: '@{parent.variables}', help: 'Defines one or more arbitrary variables that can be inherited by children widgets'}, + traversing: {type: 'boolean', value: false, help: 'Set to `true` to enable traversing gestures in this widget. Set to `smart` or `auto` to limit affected widgets by the type of the first touched widget'}, _separator: 'popup', @@ -36,9 +37,11 @@ class Modal extends Panel { popupLeft: {type: 'number|percentage', value: 'auto', help: 'Modal popup\'s position'}, popupTop: {type: 'number|percentage', value: 'auto', help: 'Modal popup\'s position'}, + _separator1: 'widget container', + layout: {type: 'string', value: 'default', choices: ['default', 'vertical', 'horizontal', 'grid'], help: 'Defines how children are laid out.'}, gridTemplate: {type: 'string|number', value: '', help:'If `layout` is `grid`, can be either a number of columns of a value css grid-template definition.'}, - traversing: {type: 'boolean', value: false, help: 'Set to `true` to enable traversing gestures in this widget. Set to `smart` or `auto` to limit affected widgets by the type of the first touched widget'}, + contain: {type: 'boolean', value: true, help:'If `layout` is `vertical` or `horizontal`, prevents children from overflowing the panel.'}, scroll: {type: 'boolean', value: true, help: 'Set to `false` to disable scrollbars'}, innerPadding: {type : 'boolean', value: true, help: 'Set to `false` to make the `padding` property apply only between children and not at the container\'s inner boundaries.'}, diff --git a/src/client/widgets/containers/panel.js b/src/client/widgets/containers/panel.js index 3bb648bf..71aa06e7 100644 --- a/src/client/widgets/containers/panel.js +++ b/src/client/widgets/containers/panel.js @@ -27,6 +27,7 @@ class Panel extends Container() { layout: {type: 'string', value: 'default', choices: ['default', 'vertical', 'horizontal', 'grid'], help:'Defines how children are laid out.'}, justify: {type: 'string', value: 'start', choices: ['start', 'end', 'center', 'space-around', 'space-between'], help:'If `layout` is `vertical` or `horizontal`, defines how widgets should be justified.'}, gridTemplate: {type: 'string|number', value: '', help:'If `layout` is `grid`, can be either a number of columns of a value css grid-template definition.'}, + contain: {type: 'boolean', value: true, help:'If `layout` is `vertical` or `horizontal`, prevents children from overflowing the panel.'}, scroll: {type: 'boolean', value: true, help: 'Set to `false` to disable scrollbars'}, innerPadding: {type : 'boolean', value: true, help: 'Set to `false` to make the `padding` property apply only between children and not at the container\'s inner boundaries.'}, @@ -61,6 +62,7 @@ class Panel extends Container() { this.container.classList.toggle('no-inner-padding', !this.getProp('innerPadding')) this.container.classList.toggle('no-scroll', !this.getProp('scroll')) this.container.classList.add('layout-' + this.getProp('layout')) + this.container.classList.toggle('layout-contain', this.getProp('contain')) this.modalBreakout = 0 diff --git a/src/client/widgets/containers/root.js b/src/client/widgets/containers/root.js index bddc65ab..fde37415 100644 --- a/src/client/widgets/containers/root.js +++ b/src/client/widgets/containers/root.js @@ -24,6 +24,7 @@ class Root extends StaticProperties(Panel, {visible: true, label: false, id: 'ro layout: {type: 'string', value: 'default', choices: ['default', 'vertical', 'horizontal', 'grid'], help:'Defines how children are laid out.'}, justify: {type: 'string', value: 'start', choices: ['start', 'end', 'center', 'space-around', 'space-between'], help:'If `layout` is `vertical` or `horizontal`, defines how widgets should be justified.'}, gridTemplate: {type: 'string|number', value: '', help:'If `layout` is `grid`, can be either a number of columns of a value css grid-template definition.'}, + contain: {type: 'boolean', value: true, help:'If `layout` is `vertical` or `horizontal`, prevents children from overflowing the panel.'}, scroll: {type: 'boolean', value: true, help: 'Set to `false` to disable scrollbars'}, innerPadding: {type : 'boolean', value: true, help: 'Set to `false` to make the `padding` property apply only between children and not at the container\'s inner boundaries.'}, diff --git a/src/client/widgets/containers/tab.js b/src/client/widgets/containers/tab.js index 9374ee97..75413a37 100644 --- a/src/client/widgets/containers/tab.js +++ b/src/client/widgets/containers/tab.js @@ -32,6 +32,7 @@ class Tab extends Panel { layout: {type: 'string', value: 'default', choices: ['default', 'vertical', 'horizontal', 'grid'], help:'Defines how children are laid out.'}, justify: {type: 'string', value: 'start', choices: ['start', 'end', 'center', 'space-around', 'space-between'], help:'If `layout` is `vertical` or `horizontal`, defines how widgets should be justified.'}, gridTemplate: {type: 'string|number', value: '', help:'If `layout` is `grid`, can be either a number of columns of a value css grid-template definition.'}, + contain: {type: 'boolean', value: true, help:'If `layout` is `vertical` or `horizontal`, prevents children from overflowing the panel.'}, scroll: {type: 'boolean', value: true, help: 'Set to `false` to disable scrollbars'}, innerPadding: {type : 'boolean', value: true, help: 'Set to `false` to make the `padding` property apply only between children and not at the container\'s inner boundaries.'}, diff --git a/src/scss/widgets/containers.scss b/src/scss/widgets/containers.scss index 39b088cb..d72284f8 100644 --- a/src/scss/widgets/containers.scss +++ b/src/scss/widgets/containers.scss @@ -61,14 +61,18 @@ position: relative!important; height: auto!important; min-height: auto!important; - min-width: auto!important; max-height: 100%; - max-width: 100%; } > .flex-expand { flex: 1 } } + + &.layout-horizontal.layout-contain > inner > .widget { + min-width: auto!important; + max-width: 100%; + } + &.layout-vertical > inner { display: flex; flex-direction: column; @@ -78,15 +82,18 @@ left:auto!important; position: relative!important; width: auto!important; - min-height: auto!important; min-width: auto!important; - max-height: 100%; max-width: 100%; } > .flex-expand { flex: 1 } } + &.layout-vertical.layout-contain > inner > .widget { + min-height: auto!important; + max-height: 100%; + } + &.layout-grid > inner { display: grid; > .widget {